Lines Matching refs:lcd
163 static int ams369fg06_spi_write_byte(struct ams369fg06 *lcd, int addr, int data) in ams369fg06_spi_write_byte() argument
178 return spi_sync(lcd->spi, &msg); in ams369fg06_spi_write_byte()
181 static int ams369fg06_spi_write(struct ams369fg06 *lcd, unsigned char address, in ams369fg06_spi_write() argument
187 ret = ams369fg06_spi_write_byte(lcd, 0x70, address); in ams369fg06_spi_write()
189 ret = ams369fg06_spi_write_byte(lcd, 0x72, command); in ams369fg06_spi_write()
194 static int ams369fg06_panel_send_sequence(struct ams369fg06 *lcd, in ams369fg06_panel_send_sequence() argument
201 ret = ams369fg06_spi_write(lcd, wbuf[i], wbuf[i+1]); in ams369fg06_panel_send_sequence()
213 static int _ams369fg06_gamma_ctl(struct ams369fg06 *lcd, in _ams369fg06_gamma_ctl() argument
220 ret = ams369fg06_spi_write(lcd, 0x40 + i, gamma[i]); in _ams369fg06_gamma_ctl()
221 ret = ams369fg06_spi_write(lcd, 0x50 + i, gamma[i+7*1]); in _ams369fg06_gamma_ctl()
222 ret = ams369fg06_spi_write(lcd, 0x60 + i, gamma[i+7*2]); in _ams369fg06_gamma_ctl()
224 dev_err(lcd->dev, "failed to set gamma table.\n"); in _ams369fg06_gamma_ctl()
233 static int ams369fg06_gamma_ctl(struct ams369fg06 *lcd, int brightness) in ams369fg06_gamma_ctl() argument
249 ret = _ams369fg06_gamma_ctl(lcd, gamma_table.gamma_22_table[gamma]); in ams369fg06_gamma_ctl()
254 static int ams369fg06_ldi_init(struct ams369fg06 *lcd) in ams369fg06_ldi_init() argument
263 ret = ams369fg06_panel_send_sequence(lcd, init_seq[i]); in ams369fg06_ldi_init()
271 static int ams369fg06_ldi_enable(struct ams369fg06 *lcd) in ams369fg06_ldi_enable() argument
280 ret = ams369fg06_panel_send_sequence(lcd, init_seq[i]); in ams369fg06_ldi_enable()
288 static int ams369fg06_ldi_disable(struct ams369fg06 *lcd) in ams369fg06_ldi_disable() argument
298 ret = ams369fg06_panel_send_sequence(lcd, init_seq[i]); in ams369fg06_ldi_disable()
311 static int ams369fg06_power_on(struct ams369fg06 *lcd) in ams369fg06_power_on() argument
317 pd = lcd->lcd_pd; in ams369fg06_power_on()
318 bd = lcd->bd; in ams369fg06_power_on()
321 pd->power_on(lcd->ld, 1); in ams369fg06_power_on()
326 dev_err(lcd->dev, "reset is NULL.\n"); in ams369fg06_power_on()
330 pd->reset(lcd->ld); in ams369fg06_power_on()
333 ret = ams369fg06_ldi_init(lcd); in ams369fg06_power_on()
335 dev_err(lcd->dev, "failed to initialize ldi.\n"); in ams369fg06_power_on()
339 ret = ams369fg06_ldi_enable(lcd); in ams369fg06_power_on()
341 dev_err(lcd->dev, "failed to enable ldi.\n"); in ams369fg06_power_on()
346 ret = ams369fg06_gamma_ctl(lcd, bd->props.brightness); in ams369fg06_power_on()
348 dev_err(lcd->dev, "lcd gamma setting failed.\n"); in ams369fg06_power_on()
355 static int ams369fg06_power_off(struct ams369fg06 *lcd) in ams369fg06_power_off() argument
360 pd = lcd->lcd_pd; in ams369fg06_power_off()
362 ret = ams369fg06_ldi_disable(lcd); in ams369fg06_power_off()
364 dev_err(lcd->dev, "lcd setting failed.\n"); in ams369fg06_power_off()
371 pd->power_on(lcd->ld, 0); in ams369fg06_power_off()
376 static int ams369fg06_power(struct ams369fg06 *lcd, int power) in ams369fg06_power() argument
381 !ams369fg06_power_is_on(lcd->power)) in ams369fg06_power()
382 ret = ams369fg06_power_on(lcd); in ams369fg06_power()
384 ams369fg06_power_is_on(lcd->power)) in ams369fg06_power()
385 ret = ams369fg06_power_off(lcd); in ams369fg06_power()
388 lcd->power = power; in ams369fg06_power()
395 struct ams369fg06 *lcd = lcd_get_data(ld); in ams369fg06_get_power() local
397 return lcd->power; in ams369fg06_get_power()
402 struct ams369fg06 *lcd = lcd_get_data(ld); in ams369fg06_set_power() local
406 dev_err(lcd->dev, "power value should be 0, 1 or 4.\n"); in ams369fg06_set_power()
410 return ams369fg06_power(lcd, power); in ams369fg06_set_power()
417 struct ams369fg06 *lcd = bl_get_data(bd); in ams369fg06_set_brightness() local
426 ret = ams369fg06_gamma_ctl(lcd, bd->props.brightness); in ams369fg06_set_brightness()
447 struct ams369fg06 *lcd = NULL; in ams369fg06_probe() local
452 lcd = devm_kzalloc(&spi->dev, sizeof(struct ams369fg06), GFP_KERNEL); in ams369fg06_probe()
453 if (!lcd) in ams369fg06_probe()
465 lcd->spi = spi; in ams369fg06_probe()
466 lcd->dev = &spi->dev; in ams369fg06_probe()
468 lcd->lcd_pd = dev_get_platdata(&spi->dev); in ams369fg06_probe()
469 if (!lcd->lcd_pd) { in ams369fg06_probe()
474 ld = devm_lcd_device_register(&spi->dev, "ams369fg06", &spi->dev, lcd, in ams369fg06_probe()
479 lcd->ld = ld; in ams369fg06_probe()
486 &spi->dev, lcd, in ams369fg06_probe()
492 lcd->bd = bd; in ams369fg06_probe()
494 if (!lcd->lcd_pd->lcd_enabled) { in ams369fg06_probe()
500 lcd->power = FB_BLANK_POWERDOWN; in ams369fg06_probe()
502 ams369fg06_power(lcd, FB_BLANK_UNBLANK); in ams369fg06_probe()
504 lcd->power = FB_BLANK_UNBLANK; in ams369fg06_probe()
507 spi_set_drvdata(spi, lcd); in ams369fg06_probe()
516 struct ams369fg06 *lcd = spi_get_drvdata(spi); in ams369fg06_remove() local
518 ams369fg06_power(lcd, FB_BLANK_POWERDOWN); in ams369fg06_remove()
525 struct ams369fg06 *lcd = dev_get_drvdata(dev); in ams369fg06_suspend() local
527 dev_dbg(dev, "lcd->power = %d\n", lcd->power); in ams369fg06_suspend()
533 return ams369fg06_power(lcd, FB_BLANK_POWERDOWN); in ams369fg06_suspend()
538 struct ams369fg06 *lcd = dev_get_drvdata(dev); in ams369fg06_resume() local
540 lcd->power = FB_BLANK_POWERDOWN; in ams369fg06_resume()
542 return ams369fg06_power(lcd, FB_BLANK_UNBLANK); in ams369fg06_resume()
551 struct ams369fg06 *lcd = spi_get_drvdata(spi); in ams369fg06_shutdown() local
553 ams369fg06_power(lcd, FB_BLANK_POWERDOWN); in ams369fg06_shutdown()