All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND] hid: 3m: Adjust major / minor axes to scale
@ 2010-09-21 21:45 Henrik Rydberg
  2010-09-21 21:51 ` Stéphane Chatty
  2010-09-22  9:30 ` Jiri Kosina
  0 siblings, 2 replies; 7+ messages in thread
From: Henrik Rydberg @ 2010-09-21 21:45 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Dmitry Torokhov, Stephane Chatty, linux-input, linux-kernel,
	Henrik Rydberg

By visual inspection, the reported touch_major and touch_minor axes
are a factor of two too large. Presumably the device actually reports
the width_major and width_minor, which are generally about a factor of
two larger than the touches themselves.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
Just in case this patch got lost somewhere, here it is again.

Cheers,
Henrik

 drivers/hid/hid-3m-pct.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/hid-3m-pct.c b/drivers/hid/hid-3m-pct.c
index 65441e0..cd4b125 100644
--- a/drivers/hid/hid-3m-pct.c
+++ b/drivers/hid/hid-3m-pct.c
@@ -162,16 +162,18 @@ static void mmm_filter_event(struct mmm_data *md, struct
input_dev *input)
 		if (f->touch) {
 			/* this finger is on the screen */
 			int wide = (f->w > f->h);
+			/* divided by two to match visual scale of touch */
+			int major = max(f->w, f->h) >> 1;
+			int minor = min(f->w, f->h) >> 1;
+
 			if (!f->prev_touch)
 				f->id = md->id++;
 			input_event(input, EV_ABS, ABS_MT_TRACKING_ID, f->id);
 			input_event(input, EV_ABS, ABS_MT_POSITION_X, f->x);
 			input_event(input, EV_ABS, ABS_MT_POSITION_Y, f->y);
 			input_event(input, EV_ABS, ABS_MT_ORIENTATION, wide);
-			input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR,
-						wide ? f->w : f->h);
-			input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR,
-						wide ? f->h : f->w);
+			input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, major);
+			input_event(input, EV_ABS, ABS_MT_TOUCH_MINOR, minor);
 			/* touchscreen emulation: pick the oldest contact */
 			if (!oldest || ((f->id - oldest->id) & (SHRT_MAX + 1)))
 				oldest = f;
-- 
1.7.1



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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
  2010-09-21 21:45 [RESEND] hid: 3m: Adjust major / minor axes to scale Henrik Rydberg
@ 2010-09-21 21:51 ` Stéphane Chatty
  2010-09-21 22:18     ` Henrik Rydberg
  2010-09-22  9:30 ` Jiri Kosina
  1 sibling, 1 reply; 7+ messages in thread
From: Stéphane Chatty @ 2010-09-21 21:51 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Jiri Kosina, Dmitry Torokhov, linux-input, linux-kernel

No problem with this one at all.

Henrik, do you confirm that this applies only to 3M? Or is it a  
general issue with the mapping from HID to input?

Cheers,

St.


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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
  2010-09-21 21:51 ` Stéphane Chatty
@ 2010-09-21 22:18     ` Henrik Rydberg
  0 siblings, 0 replies; 7+ messages in thread
From: Henrik Rydberg @ 2010-09-21 22:18 UTC (permalink / raw)
  To: Stéphane Chatty
  Cc: Jiri Kosina, Dmitry Torokhov, linux-input, linux-kernel

On 09/21/2010 11:51 PM, Stéphane Chatty wrote:

> No problem with this one at all.
> 
> Henrik, do you confirm that this applies only to 3M? Or is it a general issue
> with the mapping from HID to input?


Of the devices I have seen so far, the touch width mapping is fairly arbitrary.
Some are too large, some are too small. Regarding HID drivers in general, I
really cannot say. No particular pattern so far, in other words.

Cheers,
Henrik
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
@ 2010-09-21 22:18     ` Henrik Rydberg
  0 siblings, 0 replies; 7+ messages in thread
From: Henrik Rydberg @ 2010-09-21 22:18 UTC (permalink / raw)
  To: Stéphane Chatty
  Cc: Jiri Kosina, Dmitry Torokhov, linux-input, linux-kernel

On 09/21/2010 11:51 PM, Stéphane Chatty wrote:

> No problem with this one at all.
> 
> Henrik, do you confirm that this applies only to 3M? Or is it a general issue
> with the mapping from HID to input?


Of the devices I have seen so far, the touch width mapping is fairly arbitrary.
Some are too large, some are too small. Regarding HID drivers in general, I
really cannot say. No particular pattern so far, in other words.

Cheers,
Henrik

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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
  2010-09-21 22:18     ` Henrik Rydberg
@ 2010-09-21 22:20       ` Stéphane Chatty
  -1 siblings, 0 replies; 7+ messages in thread
From: Stéphane Chatty @ 2010-09-21 22:20 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Jiri Kosina, Dmitry Torokhov, linux-input, linux-kernel


Le 22 sept. 10 à 00:18, Henrik Rydberg a écrit :

> On 09/21/2010 11:51 PM, Stéphane Chatty wrote:
>
>> No problem with this one at all.
>>
>> Henrik, do you confirm that this applies only to 3M? Or is it a  
>> general issue
>> with the mapping from HID to input?
>
>
> Of the devices I have seen so far, the touch width mapping is  
> fairly arbitrary.
> Some are too large, some are too small. Regarding HID drivers in  
> general, I
> really cannot say. No particular pattern so far, in other words.
>

One more device dependency, then. Grrr.

Cheers,

St.

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
@ 2010-09-21 22:20       ` Stéphane Chatty
  0 siblings, 0 replies; 7+ messages in thread
From: Stéphane Chatty @ 2010-09-21 22:20 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Jiri Kosina, Dmitry Torokhov, linux-input, linux-kernel


Le 22 sept. 10 à 00:18, Henrik Rydberg a écrit :

> On 09/21/2010 11:51 PM, Stéphane Chatty wrote:
>
>> No problem with this one at all.
>>
>> Henrik, do you confirm that this applies only to 3M? Or is it a  
>> general issue
>> with the mapping from HID to input?
>
>
> Of the devices I have seen so far, the touch width mapping is  
> fairly arbitrary.
> Some are too large, some are too small. Regarding HID drivers in  
> general, I
> really cannot say. No particular pattern so far, in other words.
>

One more device dependency, then. Grrr.

Cheers,

St.


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

* Re: [RESEND] hid: 3m: Adjust major / minor axes to scale
  2010-09-21 21:45 [RESEND] hid: 3m: Adjust major / minor axes to scale Henrik Rydberg
  2010-09-21 21:51 ` Stéphane Chatty
@ 2010-09-22  9:30 ` Jiri Kosina
  1 sibling, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2010-09-22  9:30 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Dmitry Torokhov, Stephane Chatty, linux-input, linux-kernel

On Tue, 21 Sep 2010, Henrik Rydberg wrote:

> By visual inspection, the reported touch_major and touch_minor axes
> are a factor of two too large. Presumably the device actually reports
> the width_major and width_minor, which are generally about a factor of
> two larger than the touches themselves.
> 
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
> Just in case this patch got lost somewhere, here it is again.

Applied, thanks Henrik.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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

end of thread, other threads:[~2010-09-22  9:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 21:45 [RESEND] hid: 3m: Adjust major / minor axes to scale Henrik Rydberg
2010-09-21 21:51 ` Stéphane Chatty
2010-09-21 22:18   ` Henrik Rydberg
2010-09-21 22:18     ` Henrik Rydberg
2010-09-21 22:20     ` Stéphane Chatty
2010-09-21 22:20       ` Stéphane Chatty
2010-09-22  9:30 ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.