linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Chromebook Pixel 1 atmel_mxt_ts doesn't work
@ 2015-10-13 17:39 Zooko Wilcox-O'Hearn
  2015-10-13 18:05 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Zooko Wilcox-O'Hearn @ 2015-10-13 17:39 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov

I'm running Linux 4.1.10 on a Chromebook Pixel 1 and my touchpad and
touchscreen don't work. Guided by Dmitry Torokhov on G+
(https://plus.google.com/u/0/+BensonLeung/posts/8zum4U7Aztg), I've
gotten as far as thinking that maybe these /var/log/syslog messages
are indicating the problem:

Oct 13 17:35:56 spark kernel: [ 2767.471569] atmel_mxt_ts 3-004a:
Direct firmware load for maxtouch.cfg failed with error -2
Oct 13 17:35:56 spark kernel: [ 2767.509568] input: Atmel maXTouch
Touchscreen as /devices/pci0000:00/0000:00:02.0/i2c-3/3-004a/input/input14
Oct 13 17:35:56 spark kernel: [ 2767.510569] atmel_mxt_ts 2-004b:
Direct firmware load for maxtouch.cfg failed with error -2
Oct 13 17:35:56 spark kernel: [ 2767.513378] atmel_mxt_ts 3-004a:
Family: 162 Variant: 0 Firmware V1.1.AA Objects: 27
Oct 13 17:35:56 spark kernel: [ 2767.515044] input: Atmel maXTouch
Touchpad as /devices/pci0000:00/0000:00:02.0/i2c-2/2-004b/input/input15
Oct 13 17:35:56 spark kernel: [ 2767.515304] atmel_mxt_ts 2-004b:
Family: 130 Variant: 1 Firmware V1.0.AA Objects: 22

These get posted whenever I modprobe atmel_mxt_ts, although the module
is subsequently listed in lsmod.

Here are some of my kernel config options:

$ zgrep -i i2c /proc/config.gz  | grep -v ^#
CONFIG_REGMAP_I2C=y
CONFIG_TCG_TIS_I2C_ATMEL=m
CONFIG_I2C=y
CONFIG_ACPI_I2C_OPREGION=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_MUX=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_I801=y
CONFIG_I2C_ISCH=m
CONFIG_I2C_SCMI=y
CONFIG_I2C_CROS_EC_TUNNEL=y
CONFIG_I2C_STUB=m
CONFIG_MFD_CROS_EC_I2C=y
CONFIG_SND_SOC_I2C_AND_SPI=m

Here is the result of evtest:

zooko@spark~ $ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Lid Switch
/dev/input/event1:      Power Button
/dev/input/event2:      Sleep Button
/dev/input/event3:      Sleep Button
/dev/input/event4:      Power Button
/dev/input/event5:      AT Translated Set 2 keyboard
/dev/input/event6:      Video Bus
/dev/input/event7:      Chromebook HD WebCam
/dev/input/event8:      Samsung S Action Mouse ET-MP900D
/dev/input/event9:      Jabra BIZ 2400 USB
/dev/input/event10:     Lite-On Technology Corp. Goldtouch USB Keyboard
/dev/input/event11:     Atmel maXTouch Touchpad
/dev/input/event12:     Atmel maXTouch Touchscreen
/dev/input/event13:     Lite-On Technology Corp. Goldtouch USB Keyboard
Select the device event number [0-13]: 11
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "Atmel maXTouch Touchpad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     2039
      Resolution      20
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     1359
      Resolution      20
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        9
    Event code 48 (ABS_MT_TOUCH_MAJOR)
      Value      0
      Min        0
      Max      255
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max     2039
      Resolution      20
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     1359
      Resolution      20
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)

Thanks, folks!

--Zooko
--
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] 5+ messages in thread

* Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work
  2015-10-13 17:39 Chromebook Pixel 1 atmel_mxt_ts doesn't work Zooko Wilcox-O'Hearn
@ 2015-10-13 18:05 ` Dmitry Torokhov
  2015-10-13 19:59   ` Zooko Wilcox-O'Hearn
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2015-10-13 18:05 UTC (permalink / raw)
  To: Zooko Wilcox-O'Hearn; +Cc: linux-input@vger.kernel.org, Nick Dyer

Hi Zooko,

On Tue, Oct 13, 2015 at 10:39 AM, Zooko Wilcox-O'Hearn <zookog@gmail.com> wrote:
> I'm running Linux 4.1.10 on a Chromebook Pixel 1 and my touchpad and
> touchscreen don't work. Guided by Dmitry Torokhov on G+
> (https://plus.google.com/u/0/+BensonLeung/posts/8zum4U7Aztg), I've
> gotten as far as thinking that maybe these /var/log/syslog messages
> are indicating the problem:
>
> Oct 13 17:35:56 spark kernel: [ 2767.471569] atmel_mxt_ts 3-004a:
> Direct firmware load for maxtouch.cfg failed with error -2
> Oct 13 17:35:56 spark kernel: [ 2767.509568] input: Atmel maXTouch
> Touchscreen as /devices/pci0000:00/0000:00:02.0/i2c-3/3-004a/input/input14
> Oct 13 17:35:56 spark kernel: [ 2767.510569] atmel_mxt_ts 2-004b:
> Direct firmware load for maxtouch.cfg failed with error -2
> Oct 13 17:35:56 spark kernel: [ 2767.513378] atmel_mxt_ts 3-004a:
> Family: 162 Variant: 0 Firmware V1.1.AA Objects: 27
> Oct 13 17:35:56 spark kernel: [ 2767.515044] input: Atmel maXTouch
> Touchpad as /devices/pci0000:00/0000:00:02.0/i2c-2/2-004b/input/input15
> Oct 13 17:35:56 spark kernel: [ 2767.515304] atmel_mxt_ts 2-004b:
> Family: 130 Variant: 1 Firmware V1.0.AA Objects: 22
>
> These get posted whenever I modprobe atmel_mxt_ts, although the module
> is subsequently listed in lsmod.
>
> Here are some of my kernel config options:
>
> $ zgrep -i i2c /proc/config.gz  | grep -v ^#
> CONFIG_REGMAP_I2C=y
> CONFIG_TCG_TIS_I2C_ATMEL=m
> CONFIG_I2C=y
> CONFIG_ACPI_I2C_OPREGION=y
> CONFIG_I2C_BOARDINFO=y
> CONFIG_I2C_COMPAT=y
> CONFIG_I2C_CHARDEV=m
> CONFIG_I2C_MUX=m
> CONFIG_I2C_HELPER_AUTO=y
> CONFIG_I2C_ALGOBIT=m
> CONFIG_I2C_I801=y
> CONFIG_I2C_ISCH=m
> CONFIG_I2C_SCMI=y
> CONFIG_I2C_CROS_EC_TUNNEL=y
> CONFIG_I2C_STUB=m
> CONFIG_MFD_CROS_EC_I2C=y
> CONFIG_SND_SOC_I2C_AND_SPI=m
>
> Here is the result of evtest:
>
> zooko@spark~ $ sudo evtest
> No device specified, trying to scan all of /dev/input/event*
> Available devices:
> /dev/input/event0:      Lid Switch
> /dev/input/event1:      Power Button
> /dev/input/event2:      Sleep Button
> /dev/input/event3:      Sleep Button
> /dev/input/event4:      Power Button
> /dev/input/event5:      AT Translated Set 2 keyboard
> /dev/input/event6:      Video Bus
> /dev/input/event7:      Chromebook HD WebCam
> /dev/input/event8:      Samsung S Action Mouse ET-MP900D
> /dev/input/event9:      Jabra BIZ 2400 USB
> /dev/input/event10:     Lite-On Technology Corp. Goldtouch USB Keyboard
> /dev/input/event11:     Atmel maXTouch Touchpad
> /dev/input/event12:     Atmel maXTouch Touchscreen
> /dev/input/event13:     Lite-On Technology Corp. Goldtouch USB Keyboard
> Select the device event number [0-13]: 11
> Input driver version is 1.0.1
> Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
> Input device name: "Atmel maXTouch Touchpad"
> Supported events:
>   Event type 0 (EV_SYN)
>   Event type 1 (EV_KEY)
>     Event code 272 (BTN_LEFT)
>     Event code 325 (BTN_TOOL_FINGER)
>     Event code 328 (BTN_TOOL_QUINTTAP)
>     Event code 330 (BTN_TOUCH)
>     Event code 333 (BTN_TOOL_DOUBLETAP)
>     Event code 334 (BTN_TOOL_TRIPLETAP)
>     Event code 335 (BTN_TOOL_QUADTAP)
>   Event type 3 (EV_ABS)
>     Event code 0 (ABS_X)
>       Value      0
>       Min        0
>       Max     2039
>       Resolution      20
>     Event code 1 (ABS_Y)
>       Value      0
>       Min        0
>       Max     1359
>       Resolution      20
>     Event code 24 (ABS_PRESSURE)
>       Value      0
>       Min        0
>       Max      255
>     Event code 47 (ABS_MT_SLOT)
>       Value      0
>       Min        0
>       Max        9
>     Event code 48 (ABS_MT_TOUCH_MAJOR)
>       Value      0
>       Min        0
>       Max      255
>     Event code 53 (ABS_MT_POSITION_X)
>       Value      0
>       Min        0
>       Max     2039
>       Resolution      20
>     Event code 54 (ABS_MT_POSITION_Y)
>       Value      0
>       Min        0
>       Max     1359
>       Resolution      20
>     Event code 57 (ABS_MT_TRACKING_ID)
>       Value      0
>       Min        0
>       Max    65535
>     Event code 58 (ABS_MT_PRESSURE)
>       Value      0
>       Min        0
>       Max      255
> Properties:
>   Property type 0 (INPUT_PROP_POINTER)
>   Property type 2 (INPUT_PROP_BUTTONPAD)
>

Just to confirm: when you run evtest on the text console (i.e. not in
X) and touch the device, do you see any additional output besides the
properties?

Thanks.

-- 
Dmitry
--
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] 5+ messages in thread

* Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work
  2015-10-13 18:05 ` Dmitry Torokhov
@ 2015-10-13 19:59   ` Zooko Wilcox-O'Hearn
  2015-10-17 18:26     ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Zooko Wilcox-O'Hearn @ 2015-10-13 19:59 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input@vger.kernel.org, Nick Dyer

This is the complete output of running evtest and choosing option 10,
from the console (while X is running, but I'm not running evtest under
X).

zooko@spark ~ $ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      Lid Switch
/dev/input/event1:      Power Button
/dev/input/event2:      Sleep Button
/dev/input/event3:      Sleep Button
/dev/input/event4:      Power Button
/dev/input/event5:      AT Translated Set 2 keyboard
/dev/input/event6:      Chromebook HD WebCam
/dev/input/event7:      Video Bus
/dev/input/event8:      Logitech M325
/dev/input/event9:      Atmel maXTouch Touchscreen
/dev/input/event10:     Atmel maXTouch Touchpad
Select the device event number [0-10]: 10
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "Atmel maXTouch Touchpad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     2039
      Resolution      20
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     1359
      Resolution      20
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        9
    Event code 48 (ABS_MT_TOUCH_MAJOR)
      Value      0
      Min        0
      Max      255
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max     2039
      Resolution      20
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     1359
      Resolution      20
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)
Testing ... (interrupt to exit)

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

* Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work
  2015-10-13 19:59   ` Zooko Wilcox-O'Hearn
@ 2015-10-17 18:26     ` Dmitry Torokhov
  2015-10-20 18:00       ` Zooko Wilcox-O'Hearn
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2015-10-17 18:26 UTC (permalink / raw)
  To: Zooko Wilcox-O'Hearn; +Cc: linux-input@vger.kernel.org, Nick Dyer

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

On Tue, Oct 13, 2015 at 07:59:17PM +0000, Zooko Wilcox-O'Hearn wrote:
> This is the complete output of running evtest and choosing option 10,
> from the console (while X is running, but I'm not running evtest under
> X).
> 
> zooko@spark ~ $ sudo evtest
> No device specified, trying to scan all of /dev/input/event*
...
>   Property type 0 (INPUT_PROP_POINTER)
>   Property type 2 (INPUT_PROP_BUTTONPAD)
> Testing ... (interrupt to exit)

I see. I wonder if configuration data stored in controller's NVRAM was
reset somehow. You can try extracting that data from Chrome OS
repository [1] (I believe this is a public link).

Rename files from *.raw into link-*.raw and drop them in /lib/firmware
Then apply the 2 attached patches and see if it will bring the touch
back to life.

Thanks!

-- 
Dmitry

[1]
https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/overlay-link/chromeos-base/chromeos-touch-config-link/files/

[-- Attachment #2: atmel-platform-cfg.patch --]
[-- Type: text/x-diff, Size: 3907 bytes --]

Input: atmel_mxt_ts - allow specifying device-specific configs

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Atmel controllers are very flexible and to function optimally require
device-specific configuration to be loaded. While the configuration is
stored in NVRAM and is normally persistent, sometimes it gets corrupted
and needs to be reloaded.

Instead of using the same name, maxtouch.cfg, for all systems and all
devices, let's allow platform data to specify the name of configuration
file that should be loaded. This is especially useful for systems that
use Atmel controllers for both touchscreen and touchpad, since their
configurations will surely differ.

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 .../devicetree/bindings/input/atmel,maxtouch.txt   |    6 ++++++
 drivers/input/touchscreen/atmel_mxt_ts.c           |   11 ++++++++++-
 include/linux/platform_data/atmel_mxt_ts.h         |    1 +
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index 1852906..fd2344d 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -9,6 +9,12 @@ Required properties:
 - interrupts: The sink for the touchpad's IRQ output
     See ../interrupt-controller/interrupts.txt
 
+Optional properties:
+
+- linux,config-name: name of configuration file that should be loaded
+    into device for optimal functioning. If not specified "maxtouch.cfg"
+    will be used.
+
 Optional properties for main touchpad device:
 
 - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index c562205..86f4360 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1989,7 +1989,8 @@ static int mxt_initialize(struct mxt_data *data)
 	if (error)
 		goto err_free_object_table;
 
-	error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
+	error = request_firmware_nowait(THIS_MODULE, true,
+					data->pdata->cfg_name ?: MXT_CFG_NAME,
 					&client->dev, GFP_KERNEL, data,
 					mxt_config_cb);
 	if (error) {
@@ -2416,11 +2417,13 @@ static void mxt_input_close(struct input_dev *dev)
 #ifdef CONFIG_OF
 static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
 {
+	struct device_node *np;
 	struct mxt_platform_data *pdata;
 	struct device_node *np = client->dev.of_node;
 	u32 *keymap;
 	int proplen, ret;
 
+	np = client->dev.of_node;
 	if (!np)
 		return ERR_PTR(-ENOENT);
 
@@ -2448,6 +2451,8 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
 
 	pdata->suspend_mode = MXT_SUSPEND_DEEP_SLEEP;
 
+	of_property_read_string(np, "linux,config-name", &pdata->cfg_name);
+
 	return pdata;
 }
 #else
@@ -2478,11 +2483,15 @@ static struct mxt_acpi_platform_data samus_platform_data[] = {
 		.pdata	= {
 			.t19_num_keys	= ARRAY_SIZE(samus_touchpad_buttons),
 			.t19_keymap	= samus_touchpad_buttons,
+			.cfg_name	= "samus-337t.raw",
 		},
 	},
 	{
 		/* Touchscreen */
 		.hid	= "ATML0001",
+		.pdata	= {
+			.cfg_name	= "samus-2954t2.raw",
+		},
 	},
 	{ }
 };
diff --git a/include/linux/platform_data/atmel_mxt_ts.h b/include/linux/platform_data/atmel_mxt_ts.h
index 695035a..2bcd4ff 100644
--- a/include/linux/platform_data/atmel_mxt_ts.h
+++ b/include/linux/platform_data/atmel_mxt_ts.h
@@ -26,6 +26,7 @@ struct mxt_platform_data {
 	u8 t19_num_keys;
 	const unsigned int *t19_keymap;
 	enum mxt_suspend_mode suspend_mode;
+	const char *cfg_name;
 };
 
 #endif /* __LINUX_PLATFORM_DATA_ATMEL_MXT_TS_H */

[-- Attachment #3: chromeos_laptop-add-config --]
[-- Type: text/plain, Size: 1290 bytes --]

chromeos_laptop: add config names for Pixel 1 touchpad/screen

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Make use of the new facilities in Atmel driver to allow specifying
configuration file that is used by the device. We will be using
link-224sl.raw for the touchpad and link-1664s.raw for the touchpad.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/platform/chrome/chromeos_laptop.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
index 0207274..70bf81d 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -112,6 +112,7 @@ static struct mxt_platform_data atmel_224s_tp_platform_data = {
 	.t19_num_keys		= ARRAY_SIZE(mxt_t19_keys),
 	.t19_keymap		= mxt_t19_keys,
 	.suspend_mode		= MXT_SUSPEND_T9_CTRL,
+	.cfg_name		= "link-224sl.raw",
 };
 
 static struct i2c_board_info atmel_224s_tp_device = {
@@ -123,6 +124,7 @@ static struct i2c_board_info atmel_224s_tp_device = {
 static struct mxt_platform_data atmel_1664s_platform_data = {
 	.irqflags		= IRQF_TRIGGER_FALLING,
 	.suspend_mode		= MXT_SUSPEND_T9_CTRL,
+	.cfg_name		= "link-1664s.raw",
 };
 
 static struct i2c_board_info atmel_1664s_device = {

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

* Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work
  2015-10-17 18:26     ` Dmitry Torokhov
@ 2015-10-20 18:00       ` Zooko Wilcox-O'Hearn
  0 siblings, 0 replies; 5+ messages in thread
From: Zooko Wilcox-O'Hearn @ 2015-10-20 18:00 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input@vger.kernel.org, Nick Dyer

[-- Attachment #1: Type: text/plain, Size: 309 bytes --]

Dear Dmitry:

It worked! Thank you. Here's the patch that I had to manually massage
to apply (the one you sent doesn't apply to Linux 4.1.10).

I don't currently have touchscreen working though, only touchpad.
Maybe I just need to configure something in userspace to turn the
touchscreen on?

Regards,

Zooko

[-- Attachment #2: patch-atmelstuff.diff.txt --]
[-- Type: text/plain, Size: 3696 bytes --]

diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
index 1852906..fd2344d 100644
--- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt
@@ -9,6 +9,12 @@ Required properties:
 - interrupts: The sink for the touchpad's IRQ output
     See ../interrupt-controller/interrupts.txt
 
+Optional properties:
+
+- linux,config-name: name of configuration file that should be loaded
+    into device for optimal functioning. If not specified "maxtouch.cfg"
+    will be used.
+
 Optional properties for main touchpad device:
 
 - linux,gpio-keymap: When enabled, the SPT_GPIOPWN_T19 object sends messages
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 40b98dd..f50d4b5 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -2035,7 +2035,8 @@ static int mxt_initialize(struct mxt_data *data)
 	if (error)
 		goto err_free_object_table;
 
-	error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
+	error = request_firmware_nowait(THIS_MODULE, true,
+					data->pdata->cfg_name ?: MXT_CFG_NAME,
 					&client->dev, GFP_KERNEL, data,
 					mxt_config_cb);
 	if (error) {
@@ -2375,6 +2376,7 @@ static void mxt_input_close(struct input_dev *dev)
 #ifdef CONFIG_OF
 static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
 {
+	struct device_node *np;
 	struct mxt_platform_data *pdata;
 	u32 *keymap;
 	u32 keycode;
@@ -2383,6 +2385,10 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
 	if (!client->dev.of_node)
 		return ERR_PTR(-ENOENT);
 
+	np = client->dev.of_node;
+ 	if (!np)
+ 		return ERR_PTR(-ENOENT);
+
 	pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return ERR_PTR(-ENOMEM);
@@ -2409,6 +2415,8 @@ static const struct mxt_platform_data *mxt_parse_dt(struct i2c_client *client)
 		pdata->t19_keymap = keymap;
 	}
 
+	of_property_read_string(np, "linux,config-name", &pdata->cfg_name);
+
 	return pdata;
 }
 #else
@@ -2439,11 +2447,15 @@ static struct mxt_acpi_platform_data samus_platform_data[] = {
 		.pdata	= {
 			.t19_num_keys	= ARRAY_SIZE(samus_touchpad_buttons),
 			.t19_keymap	= samus_touchpad_buttons,
+			.cfg_name	= "samus-337t.raw",
 		},
 	},
 	{
 		/* Touchscreen */
 		.hid	= "ATML0001",
+		.pdata	= {
+			.cfg_name	= "samus-2954t2.raw",
+		},
 	},
 	{ }
 };
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c
index a04019a..bff39fe 100644
--- a/drivers/platform/chrome/chromeos_laptop.c
+++ b/drivers/platform/chrome/chromeos_laptop.c
@@ -111,6 +111,7 @@ static struct mxt_platform_data atmel_224s_tp_platform_data = {
 	.irqflags		= IRQF_TRIGGER_FALLING,
 	.t19_num_keys		= ARRAY_SIZE(mxt_t19_keys),
 	.t19_keymap		= mxt_t19_keys,
+	.cfg_name		= "link-224sl.raw",
 };
 
 static struct i2c_board_info atmel_224s_tp_device = {
@@ -121,6 +122,7 @@ static struct i2c_board_info atmel_224s_tp_device = {
 
 static struct mxt_platform_data atmel_1664s_platform_data = {
 	.irqflags		= IRQF_TRIGGER_FALLING,
+	.cfg_name		= "link-1664s.raw",
 };
 
 static struct i2c_board_info atmel_1664s_device = {
diff --git a/include/linux/i2c/atmel_mxt_ts.h b/include/linux/i2c/atmel_mxt_ts.h
index 02bf6ea..aeb8c9a 100644
--- a/include/linux/i2c/atmel_mxt_ts.h
+++ b/include/linux/i2c/atmel_mxt_ts.h
@@ -20,6 +20,7 @@ struct mxt_platform_data {
 	unsigned long irqflags;
 	u8 t19_num_keys;
 	const unsigned int *t19_keymap;
+	const char *cfg_name;
 };
 
 #endif /* __LINUX_ATMEL_MXT_TS_H */

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

end of thread, other threads:[~2015-10-20 18:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 17:39 Chromebook Pixel 1 atmel_mxt_ts doesn't work Zooko Wilcox-O'Hearn
2015-10-13 18:05 ` Dmitry Torokhov
2015-10-13 19:59   ` Zooko Wilcox-O'Hearn
2015-10-17 18:26     ` Dmitry Torokhov
2015-10-20 18:00       ` Zooko Wilcox-O'Hearn

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).