[PATCH 1/2] input:touchscreen:ft5x_ts: Make device visible under /sys/class/input/input*

444 views
Skip to first unread message

Jari Helaakoski

unread,
Nov 30, 2012, 3:07:03 PM11/30/12
to linux...@googlegroups.com, Jari Helaakoski
---
drivers/input/touchscreen/ft5x_ts.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/input/touchscreen/ft5x_ts.c b/drivers/input/touchscreen/ft5x_ts.c
index 71f341a..4e14f65 100644
--- a/drivers/input/touchscreen/ft5x_ts.c
+++ b/drivers/input/touchscreen/ft5x_ts.c
@@ -1735,6 +1735,8 @@ ft5x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
set_bit(EV_KEY, input_dev->evbit);

input_dev->name = CTP_NAME; //dev_name(&client->dev)
+ input_dev->id.bustype = BUS_I2C;
+ input_dev->dev.parent = &client->dev;
err = input_register_device(input_dev);
if (err) {
dev_err(&client->dev,
--
1.7.9.5

Jari Helaakoski

unread,
Nov 30, 2012, 3:07:04 PM11/30/12
to linux...@googlegroups.com, Jari Helaakoski
[ 18.476] (II) config/udev: Adding input device ft5x_ts (/dev/input/mouse0)
[ 18.476] (II) No input driver specified, ignoring this device.
[ 18.476] (II) This device may have been added with another device file.
[ 18.516] (II) config/udev: Adding input device ft5x_ts (/dev/input/event1)
[ 18.516] (**) ft5x_ts: Applying InputClass "evdev touchscreen catchall"
[ 18.516] (II) Using input driver 'evdev' for 'ft5x_ts'
[ 18.516] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 18.516] (**) ft5x_ts: always reports core events
[ 18.517] (**) evdev: ft5x_ts: Device: "/dev/input/event1"
[ 18.517] (--) evdev: ft5x_ts: Vendor 0 Product 0
[ 18.517] (--) evdev: ft5x_ts: Found absolute axes
[ 18.517] (--) evdev: ft5x_ts: Found absolute multitouch axes
[ 18.517] (--) evdev: ft5x_ts: Found x and y absolute axes
[ 18.517] (--) evdev: ft5x_ts: Found absolute touchscreen
[ 18.518] (II) evdev: ft5x_ts: Configuring as touchscreen
[ 18.518] (**) evdev: ft5x_ts: YAxisMapping: buttons 4 and 5
[ 18.518] (**) evdev: ft5x_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 18.518] (**) Option "config_info" "udev:/sys/devices/platform/sun4i-i2c.2/i2c-2/2-0038/input/input1/event1"
[ 18.518] (II) XINPUT: Adding extended input device "ft5x_ts" (type: TOUCHSCREEN, id 7)
[ 18.519] (II) evdev: ft5x_ts: initialized for absolute axes.
[ 18.561] (**) ft5x_ts: (accel) keeping acceleration scheme 1
[ 18.562] (**) ft5x_ts: (accel) acceleration profile 0
[ 18.562] (**) ft5x_ts: (accel) acceleration factor: 2.000
[ 18.562] (**) ft5x_ts: (accel) acceleration threshold: 4[ 21.029] (II) config/udev: Adding input device ft5x_ts (/dev/input/event1)
[ 21.029] (**) ft5x_ts: Applying InputClass "evdev touchscreen catchall"
[ 21.029] (II) Using input driver 'evdev' for 'ft5x_ts'
[ 21.029] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 21.029] (**) ft5x_ts: always reports core events
[ 21.029] (**) evdev: ft5x_ts: Device: "/dev/input/event1"
[ 21.029] (--) evdev: ft5x_ts: Vendor 0 Product 0
[ 21.029] (--) evdev: ft5x_ts: Found absolute axes
[ 21.030] (--) evdev: ft5x_ts: Found absolute multitouch axes
[ 21.030] (--) evdev: ft5x_ts: Found x and y absolute axes
[ 21.030] (--) evdev: ft5x_ts: Found absolute touchscreen
[ 21.030] (II) evdev: ft5x_ts: Configuring as touchscreen
[ 21.030] (**) evdev: ft5x_ts: YAxisMapping: buttons 4 and 5
[ 21.030] (**) evdev: ft5x_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 21.031] (**) Option "config_info" "udev:/sys/devices/platform/sun4i-i2c.2/i2c-2/2-0038/input/input1/event1"
[ 21.031] (II) XINPUT: Adding extended input device "ft5x_ts" (type: TOUCHSCREEN, id 7)
[ 21.032] (II) evdev: ft5x_ts: initialized for absolute axes.
[ 21.033] (**) ft5x_ts: (accel) keeping acceleration scheme 1
[ 21.033] (**) ft5x_ts: (accel) acceleration profile 0
[ 21.034] (**) ft5x_ts: (accel) acceleration factor: 2.000
[ 21.034] (**) ft5x_ts: (accel) acceleration threshold: 4
[ 21.036] (II) config/udev: Adding input device ft5x_ts (/dev/input/mouse0)
[ 21.036] (II) No input driver specified, ignoring this device.
[ 21.036] (II) This device may have been added with another device file.
---
drivers/input/touchscreen/ft5x_ts.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/input/touchscreen/ft5x_ts.c b/drivers/input/touchscreen/ft5x_ts.c
index 4e14f65..e83cd06 100644
--- a/drivers/input/touchscreen/ft5x_ts.c
+++ b/drivers/input/touchscreen/ft5x_ts.c
@@ -1696,14 +1696,28 @@ ft5x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)

ft5x_ts->input_dev = input_dev;

+ set_bit(EV_ABS, input_dev->evbit);
+ set_bit(EV_KEY, input_dev->evbit);
+
+ set_bit(ABS_X, input_dev->absbit);
+ set_bit(ABS_Y, input_dev->absbit);
+ set_bit(ABS_PRESSURE, input_dev->absbit);
+
+ set_bit(BTN_TOUCH, input_dev->keybit);
+
+ input_set_abs_params(input_dev,
+ ABS_X, 0, SCREEN_MAX_X, 0, 0);
+ input_set_abs_params(input_dev,
+ ABS_Y, 0, SCREEN_MAX_Y, 0, 0);
+ input_set_abs_params(input_dev,
+ ABS_PRESSURE, 0, PRESS_MAX, 0 , 0);
+
#ifdef CONFIG_FT5X0X_MULTITOUCH
set_bit(ABS_MT_TOUCH_MAJOR, input_dev->absbit);
set_bit(ABS_MT_POSITION_X, input_dev->absbit);
set_bit(ABS_MT_POSITION_Y, input_dev->absbit);
set_bit(ABS_MT_WIDTH_MAJOR, input_dev->absbit);
-#ifdef FOR_TSLIB_TEST
- set_bit(BTN_TOUCH, input_dev->keybit);
-#endif
+
input_set_abs_params(input_dev,
ABS_MT_POSITION_X, 0, SCREEN_MAX_X, 0, 0);
input_set_abs_params(input_dev,
@@ -1720,20 +1734,8 @@ ft5x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)
for (i = 1; i < TOUCH_KEY_NUMBER; i++)
set_bit(i, input_dev->keybit);
#endif
-#else
- set_bit(ABS_X, input_dev->absbit);
- set_bit(ABS_Y, input_dev->absbit);
- set_bit(ABS_PRESSURE, input_dev->absbit);
- set_bit(BTN_TOUCH, input_dev->keybit);
- input_set_abs_params(input_dev, ABS_X, 0, SCREEN_MAX_X, 0, 0);
- input_set_abs_params(input_dev, ABS_Y, 0, SCREEN_MAX_Y, 0, 0);
- input_set_abs_params(input_dev,
- ABS_PRESSURE, 0, PRESS_MAX, 0 , 0);
#endif

- set_bit(EV_ABS, input_dev->evbit);
- set_bit(EV_KEY, input_dev->evbit);
-
input_dev->name = CTP_NAME; //dev_name(&client->dev)
input_dev->id.bustype = BUS_I2C;
input_dev->dev.parent = &client->dev;
--
1.7.9.5

Jari Helaakoski

unread,
Nov 30, 2012, 3:20:13 PM11/30/12
to linux...@googlegroups.com


2012/11/30 Jari Helaakoski <tek...@gmail.com>

[    18.476] (II) config/udev: Adding input device ft5x_ts (/dev/input/mouse0)
[    18.476] (II) No input driver specified, ignoring this device.
[    18.476] (II) This device may have been added with another device file.
[    18.516] (II) config/udev: Adding input device ft5x_ts (/dev/input/event1)
[    18.516] (**) ft5x_ts: Applying InputClass "evdev touchscreen catchall"
[    18.516] (II) Using input driver 'evdev' for 'ft5x_ts'
[    18.516] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[    18.516] (**) ft5x_ts: always reports core events
[    18.517] (**) evdev: ft5x_ts: Device: "/dev/input/event1"
[    18.517] (--) evdev: ft5x_ts: Vendor 0 Product 0
[    18.517] (--) evdev: ft5x_ts: Found absolute axes
[    18.517] (--) evdev: ft5x_ts: Found absolute multitouch axes
[    18.517] (--) evdev: ft5x_ts: Found x and y absolute axes
[    18.517] (--) evdev: ft5x_ts: Found absolute touchscreen
[    18.518] (II) evdev: ft5x_ts: Configuring as touchscreen
[    18.518] (**) evdev: ft5x_ts: YAxisMapping: buttons 4 and 5
[    18.518] (**) evdev: ft5x_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[    18.518] (**) Option "config_info" "udev:/sys/devices/platform/sun4i-i2c.2/i2c-2/2-0038/input/input1/event1"
[    18.518] (II) XINPUT: Adding extended input device "ft5x_ts" (type: TOUCHSCREEN, id 7)
[    18.519] (II) evdev: ft5x_ts: initialized for absolute axes.
[    18.561] (**) ft5x_ts: (accel) keeping acceleration scheme 1
[    18.562] (**) ft5x_ts: (accel) acceleration profile 0
[    18.562] (**) ft5x_ts: (accel) acceleration factor: 2.000
[    18.562] (**) ft5x_ts: (accel) acceleration threshold: 4[    21.029]
 
Uups. Xorg.log pasted twice. 
Other notice that these patches were tested only with X11. Android results would be nice too.
-Jari

Alejandro Mery

unread,
Jan 8, 2013, 4:35:45 PM1/8/13
to linux...@googlegroups.com
sorry for forgetting it one. applied on both stage branches

cheers,
Alejandro

Neal Peacock

unread,
Jan 15, 2013, 12:01:35 AM1/15/13
to linux...@googlegroups.com
I think the second part of the patch didn't get applied.
>
> cheers,
> Alejandro
>

Jari Helaakoski

unread,
Jan 15, 2013, 2:20:00 AM1/15/13
to linux...@googlegroups.com
Hi,

2013/1/15 Neal Peacock <kuliman...@gmail.com>

I think the second part of the patch didn't get applied.

We agried with Alejandro that I'll redo that patch since you reported some different behavior.

-Jari

Neal Peacock

unread,
Jan 15, 2013, 8:17:42 AM1/15/13
to linux...@googlegroups.com

OK yeah I remember.  At first I didn't need your patch to use the driver and I thought it worked better without it.  However, sometime between then and now my build started behaving the same as your original problem, X wouldn't pick it up.

So I'm not sure what changed elsewhere but this patch is vital now.
>
> -Jari
>
> --
>  
>  

Reply all
Reply to author
Forward
0 new messages