From patchwork Tue Aug 27 06:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11116145 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 099471395 for ; Tue, 27 Aug 2019 06:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E615620828 for ; Tue, 27 Aug 2019 06:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727251AbfH0G2i (ORCPT ); Tue, 27 Aug 2019 02:28:38 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:48162 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728222AbfH0G2i (ORCPT ); Tue, 27 Aug 2019 02:28:38 -0400 IronPort-SDR: AV0GKLhYxaGjXw7K/fdDDhHtc+625recBxE3ZYKo7GOSMBiAp62Aifkgu9buzWHar2gQ5ZU2p6 bGxbqBSKsQHvL4hyNk+lEQG0vFzoou2F3Cr2ADTi923Pwo24wIx7VdffYSy9lNM15GUOjGRtAq hZtqbuUGpZTdj33j/HKEw+3U8dGtLEXZrMgaFVhBJg9Ho48aheF4kUHs7aLM9AI8VMvP2/++6a 8/AqKXOayF5ogHLMmREWgXP1ZWxKQuSulhaP5dAsuYt7H+C1gI19sKl7K8tfX5sT8IOhszt134 IYQ= X-IronPort-AV: E=Sophos;i="5.64,436,1559548800"; d="scan'208";a="40784496" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 26 Aug 2019 22:28:36 -0800 IronPort-SDR: ciZzcER6kf8kpvyIWgKb0EHfL/U//fKFphmvhFWNrJtSDo+CicTU9uGF5o153370smZSGc5bZx 8rd1I5KdVoCjrCH5q00WiZsDWUOMp3Z+nAIsoHbzjwiNSFe3HB4ral1UslJSeo3yIM0SLS0SRQ MoZVUPDzON/adFy7crD58itNiOdl6N7uiTRel6QCDHztgk+8uhhlRglRcW5w8ML4EG4bA+0lKQ ZfZRhJ3oIyFW6NYpcv3WWur/UG/VDWeCuKI47Jqsnh9eZOo8wUDVn3a7hczEWbHdCz8CaDHYsP GQk= From: Jiada Wang To: , CC: , , , Subject: [PATCH v2 18/49] Input: atmel_mxt_ts - allow input name to be specified in platform data Date: Tue, 27 Aug 2019 15:28:03 +0900 Message-ID: <20190827062834.20494-4-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190827062834.20494-1-jiada_wang@mentor.com> References: <20190827062834.20494-1-jiada_wang@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) 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 c6be716a974c..923ceb5118c5 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);