From patchwork Sat Oct 17 18:26:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7423021 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB438BEEA4 for ; Sat, 17 Oct 2015 18:26:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8543920627 for ; Sat, 17 Oct 2015 18:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3713920619 for ; Sat, 17 Oct 2015 18:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751306AbbJQS0Y (ORCPT ); Sat, 17 Oct 2015 14:26:24 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34117 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbbJQS0X (ORCPT ); Sat, 17 Oct 2015 14:26:23 -0400 Received: by pasz6 with SMTP id z6so7849121pas.1 for ; Sat, 17 Oct 2015 11:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=qL7ZahuN7NWqzp6hXRtisAgsHdZbSjOtUhGfjuF/jFo=; b=0lYbzH0wQ3/ddlW+PGbdNYeSBbSHLCNrCIANCo8WuEkDMkLJNbV3V2e6HvOzsYb5YX GcKL8rSpq8XQLGHS4/E/urhKbTXgKCEVdmQPgV5hvpoXr+VcBj5Ks//CXAJbtGIe818v Mwh9GH5KCmKYbavw/TExpmV+fF3+AGP6OMuiUTNHHNZDUeAwnQ/UjclJBOr5H7OrR5MD H9XyK01LUPSmEXzMmTIh8vtWDgo1ydnlmH54+J75KjoluPQHOVsviO0hzlWYbYGCdiu5 8lS1sOk71jIry5WOrOt+0ekJOQ5mmsrKzmqGsgFIO/uXKNIVcHOOrwJQHUxy8yvS42Aw Xtzw== X-Received: by 10.66.161.234 with SMTP id xv10mr23973736pab.131.1445106382823; Sat, 17 Oct 2015 11:26:22 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:fc03:2fac:f4de:3d48]) by smtp.gmail.com with ESMTPSA id ir4sm27721105pbb.93.2015.10.17.11.26.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 17 Oct 2015 11:26:21 -0700 (PDT) Date: Sat, 17 Oct 2015 11:26:19 -0700 From: Dmitry Torokhov To: Zooko Wilcox-O'Hearn Cc: "linux-input@vger.kernel.org" , Nick Dyer Subject: Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work Message-ID: <20151017182619.GH13470@dtor-ws> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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! Input: atmel_mxt_ts - allow specifying device-specific configs From: Dmitry Torokhov 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 Tested-by: Javier Martinez Canillas Signed-off-by: Dmitry Torokhov --- .../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 */