Dear all,

This patch solves TS firmware updating bugs.

Please help to integrate the patch, thanks

 

Subject: Rewrite elan_iap_write()

 

1. Rewrite elan_iap_write().

2. Enable/Disable irq while iap_close/iap_open.

3. Update driver version to 3.0.2

 

Signed-off-by: Mike Hsu <[email protected]>

Signed-off-by: Stanley Zeng <[email protected]>

 

---

ektf2136_spi.c |   18 ++++++++++--------

1 file changed, 10 insertions(+), 8 deletions(-)

 

--- a/drivers/input/touchscreen/ektf2136_spi.c   2011-05-16
02:06:26.296875000 +0000

+++ b/drivers/input/touchscreen/ektf2136_spi.c           2011-05-01
22:36:20.458182004 +0000

@@ -30,11 +30,11 @@

 #include <linux/pm_runtime.h>

 

 #define DRV_NAME    "ektf2136_spi"

-#define DRIVER_VERSION  "v3.0.1"

+#define DRIVER_VERSION "v3.0.2"

 

 #define DRV_MA_VER 3

 #define DRV_MI_VER 0

-#define DRV_SUB_MI_VER 1

+#define DRV_SUB_MI_VER 2

 

 static const char ELAN_TS_NAME[]         = "ektf2136_spi";

 

@@ -1415,6 +1415,7 @@ static int elan_iap_open(struct inode *i

                                                               struct
elan_data, firmware);

          if (test_and_set_bit(0, &ed->busy))

                    return -EBUSY;

+        disable_irq(ed->spi->irq);

          pm_runtime_get_sync(&ed->spi->dev);

          return 0;

 }

@@ -1424,6 +1425,7 @@ static int elan_iap_release(struct inode

          struct elan_data *ed = container_of(filp->private_data,

                                                               struct
elan_data, firmware);

          pm_runtime_put(&ed->spi->dev);

+        enable_irq(ed->spi->irq);

          clear_bit(0, &ed->busy);

          return 0;

 }

@@ -1431,7 +1433,7 @@ static int elan_iap_release(struct inode

 static ssize_t elan_iap_write(struct file *filp, const char *buff,

                                                               size_t count,
loff_t *offp)

 {

-         static const u8 invoke_iap_mode_cmd[4] = { 0x54, 0x00, 0x12, 0x34
};

+        static const u8 iap_reset_data[4] = { 0x77, 0x77, 0x77, 0x77 };

          struct elan_data *ed = container_of(filp->private_data,

                                                               struct
elan_data, firmware);

          int rc;

@@ -1446,12 +1448,12 @@ static ssize_t elan_iap_write(struct fil

          mutex_lock(&ed->mutex);

 

          if (count == 4) {

-                    if (!memcmp(txbuf, invoke_iap_mode_cmd, 4))

-                               rc = elan_spi_write_cmd(ed->spi, txbuf,
count,

-
"invoke_iap_mode_cmd");

-                    else

+                   if (!memcmp(txbuf, iap_reset_data, 4))

                               rc = elan_spi_write_data(ed->spi, txbuf,
count,

-
"iap_write_data");

+
"iap_reset_data");

+                   else

+                              rc = elan_spi_write_cmd(ed->spi, txbuf,
count,

+
"iap_write_cmd");

          } else

                    rc = elan_spi_write_data(ed->spi, txbuf, count,

 
"iap_write_data");

Attachment: ektf2136_spi_Rewrite_iap_write.patch
Description: Binary data

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to