Patchwork input: bcm5974: Adjust major / minor to scale

login
register
mail settings
Submitter Henrik Rydberg
Date Sept. 1, 2010, 11:46 a.m.
Message ID <1283341591-5283-1-git-send-email-rydberg@euromail.se>
Download mbox | patch
Permalink /patch/63370/
State Accepted
Delegated to: Leann Ogasawara
Headers show

Comments

Henrik Rydberg - Sept. 1, 2010, 11:46 a.m.
By visual inspection, the reported touch_major and touch_minor axes
are a factor of two too small. Presumably the device actually reports
the semi-major and semi-minor axes. Corrected with this patch.

Proposed for inclusion in maverick.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/mouse/bcm5974.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Chase Douglas - Sept. 1, 2010, 12:42 p.m.
On Wed, 2010-09-01 at 13:46 +0200, Henrik Rydberg wrote:
> By visual inspection, the reported touch_major and touch_minor axes
> are a factor of two too small. Presumably the device actually reports
> the semi-major and semi-minor axes. Corrected with this patch.
> 
> Proposed for inclusion in maverick.
> 
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

This is a really minor change that hopefully just makes things more
consistent across drivers.

Acked-by: Chase Douglas <chase.douglas@canonical.com>

> ---
>  drivers/input/mouse/bcm5974.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
> index ea67c49..b952317 100644
> --- a/drivers/input/mouse/bcm5974.c
> +++ b/drivers/input/mouse/bcm5974.c
> @@ -337,10 +337,14 @@ static void report_finger_data(struct input_dev *input,
>  			       const struct bcm5974_config *cfg,
>  			       const struct tp_finger *f)
>  {
> -	input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major));
> -	input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor));
> -	input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major));
> -	input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor));
> +	input_report_abs(input, ABS_MT_TOUCH_MAJOR,
> +			 raw2int(f->force_major) << 1);
> +	input_report_abs(input, ABS_MT_TOUCH_MINOR,
> +			 raw2int(f->force_minor) << 1);
> +	input_report_abs(input, ABS_MT_WIDTH_MAJOR,
> +			 raw2int(f->size_major) << 1);
> +	input_report_abs(input, ABS_MT_WIDTH_MINOR,
> +			 raw2int(f->size_minor) << 1);
>  	input_report_abs(input, ABS_MT_ORIENTATION,
>  			 MAX_FINGER_ORIENTATION - raw2int(f->orientation));
>  	input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x));
> -- 
> 1.7.1
Leann Ogasawara - Sept. 3, 2010, 1:40 a.m.
Applied to Maverick linux master.

Thanks,
Leann

On Wed, 2010-09-01 at 13:46 +0200, Henrik Rydberg wrote:
> By visual inspection, the reported touch_major and touch_minor axes
> are a factor of two too small. Presumably the device actually reports
> the semi-major and semi-minor axes. Corrected with this patch.
> 
> Proposed for inclusion in maverick.
> 
> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> ---
>  drivers/input/mouse/bcm5974.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
> index ea67c49..b952317 100644
> --- a/drivers/input/mouse/bcm5974.c
> +++ b/drivers/input/mouse/bcm5974.c
> @@ -337,10 +337,14 @@ static void report_finger_data(struct input_dev *input,
>  			       const struct bcm5974_config *cfg,
>  			       const struct tp_finger *f)
>  {
> -	input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major));
> -	input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor));
> -	input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major));
> -	input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor));
> +	input_report_abs(input, ABS_MT_TOUCH_MAJOR,
> +			 raw2int(f->force_major) << 1);
> +	input_report_abs(input, ABS_MT_TOUCH_MINOR,
> +			 raw2int(f->force_minor) << 1);
> +	input_report_abs(input, ABS_MT_WIDTH_MAJOR,
> +			 raw2int(f->size_major) << 1);
> +	input_report_abs(input, ABS_MT_WIDTH_MINOR,
> +			 raw2int(f->size_minor) << 1);
>  	input_report_abs(input, ABS_MT_ORIENTATION,
>  			 MAX_FINGER_ORIENTATION - raw2int(f->orientation));
>  	input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x));
> -- 
> 1.7.1
> 
>

Patch

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index ea67c49..b952317 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -337,10 +337,14 @@  static void report_finger_data(struct input_dev *input,
 			       const struct bcm5974_config *cfg,
 			       const struct tp_finger *f)
 {
-	input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major));
-	input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor));
-	input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major));
-	input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor));
+	input_report_abs(input, ABS_MT_TOUCH_MAJOR,
+			 raw2int(f->force_major) << 1);
+	input_report_abs(input, ABS_MT_TOUCH_MINOR,
+			 raw2int(f->force_minor) << 1);
+	input_report_abs(input, ABS_MT_WIDTH_MAJOR,
+			 raw2int(f->size_major) << 1);
+	input_report_abs(input, ABS_MT_WIDTH_MINOR,
+			 raw2int(f->size_minor) << 1);
 	input_report_abs(input, ABS_MT_ORIENTATION,
 			 MAX_FINGER_ORIENTATION - raw2int(f->orientation));
 	input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x));