AndreiLux / Perseus-UNIVERSAL5410

This is a clean kernel glued together upon Samsung's last public branch of android-exynos-3.4 with sources provided by the OSRC releases. The OSRC release has been stripped clean of all non-i9500 related code and sourced, as much as possible through the original patches.
https://github.com/AndreiLux/Perseus-UNIVERSAL5410/wiki
Other
30 stars 19 forks source link

[PATCH] Fix: touchscreen doesn't work upon boot #2

Closed sorgelig closed 11 years ago

sorgelig commented 11 years ago
From 6cda620b48b07849f7d1dca58f771bf3e4405d8d Mon Sep 17 00:00:00 2001
From: sorg <pour.garbage@gmail.com>
Date: Tue, 11 Jun 2013 01:19:17 +0800
Subject: [PATCH] Fix: touchscreen doesn't work upon boot

---
 drivers/video/backlight/s6e8fa0_I_mipi_lcd.c |   19 +++++++++++++++----
 drivers/video/backlight/s6e8fa0_I_param.h    |    5 +++++
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/s6e8fa0_I_mipi_lcd.c b/drivers/video/backlight/s6e8fa0_I_mipi_lcd.c
index 7a59ccf..fb3cac6 100644
--- a/drivers/video/backlight/s6e8fa0_I_mipi_lcd.c
+++ b/drivers/video/backlight/s6e8fa0_I_mipi_lcd.c
@@ -901,14 +901,24 @@ static int update_brightness(struct lcd_info *lcd, u8 force)
 /* So other type's lcd driver don't have this function */
 static void s6e8fa0_ldi_touchkey_on(void)
 {
-   if (g_lcd != NULL)
-       s6e8fa0_write(g_lcd, SEQ_TOUCHKEY_ON, ARRAY_SIZE(SEQ_TOUCHKEY_ON));
+   struct lcd_info *lcd = g_lcd;
+
+   if (lcd != NULL && lcd->ldi_enable) {
+       s6e8fa0_write(lcd, SEQ_TEST_KEY_ON_FC, ARRAY_SIZE(SEQ_TEST_KEY_ON_FC));
+       s6e8fa0_write(lcd, SEQ_TOUCHKEY_ON, ARRAY_SIZE(SEQ_TOUCHKEY_ON));
+       s6e8fa0_write(lcd, SEQ_TEST_KEY_OFF_FC, ARRAY_SIZE(SEQ_TEST_KEY_OFF_FC));
+   }
 }

 static void s6e8fa0_ldi_touchkey_off(void)
 {
-   if (g_lcd != NULL)
-       s6e8fa0_write(g_lcd, SEQ_TOUCHKEY_OFF, ARRAY_SIZE(SEQ_TOUCHKEY_OFF));
+   struct lcd_info *lcd = g_lcd;
+
+   if (lcd != NULL && lcd->ldi_enable) {
+       s6e8fa0_write(lcd, SEQ_TEST_KEY_ON_FC, ARRAY_SIZE(SEQ_TEST_KEY_ON_FC));
+       s6e8fa0_write(lcd, SEQ_TOUCHKEY_OFF, ARRAY_SIZE(SEQ_TOUCHKEY_OFF));
+       s6e8fa0_write(lcd, SEQ_TEST_KEY_OFF_FC, ARRAY_SIZE(SEQ_TEST_KEY_OFF_FC));
+   }
 }

 static int s6e8fa0_ldi_init(struct lcd_info *lcd)
@@ -919,6 +929,7 @@ static int s6e8fa0_ldi_init(struct lcd_info *lcd)
    s6e8fa0_write(lcd, SEQ_TEST_KEY_ON_FC, ARRAY_SIZE(SEQ_TEST_KEY_ON_FC));

    s6e8fa0_write(lcd, SEQ_TOUCHKEY_OFF, ARRAY_SIZE(SEQ_TOUCHKEY_OFF));
+   s6e8fa0_write(lcd, SEQ_TEST_KEY_OFF_FC, ARRAY_SIZE(SEQ_TEST_KEY_OFF_FC));

    s6e8fa0_write(lcd, SEQ_SLEEP_OUT, ARRAY_SIZE(SEQ_SLEEP_OUT));

diff --git a/drivers/video/backlight/s6e8fa0_I_param.h b/drivers/video/backlight/s6e8fa0_I_param.h
index ea6a081..9744943 100644
--- a/drivers/video/backlight/s6e8fa0_I_param.h
+++ b/drivers/video/backlight/s6e8fa0_I_param.h
@@ -75,6 +75,11 @@ static const unsigned char SEQ_TEST_KEY_ON_FC[] = {
    0x5A, 0x5A,
 };

+static const unsigned char SEQ_TEST_KEY_OFF_FC[] = {
+   0xFC,
+   0xA5, 0xA5,
+};
+
 static const unsigned char SEQ_SLEEP_OUT[] = {
    0x11,
    0x00, 0x00
-- 
1.7.9.5