• Home
  • Raw
  • Download

Lines Matching refs:lcd

73 static void s6e8ax0_regulator_enable(struct s6e8ax0 *lcd)  in s6e8ax0_regulator_enable()  argument
78 pd = lcd->ddi_pd; in s6e8ax0_regulator_enable()
79 mutex_lock(&lcd->lock); in s6e8ax0_regulator_enable()
80 if (!lcd->enabled) { in s6e8ax0_regulator_enable()
85 lcd->enabled = true; in s6e8ax0_regulator_enable()
89 mutex_unlock(&lcd->lock); in s6e8ax0_regulator_enable()
92 static void s6e8ax0_regulator_disable(struct s6e8ax0 *lcd) in s6e8ax0_regulator_disable() argument
96 mutex_lock(&lcd->lock); in s6e8ax0_regulator_disable()
97 if (lcd->enabled) { in s6e8ax0_regulator_disable()
102 lcd->enabled = false; in s6e8ax0_regulator_disable()
105 mutex_unlock(&lcd->lock); in s6e8ax0_regulator_disable()
286 static void s6e8ax0_panel_cond(struct s6e8ax0 *lcd) in s6e8ax0_panel_cond() argument
288 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_panel_cond()
303 if (lcd->dsim_dev->panel_reverse) in s6e8ax0_panel_cond()
304 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_panel_cond()
308 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_panel_cond()
312 static void s6e8ax0_display_cond(struct s6e8ax0 *lcd) in s6e8ax0_display_cond() argument
314 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_display_cond()
319 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_display_cond()
324 static void s6e8ax0_gamma_cond(struct s6e8ax0 *lcd) in s6e8ax0_gamma_cond() argument
326 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_gamma_cond()
327 unsigned int gamma = lcd->bd->props.brightness; in s6e8ax0_gamma_cond()
329 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_gamma_cond()
334 static void s6e8ax0_gamma_update(struct s6e8ax0 *lcd) in s6e8ax0_gamma_update() argument
336 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_gamma_update()
341 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_gamma_update()
346 static void s6e8ax0_etc_cond1(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond1() argument
348 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond1()
354 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond1()
358 static void s6e8ax0_etc_cond2(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond2() argument
360 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond2()
366 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond2()
370 static void s6e8ax0_etc_cond3(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond3() argument
372 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond3()
377 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond3()
381 static void s6e8ax0_etc_cond4(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond4() argument
383 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond4()
388 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond4()
392 static void s6e8ax0_etc_cond5(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond5() argument
394 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond5()
399 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond5()
402 static void s6e8ax0_etc_cond6(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond6() argument
404 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond6()
409 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_etc_cond6()
414 static void s6e8ax0_etc_cond7(struct s6e8ax0 *lcd) in s6e8ax0_etc_cond7() argument
416 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_etc_cond7()
421 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_etc_cond7()
425 static void s6e8ax0_elvss_set(struct s6e8ax0 *lcd) in s6e8ax0_elvss_set() argument
427 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_elvss_set()
432 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_elvss_set()
436 static void s6e8ax0_elvss_nvm_set(struct s6e8ax0 *lcd) in s6e8ax0_elvss_nvm_set() argument
438 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_elvss_nvm_set()
445 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_elvss_nvm_set()
449 static void s6e8ax0_sleep_in(struct s6e8ax0 *lcd) in s6e8ax0_sleep_in() argument
451 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_sleep_in()
456 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_sleep_in()
461 static void s6e8ax0_sleep_out(struct s6e8ax0 *lcd) in s6e8ax0_sleep_out() argument
463 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_sleep_out()
468 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_sleep_out()
473 static void s6e8ax0_display_on(struct s6e8ax0 *lcd) in s6e8ax0_display_on() argument
475 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_display_on()
480 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_display_on()
485 static void s6e8ax0_display_off(struct s6e8ax0 *lcd) in s6e8ax0_display_off() argument
487 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_display_off()
492 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_display_off()
497 static void s6e8ax0_apply_level2_key(struct s6e8ax0 *lcd) in s6e8ax0_apply_level2_key() argument
499 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_apply_level2_key()
504 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_apply_level2_key()
508 static void s6e8ax0_acl_on(struct s6e8ax0 *lcd) in s6e8ax0_acl_on() argument
510 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_acl_on()
515 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_acl_on()
520 static void s6e8ax0_acl_off(struct s6e8ax0 *lcd) in s6e8ax0_acl_off() argument
522 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_acl_off()
527 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_acl_off()
533 static void s6e8ax0_acl_ctrl_set(struct s6e8ax0 *lcd) in s6e8ax0_acl_ctrl_set() argument
535 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_acl_ctrl_set()
558 if (lcd->acl_enable) { in s6e8ax0_acl_ctrl_set()
559 if (lcd->cur_acl == 0) { in s6e8ax0_acl_ctrl_set()
560 if (lcd->gamma == 0 || lcd->gamma == 1) { in s6e8ax0_acl_ctrl_set()
561 s6e8ax0_acl_off(lcd); in s6e8ax0_acl_ctrl_set()
562 dev_dbg(&lcd->ld->dev, in s6e8ax0_acl_ctrl_set()
563 "cur_acl=%d\n", lcd->cur_acl); in s6e8ax0_acl_ctrl_set()
565 s6e8ax0_acl_on(lcd); in s6e8ax0_acl_ctrl_set()
567 switch (lcd->gamma) { in s6e8ax0_acl_ctrl_set()
569 s6e8ax0_acl_off(lcd); in s6e8ax0_acl_ctrl_set()
570 lcd->cur_acl = 0; in s6e8ax0_acl_ctrl_set()
573 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_acl_ctrl_set()
577 lcd->cur_acl = 40; in s6e8ax0_acl_ctrl_set()
580 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_acl_ctrl_set()
584 lcd->cur_acl = 45; in s6e8ax0_acl_ctrl_set()
587 ops->cmd_write(lcd_to_master(lcd), in s6e8ax0_acl_ctrl_set()
591 lcd->cur_acl = 50; in s6e8ax0_acl_ctrl_set()
597 s6e8ax0_acl_off(lcd); in s6e8ax0_acl_ctrl_set()
598 lcd->cur_acl = 0; in s6e8ax0_acl_ctrl_set()
599 dev_dbg(&lcd->ld->dev, "cur_acl = %d\n", lcd->cur_acl); in s6e8ax0_acl_ctrl_set()
603 static void s6e8ax0_read_id(struct s6e8ax0 *lcd, u8 *mtp_id) in s6e8ax0_read_id() argument
607 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_read_id()
609 ret = ops->cmd_read(lcd_to_master(lcd), in s6e8ax0_read_id()
614 static int s6e8ax0_panel_init(struct s6e8ax0 *lcd) in s6e8ax0_panel_init() argument
616 s6e8ax0_apply_level2_key(lcd); in s6e8ax0_panel_init()
617 s6e8ax0_sleep_out(lcd); in s6e8ax0_panel_init()
619 s6e8ax0_panel_cond(lcd); in s6e8ax0_panel_init()
620 s6e8ax0_display_cond(lcd); in s6e8ax0_panel_init()
621 s6e8ax0_gamma_cond(lcd); in s6e8ax0_panel_init()
622 s6e8ax0_gamma_update(lcd); in s6e8ax0_panel_init()
624 s6e8ax0_etc_cond1(lcd); in s6e8ax0_panel_init()
625 s6e8ax0_etc_cond2(lcd); in s6e8ax0_panel_init()
626 s6e8ax0_etc_cond3(lcd); in s6e8ax0_panel_init()
627 s6e8ax0_etc_cond4(lcd); in s6e8ax0_panel_init()
628 s6e8ax0_etc_cond5(lcd); in s6e8ax0_panel_init()
629 s6e8ax0_etc_cond6(lcd); in s6e8ax0_panel_init()
630 s6e8ax0_etc_cond7(lcd); in s6e8ax0_panel_init()
632 s6e8ax0_elvss_nvm_set(lcd); in s6e8ax0_panel_init()
633 s6e8ax0_elvss_set(lcd); in s6e8ax0_panel_init()
635 s6e8ax0_acl_ctrl_set(lcd); in s6e8ax0_panel_init()
636 s6e8ax0_acl_on(lcd); in s6e8ax0_panel_init()
639 msleep(lcd->ddi_pd->power_on_delay); in s6e8ax0_panel_init()
644 static int s6e8ax0_update_gamma_ctrl(struct s6e8ax0 *lcd, int brightness) in s6e8ax0_update_gamma_ctrl() argument
646 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_update_gamma_ctrl()
648 ops->cmd_write(lcd_to_master(lcd), MIPI_DSI_DCS_LONG_WRITE, in s6e8ax0_update_gamma_ctrl()
653 s6e8ax0_gamma_update(lcd); in s6e8ax0_update_gamma_ctrl()
654 lcd->gamma = brightness; in s6e8ax0_update_gamma_ctrl()
659 static int s6e8ax0_gamma_ctrl(struct s6e8ax0 *lcd, int gamma) in s6e8ax0_gamma_ctrl() argument
661 s6e8ax0_update_gamma_ctrl(lcd, gamma); in s6e8ax0_gamma_ctrl()
668 struct s6e8ax0 *lcd = lcd_get_data(ld); in s6e8ax0_set_power() local
669 struct mipi_dsim_master_ops *ops = lcd_to_master_ops(lcd); in s6e8ax0_set_power()
674 dev_err(lcd->dev, "power value should be 0, 1 or 4.\n"); in s6e8ax0_set_power()
680 if ((POWER_IS_ON(power) && POWER_IS_OFF(lcd->power)) in s6e8ax0_set_power()
681 || (POWER_IS_ON(power) && POWER_IS_NRM(lcd->power))) { in s6e8ax0_set_power()
682 ret = ops->set_blank_mode(lcd_to_master(lcd), power); in s6e8ax0_set_power()
683 if (!ret && lcd->power != power) in s6e8ax0_set_power()
684 lcd->power = power; in s6e8ax0_set_power()
688 if ((POWER_IS_OFF(power) && POWER_IS_ON(lcd->power)) || in s6e8ax0_set_power()
689 (POWER_IS_ON(lcd->power) && POWER_IS_NRM(power))) { in s6e8ax0_set_power()
690 ret = ops->set_early_blank_mode(lcd_to_master(lcd), in s6e8ax0_set_power()
692 if (!ret && lcd->power != power) in s6e8ax0_set_power()
693 lcd->power = power; in s6e8ax0_set_power()
702 struct s6e8ax0 *lcd = lcd_get_data(ld); in s6e8ax0_get_power() local
704 return lcd->power; in s6e8ax0_get_power()
715 struct s6e8ax0 *lcd = bl_get_data(bd); in s6e8ax0_set_brightness() local
719 dev_err(lcd->dev, "lcd brightness should be %d to %d.\n", in s6e8ax0_set_brightness()
724 ret = s6e8ax0_gamma_ctrl(lcd, brightness); in s6e8ax0_set_brightness()
745 struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); in s6e8ax0_power_on() local
747 msleep(lcd->ddi_pd->power_on_delay); in s6e8ax0_power_on()
751 s6e8ax0_regulator_enable(lcd); in s6e8ax0_power_on()
753 s6e8ax0_regulator_disable(lcd); in s6e8ax0_power_on()
755 msleep(lcd->ddi_pd->reset_delay); in s6e8ax0_power_on()
758 if (lcd->ddi_pd->reset) in s6e8ax0_power_on()
759 lcd->ddi_pd->reset(lcd->ld); in s6e8ax0_power_on()
765 struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); in s6e8ax0_set_sequence() local
767 s6e8ax0_panel_init(lcd); in s6e8ax0_set_sequence()
768 s6e8ax0_display_on(lcd); in s6e8ax0_set_sequence()
770 lcd->power = FB_BLANK_UNBLANK; in s6e8ax0_set_sequence()
775 struct s6e8ax0 *lcd; in s6e8ax0_probe() local
779 lcd = devm_kzalloc(&dsim_dev->dev, sizeof(struct s6e8ax0), GFP_KERNEL); in s6e8ax0_probe()
780 if (!lcd) { in s6e8ax0_probe()
785 lcd->dsim_dev = dsim_dev; in s6e8ax0_probe()
786 lcd->ddi_pd = (struct lcd_platform_data *)dsim_dev->platform_data; in s6e8ax0_probe()
787 lcd->dev = &dsim_dev->dev; in s6e8ax0_probe()
789 mutex_init(&lcd->lock); in s6e8ax0_probe()
791 ret = devm_regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); in s6e8ax0_probe()
793 dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); in s6e8ax0_probe()
797 lcd->ld = lcd_device_register("s6e8ax0", lcd->dev, lcd, in s6e8ax0_probe()
799 if (IS_ERR(lcd->ld)) { in s6e8ax0_probe()
800 dev_err(lcd->dev, "failed to register lcd ops.\n"); in s6e8ax0_probe()
801 return PTR_ERR(lcd->ld); in s6e8ax0_probe()
804 lcd->bd = backlight_device_register("s6e8ax0-bl", lcd->dev, lcd, in s6e8ax0_probe()
806 if (IS_ERR(lcd->bd)) { in s6e8ax0_probe()
807 dev_err(lcd->dev, "failed to register backlight ops.\n"); in s6e8ax0_probe()
808 ret = PTR_ERR(lcd->bd); in s6e8ax0_probe()
812 lcd->bd->props.max_brightness = MAX_BRIGHTNESS; in s6e8ax0_probe()
813 lcd->bd->props.brightness = MAX_BRIGHTNESS; in s6e8ax0_probe()
815 s6e8ax0_read_id(lcd, mtp_id); in s6e8ax0_probe()
817 dev_err(lcd->dev, "read id failed\n"); in s6e8ax0_probe()
819 dev_info(lcd->dev, "Read ID : %x, %x, %x\n", in s6e8ax0_probe()
823 dev_info(lcd->dev, in s6e8ax0_probe()
826 dev_info(lcd->dev, in s6e8ax0_probe()
829 lcd->acl_enable = 1; in s6e8ax0_probe()
830 lcd->cur_acl = 0; in s6e8ax0_probe()
832 dev_set_drvdata(&dsim_dev->dev, lcd); in s6e8ax0_probe()
834 dev_dbg(lcd->dev, "probed s6e8ax0 panel driver.\n"); in s6e8ax0_probe()
839 lcd_device_unregister(lcd->ld); in s6e8ax0_probe()
846 struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); in s6e8ax0_suspend() local
848 s6e8ax0_sleep_in(lcd); in s6e8ax0_suspend()
849 msleep(lcd->ddi_pd->power_off_delay); in s6e8ax0_suspend()
850 s6e8ax0_display_off(lcd); in s6e8ax0_suspend()
852 s6e8ax0_regulator_disable(lcd); in s6e8ax0_suspend()
859 struct s6e8ax0 *lcd = dev_get_drvdata(&dsim_dev->dev); in s6e8ax0_resume() local
861 s6e8ax0_sleep_out(lcd); in s6e8ax0_resume()
862 msleep(lcd->ddi_pd->power_on_delay); in s6e8ax0_resume()
864 s6e8ax0_regulator_enable(lcd); in s6e8ax0_resume()