Dear all,

For debug and clarify issue, compute touch event counter and show
information in sysfs

Please help to integrate the patch, thanks

 

Subject: Add sysfs attribute for touch event counter

 

1. Add sysfs attribute for touch event counter

2. Add STA_SLEEP_MODE for TS driver status checking

3. Change TS driver version to v3.0.4

 

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

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

 

---

ektf2136_spi.c |   22 ++++++++++++++++++++--

1 file changed, 20 insertions(+), 2 deletions(-)

 

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

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

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

 #include <linux/pm_runtime.h>

 

 #define DRV_NAME    "ektf2136_spi"

-#define DRIVER_VERSION  "v3.0.3"

+#define DRIVER_VERSION "v3.0.4"

 

 #define DRV_MA_VER 3

 #define DRV_MI_VER 0

-#define DRV_SUB_MI_VER 3

+#define DRV_SUB_MI_VER 4

 

 static const char ELAN_TS_NAME[]       = "ektf2136_spi";

 

@@ -46,6 +46,7 @@ static const char ELAN_TS_NAME[]   = "ektf

 #define STA_ERR_HELLO_PKT   0x00000010

 #define STA_USE_IRQ         0x00000020

 #define STA_USE_SR          0x00000040

+#define STA_SLEEP_MODE      0x00000080

 

 /* Firmware protocol status flag */

 #define PRO_SPI_WRT_CMD_SYNC     0x00000001

@@ -259,6 +260,14 @@ static ssize_t show_adapter_pkt_rvd(stru

          return sprintf(buf, "%ld %ld\n", ed->packet_received,
ed->packet_fail);

 }

 

+static ssize_t show_adapter_touch_event_num(struct device *dev,

+                                        struct device_attribute *attr, char
*buf)

+{

+        struct spi_device *spi = to_spi_device(dev);

+        struct elan_data *ed = spi_get_drvdata(spi);

+        return sprintf(buf, "%ld %ld\n", ed->touched_sync,
ed->no_touched_sync);

+}

+

 static ssize_t show_power_state(struct device *dev,

                                          struct device_attribute *attr,
char *buf)

 {

@@ -306,6 +315,7 @@ static DEVICE_ATTR(ts_col, S_IRUGO, show

 static DEVICE_ATTR(drv_status, S_IRUGO, show_adapter_status, NULL);

 static DEVICE_ATTR(ts_irq_num, S_IRUGO, show_adapter_irq_num, NULL);

 static DEVICE_ATTR(ts_packet, S_IRUGO, show_adapter_pkt_rvd, NULL);

+static DEVICE_ATTR(ts_evt_num, S_IRUGO, show_adapter_touch_event_num,
NULL);

 static DEVICE_ATTR(power_state, S_IRUGO|S_IWUGO, show_power_state,

 
store_power_state);

 

@@ -319,6 +329,7 @@ static struct attribute *elan_attributes

          &dev_attr_drv_status.attr,

          &dev_attr_ts_irq_num.attr,

          &dev_attr_ts_packet.attr,

+        &dev_attr_ts_evt_num.attr,

          &dev_attr_power_state.attr,

          NULL

 };

@@ -1809,6 +1820,9 @@ static int ektf2136_runtime_suspend(stru

          ed->power_state = 0;

          mutex_unlock(&ed->sysfs_mutex);

          msleep(100);

+

+        ed->status |= STA_SLEEP_MODE;

+

          return 0;

 }

 

@@ -1832,12 +1846,16 @@ static int ektf2136_runtime_resume(struc

          ed->power_state = 1;

          mutex_unlock(&ed->sysfs_mutex);

          msleep(100);

+

+        ed->status &= ~STA_SLEEP_MODE;

+

          return 0;

 }

 

 static const struct dev_pm_ops ektf2136_pm_ops = {

          .runtime_suspend = ektf2136_runtime_suspend,

          .runtime_resume  = ektf2136_runtime_resume,

+

 };

 #endif

Attachment: ektf2136_spi_Add_sysfs_for_touch_event_num.patch
Description: Binary data

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

Reply via email to