RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

> > Yes, I've received an email saying that the patch will show up in the next
> > release of the linux-next tree, but I was not aware that linux-next tree
> > means 3.8-rc1.
> 
> It does not, you didn't read the next sentance which described when the
> patch would be sent to Linus...

Thank you for correcting. Correction to my earlier reply: The patch will
show up in the next release of the linux-next tree, then to Linus Torvalds.
And if it gets accepted at each step along the way, it will be merged in
the mainline :-)

Best regards,
Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

> That is because they were new features, and not regressions, so they
> will be showing up in Linus's tree for 3.8-rc1.
> 
> > May I know status of this patch? Please let me know if there is anything I
> > should do.
> 
> Didn't you get an email when I applied the patches saying where the
> patches could be seen and when they would be merged to Linus?
> 

Yes, I've received an email saying that the patch will show up in the next
release of the linux-next tree, but I was not aware that linux-next tree
means 3.8-rc1.
Now I understand, and really thank you for your prompt reply.

Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

> > For next time: Once you have received an acked-by or reviewed-by, you
> > may add that line under your own signed-off-by in subsequent
> > mails. That way, the status of the patch can be tracked properly,
> > making life easier for everyone.
> >
> > Greg, I think we are ready now. :-)
> 
> All applied.

There are coming patches which needs to be updated and based on this patch,
but I noticed that this patch has not been submitted in recent mainline
archives (3.7-rc7/3.7-rc8).
May I know status of this patch? Please let me know if there is anything I 
should do.
Appreciate your advice.

Best regards,
Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

  For next time: Once you have received an acked-by or reviewed-by, you
  may add that line under your own signed-off-by in subsequent
  mails. That way, the status of the patch can be tracked properly,
  making life easier for everyone.
 
  Greg, I think we are ready now. :-)
 
 All applied.

There are coming patches which needs to be updated and based on this patch,
but I noticed that this patch has not been submitted in recent mainline
archives (3.7-rc7/3.7-rc8).
May I know status of this patch? Please let me know if there is anything I 
should do.
Appreciate your advice.

Best regards,
Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

 That is because they were new features, and not regressions, so they
 will be showing up in Linus's tree for 3.8-rc1.
 
  May I know status of this patch? Please let me know if there is anything I
  should do.
 
 Didn't you get an email when I applied the patches saying where the
 patches could be seen and when they would be merged to Linus?
 

Yes, I've received an email saying that the patch will show up in the next
release of the linux-next tree, but I was not aware that linux-next tree
means 3.8-rc1.
Now I understand, and really thank you for your prompt reply.

Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-12-06 Thread Alexandra Chin
Hi Greg,

  Yes, I've received an email saying that the patch will show up in the next
  release of the linux-next tree, but I was not aware that linux-next tree
  means 3.8-rc1.
 
 It does not, you didn't read the next sentance which described when the
 patch would be sent to Linus...

Thank you for correcting. Correction to my earlier reply: The patch will
show up in the next release of the linux-next tree, then to Linus Torvalds.
And if it gets accepted at each step along the way, it will be merged in
the mainline :-)

Best regards,
Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-16 Thread Alexandra Chin
Hi Dmitry,

> > > Please have Greg commit the patch that Henrik reviewed to staging and
> > > then work with Christopher Heiny group on getting the full featured
> > > driver into mainline.

Thanks for your reminding, final patch has been re-sent to staging
maintainer.

> In this case you need to enumerate the benefits of this driver over
> unified driver and show why the unified driver can't be fixed.
> 
> Currently the driver is in mainline (even though the directory is
> staging) and nobody will remove it until another driver is fully
> functional and ready for prime time. But once this happens I do not see
> the benefits of maintaining 2 drivers for the same hardware.

I see. Given that the driver will remain in mainline before generic driver
is ready, currently I will continue to maintain the driver in staging.

Appreciate your response.

Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-16 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.

Signed-off-by: Alexandra Chin 
---
This patch was tested on Pandaboard.

Changes from v6:
- Incorporated Henrik's review comments
  *remove irrelevant changes within the patch

Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   76 +++--
 1 files changed, 33 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ed304e0 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata->fingers_supported;
struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi->num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi->fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -358,7 +358,11 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
data_offset, data,

[PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-16 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
This patch was tested on Pandaboard.

Changes from v6:
- Incorporated Henrik's review comments
  *remove irrelevant changes within the patch

Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   76 +++--
 1 files changed, 33 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ed304e0 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata-fingers_supported;
struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi-fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -358,7 +358,11 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata

RE: [RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-16 Thread Alexandra Chin
Hi Dmitry,

   Please have Greg commit the patch that Henrik reviewed to staging and
   then work with Christopher Heiny group on getting the full featured
   driver into mainline.

Thanks for your reminding, final patch has been re-sent to staging
maintainer.

 In this case you need to enumerate the benefits of this driver over
 unified driver and show why the unified driver can't be fixed.
 
 Currently the driver is in mainline (even though the directory is
 staging) and nobody will remove it until another driver is fully
 functional and ready for prime time. But once this happens I do not see
 the benefits of maintaining 2 drivers for the same hardware.

I see. Given that the driver will remain in mainline before generic driver
is ready, currently I will continue to maintain the driver in staging.

Appreciate your response.

Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-14 Thread Alexandra Chin
Hi Dmitry,

> > As I know, currently there is no synaptics RMI4 touchscreen driver in the
> > main tree. In order to support our customers effectively, is it able to 
> > merge
> > staging ste_rmi4 driver into the main kernel.org tree? If it is accepted, 
> > should
> > I send a patch for this change?
> 
> I believe that we should keep ste_rmi4 in staging, not as reflection of
> its code quality, but rather because it is a temporary solution until
> full-fledged RMI4 driver is merged.
> 
> Please have Greg commit the patch that Henrik reviewed to staging and
> then work with Christopher Heiny group on getting the full featured
> driver into mainline.

Thank you for the prompt reply. The ste_rmi4 driver is actually not intended to 
be
a temporary solution for the full-fledged driver. We have requests from a number
of our customers and partners (Qualcomm, Samsung, Intel etc.) urging us to have
a driver available in the kernel mainline that is specific to touchscreen with 
simple
architecture and supporting our S3200 family of Touch Controllers and above. We
are committing resources to continue to maintain this driver and provide updates
to support future touch controller revisions from Synaptics.
It would be greatly appreciated if this driver can be considered for inclusion 
in the
kernel mainline.

Thank you.

Alexandra Chin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-14 Thread Alexandra Chin
Hi Henrik and all,

As I know, currently there is no synaptics RMI4 touchscreen driver in the
main tree. In order to support our customers effectively, is it able to merge
staging ste_rmi4 driver into the main kernel.org tree? If it is accepted, should
I send a patch for this change?

Any advice is greatly appreciated!

Alexandra Chin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-14 Thread Alexandra Chin
Hi Henrik,

> > @@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct
> synaptics_rmi4_data *pdata,
> > data_offset, data,
> > data_reg_blk_size);
> > if (retval != data_reg_blk_size) {
> > -   printk(KERN_ERR "%s:read data failed\n",
> > +   dev_err(>dev, "%s:read data failed\n",
> 
> Still not needed for this patch. Please try to refrain from making
> unnecessary changes in the future.
> 

Thanks for your acceptance!
And I will remember that do not put irrelevant changes in the same patch.
I will follow the rule to keep updating changes of v4 in future patch.
Thanks you.

Alexandra Chin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-14 Thread Alexandra Chin
Hi Henrik,

  @@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct
 synaptics_rmi4_data *pdata,
  data_offset, data,
  data_reg_blk_size);
  if (retval != data_reg_blk_size) {
  -   printk(KERN_ERR %s:read data failed\n,
  +   dev_err(client-dev, %s:read data failed\n,
 
 Still not needed for this patch. Please try to refrain from making
 unnecessary changes in the future.
 

Thanks for your acceptance!
And I will remember that do not put irrelevant changes in the same patch.
I will follow the rule to keep updating changes of v4 in future patch.
Thanks you.

Alexandra Chin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-14 Thread Alexandra Chin
Hi Henrik and all,

As I know, currently there is no synaptics RMI4 touchscreen driver in the
main tree. In order to support our customers effectively, is it able to merge
staging ste_rmi4 driver into the main kernel.org tree? If it is accepted, should
I send a patch for this change?

Any advice is greatly appreciated!

Alexandra Chin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC] staging: ste_rmi4: merge into the main kernel tree

2012-11-14 Thread Alexandra Chin
Hi Dmitry,

  As I know, currently there is no synaptics RMI4 touchscreen driver in the
  main tree. In order to support our customers effectively, is it able to 
  merge
  staging ste_rmi4 driver into the main kernel.org tree? If it is accepted, 
  should
  I send a patch for this change?
 
 I believe that we should keep ste_rmi4 in staging, not as reflection of
 its code quality, but rather because it is a temporary solution until
 full-fledged RMI4 driver is merged.
 
 Please have Greg commit the patch that Henrik reviewed to staging and
 then work with Christopher Heiny group on getting the full featured
 driver into mainline.

Thank you for the prompt reply. The ste_rmi4 driver is actually not intended to 
be
a temporary solution for the full-fledged driver. We have requests from a number
of our customers and partners (Qualcomm, Samsung, Intel etc.) urging us to have
a driver available in the kernel mainline that is specific to touchscreen with 
simple
architecture and supporting our S3200 family of Touch Controllers and above. We
are committing resources to continue to maintain this driver and provide updates
to support future touch controller revisions from Synaptics.
It would be greatly appreciated if this driver can be considered for inclusion 
in the
kernel mainline.

Thank you.

Alexandra Chin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-13 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.
 
Signed-off-by: Alexandra Chin 
---
This patch was tested on Pandaboard.

Changes from v6:
- Incorporated Henrik's review comments
  *remove irrelevant changes within the patch

Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   76 +++--
 1 files changed, 33 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ed304e0 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata->fingers_supported;
struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi->num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi->fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -358,7 +358,11 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
data_offset, data,

[PATCH v6] staging: ste_rmi4: Convert to Type-B support

2012-11-13 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.
 
Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
This patch was tested on Pandaboard.

Changes from v6:
- Incorporated Henrik's review comments
  *remove irrelevant changes within the patch

Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   76 +++--
 1 files changed, 33 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ed304e0 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata-fingers_supported;
struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi-fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -358,7 +358,11 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -367,50 +371,33 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata

RE: [PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

> > > I am seeing _new_ irrelevant changes in this version... There is no
> > > need to revert to v3. Just remove the synaptics_rmi4_query_function()
> > > changes and other uneeded cruft from the v4 patch. No new changes,
> > > please, and make sure the final patch is tested.
> >
> > Those changes are intended to fix line over 80 characters in v3.
> > The code has been optimized and the logic does not change.
> 
> I would still prefer if the trivial non-functional changes were
> deferred to later patches. I realize that the change from 'TOUCHPAD'
> to 'TOUCHSCREEN' created some problems, but those changes were not
> called for in the first place. How about leaving those lines be for
> now, and then change to something more generic in a later patch? The
> code will obviously work equally well for both touchpad and
> touchscreen settings, so the defines could be better named anyways.
> 
> > Patch v5 has been verified with pandaboard.
> 
> Thank you.
> 
> Henrik

I see. As your suggestions in patch v5, I will resend patch containing only
functional changes.
Thanks for your advice.

Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

>> Convert to MT-B because Synaptics touch devices are capable
>> of tracking identifiable fingers.
>>
>> Signed-off-by: Alexandra Chin 
>> ---
>> Changes from v5:
>> - Incorporated Henrik's review comments
>>   *rollback to v3 from v4
>>   *fix odd line break in v3
>> - Include Alexandra in the list of authors
>
> I am seeing _new_ irrelevant changes in this version... There is no
> need to revert to v3. Just remove the synaptics_rmi4_query_function()
> changes and other uneeded cruft from the v4 patch. No new changes,
> please, and make sure the final patch is tested.

Those changes are intended to fix line over 80 characters in v3.
The code has been optimized and the logic does not change.
Patch v5 has been verified with pandaboard.
Any suggestions are much appreciated.

Best regards,
Alexandra--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

Really thanks a lot for all your advice.

> > @@ -751,7 +739,7 @@ static int synaptics_rmi4_i2c_query_device(struct
> synaptics_rmi4_data *pdata)
> > pdata->fn01_data_base_addr =
> > rmi_fd.data_base_addr;
> > break;
> > -   case SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM:
> > +   case SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM:
> > if (rmi_fd.intr_src_count) {
> > rfi = kmalloc(sizeof(*rfi),
> > GFP_KERNEL);
> > @@ -761,7 +749,8 @@ static int synaptics_rmi4_i2c_query_device(struct
> synaptics_rmi4_data *pdata)
> > __func__);
> > return -ENOMEM;
> > }
> > -   retval = synpatics_rmi4_touchpad_detect
> > +   retval =
> > +   synpatics_rmi4_touchscreen_detect
> > (pdata, rfi,
> > _fd,
> > intr_count);
> 
> Odd line break is a clear sign that something could be broken out into its own
> function.
> 
> > @@ -854,8 +843,9 @@ static int synaptics_rmi4_i2c_query_device(struct
> synaptics_rmi4_data *pdata)
> > list_for_each_entry(rfi, >support_fn_list, link) {
> > if (rfi->num_of_data_sources) {
> > if (rfi->fn_number ==
> > -   SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM) {
> > -   retval = synaptics_rmi4_touchpad_config
> > +   SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM) {
> > +   retval =
> > +   synaptics_rmi4_touchscreen_config
> > (pdata, rfi);
> > if (retval < 0)
> > return retval;
> 
> Same here.
> 

As you mentioned, there are odd lines in patch v3.
These odd lines are because that lines are over 80 characters after "touchpad" 
is
replaced by "touchscreen".

In patch v4, I did the splitting of the functions to fix line over 80 
characters issue
(and other irrelevant work).

Somehow I realized that code itself can be optimized, and there is no need
to break out function to fix line over 80 characters issues. Therefore I 
rollback
patch to v3, and reorganized code flow to fix line over 80 characters issues in
patch v5. Patch v5 only includes odd lines issue fixed, although it looks a 
little
too large.

And these changes have been verified with Pandaboard.

Greatly appreciate your suggestions, and please let me know if you have any
concerns about v5 (https://lkml.org/lkml/2012/11/8/31).

Yours very truly,
Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

Really thanks a lot for all your advice.

  @@ -751,7 +739,7 @@ static int synaptics_rmi4_i2c_query_device(struct
 synaptics_rmi4_data *pdata)
  pdata-fn01_data_base_addr =
  rmi_fd.data_base_addr;
  break;
  -   case SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM:
  +   case SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM:
  if (rmi_fd.intr_src_count) {
  rfi = kmalloc(sizeof(*rfi),
  GFP_KERNEL);
  @@ -761,7 +749,8 @@ static int synaptics_rmi4_i2c_query_device(struct
 synaptics_rmi4_data *pdata)
  __func__);
  return -ENOMEM;
  }
  -   retval = synpatics_rmi4_touchpad_detect
  +   retval =
  +   synpatics_rmi4_touchscreen_detect
  (pdata, rfi,
  rmi_fd,
  intr_count);
 
 Odd line break is a clear sign that something could be broken out into its own
 function.
 
  @@ -854,8 +843,9 @@ static int synaptics_rmi4_i2c_query_device(struct
 synaptics_rmi4_data *pdata)
  list_for_each_entry(rfi, rmi-support_fn_list, link) {
  if (rfi-num_of_data_sources) {
  if (rfi-fn_number ==
  -   SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM) {
  -   retval = synaptics_rmi4_touchpad_config
  +   SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM) {
  +   retval =
  +   synaptics_rmi4_touchscreen_config
  (pdata, rfi);
  if (retval  0)
  return retval;
 
 Same here.
 

As you mentioned, there are odd lines in patch v3.
These odd lines are because that lines are over 80 characters after touchpad 
is
replaced by touchscreen.

In patch v4, I did the splitting of the functions to fix line over 80 
characters issue
(and other irrelevant work).

Somehow I realized that code itself can be optimized, and there is no need
to break out function to fix line over 80 characters issues. Therefore I 
rollback
patch to v3, and reorganized code flow to fix line over 80 characters issues in
patch v5. Patch v5 only includes odd lines issue fixed, although it looks a 
little
too large.

And these changes have been verified with Pandaboard.

Greatly appreciate your suggestions, and please let me know if you have any
concerns about v5 (https://lkml.org/lkml/2012/11/8/31).

Yours very truly,
Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

 Convert to MT-B because Synaptics touch devices are capable
 of tracking identifiable fingers.

 Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
 ---
 Changes from v5:
 - Incorporated Henrik's review comments
   *rollback to v3 from v4
   *fix odd line break in v3
 - Include Alexandra in the list of authors

 I am seeing _new_ irrelevant changes in this version... There is no
 need to revert to v3. Just remove the synaptics_rmi4_query_function()
 changes and other uneeded cruft from the v4 patch. No new changes,
 please, and make sure the final patch is tested.

Those changes are intended to fix line over 80 characters in v3.
The code has been optimized and the logic does not change.
Patch v5 has been verified with pandaboard.
Any suggestions are much appreciated.

Best regards,
Alexandra--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-12 Thread Alexandra Chin
Hi Henrik,

   I am seeing _new_ irrelevant changes in this version... There is no
   need to revert to v3. Just remove the synaptics_rmi4_query_function()
   changes and other uneeded cruft from the v4 patch. No new changes,
   please, and make sure the final patch is tested.
 
  Those changes are intended to fix line over 80 characters in v3.
  The code has been optimized and the logic does not change.
 
 I would still prefer if the trivial non-functional changes were
 deferred to later patches. I realize that the change from 'TOUCHPAD'
 to 'TOUCHSCREEN' created some problems, but those changes were not
 called for in the first place. How about leaving those lines be for
 now, and then change to something more generic in a later patch? The
 code will obviously work equally well for both touchpad and
 touchscreen settings, so the defines could be better named anyways.
 
  Patch v5 has been verified with pandaboard.
 
 Thank you.
 
 Henrik

I see. As your suggestions in patch v5, I will resend patch containing only
functional changes.
Thanks for your advice.

Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-07 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.

Signed-off-by: Alexandra Chin 
---
Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3
- Include Alexandra in the list of authors

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  245 -
 1 files changed, 114 insertions(+), 131 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..7b636c7 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,10 +1,11 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA  for ST-Ericsson
  * Author: Naveen Kumar G  for ST-Ericsson
+ * Author: Alexandra Chin 
  * Copyright 2010 (c) ST-Ericsson AB
  */
 /*
@@ -31,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +65,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +165,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +186,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -291,34 +294,33 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen 
device
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to reports for the rmi4 touchscreen device
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data *pdata,
struct synaptics_rmi4_fn *rfi)
 {
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata->fingers_supported;
struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +335,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-

RE: [PATCH v4] staging: ste_rmi4: Convert to Type-B support

2012-11-07 Thread Alexandra Chin
Hi Henrik.

> > Convert to MT-B because Synaptics touch devices are capable of tracking
> > identifiable fingers.
> >
> > Signed-off-by: Alexandra Chin 
> > ---
> > Changes from v4:
> > - Incorporated Henrik's review comments
> >   *split function synpatics_rmi4_touchscreen_report
> >   *split function synaptics_rmi4_i2c_query_device
> 
> Thanks for the changes. The patch looks cleaner, but also much larger,
> containing many changes irrelevant to the commit message (and to what
> has hitherto been reviewed). Please resend a minimum patch, there is
> plenty of room for additional patches after this one. :-)
> 
> Thanks,
> Henrik

Appreciate your review!
I think there is not much of change in patch v4, but git diff tool makes it 
look larger.
Since patch v4 is considered too large, let me resubmit a minimum patch,
and update changes of v4 in future patch.
Thank you for your advice.

Alexandra
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v4] staging: ste_rmi4: Convert to Type-B support

2012-11-07 Thread Alexandra Chin
Hi Henrik.

  Convert to MT-B because Synaptics touch devices are capable of tracking
  identifiable fingers.
 
  Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
  ---
  Changes from v4:
  - Incorporated Henrik's review comments
*split function synpatics_rmi4_touchscreen_report
*split function synaptics_rmi4_i2c_query_device
 
 Thanks for the changes. The patch looks cleaner, but also much larger,
 containing many changes irrelevant to the commit message (and to what
 has hitherto been reviewed). Please resend a minimum patch, there is
 plenty of room for additional patches after this one. :-)
 
 Thanks,
 Henrik

Appreciate your review!
I think there is not much of change in patch v4, but git diff tool makes it 
look larger.
Since patch v4 is considered too large, let me resubmit a minimum patch,
and update changes of v4 in future patch.
Thank you for your advice.

Alexandra
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5] staging: ste_rmi4: Convert to Type-B support

2012-11-07 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable
of tracking identifiable fingers.

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
Changes from v5:
- Incorporated Henrik's review comments
  *rollback to v3 from v4
  *fix odd line break in v3
- Include Alexandra in the list of authors

Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  245 -
 1 files changed, 114 insertions(+), 131 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..7b636c7 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,10 +1,11 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA js...@stericsson.com for ST-Ericsson
  * Author: Naveen Kumar G naveen.gaddip...@stericsson.com for ST-Ericsson
+ * Author: Alexandra Chin alexandra.c...@tw.synaptics.com
  * Copyright 2010 (c) ST-Ericsson AB
  */
 /*
@@ -31,6 +32,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +65,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +165,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +186,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -291,34 +294,33 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen 
device
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to reports for the rmi4 touchscreen device
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data *pdata,
struct synaptics_rmi4_fn *rfi)
 {
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata-fingers_supported;
struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +335,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10

[PATCH v4] staging: ste_rmi4: Convert to Type-B support

2012-11-06 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable of tracking
identifiable fingers.

Signed-off-by: Alexandra Chin 
---
Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  375 ++---
 1 files changed, 215 insertions(+), 160 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ef3fd0c 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,10 +1,11 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA  for ST-Ericsson
  * Author: Naveen Kumar G  for ST-Ericsson
+ * Author: Alexandra Chin 
  * Copyright 2010 (c) ST-Ericsson AB
  */
 /*
@@ -31,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +65,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +165,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +186,8 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
+   int finger_status_register_count;
 };
 
 /**
@@ -291,34 +295,100 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_finger_report() - finger reports
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
+ * @finger: finger index
+ * @values: pointer to buffer of status registers
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to report multi-finger data to input subsystem
+ * and returns true if finger status is non zero
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static bool synpatics_rmi4_finger_report(struct synaptics_rmi4_data *pdata,
+   struct synaptics_rmi4_fn *rfi,
+   int finger,
+   unsigned char *values)
+{
+   int retval;
+   int x, y;
+   int wx, wy;
+   int reg;
+   int finger_shift;
+   int finger_status;
+   int finger_registers = pdata->finger_status_register_count;
+   unsigned char   data[DATA_LEN];
+   unsigned char   data_reg_blk_size = rfi->size_of_data_register_block;
+   unsigned short  data_offset;
+   unsigned short  data_base_addr = rfi->fn_desc.data_base_addr;
+   struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
+
+   /* determine which data byte the finger status is in */
+   reg = finger / 4;
+   /* bit shift to get finger's status */
+   finger_shift= (finger % 4) * 2;
+   finger_status   = (values[reg] >> finger_shift) & MASK_2BIT;
+
+   /*
+* if finger status indicates a finger is present then
+* read the finger data and report it
+*/
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_stat

[PATCH v4] staging: ste_rmi4: Convert to Type-B support

2012-11-06 Thread Alexandra Chin
Convert to MT-B because Synaptics touch devices are capable of tracking
identifiable fingers.

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
Changes from v4:
- Incorporated Henrik's review comments
  *split function synpatics_rmi4_touchscreen_report
  *split function synaptics_rmi4_i2c_query_device

Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  375 ++---
 1 files changed, 215 insertions(+), 160 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..ef3fd0c 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,10 +1,11 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA js...@stericsson.com for ST-Ericsson
  * Author: Naveen Kumar G naveen.gaddip...@stericsson.com for ST-Ericsson
+ * Author: Alexandra Chin alexandra.c...@tw.synaptics.com
  * Copyright 2010 (c) ST-Ericsson AB
  */
 /*
@@ -31,6 +32,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +65,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +165,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +186,8 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
+   int finger_status_register_count;
 };
 
 /**
@@ -291,34 +295,100 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_finger_report() - finger reports
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
+ * @finger: finger index
+ * @values: pointer to buffer of status registers
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to report multi-finger data to input subsystem
+ * and returns true if finger status is non zero
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static bool synpatics_rmi4_finger_report(struct synaptics_rmi4_data *pdata,
+   struct synaptics_rmi4_fn *rfi,
+   int finger,
+   unsigned char *values)
+{
+   int retval;
+   int x, y;
+   int wx, wy;
+   int reg;
+   int finger_shift;
+   int finger_status;
+   int finger_registers = pdata-finger_status_register_count;
+   unsigned char   data[DATA_LEN];
+   unsigned char   data_reg_blk_size = rfi-size_of_data_register_block;
+   unsigned short  data_offset;
+   unsigned short  data_base_addr = rfi-fn_desc.data_base_addr;
+   struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
+
+   /* determine which data byte the finger status is in */
+   reg = finger / 4;
+   /* bit shift to get finger's status */
+   finger_shift= (finger % 4) * 2;
+   finger_status   = (values[reg]  finger_shift)  MASK_2BIT;
+
+   /*
+* if finger status indicates a finger is present then
+* read the finger data and report it
+*/
+   input_mt_slot(input_dev

RE: [PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-04 Thread Alexandra Chin
Hi Henrik,

> > This patch converts to MT-B because Synaptics touch devices are
> > capable of tracking identifiable fingers
> >
> > This patch was tested on pandaboard, except input_mt_sync_frame(),
> > which is a quite new function.
> 
> I am not sure how to interpret this. Is the patch untested, or tested
> on something different from a pandaboard?

My validation platform is pandaboard. However kernel running on pandaboard
Have not been updated to 3.7, therefore kernel does not contain function
input_mt_sync_frame(). When I tested my patch on pandaboard, I modified
the patch to call function input_mt_report_pointer_emulation(), instead of
calling function input_mt_sync_frame(). I think calling 
input_mt_report_pointer_emulation() or input_mt_sync_frame()
should have the same results.
Please let me know if my understanding is incorrect.

> > I changed to use sylpheed as my mail client. Please let me know
> > if there is any problem.
> > Greatly appreciate your time.
> 
> As mentioned, the commit message of the patch should not contain mail
> conversation.

Oh, I see! I should move conversation message to the outside of the patch 
content. Thanks for your reminder.

> >  drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  122
> -
> >  1 files changed, 57 insertions(+), 65 deletions(-)
> >
> > diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
> b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
> > index 277491a..7876f6b 100644
> > --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
> > +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
> > @@ -1,7 +1,7 @@
> >  /**
> >   *
> > - * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
> > - * Copyright (c) 2007-2010, Synaptics Incorporated
> > + * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
> > + * Copyright (c) 2007-2012, Synaptics Incorporated
> >   *
> >   * Author: Js HA  for ST-Ericsson
> >   * Author: Naveen Kumar G  for
> ST-Ericsson
> > @@ -31,6 +31,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include "synaptics_i2c_rmi4.h"
> >
> >  /* TODO: for multiple device support will need a per-device mutex */
> > @@ -63,12 +64,11 @@
> >  #define MASK_4BIT  0x0F
> >  #define MASK_3BIT  0x07
> >  #define MASK_2BIT  0x03
> > -#define TOUCHPAD_CTRL_INTR 0x8
> > +#define TOUCHSCREEN_CTRL_INTR  0x8
> >  #define PDT_START_SCAN_LOCATION (0x00E9)
> >  #define PDT_END_SCAN_LOCATION  (0x000A)
> >  #define PDT_ENTRY_SIZE (0x0006)
> > -#define RMI4_NUMBER_OF_MAX_FINGERS (8)
> > -#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
> > +#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
> >  #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
> >
> >  /**
> > @@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
> >   * @regulator: pointer to the regulator structure
> >   * @wait: wait queue structure variable
> >   * @touch_stopped: flag to stop the thread function
> > + * @fingers_supported: maximum supported fingers
> >   *
> >   * This structure gives the device data information.
> >   */
> > @@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
> > struct regulator*regulator;
> > wait_queue_head_t   wait;
> > booltouch_stopped;
> > +   unsigned char   fingers_supported;
> >  };
> >
> >  /**
> > @@ -291,34 +293,33 @@ exit:
> >  }
> >
> >  /**
> > - * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
> > + * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen
> device
> >   * @pdata: pointer to synaptics_rmi4_data structure
> >   * @rfi: pointer to synaptics_rmi4_fn structure
> >   *
> > - * This function calls to reports for the rmi4 touchpad device
> > + * This function calls to reports for the rmi4 touchscreen device
> >   */
> > -static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data 
> > *pdata,
> > +static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data
> *pdata,
> > struct synaptics_rmi4_fn *rfi)
> >  {
> > /* number of touch points - fingers down in this case */
> > int touch_count = 0;
> > int finger;
> > -   int fingers_supported;
> > int finger_registers;
> > int reg;
> > int finger_shift;
> > int finger_status;
> > int retval;
> > +   int x, y;
> > +   int wx, wy;
> > unsigned short  data_base_addr;
> > unsigned short  data_offset;
> > unsigned char   data_reg_blk_size;
> > unsigned char   values[2];
> > unsigned char   data[DATA_LEN];
> > -   int x[RMI4_NUMBER_OF_MAX_FINGERS];
> > -   int y[RMI4_NUMBER_OF_MAX_FINGERS];
> > -   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
> > -   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
> > +   unsigned char   fingers_supported = pdata->fingers_supported;
> > struct  i2c_client *client = pdata->i2c_client;
> > +  

RE: [PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-04 Thread Alexandra Chin
Hi Henrik,

  This patch converts to MT-B because Synaptics touch devices are
  capable of tracking identifiable fingers
 
  This patch was tested on pandaboard, except input_mt_sync_frame(),
  which is a quite new function.
 
 I am not sure how to interpret this. Is the patch untested, or tested
 on something different from a pandaboard?

My validation platform is pandaboard. However kernel running on pandaboard
Have not been updated to 3.7, therefore kernel does not contain function
input_mt_sync_frame(). When I tested my patch on pandaboard, I modified
the patch to call function input_mt_report_pointer_emulation(), instead of
calling function input_mt_sync_frame(). I think calling 
input_mt_report_pointer_emulation() or input_mt_sync_frame()
should have the same results.
Please let me know if my understanding is incorrect.

  I changed to use sylpheed as my mail client. Please let me know
  if there is any problem.
  Greatly appreciate your time.
 
 As mentioned, the commit message of the patch should not contain mail
 conversation.

Oh, I see! I should move conversation message to the outside of the patch 
content. Thanks for your reminder.

   drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  122
 -
   1 files changed, 57 insertions(+), 65 deletions(-)
 
  diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
 b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
  index 277491a..7876f6b 100644
  --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
  +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
  @@ -1,7 +1,7 @@
   /**
*
  - * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
  - * Copyright (c) 2007-2010, Synaptics Incorporated
  + * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
  + * Copyright (c) 2007-2012, Synaptics Incorporated
*
* Author: Js HA js...@stericsson.com for ST-Ericsson
* Author: Naveen Kumar G naveen.gaddip...@stericsson.com for
 ST-Ericsson
  @@ -31,6 +31,7 @@
   #include linux/interrupt.h
   #include linux/regulator/consumer.h
   #include linux/module.h
  +#include linux/input/mt.h
   #include synaptics_i2c_rmi4.h
 
   /* TODO: for multiple device support will need a per-device mutex */
  @@ -63,12 +64,11 @@
   #define MASK_4BIT  0x0F
   #define MASK_3BIT  0x07
   #define MASK_2BIT  0x03
  -#define TOUCHPAD_CTRL_INTR 0x8
  +#define TOUCHSCREEN_CTRL_INTR  0x8
   #define PDT_START_SCAN_LOCATION (0x00E9)
   #define PDT_END_SCAN_LOCATION  (0x000A)
   #define PDT_ENTRY_SIZE (0x0006)
  -#define RMI4_NUMBER_OF_MAX_FINGERS (8)
  -#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
  +#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
   #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
   /**
  @@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
* @regulator: pointer to the regulator structure
* @wait: wait queue structure variable
* @touch_stopped: flag to stop the thread function
  + * @fingers_supported: maximum supported fingers
*
* This structure gives the device data information.
*/
  @@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
  struct regulator*regulator;
  wait_queue_head_t   wait;
  booltouch_stopped;
  +   unsigned char   fingers_supported;
   };
 
   /**
  @@ -291,34 +293,33 @@ exit:
   }
 
   /**
  - * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
  + * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen
 device
* @pdata: pointer to synaptics_rmi4_data structure
* @rfi: pointer to synaptics_rmi4_fn structure
*
  - * This function calls to reports for the rmi4 touchpad device
  + * This function calls to reports for the rmi4 touchscreen device
*/
  -static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data 
  *pdata,
  +static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data
 *pdata,
  struct synaptics_rmi4_fn *rfi)
   {
  /* number of touch points - fingers down in this case */
  int touch_count = 0;
  int finger;
  -   int fingers_supported;
  int finger_registers;
  int reg;
  int finger_shift;
  int finger_status;
  int retval;
  +   int x, y;
  +   int wx, wy;
  unsigned short  data_base_addr;
  unsigned short  data_offset;
  unsigned char   data_reg_blk_size;
  unsigned char   values[2];
  unsigned char   data[DATA_LEN];
  -   int x[RMI4_NUMBER_OF_MAX_FINGERS];
  -   int y[RMI4_NUMBER_OF_MAX_FINGERS];
  -   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
  -   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
  +   unsigned char   fingers_supported = pdata-fingers_supported;
  struct  i2c_client *client = pdata-i2c_client;
  +   struct  input_dev *input_dev = pdata-input_dev;
 
 The patch is definitely an improvement over 

[PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-02 Thread Alexandra Chin
Hi Henrik and all,

This patch converts to MT-B because Synaptics touch devices are
capable of tracking identifiable fingers

This patch was tested on pandaboard, except input_mt_sync_frame(),
which is a quite new function.
I changed to use sylpheed as my mail client. Please let me know
if there is any problem.
Greatly appreciate your time.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag

 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  122 -
 1 files changed, 57 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..7876f6b 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,7 +1,7 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA  for ST-Ericsson
  * Author: Naveen Kumar G  for ST-Ericsson
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +64,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -291,34 +293,33 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen 
device
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to reports for the rmi4 touchscreen device
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data *pdata,
struct synaptics_rmi4_fn *rfi)
 {
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata->fingers_supported;
struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi->num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi->fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdat

[PATCH v3] staging: ste_rmi4: Convert to Type-B support

2012-11-02 Thread Alexandra Chin
Hi Henrik and all,

This patch converts to MT-B because Synaptics touch devices are
capable of tracking identifiable fingers

This patch was tested on pandaboard, except input_mt_sync_frame(),
which is a quite new function.
I changed to use sylpheed as my mail client. Please let me know
if there is any problem.
Greatly appreciate your time.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
Changes from v3:
- Incorporated Henrik's review comments
  *remove 'else' after an error path return
  *add input_mt_sync_frame() for pointer emulation effects
  *correct names of touchscreen
- Replace printk with dev_err

Changes from v2:
- Incorporated Henrik's review comments
  *directly report finger state with Type-B
- Against 3.7-rcX
  *call input_mt_init_slots with INPUT_MT_DIRECT flag

 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |  122 -
 1 files changed, 57 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..7876f6b 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -1,7 +1,7 @@
 /**
  *
- * Synaptics Register Mapped Interface (RMI4) I2C Physical Layer Driver.
- * Copyright (c) 2007-2010, Synaptics Incorporated
+ * Synaptics Register Mapped Interface (RMI4) I2C Touchscreen Driver.
+ * Copyright (c) 2007-2012, Synaptics Incorporated
  *
  * Author: Js HA js...@stericsson.com for ST-Ericsson
  * Author: Naveen Kumar G naveen.gaddip...@stericsson.com for ST-Ericsson
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -63,12 +64,11 @@
 #define MASK_4BIT  0x0F
 #define MASK_3BIT  0x07
 #define MASK_2BIT  0x03
-#define TOUCHPAD_CTRL_INTR 0x8
+#define TOUCHSCREEN_CTRL_INTR  0x8
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
-#define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
+#define SYNAPTICS_RMI4_TOUCHSCREEN_FUNC_NUM(0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
 /**
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -291,34 +293,33 @@ exit:
 }
 
 /**
- * synpatics_rmi4_touchpad_report() - reports for the rmi4 touchpad device
+ * synpatics_rmi4_touchscreen_report() - reports for the rmi4 touchscreen 
device
  * @pdata: pointer to synaptics_rmi4_data structure
  * @rfi: pointer to synaptics_rmi4_fn structure
  *
- * This function calls to reports for the rmi4 touchpad device
+ * This function calls to reports for the rmi4 touchscreen device
  */
-static int synpatics_rmi4_touchpad_report(struct synaptics_rmi4_data *pdata,
+static int synpatics_rmi4_touchscreen_report(struct synaptics_rmi4_data *pdata,
struct synaptics_rmi4_fn *rfi)
 {
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata-fingers_supported;
struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-num_of_data_points;
finger_registers= (fingers_supported

[PATCH v2] staging: ste_rmi4: Convert to Type-B support

2012-11-01 Thread Alexandra Chin
>From 783c14e5978600cc78e11ea078cc413d77a9debd Mon Sep 17 00:00:00 2001
From: Alexandra Chin 
Date: Thu, 1 Nov 2012 17:02:14 +0800
Subject: [PATCH v2] staging: ste_rmi4: Convert to Type-B support

This patch:
- convert to MT-B because Synaptics touch devices are capable of
  tracking identifiable fingers
  -- driver straightly reports all fingers' status
- call input_mt_init_slots with INPUT_MT_DIRECT flag
- against v3.7-rc3 kernel

Any comments please let me know. Thank you.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   68 +++--
 1 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..0338b1e 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata->fingers_supported;
struct  i2c_client *client = pdata->i2c_client;
+   struct  input_dev *input_dev = pdata->input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi->num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi->fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -353,12 +353,16 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
reg = finger/4;
/* bit shift to get finger's status */
finger_shift= (finger % 4) * 2;
-   finger_status   = (values[reg] >> finger_shift) & 3;
+   finger_status   = (values[reg] >> finger_shift) & MASK_2BIT;
/*
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -371,46 +375,29 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
__func__);
return 0;
} else {
-   x[touch_count]  =
-   (data[0] << 4) | (data[2] & MASK_4BIT);
-   y[touch_count

[PATCH v2] staging: ste_rmi4: Convert to Type-B support

2012-11-01 Thread Alexandra Chin
From 783c14e5978600cc78e11ea078cc413d77a9debd Mon Sep 17 00:00:00 2001
From: Alexandra Chin alexandra.c...@tw.synaptics.com
Date: Thu, 1 Nov 2012 17:02:14 +0800
Subject: [PATCH v2] staging: ste_rmi4: Convert to Type-B support

This patch:
- convert to MT-B because Synaptics touch devices are capable of
  tracking identifiable fingers
  -- driver straightly reports all fingers' status
- call input_mt_init_slots with INPUT_MT_DIRECT flag
- against v3.7-rc3 kernel

Any comments please let me know. Thank you.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   68 +++--
 1 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 277491a..0338b1e 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,6 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +164,7 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +185,7 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char   fingers_supported;
 };
 
 /**
@@ -303,22 +305,21 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
int finger_status;
int retval;
+   int x, y;
+   int wx, wy;
unsigned short  data_base_addr;
unsigned short  data_offset;
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char   fingers_supported = pdata-fingers_supported;
struct  i2c_client *client = pdata-i2c_client;
+   struct  input_dev *input_dev = pdata-input_dev;
 
/* get 2D sensor finger data */
/*
@@ -333,7 +334,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-num_of_data_points;
finger_registers= (fingers_supported + 3)/4;
data_base_addr  = rfi-fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
@@ -353,12 +353,16 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
reg = finger/4;
/* bit shift to get finger's status */
finger_shift= (finger % 4) * 2;
-   finger_status   = (values[reg]  finger_shift)  3;
+   finger_status   = (values[reg]  finger_shift)  MASK_2BIT;
/*
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   input_mt_slot(input_dev, finger);
+   input_mt_report_slot_state(input_dev, MT_TOOL_FINGER,
+   finger_status != 0);
+
+   if (finger_status) {
/* Read the finger data */
data_offset = data_base_addr +
((finger * data_reg_blk_size) +
@@ -371,46 +375,29 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
__func__);
return 0;
} else {
-   x[touch_count]  =
-   (data[0]  4) | (data[2

RE: [PATCH] staging: ste_rmi4: Convert to Type-B support

2012-10-31 Thread Alexandra Chin
Hi Henrik,

I see what you mean. Input subsystem handles multi-touch tracking for input 
driver.
I will update reporting process, and resubmit a patch against 3.7-rcX.
Greatly appreciate your comments.

Alexandra Chin


[PATCH] staging: ste_rmi4: Convert to Type-B support

2012-10-31 Thread Alexandra Chin
>From 4d0dbd9ee464027e7c40658abb9dd019be520e4d Mon Sep 17 00:00:00 2001
From: Alexandra Chin 
Date: Wed, 31 Oct 2012 16:21:12 +0800
Subject: [PATCH] staging: ste_rmi4: Convert to Type-B support

This patch:
- Convert to MT-B because Synaptics touch devices are capable of
  tracking identifiable fingers
- Modify maximum supported fingers up to 10
- Set INPUT_PROP_POINTER for direct input devices

Any comments and suggestions are welcomed.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   82 
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 11728a0..e69ca5ee1 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "synaptics_i2c_rmi4.h"
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,7 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
+#define RMI4_NUMBER_OF_MAX_FINGERS (10)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +165,8 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @finger_state: previous state of fingers
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +187,8 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char finger_state[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char fingers_supported;
 };
 
 /**
@@ -303,7 +308,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
@@ -314,10 +318,8 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   int x, y;
+   int wx, wy;
struct  i2c_client *client = pdata->i2c_client;
 
/* get 2D sensor finger data */
@@ -333,8 +335,7 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi->num_of_data_points;
-   finger_registers= (fingers_supported + 3)/4;
+   finger_registers= (pdata->fingers_supported + 3)/4;
data_base_addr  = rfi->fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
finger_registers);
@@ -348,17 +349,26 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * to get absolute data.
 */
data_reg_blk_size = rfi->size_of_data_register_block;
-   for (finger = 0; finger < fingers_supported; finger++) {
+   for (finger = 0; finger < pdata->fingers_supported; finger++) {
/* determine which data byte the finger status is in */
reg = finger/4;
/* bit shift to get finger's status */
finger_shift= (finger % 4) * 2;
-   finger_status   = (values[reg] >> finger_shift) & 3;
+   finger_status   = (values[reg] >> finger_shift) & MASK_2BIT;
/*
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   if (!finger_status && !pdata->finger_state[finger])
+   continue;
+
+   input_mt_slot(pdata->input_dev, finger);
+   input_mt_report_slot_state(pdata->input_dev,
+   MT_TOOL_FINGER, finger_status);
+
+   if (!finger_status && pdata->finger_state[finger]) {
+   /* rele

[PATCH] staging: ste_rmi4: Convert to Type-B support

2012-10-31 Thread Alexandra Chin
From 4d0dbd9ee464027e7c40658abb9dd019be520e4d Mon Sep 17 00:00:00 2001
From: Alexandra Chin alexandra.c...@tw.synaptics.com
Date: Wed, 31 Oct 2012 16:21:12 +0800
Subject: [PATCH] staging: ste_rmi4: Convert to Type-B support

This patch:
- Convert to MT-B because Synaptics touch devices are capable of
  tracking identifiable fingers
- Modify maximum supported fingers up to 10
- Set INPUT_PROP_POINTER for direct input devices

Any comments and suggestions are welcomed.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
 drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c |   82 
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c 
b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
index 11728a0..e69ca5ee1 100644
--- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
+++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c
@@ -31,6 +31,7 @@
 #include linux/interrupt.h
 #include linux/regulator/consumer.h
 #include linux/module.h
+#include linux/input/mt.h
 #include synaptics_i2c_rmi4.h
 
 /* TODO: for multiple device support will need a per-device mutex */
@@ -67,7 +68,7 @@
 #define PDT_START_SCAN_LOCATION (0x00E9)
 #define PDT_END_SCAN_LOCATION  (0x000A)
 #define PDT_ENTRY_SIZE (0x0006)
-#define RMI4_NUMBER_OF_MAX_FINGERS (8)
+#define RMI4_NUMBER_OF_MAX_FINGERS (10)
 #define SYNAPTICS_RMI4_TOUCHPAD_FUNC_NUM   (0x11)
 #define SYNAPTICS_RMI4_DEVICE_CONTROL_FUNC_NUM (0x01)
 
@@ -164,6 +165,8 @@ struct synaptics_rmi4_device_info {
  * @regulator: pointer to the regulator structure
  * @wait: wait queue structure variable
  * @touch_stopped: flag to stop the thread function
+ * @finger_state: previous state of fingers
+ * @fingers_supported: maximum supported fingers
  *
  * This structure gives the device data information.
  */
@@ -184,6 +187,8 @@ struct synaptics_rmi4_data {
struct regulator*regulator;
wait_queue_head_t   wait;
booltouch_stopped;
+   unsigned char finger_state[RMI4_NUMBER_OF_MAX_FINGERS];
+   unsigned char fingers_supported;
 };
 
 /**
@@ -303,7 +308,6 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
/* number of touch points - fingers down in this case */
int touch_count = 0;
int finger;
-   int fingers_supported;
int finger_registers;
int reg;
int finger_shift;
@@ -314,10 +318,8 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
unsigned char   data_reg_blk_size;
unsigned char   values[2];
unsigned char   data[DATA_LEN];
-   int x[RMI4_NUMBER_OF_MAX_FINGERS];
-   int y[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wx[RMI4_NUMBER_OF_MAX_FINGERS];
-   int wy[RMI4_NUMBER_OF_MAX_FINGERS];
+   int x, y;
+   int wx, wy;
struct  i2c_client *client = pdata-i2c_client;
 
/* get 2D sensor finger data */
@@ -333,8 +335,7 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 *  10 = finger present but data may not be accurate,
 *  11 = reserved for product use.
 */
-   fingers_supported   = rfi-num_of_data_points;
-   finger_registers= (fingers_supported + 3)/4;
+   finger_registers= (pdata-fingers_supported + 3)/4;
data_base_addr  = rfi-fn_desc.data_base_addr;
retval = synaptics_rmi4_i2c_block_read(pdata, data_base_addr, values,
finger_registers);
@@ -348,17 +349,26 @@ static int synpatics_rmi4_touchpad_report(struct 
synaptics_rmi4_data *pdata,
 * to get absolute data.
 */
data_reg_blk_size = rfi-size_of_data_register_block;
-   for (finger = 0; finger  fingers_supported; finger++) {
+   for (finger = 0; finger  pdata-fingers_supported; finger++) {
/* determine which data byte the finger status is in */
reg = finger/4;
/* bit shift to get finger's status */
finger_shift= (finger % 4) * 2;
-   finger_status   = (values[reg]  finger_shift)  3;
+   finger_status   = (values[reg]  finger_shift)  MASK_2BIT;
/*
 * if finger status indicates a finger is present then
 * read the finger data and report it
 */
-   if (finger_status == 1 || finger_status == 2) {
+   if (!finger_status  !pdata-finger_state[finger])
+   continue;
+
+   input_mt_slot(pdata-input_dev, finger);
+   input_mt_report_slot_state(pdata-input_dev,
+   MT_TOOL_FINGER, finger_status);
+
+   if (!finger_status  pdata-finger_state[finger

RE: [PATCH] staging: ste_rmi4: Convert to Type-B support

2012-10-31 Thread Alexandra Chin
Hi Henrik,

I see what you mean. Input subsystem handles multi-touch tracking for input 
driver.
I will update reporting process, and resubmit a patch against 3.7-rcX.
Greatly appreciate your comments.

Alexandra Chin


RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-05 Thread Alexandra Chin
Hi Dmitry/Henrik,


From: Dmitry Torokhov
Sent: Thursday, October 04, 2012 2:52 PM
> Given that the other group at Synaptics works on general version of RMI4
> driver what is the benefit of having separate driver for DS4 line? I can
> understand keeping one copy of older driver in staging so that some
> customers coudl still use hardware while universal implementation is
> being developed, but I do not see why we would want to have 3 separate
> drivers.


Thank you for your suggestions and comments!

We agree with your opinion. We will submit the driver as a patch on top 
of STE's driver since it is in the staging.

And we would like to state our purpose clearly why we are doing this 
including the following:
- We have customers that require a Touch Controller platform specific
 driver, that is protocol specific, following a single source file structure.
- There is also a requirement that the platform specific driver has to be 
 adopted and included into the Linux kernel.

As you are aware, Chris' team is working on general version of RMI4. 
However customers still require a platform specific driver for Touch 
Controller platform. We really hope both drivers (general RMI4 driver 
and STE's driver) being adopted into the kernel. This will allow us to 
provide the best flexibility possible to customers.

Your opinion will be greatly appreciated.

Alexandra Chin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-05 Thread Alexandra Chin
Hi Dmitry/Henrik,


From: Dmitry Torokhov
Sent: Thursday, October 04, 2012 2:52 PM
 Given that the other group at Synaptics works on general version of RMI4
 driver what is the benefit of having separate driver for DS4 line? I can
 understand keeping one copy of older driver in staging so that some
 customers coudl still use hardware while universal implementation is
 being developed, but I do not see why we would want to have 3 separate
 drivers.


Thank you for your suggestions and comments!

We agree with your opinion. We will submit the driver as a patch on top 
of STE's driver since it is in the staging.

And we would like to state our purpose clearly why we are doing this 
including the following:
- We have customers that require a Touch Controller platform specific
 driver, that is protocol specific, following a single source file structure.
- There is also a requirement that the platform specific driver has to be 
 adopted and included into the Linux kernel.

As you are aware, Chris' team is working on general version of RMI4. 
However customers still require a platform specific driver for Touch 
Controller platform. We really hope both drivers (general RMI4 driver 
and STE's driver) being adopted into the kernel. This will allow us to 
provide the best flexibility possible to customers.

Your opinion will be greatly appreciated.

Alexandra Chin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-03 Thread Alexandra Chin
From: Henrik Rydberg
Sent: Thursday, October 04, 2012 2:01 AM
> It seems this driver is already present in staging. Comments and
> formatting have been improved in the staging version, but that aside,
> the two versions look very similar.  Why don't you submit fixes to
> that driver instead?

> On a general note, both versions of the driver use MT-A. Please
> convert to MT-B, using the in-kernel tracking if necessary.


Hi Henrik,

Appreciate your suggestion!
We are going to update a patch of using MT-B, because Synaptics devices are 
capable of tracking identifiable contacts (type B).
Thanks for pointing out this.

You are right, there is already a synaptics_i2c_rmi4 driver in staging 
state (drivers/staging/ste_rmi4). 
Actually synaptics_ds4_i2c driver is developed based on synaptics_i2c_rmi4 
driver. The point is that we would want to make a clear definition that 
synaptics_ds4_i2c only targets to DS4 family, so that we can keep maintaining 
driver focusing on DS4 product line (not all Synaptics touchscreen devices are 
DS4 compatible).

We are open to discuss if it is appropriate to retained DS4 driver, and please 
let us know if you have any concerns.

Best Regards,
Alexandra Chin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-03 Thread Alexandra Chin
From: Henrik Rydberg
Sent: Thursday, October 04, 2012 2:01 AM
 It seems this driver is already present in staging. Comments and
 formatting have been improved in the staging version, but that aside,
 the two versions look very similar.  Why don't you submit fixes to
 that driver instead?

 On a general note, both versions of the driver use MT-A. Please
 convert to MT-B, using the in-kernel tracking if necessary.


Hi Henrik,

Appreciate your suggestion!
We are going to update a patch of using MT-B, because Synaptics devices are 
capable of tracking identifiable contacts (type B).
Thanks for pointing out this.

You are right, there is already a synaptics_i2c_rmi4 driver in staging 
state (drivers/staging/ste_rmi4). 
Actually synaptics_ds4_i2c driver is developed based on synaptics_i2c_rmi4 
driver. The point is that we would want to make a clear definition that 
synaptics_ds4_i2c only targets to DS4 family, so that we can keep maintaining 
driver focusing on DS4 product line (not all Synaptics touchscreen devices are 
DS4 compatible).

We are open to discuss if it is appropriate to retained DS4 driver, and please 
let us know if you have any concerns.

Best Regards,
Alexandra Chin
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-02 Thread Alexandra Chin
Add Chris in mail loop.

Best Regards,
Alexandra Chin


 Synaptics Hong Kong Limited, Taiwan Branch
 5F., No. 501, Sec. 2 Tiding Blvd., Neihu District, 
 Taipei City 114, Taiwan
Office: 886.2.8752.5700  ext:652
Email:alexandra.c...@synaptics.com.tw


-Original Message-
From: Alexandra Chin 
Sent: Tuesday, October 02, 2012 3:58 PM
To: Dmitry Torokhov; 'Henrik Rydberg'
Cc: Linux Kernel; Linux Input; Linus Walleij; Naveen Kumar Gaddipati; Mahesh 
Srinivasan; Alex Chang; Scott Lin
Subject: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 
touchscreen I2C devices

Hi Henrik/Dmitry,

We are working on a product specific driver for Synaptics DS4 I2C touchscreen
devices. It was submitted on Sept. 16, 2012, but has not been reviewed.
(http://lkml.org/lkml/2012/9/16/24). 
We found several warnings after running script/checkpatch.pl, therefore 
an updated patch is attached.

As Chris says in https://lkml.org/lkml/2012/9/19/505, this driver will enable
us to support all our customers effectively and provide our customers with 
the best flexibility possible.
Please help review attached patch, and we really appreciate your feedback :-)



Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij  and
Naveen Kumar Gaddipati .

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including
making updates, as well as supporting future Touch Controller revisions
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1083 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1239 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 create mode 100644 include/linux/input/synaptics_dsx.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate "Synaptics ds4 i2c touchscreen"
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..6e85d97
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1083 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin 
+ * Copyright (C) 2012 Scott Lin 
+ * Copyright (C) 2010 Js HA 
+ * Copyright (C) 2010 Naveen Kumar G 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed i

[PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-02 Thread Alexandra Chin
Hi Henrik/Dmitry,

We are working on a product specific driver for Synaptics DS4 I2C touchscreen
devices. It was submitted on Sept. 16, 2012, but has not been reviewed.
(http://lkml.org/lkml/2012/9/16/24). 
We found several warnings after running script/checkpatch.pl, therefore 
an updated patch is attached.

As Chris says in https://lkml.org/lkml/2012/9/19/505, this driver will enable
us to support all our customers effectively and provide our customers with 
the best flexibility possible.
Please help review attached patch, and we really appreciate your feedback :-)



Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij  and
Naveen Kumar Gaddipati .

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including
making updates, as well as supporting future Touch Controller revisions
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1083 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1239 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 create mode 100644 include/linux/input/synaptics_dsx.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate "Synaptics ds4 i2c touchscreen"
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..6e85d97
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1083 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin 
+ * Copyright (C) 2012 Scott Lin 
+ * Copyright (C) 2010 Js HA 
+ * Copyright (C) 2010 Naveen Kumar G 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "synaptics_ds4_rmi4_i2c.h"
+
+#define DRIVER_NAME "sy

[PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-02 Thread Alexandra Chin
Hi Henrik/Dmitry,

We are working on a product specific driver for Synaptics DS4 I2C touchscreen
devices. It was submitted on Sept. 16, 2012, but has not been reviewed.
(http://lkml.org/lkml/2012/9/16/24). 
We found several warnings after running script/checkpatch.pl, therefore 
an updated patch is attached.

As Chris says in https://lkml.org/lkml/2012/9/19/505, this driver will enable
us to support all our customers effectively and provide our customers with 
the best flexibility possible.
Please help review attached patch, and we really appreciate your feedback :-)



Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij linus.wall...@stericsson.com and
Naveen Kumar Gaddipati naveen.gaddip...@stericsson.com.

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including
making updates, as well as supporting future Touch Controller revisions
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1083 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1239 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 create mode 100644 include/linux/input/synaptics_dsx.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate Synaptics ds4 i2c touchscreen
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..6e85d97
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1083 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin alexandra.c...@tw.synaptics.com
+ * Copyright (C) 2012 Scott Lin scott@tw.synaptics.com
+ * Copyright (C) 2010 Js HA js...@stericsson.com
+ * Copyright (C) 2010 Naveen Kumar G naveen.gaddip...@stericsson.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA

RE: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-10-02 Thread Alexandra Chin
Add Chris in mail loop.

Best Regards,
Alexandra Chin


 Synaptics Hong Kong Limited, Taiwan Branch
 5F., No. 501, Sec. 2 Tiding Blvd., Neihu District, 
 Taipei City 114, Taiwan
Office: 886.2.8752.5700  ext:652
Email:alexandra.c...@synaptics.com.tw


-Original Message-
From: Alexandra Chin 
Sent: Tuesday, October 02, 2012 3:58 PM
To: Dmitry Torokhov; 'Henrik Rydberg'
Cc: Linux Kernel; Linux Input; Linus Walleij; Naveen Kumar Gaddipati; Mahesh 
Srinivasan; Alex Chang; Scott Lin
Subject: [PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 
touchscreen I2C devices

Hi Henrik/Dmitry,

We are working on a product specific driver for Synaptics DS4 I2C touchscreen
devices. It was submitted on Sept. 16, 2012, but has not been reviewed.
(http://lkml.org/lkml/2012/9/16/24). 
We found several warnings after running script/checkpatch.pl, therefore 
an updated patch is attached.

As Chris says in https://lkml.org/lkml/2012/9/19/505, this driver will enable
us to support all our customers effectively and provide our customers with 
the best flexibility possible.
Please help review attached patch, and we really appreciate your feedback :-)



Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij linus.wall...@stericsson.com and
Naveen Kumar Gaddipati naveen.gaddip...@stericsson.com.

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including
making updates, as well as supporting future Touch Controller revisions
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1083 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1239 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 create mode 100644 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 create mode 100644 include/linux/input/synaptics_dsx.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate Synaptics ds4 i2c touchscreen
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..6e85d97
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1083 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin alexandra.c...@tw.synaptics.com
+ * Copyright (C) 2012 Scott Lin scott@tw.synaptics.com
+ * Copyright (C) 2010 Js HA js...@stericsson.com
+ * Copyright (C) 2010 Naveen Kumar G naveen.gaddip...@stericsson.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General

[PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-09-16 Thread Alexandra Chin
Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij  and
Naveen Kumar Gaddipati .

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including 
making updates, as well as supporting future Touch Controller revisions 
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin 
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1085 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1241 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate "Synaptics ds4 i2c touchscreen"
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..c3bf46f
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1085 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin 
+ * Copyright (C) 2012 Scott Lin 
+ * Copyright (C) 2010 Js HA 
+ * Copyright (C) 2010 Naveen Kumar G 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "synaptics_ds4_rmi4_i2c.h"
+
+#define DRIVER_NAME "synaptics_ds4_i2c"
+#define INPUT_PHYS_NAME "synaptics_ds4_i2c/input0"
+
+#define PAGES_TO_SERVICE   0xFF
+#define MAX_INTR_REGISTERS 4
+#define MAX_TOUCH_MAJOR15
+#define BUF_LEN37
+#define PAGE_LEN   2
+#define DATA_LEN   12
+#define QUERY_LEN  9
+#define DATA_BUF_LEN   10
+#define STD_QUERY_LEN  21
+
+#define MASK_16BIT 0x
+#define MASK_8BIT  0xFF
+#define MASK_7BIT  0x7F
+#define MASK_5BIT  0x1F
+#define MASK_4BIT  0x0F
+#define MASK_3BIT  0x07
+#define MASK_2BIT  0x03
+#define TOUCH_CTRL_INTR0x8
+
+#define NO_SLEEP_ON(1 << 3)
+#define NO_SLEEP_OFF   (0

[PATCH] Input: Add new driver into Input Subsystem for Synaptics DS4 touchscreen I2C devices

2012-09-16 Thread Alexandra Chin
Synaptics DS4 touchscreen driver implements a generic driver supporting I2C
protocol for Synaptics Design Studio 4 (DS4) family of Touchscreen Controllers
which include the following:

- S32xX series
- S730X series
- S22xx series

The driver supports multifinger pointing functionality and power management.
The driver is based on the original work submitted by
Linus Walleij linus.wall...@stericsson.com and
Naveen Kumar Gaddipati naveen.gaddip...@stericsson.com.

This patch is against the v3.1-rc9 tag of Dmitry Torokhov's kernel tree,
commit bd68dfe0071b50bc69416a92ee22b63d1cc33a3b.

Changes in this patch:
 - modified:   drivers/input/touchscreen/Kconfig
 - modified:   drivers/input/touchscreen/Makefile
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
 - new file:   drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h
 - new file:   include/linux/input/synaptics_dsx.h

This patch is functionally tested on omap beagleboard-xm.

We will continue to maintain and support this driver officially, including 
making updates, as well as supporting future Touch Controller revisions 
from Synaptics.

Any comments are much appreciated.

Alexandra Chin

Signed-off-by: Alexandra Chin alexandra.c...@tw.synaptics.com
---
 drivers/input/touchscreen/Kconfig  |   12 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c | 1085 
 drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.h |   94 ++
 include/linux/input/synaptics_dsx.h|   49 +
 5 files changed, 1241 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index 1ba232c..431c72b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -900,4 +900,16 @@ config TOUCHSCREEN_TPS6507X
  To compile this driver as a module, choose M here: the
  module will be called tps6507x_ts.
 
+config TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C
+   tristate Synaptics ds4 i2c touchscreen
+   depends on I2C
+   help
+ Say Y here if you have a Synaptics DS4 I2C touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called synaptics_ds4_rmi4_i2c.
+
 endif
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 178eb12..61f5f22 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -73,3 +73,4 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE)+= 
mainstone-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE)  += zylonite-wm97xx.o
 obj-$(CONFIG_TOUCHSCREEN_W90X900)  += w90p910_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
+obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DS4_RMI4_I2C)   += 
synaptics_ds4_rmi4_i2c.o
diff --git a/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c 
b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
new file mode 100644
index 000..c3bf46f
--- /dev/null
+++ b/drivers/input/touchscreen/synaptics_ds4_rmi4_i2c.c
@@ -0,0 +1,1085 @@
+/*
+ * Synaptics DS4 touchscreen driver
+ *
+ * Copyright (C) 2012 Synaptics Incorporated
+ *
+ * Copyright (C) 2012 Alexandra Chin alexandra.c...@tw.synaptics.com
+ * Copyright (C) 2012 Scott Lin scott@tw.synaptics.com
+ * Copyright (C) 2010 Js HA js...@stericsson.com
+ * Copyright (C) 2010 Naveen Kumar G naveen.gaddip...@stericsson.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include linux/input.h
+#include linux/slab.h
+#include linux/module.h
+#include linux/i2c.h
+#include linux/interrupt.h
+#include linux/regulator/consumer.h
+#include linux/gpio.h
+#include linux/delay.h
+#include linux/input/synaptics_dsx.h
+#include synaptics_ds4_rmi4_i2c.h
+
+#define DRIVER_NAME synaptics_ds4_i2c
+#define INPUT_PHYS_NAME synaptics_ds4_i2c/input0
+
+#define PAGES_TO_SERVICE   0xFF
+#define MAX_INTR_REGISTERS 4
+#define MAX_TOUCH_MAJOR15
+#define BUF_LEN37
+#define PAGE_LEN   2
+#define DATA_LEN   12
+#define QUERY_LEN  9
+#define DATA_BUF_LEN   10
+#define STD_QUERY_LEN  21
+
+#define MASK_16BIT 0x
+#define MASK_8BIT  0xFF
+#define