Lines Matching refs:lcd
78 static void ili9320_reset(struct ili9320 *lcd) in ili9320_reset() argument
80 struct ili9320_platdata *cfg = lcd->platdata; in ili9320_reset()
92 static inline int ili9320_init_chip(struct ili9320 *lcd) in ili9320_init_chip() argument
96 ili9320_reset(lcd); in ili9320_init_chip()
98 ret = lcd->client->init(lcd, lcd->platdata); in ili9320_init_chip()
100 dev_err(lcd->dev, "failed to initialise display\n"); in ili9320_init_chip()
104 lcd->initialised = 1; in ili9320_init_chip()
108 static inline int ili9320_power_on(struct ili9320 *lcd) in ili9320_power_on() argument
110 if (!lcd->initialised) in ili9320_power_on()
111 ili9320_init_chip(lcd); in ili9320_power_on()
113 lcd->display1 |= (ILI9320_DISPLAY1_D(3) | ILI9320_DISPLAY1_BASEE); in ili9320_power_on()
114 ili9320_write(lcd, ILI9320_DISPLAY1, lcd->display1); in ili9320_power_on()
119 static inline int ili9320_power_off(struct ili9320 *lcd) in ili9320_power_off() argument
121 lcd->display1 &= ~(ILI9320_DISPLAY1_D(3) | ILI9320_DISPLAY1_BASEE); in ili9320_power_off()
122 ili9320_write(lcd, ILI9320_DISPLAY1, lcd->display1); in ili9320_power_off()
129 static int ili9320_power(struct ili9320 *lcd, int power) in ili9320_power() argument
133 dev_dbg(lcd->dev, "power %d => %d\n", lcd->power, power); in ili9320_power()
135 if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->power)) in ili9320_power()
136 ret = ili9320_power_on(lcd); in ili9320_power()
137 else if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->power)) in ili9320_power()
138 ret = ili9320_power_off(lcd); in ili9320_power()
141 lcd->power = power; in ili9320_power()
143 dev_warn(lcd->dev, "failed to set power mode %d\n", power); in ili9320_power()
148 static inline struct ili9320 *to_our_lcd(struct lcd_device *lcd) in to_our_lcd() argument
150 return lcd_get_data(lcd); in to_our_lcd()
155 struct ili9320 *lcd = to_our_lcd(ld); in ili9320_set_power() local
157 return ili9320_power(lcd, power); in ili9320_set_power()
162 struct ili9320 *lcd = to_our_lcd(ld); in ili9320_get_power() local
164 return lcd->power; in ili9320_get_power()
204 struct lcd_device *lcd; in ili9320_probe_spi() local
236 lcd = devm_lcd_device_register(&spi->dev, "ili9320", dev, ili, in ili9320_probe_spi()
238 if (IS_ERR(lcd)) { in ili9320_probe_spi()
240 return PTR_ERR(lcd); in ili9320_probe_spi()
243 ili->lcd = lcd; in ili9320_probe_spi()
265 int ili9320_suspend(struct ili9320 *lcd) in ili9320_suspend() argument
269 ret = ili9320_power(lcd, FB_BLANK_POWERDOWN); in ili9320_suspend()
271 if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) { in ili9320_suspend()
272 ili9320_write(lcd, ILI9320_POWER1, lcd->power1 | in ili9320_suspend()
275 lcd->initialised = 0; in ili9320_suspend()
282 int ili9320_resume(struct ili9320 *lcd) in ili9320_resume() argument
284 dev_info(lcd->dev, "resuming from power state %d\n", lcd->power); in ili9320_resume()
286 if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) in ili9320_resume()
287 ili9320_write(lcd, ILI9320_POWER1, 0x00); in ili9320_resume()
289 return ili9320_power(lcd, FB_BLANK_UNBLANK); in ili9320_resume()
295 void ili9320_shutdown(struct ili9320 *lcd) in ili9320_shutdown() argument
297 ili9320_power(lcd, FB_BLANK_POWERDOWN); in ili9320_shutdown()