From patchwork Tue Nov 24 18:58:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7692821 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5A59C9F1D3 for ; Tue, 24 Nov 2015 18:58:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77BBC20890 for ; Tue, 24 Nov 2015 18:58:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90F8E20861 for ; Tue, 24 Nov 2015 18:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107AbbKXS6P (ORCPT ); Tue, 24 Nov 2015 13:58:15 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35698 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbbKXS6O (ORCPT ); Tue, 24 Nov 2015 13:58:14 -0500 Received: by pacej9 with SMTP id ej9so30425466pac.2; Tue, 24 Nov 2015 10:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=uNCQDE5GEuH7ZPuUTIHIM1hhE7TRNNYcsQB5fR1bv54=; b=vnnlaSm6RWP1t+NEWEeIj+hPFucA/IgauzES+P3zJQjBCVeKY/WjML9YIKN+TRzUIe HBDAVNrRfE+3hpL6Dh3o71EgHeu4bWjuhcOM+WtAu1sScvv5Ejl59xuoX7Ppxn7ssOyx cZh9DyTevN3Bw+RK0Qy1/yEConKtn178cbVKub1WZ9ArKxCWliWv/n44kqDnHhEonQuI /cd1nc5/jOuFwE0Ur3Ovn9ByOcT1IsYMyESKAFuVV5Fr27ziW2TiDvGxXjsj4gPnojdl /FK1ez/tXhhmhLHjsPTj5fwDAek4/jac3aacc2ioY/BI067Y80aRlUm9Fw67Enu5MvUn PuCA== X-Received: by 10.98.89.196 with SMTP id k65mr25254227pfj.12.1448391493707; Tue, 24 Nov 2015 10:58:13 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:64d9:7515:4e8f:deaf]) by smtp.gmail.com with ESMTPSA id q65sm15869121pfa.18.2015.11.24.10.58.11 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 24 Nov 2015 10:58:13 -0800 (PST) Date: Tue, 24 Nov 2015 10:58:10 -0800 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Nick Dyer , Javier Martinez Canillas , Yufeng Shen , Benson Leung , linux-kernel@vger.kernel.org Subject: [PATCH] Input: atmel_mxt_ts - add generic platform data for Chromebooks Message-ID: <20151124185810.GA18357@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline 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=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Apparently people are installing generic Linux distributions not only on Pixels but also on other Chromebooks. Unfortunately on all of them Atmel parts assigned names ATML0000 and ATML0001, and do not carry any other configuration data. So let's create generic instance of platform data that should cover most of them (we assume that they will not be using T100 objects, since with those Google mapped BTN_LEFT onto a different GPIO, so slightly different keymap would be needed, but I think we used parts with T100 on ARM devices where we thankfully have DTS and can describe the devices better). Tested-by: Rich K Signed-off-by: Dmitry Torokhov Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/atmel_mxt_ts.c | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index c562205..159120b 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2487,6 +2487,31 @@ static struct mxt_acpi_platform_data samus_platform_data[] = { { } }; +static unsigned int chromebook_tp_buttons[] = { + KEY_RESERVED, + KEY_RESERVED, + KEY_RESERVED, + KEY_RESERVED, + KEY_RESERVED, + BTN_LEFT +}; + +static struct mxt_acpi_platform_data chromebook_platform_data[] = { + { + /* Touchpad */ + .hid = "ATML0000", + .pdata = { + .t19_num_keys = ARRAY_SIZE(chromebook_tp_buttons), + .t19_keymap = chromebook_tp_buttons, + }, + }, + { + /* Touchscreen */ + .hid = "ATML0001", + }, + { } +}; + static const struct dmi_system_id mxt_dmi_table[] = { { /* 2015 Google Pixel */ @@ -2497,6 +2522,14 @@ static const struct dmi_system_id mxt_dmi_table[] = { }, .driver_data = samus_platform_data, }, + { + /* Other Google Chromebooks */ + .ident = "Chromebook", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), + }, + .driver_data = chromebook_platform_data, + }, { } };