From patchwork Tue Oct 20 18:00:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zooko Wilcox-O'Hearn X-Patchwork-Id: 7449611 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 5FAF8BEEA4 for ; Tue, 20 Oct 2015 18:00:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D2D62083C for ; Tue, 20 Oct 2015 18:00:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C9C9207DE for ; Tue, 20 Oct 2015 18:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750996AbbJTSAV (ORCPT ); Tue, 20 Oct 2015 14:00:21 -0400 Received: from mail-ig0-f180.google.com ([209.85.213.180]:37465 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750910AbbJTSAU (ORCPT ); Tue, 20 Oct 2015 14:00:20 -0400 Received: by igbhv6 with SMTP id hv6so20376282igb.0 for ; Tue, 20 Oct 2015 11:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+lKXHe5JrGorZ9NtqqdAMAA3rLRkdDoZw97gLcByNAw=; b=oRAiILQNDrWYn3LfWuagBn/ElpXP8WjL1P0Z25CXyE3T/KdNYcNRFpecKESrjnTvIK 8d2+enP1UU+4M7fXoLkMZxeNuv0gazvkAeIa9Qfa870HaZtny8/ZmMCtx6vpsh2IugIs IWoZS1XCU4wNj0xUWWh3QmSZvRzqjJZRdc+XIyat5cplwuT6qxNJkXwdN3ugZuRu1R0r 18J7q4yR03yMHLpIKJav6Fq73IeUfixHma2suS8bc2jmpG8w1rkmYs5IG53PcmPwrIeQ IGkIO3oD1gP8+b6QHzXVapgcmpprUg84ASM7rtt2DGBMxFjmr+SSl5wD/lZMoITjtXPW XWiQ== MIME-Version: 1.0 X-Received: by 10.50.57.44 with SMTP id f12mr25278753igq.29.1445364019717; Tue, 20 Oct 2015 11:00:19 -0700 (PDT) Received: by 10.36.194.69 with HTTP; Tue, 20 Oct 2015 11:00:19 -0700 (PDT) In-Reply-To: <20151017182619.GH13470@dtor-ws> References: <20151017182619.GH13470@dtor-ws> Date: Tue, 20 Oct 2015 18:00:19 +0000 Message-ID: Subject: Re: Chromebook Pixel 1 atmel_mxt_ts doesn't work From: "Zooko Wilcox-O'Hearn" To: Dmitry Torokhov Cc: "linux-input@vger.kernel.org" , Nick Dyer 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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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 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 */