[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#703607: Please include Cypress PS/2 Trackpad driver in linux-image-3.2.0-*



Hi Ben,

On 18:20 Sun 24 Mar     , Ben Hutchings wrote:
> On Thu, 2013-03-21 at 12:21 +0200, Apollon Oikonomopoulos wrote:
> > The trackpad driver from 3.9rc1 is not trivial to backport since the 
> > kernel's
> > multitouch input API has changed significantly.
> 
> I would still prefer to use a backport of the upstream version, so we
> can be sure that the functionality is equivalent and there shouldn't be
> a regression when users upgrade to the later upstream version.
> 
> Could you test the attached series of patches?
> 
> Ben.

Thanks for the quick response, unfortunately the kernel with the 
patchset applied failed to build at first. The attached patches, when 
applied on top of your patches, build and seem to work correctly.  I'll 
also test with an older Macbook to see if other drivers break with this 
patchset.

Regards,
Apollon

>From 90b1e99d6eaa37bb6770542762d3eb8f607e97b5 Mon Sep 17 00:00:00 2001
From: Apollon Oikonomopoulos <apollon@skroutz.gr>
Date: Tue, 26 Mar 2013 11:33:54 +0200
Subject: [PATCH 6/8] Fix input_mt_set_matrix call

input_mt_set_matrix was called with an invalid number of arguments from within
input_mt_assign_slots. Fix the call by removing the first argument, which is
incompatible with the function's signature.
---
 drivers/input/input-mt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c164d49..de1ac22 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -387,7 +387,7 @@ int input_mt_assign_slots(struct input_dev *dev, int *slots,
 	if (num_pos < 1)
 		return 0;
 
-	nrc = input_mt_set_matrix(dev, mt, pos, num_pos);
+	nrc = input_mt_set_matrix(mt, pos, num_pos);
 	find_reduced_matrix(mt->red, num_pos, nrc / num_pos, nrc);
 	input_mt_set_slots(mt, slots, num_pos);
 
-- 
1.7.10.4

>From 9969ed45b929fd1819a060578560dfe8126a56b0 Mon Sep 17 00:00:00 2001
From: Apollon Oikonomopoulos <apollon@skroutz.gr>
Date: Tue, 26 Mar 2013 11:34:28 +0200
Subject: [PATCH 7/8] Cypress PS/2: use input_mt_init_slots_flags

Debian-specific: call input_mt_init_slots_flags to initialize the Cypress PS/2
driver, instead of input_mt_init_slots.
---
 drivers/input/mouse/cypress_ps2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
index f51765f..4e366b9 100644
--- a/drivers/input/mouse/cypress_ps2.c
+++ b/drivers/input/mouse/cypress_ps2.c
@@ -386,7 +386,7 @@ static int cypress_set_input_params(struct input_dev *input,
 	input_set_abs_params(input, ABS_MT_POSITION_Y, 0, cytp->tp_max_abs_y, 0, 0);
 	input_set_abs_params(input, ABS_MT_PRESSURE, 0, 255, 0, 0);
 
-	ret = input_mt_init_slots(input, CYTP_MAX_MT_SLOTS,
+	ret = input_mt_init_slots_flags(input, CYTP_MAX_MT_SLOTS,
 			INPUT_MT_DROP_UNUSED|INPUT_MT_TRACK);
 	if (ret < 0)
 		return ret;
-- 
1.7.10.4

>From b540394376bba90fe33ab759e332d7d60b406a99 Mon Sep 17 00:00:00 2001
From: Apollon Oikonomopoulos <apollon@skroutz.gr>
Date: Tue, 26 Mar 2013 12:07:43 +0200
Subject: [PATCH 8/8] input_mt_init_slots_flags: fix slot initialization

input_mt_init_slots_flags used an invalid pointer to initialize the slots
as unused. Fix this by passing the correcto pointer (&mt->slots[i] instead of
&dev->mt[i]).
---
 drivers/input/input-mt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index de1ac22..8129f1f 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -90,7 +90,7 @@ int input_mt_init_slots_flags(struct input_dev *dev, unsigned int num_slots,
 
 	/* Mark slots as 'unused' */
 	for (i = 0; i < num_slots; i++)
-		input_mt_set_value(&dev->mt[i], ABS_MT_TRACKING_ID, -1);
+		input_mt_set_value(&mt->slots[i], ABS_MT_TRACKING_ID, -1);
 
 	dev->mt = &mt->slots[0];
 	return 0;
-- 
1.7.10.4


Reply to: