From patchwork Tue Sep 17 09:37:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11148407 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 52B7814DB for ; Tue, 17 Sep 2019 09:39:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A1272189D for ; Tue, 17 Sep 2019 09:39:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfIQJjD (ORCPT ); Tue, 17 Sep 2019 05:39:03 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:59351 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbfIQJjB (ORCPT ); Tue, 17 Sep 2019 05:39:01 -0400 IronPort-SDR: qDt9WARS/bvl2fdcGdSTP8aRHCGKJ0Chl4bOIsPltWJmwZfA15obywX0a67I+nbeK+3Uv/aVqN 9HAs54b9qis8/LUGmhbzbkIHzJ1fpoxa/H+Fp+fpf3fO4hDdRMYNuWIAYLVWvrYHvdxmhQ7tov RiZt8LK5j38Wlt8jun/DHhnzBl0BXcRM/vlaZqb6Bd0jvBKLDg3YAkOc/WMZ/WnKVM0eyoZE/i u3WZXPHuiy80JPqsgT1GXyssC5jgjBssDxwxNMyQf2BjzKOn1W0dqKvlGR2GDHltr0oiKrlRlX gHw= X-IronPort-AV: E=Sophos;i="5.64,515,1559548800"; d="scan'208";a="43223072" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 17 Sep 2019 01:39:00 -0800 IronPort-SDR: 3f/shU3LjsDbKvGCGlak+XAXmm9rjJUsTrDisDxwOkXDmsomR9k92YnxYxPG3gE/t9Qf4oFQIu jfukQW1YOHT4YMOw2cEt3hZIobTJtlSxdZu/RMxYgJYIJvu25cZcWzGncUg1kczszTR9aQ8P+H K1w+0btrefX8xDqjQ2oZAEOo7/+sftf71XF/Q/oXXP1Lkwzj4NjqSaKrJHMGgnupFEAAoMh0tj 7d+2wofpDDvxnISu/aEuilEO68Z/iJVoibOlCXNlKqCj+rhfPDku0yK8h1rshHha/cCaf8Q/t6 cYE= From: Jiada Wang To: , , , , CC: , , Subject: [PATCH v3 18/49] Input: atmel_mxt_ts - allow input name to be specified in platform data Date: Tue, 17 Sep 2019 18:37:35 +0900 Message-ID: <20190917093806.18538-4-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190917093806.18538-1-jiada_wang@mentor.com> References: <20190917093806.18538-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nick Dyer Android systems identify the input device and map to IDC file by using the input device name. To avoid unnecessary deltas to the driver file, allow this to be set from the platform data. Signed-off-by: Nick Dyer (cherry picked from ndyer/linux/for-upstream commit cbf94a7bda754d2e1899d9f50313a0bccc91422d) [gdavis: Resolve forward port conflicts due to applying upstream commit 96a938aa214e ("Input: atmel_mxt_ts - remove platform data support").] Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- .../devicetree/bindings/input/atmel,maxtouch.txt | 2 ++ drivers/input/touchscreen/atmel_mxt_ts.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt index 713ce870805c..d7db16920083 100644 --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.txt +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.txt @@ -40,6 +40,8 @@ Optional properties for main touchpad device: - atmel,cfg_name: Provide name of configuration file in OBP_RAW format. This will be downloaded from the firmware loader on probe to the device. +- atmel,input_name: Override name of input device from the default. + Example: touch@4b { diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index c09ef7689f6a..f0522f4416dc 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -336,6 +336,7 @@ struct mxt_data { char *fw_name; char *cfg_name; const char *pcfg_name; + const char *input_name; /* Cached parameters from object table */ u16 T5_address; @@ -2412,7 +2413,11 @@ static int mxt_initialize_input_device(struct mxt_data *data) if (!input_dev) return -ENOMEM; - input_dev->name = "Atmel maXTouch Touchscreen"; + if (data->input_name) + input_dev->name = data->input_name; + else + input_dev->name = "Atmel maXTouch Touchscreen"; + input_dev->phys = data->phys; input_dev->id.bustype = BUS_I2C; input_dev->dev.parent = dev; @@ -3653,6 +3658,8 @@ static int mxt_parse_device_properties(struct mxt_data *data) device_property_read_string(dev, "atmel,cfg_name", &data->pcfg_name); + device_property_read_string(dev, "atmel,input_name", &data->input_name); + if (device_property_present(dev, keymap_property)) { n_keys = device_property_read_u32_array(dev, keymap_property, NULL, 0);