Lines Matching refs:lcd
75 static void ili9320_reset(struct ili9320 *lcd) in ili9320_reset() argument
77 struct ili9320_platdata *cfg = lcd->platdata; in ili9320_reset()
89 static inline int ili9320_init_chip(struct ili9320 *lcd) in ili9320_init_chip() argument
93 ili9320_reset(lcd); in ili9320_init_chip()
95 ret = lcd->client->init(lcd, lcd->platdata); in ili9320_init_chip()
97 dev_err(lcd->dev, "failed to initialise display\n"); in ili9320_init_chip()
101 lcd->initialised = 1; in ili9320_init_chip()
105 static inline int ili9320_power_on(struct ili9320 *lcd) in ili9320_power_on() argument
107 if (!lcd->initialised) in ili9320_power_on()
108 ili9320_init_chip(lcd); in ili9320_power_on()
110 lcd->display1 |= (ILI9320_DISPLAY1_D(3) | ILI9320_DISPLAY1_BASEE); in ili9320_power_on()
111 ili9320_write(lcd, ILI9320_DISPLAY1, lcd->display1); in ili9320_power_on()
116 static inline int ili9320_power_off(struct ili9320 *lcd) in ili9320_power_off() argument
118 lcd->display1 &= ~(ILI9320_DISPLAY1_D(3) | ILI9320_DISPLAY1_BASEE); in ili9320_power_off()
119 ili9320_write(lcd, ILI9320_DISPLAY1, lcd->display1); in ili9320_power_off()
126 static int ili9320_power(struct ili9320 *lcd, int power) in ili9320_power() argument
130 dev_dbg(lcd->dev, "power %d => %d\n", lcd->power, power); in ili9320_power()
132 if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->power)) in ili9320_power()
133 ret = ili9320_power_on(lcd); in ili9320_power()
134 else if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->power)) in ili9320_power()
135 ret = ili9320_power_off(lcd); in ili9320_power()
138 lcd->power = power; in ili9320_power()
140 dev_warn(lcd->dev, "failed to set power mode %d\n", power); in ili9320_power()
145 static inline struct ili9320 *to_our_lcd(struct lcd_device *lcd) in to_our_lcd() argument
147 return lcd_get_data(lcd); in to_our_lcd()
152 struct ili9320 *lcd = to_our_lcd(ld); in ili9320_set_power() local
154 return ili9320_power(lcd, power); in ili9320_set_power()
159 struct ili9320 *lcd = to_our_lcd(ld); in ili9320_get_power() local
161 return lcd->power; in ili9320_get_power()
201 struct lcd_device *lcd; in ili9320_probe_spi() local
233 lcd = devm_lcd_device_register(&spi->dev, "ili9320", dev, ili, in ili9320_probe_spi()
235 if (IS_ERR(lcd)) { in ili9320_probe_spi()
237 return PTR_ERR(lcd); in ili9320_probe_spi()
240 ili->lcd = lcd; in ili9320_probe_spi()
261 int ili9320_suspend(struct ili9320 *lcd) in ili9320_suspend() argument
265 ret = ili9320_power(lcd, FB_BLANK_POWERDOWN); in ili9320_suspend()
267 if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) { in ili9320_suspend()
268 ili9320_write(lcd, ILI9320_POWER1, lcd->power1 | in ili9320_suspend()
271 lcd->initialised = 0; in ili9320_suspend()
278 int ili9320_resume(struct ili9320 *lcd) in ili9320_resume() argument
280 dev_info(lcd->dev, "resuming from power state %d\n", lcd->power); in ili9320_resume()
282 if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) in ili9320_resume()
283 ili9320_write(lcd, ILI9320_POWER1, 0x00); in ili9320_resume()
285 return ili9320_power(lcd, FB_BLANK_UNBLANK); in ili9320_resume()
291 void ili9320_shutdown(struct ili9320 *lcd) in ili9320_shutdown() argument
293 ili9320_power(lcd, FB_BLANK_POWERDOWN); in ili9320_shutdown()