linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver
@ 2011-07-27 17:28 Yufeng Shen
  2011-07-30 19:12 ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Yufeng Shen @ 2011-07-27 17:28 UTC (permalink / raw)
  To: linux-input
  Cc: Dmitry Torokhov, Henrik Rydberg, Iiro Valkonen, Joonyoung Shim,
	Chris Leech, linux-kernel, Wanlong Gao, Yufeng Shen

Atmel mxt1386 touch controller has the touch pressure information but
the current driver atmel_mxt_ts does not expose it to the user space.
This patch makes the driver report the touch pressure information to
user space.

ChangeLog:
v2: fixed indentation as commented by Wanlong Gao

Change-Id: Ie0e4683a3cd5ec79222f7682b0ddc24f909af543
---
 drivers/input/touchscreen/atmel_mxt_ts.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index ae00604..9bdf4e0 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -244,6 +244,7 @@ struct mxt_finger {
 	int x;
 	int y;
 	int area;
+	int pressure;
 };
 
 /* Each client has this additional data */
@@ -536,6 +537,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id)
 					finger[id].x);
 			input_report_abs(input_dev, ABS_MT_POSITION_Y,
 					finger[id].y);
+			input_report_abs(input_dev, ABS_MT_PRESSURE,
+					finger[id].pressure);
 		} else {
 			finger[id].status = 0;
 		}
@@ -560,6 +563,7 @@ static void mxt_input_touchevent(struct mxt_data *data,
 	int x;
 	int y;
 	int area;
+	int pressure;
 
 	/* Check the touch is present on the screen */
 	if (!(status & MXT_DETECT)) {
@@ -584,6 +588,7 @@ static void mxt_input_touchevent(struct mxt_data *data,
 		y = y >> 2;
 
 	area = message->message[4];
+	pressure = message->message[5];
 
 	dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id,
 		status & MXT_MOVE ? "moved" : "pressed",
@@ -594,6 +599,7 @@ static void mxt_input_touchevent(struct mxt_data *data,
 	finger[id].x = x;
 	finger[id].y = y;
 	finger[id].area = area;
+	finger[id].pressure = pressure;
 
 	mxt_input_report(data, id);
 }
@@ -1125,6 +1131,8 @@ static int __devinit mxt_probe(struct i2c_client *client,
 			     0, data->max_x, 0, 0);
 	input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
 			     0, data->max_y, 0, 0);
+	input_set_abs_params(input_dev, ABS_MT_PRESSURE,
+			     0, 255, 0, 0);
 
 	input_set_drvdata(input_dev, data);
 	i2c_set_clientdata(client, data);
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver
  2011-07-27 17:28 [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver Yufeng Shen
@ 2011-07-30 19:12 ` Dmitry Torokhov
  2011-08-03 16:22   ` Yufeng Shen
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2011-07-30 19:12 UTC (permalink / raw)
  To: Yufeng Shen
  Cc: linux-input, Henrik Rydberg, Iiro Valkonen, Joonyoung Shim,
	Chris Leech, linux-kernel, Wanlong Gao

Hi Yufeng,

On Wed, Jul 27, 2011 at 01:28:15PM -0400, Yufeng Shen wrote:
> Atmel mxt1386 touch controller has the touch pressure information but
> the current driver atmel_mxt_ts does not expose it to the user space.
> This patch makes the driver report the touch pressure information to
> user space.
> 

What about other controllers supported by this driver? Do all of them
report pressure? Do all have the same reporting range?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver
  2011-07-30 19:12 ` Dmitry Torokhov
@ 2011-08-03 16:22   ` Yufeng Shen
  2011-08-09  7:01     ` Dmitry Torokhov
  0 siblings, 1 reply; 4+ messages in thread
From: Yufeng Shen @ 2011-08-03 16:22 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, Henrik Rydberg, Iiro Valkonen, Joonyoung Shim,
	Chris Leech, linux-kernel, Wanlong Gao, Gong, Michael

Re-sent this email due to linux-input@veger.kernel.org rejecting last
reply for containing HTML subpart

-----------------------------------------------------------------------------------------------------------------------------------------------

Hi Dmitry,

Currently the driver atmel_mxt_ts.c supports 3 different models of
atmel touch controller:

1. qt602240_ts
2. atmel_mxt_ts   (which is for mxt1386)
3. mXT224

Confirmed with atmel side that qt602240_ts is actually an alias for
mxt224, and mxt224
follows the same protocol guide with mxt1386, which means it will
report the pressure
information the same way as mxt1386.

--- Yufeng Shen

On Sat, Jul 30, 2011 at 3:12 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Hi Yufeng,
>
> On Wed, Jul 27, 2011 at 01:28:15PM -0400, Yufeng Shen wrote:
>> Atmel mxt1386 touch controller has the touch pressure information but
>> the current driver atmel_mxt_ts does not expose it to the user space.
>> This patch makes the driver report the touch pressure information to
>> user space.
>>
>
> What about other controllers supported by this driver? Do all of them
> report pressure? Do all have the same reporting range?
>
> Thanks.
>
> --
> Dmitry
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver
  2011-08-03 16:22   ` Yufeng Shen
@ 2011-08-09  7:01     ` Dmitry Torokhov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2011-08-09  7:01 UTC (permalink / raw)
  To: Yufeng Shen
  Cc: linux-input, Henrik Rydberg, Iiro Valkonen, Joonyoung Shim,
	Chris Leech, linux-kernel, Wanlong Gao, Gong, Michael

Hi Yufeng,

On Wed, Aug 03, 2011 at 12:22:19PM -0400, Yufeng Shen wrote:
> Hi Dmitry,
> 
> Currently the driver atmel_mxt_ts.c supports 3 different models of
> atmel touch controller:
> 
> 1. qt602240_ts
> 2. atmel_mxt_ts   (which is for mxt1386)
> 3. mXT224
> 
> Confirmed with atmel side that qt602240_ts is actually an alias for
> mxt224, and mxt224
> follows the same protocol guide with mxt1386, which means it will
> report the pressure
> information the same way as mxt1386.

Great, thanks for confirming that. Can I please have your
"Signed-off-by:" so I can apply the patch?

-- 
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-09  7:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-27 17:28 [PATCH v2] Input: atmel_mxt_ts - Report pressure information from the driver Yufeng Shen
2011-07-30 19:12 ` Dmitry Torokhov
2011-08-03 16:22   ` Yufeng Shen
2011-08-09  7:01     ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).