From 52c5f369788dd21d9773ecb31aa79ed8c65d0c4e Mon Sep 17 00:00:00 2001 From: Evoke Zhang Date: Wed, 15 Aug 2018 20:16:14 +0800 Subject: [PATCH] lcd: fix lcd_status mistake PD#171850: lcd: fix lcd_status mistake Change-Id: I5f0486bbc5ba89ba153d752a9e43af1379697658 Signed-off-by: Evoke Zhang --- drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c | 9 +++++---- drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c | 7 ++++--- drivers/amlogic/media/vout/lcd/lcd_vout.c | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c index 83288c749044..2cd629daefb1 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tablet/lcd_tablet.c @@ -216,7 +216,7 @@ static int lcd_set_vframe_rate_hint(int duration) struct lcd_vframe_match_s *vtable = lcd_vframe_match_table_1; int fps, i, n; - if (lcd_drv->lcd_status == 0) { + if ((lcd_drv->lcd_status & LCD_STATUS_ENCL_ON) == 0) { LCDPR("%s: lcd is disabled, exit\n", __func__); return 0; } @@ -271,7 +271,7 @@ static int lcd_set_vframe_rate_end_hint(void) struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver(); struct vinfo_s *info; - if (lcd_drv->lcd_status == 0) { + if ((lcd_drv->lcd_status & LCD_STATUS_ENCL_ON) == 0) { LCDPR("%s: lcd is disabled, exit\n", __func__); return 0; } @@ -615,15 +615,16 @@ static int lcd_init_load_from_dts(struct lcd_config_s *pconf, int ret = 0; struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver(); + /* lock pinmux if lcd in on */ switch (pconf->lcd_basic.lcd_type) { case LCD_TTL: - if (lcd_drv->lcd_status) /* lock pinmux if lcd in on */ + if (lcd_drv->lcd_status & LCD_STATUS_IF_ON) lcd_ttl_pinmux_set(1); else lcd_ttl_pinmux_set(0); break; case LCD_VBYONE: - if (lcd_drv->lcd_status) /* lock pinmux if lcd in on */ + if (lcd_drv->lcd_status & LCD_STATUS_IF_ON) lcd_vbyone_pinmux_set(1); break; default: diff --git a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c index 6ffa9ee53c70..8e36aa7fb3c3 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c +++ b/drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.c @@ -474,7 +474,7 @@ static int lcd_set_vframe_rate_hint(int duration) LCDPR("vout_serve bypass\n"); return 0; } - if (lcd_drv->lcd_status == 0) { + if ((lcd_drv->lcd_status & LCD_STATUS_ENCL_ON) == 0) { LCDPR("%s: lcd is disabled, exit\n", __func__); return 0; } @@ -537,7 +537,7 @@ static int lcd_set_vframe_rate_end_hint(void) LCDPR("vout_serve bypass\n"); return 0; } - if (lcd_drv->lcd_status == 0) { + if ((lcd_drv->lcd_status & LCD_STATUS_ENCL_ON) == 0) { LCDPR("%s: lcd is disabled, exit\n", __func__); return 0; } @@ -775,9 +775,10 @@ static int lcd_init_load_from_dts(struct lcd_config_s *pconf, int ret = 0; struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver(); + /* lock pinmux if lcd in on */ switch (pconf->lcd_basic.lcd_type) { case LCD_VBYONE: - if (lcd_drv->lcd_status) /* lock pinmux if lcd in on */ + if (lcd_drv->lcd_status & LCD_STATUS_IF_ON) lcd_vbyone_pinmux_set(1); break; default: diff --git a/drivers/amlogic/media/vout/lcd/lcd_vout.c b/drivers/amlogic/media/vout/lcd/lcd_vout.c index fa1ccb9e65fc..7a7c80bfa5bd 100644 --- a/drivers/amlogic/media/vout/lcd/lcd_vout.c +++ b/drivers/amlogic/media/vout/lcd/lcd_vout.c @@ -1141,7 +1141,7 @@ static void lcd_auto_test_delayed(struct work_struct *work) static void lcd_auto_test(unsigned char flag) { - lcd_driver->lcd_test_flag = flag; + lcd_driver->lcd_test_state = flag; if (lcd_driver->workqueue) { queue_delayed_work(lcd_driver->workqueue, &lcd_test_delayed_work, @@ -1257,7 +1257,7 @@ static int lcd_resume(struct platform_device *pdev) static int lcd_suspend(struct platform_device *pdev, pm_message_t state) { mutex_lock(&lcd_driver->power_mutex); - if (lcd_driver->lcd_status) { + if (lcd_driver->lcd_status & LCD_STATUS_ENCL_ON) { aml_lcd_notifier_call_chain(LCD_EVENT_POWER_OFF, NULL); lcd_resume_flag = 0; LCDPR("%s finished\n", __func__); @@ -1271,7 +1271,7 @@ static void lcd_shutdown(struct platform_device *pdev) if (lcd_debug_print_flag) LCDPR("%s\n", __func__); - if (lcd_driver->lcd_status) + if (lcd_driver->lcd_status & LCD_STATUS_ENCL_ON) aml_lcd_notifier_call_chain(LCD_EVENT_POWER_OFF, NULL); }