Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4314274ybc; Fri, 22 Nov 2019 00:27:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxRUiGDhIv8Z102a3MoxwyCf0OL4oFCuQ5rAAdXMe8BZRcHxoo6hK6DC3/9vFdLor7D56wS X-Received: by 2002:a17:906:194a:: with SMTP id b10mr20926615eje.123.1574411238066; Fri, 22 Nov 2019 00:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574411238; cv=none; d=google.com; s=arc-20160816; b=ypR+lyTqmK6TJvO+m5pWvv9pSp0Hi0B4IKDpHU2XtZ0sY8/qKVeqFzGEhDgAdLK2nh /qWQTOi/sdERkykynpyeAOAhOlPW6ydfdoMnFd1aKZhA8Mceork73YBHfYU3Jk76P1QY TbKj+MCpBeA1KqaDpFpUVIzvY66LPucHO53EwXOQ5c80pqQC9vmBe1wjwEcGjn0lZZqh PT/8ozPi07mRFP93h35Z+wcJz9DVYIPdmyrCPnwVOxIjrWkyG41RoWv0H/QatNqdKiMQ +7i0/JbHNXzMeYFk6+Oav7J8n1mzWQ2Gl2jHgaRTriyehJvfGHf1xnR/r6KdfCQrCo6E UrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=gPPUMjmkJTwMVJxw8N7jv/XviKu1cmgF81t8oFS23Ws=; b=XSEHGnjqg19k3Sp7M7JEw3Xxf2PctZjHRudmBMKzBr06KNYVM/zvUOmUVxWrtScuoV hL+N3KvUqa+Dzd3NMfroRjC1/hEJHCTQjFCZbinm0UHOu8TiGz2pUqIvXWhLl633N17U QZAQDZ7xEVuMv+fEJjwurwvGT+tc5MKQd2X/WeVBzUqbUceMaURKmIdzC20ZtRhwtAzL tyXKoCFy58c3R6JhZBpjfWOSLVXxMFJkyoDQsAjDe6tHKEE6LW6x6IO/qutBhc+zFG45 it3bR9ex3atrbPcFNWOSsHqzNI3Msrq5WcO9puIocAkEgiEqdV/Se20zgXr7bq1RHu3s P51A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si4719819edf.79.2019.11.22.00.26.54; Fri, 22 Nov 2019 00:27:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727377AbfKVIZL (ORCPT + 99 others); Fri, 22 Nov 2019 03:25:11 -0500 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:4430 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbfKVIZJ (ORCPT ); Fri, 22 Nov 2019 03:25:09 -0500 IronPort-SDR: ZH5ZcX6CL+S4IM6cerZMlA0iWeFlf+7Dy2/Bp2HF+odIDqRIdn4ykC7tDyH/IdXJgHIZUSW2wZ T0n9gb6XORKMANiqiGFU2QkncEtJ9AwUHO0lXI2OMAlj9jp52KqeR75rkVh+PvohhkqeMsdo/7 SUgDdhScFz+hLDFUWTnXNkzLXLYUKmWOxw2f1YosSnIeIXf1s9Q4ZdUavUapOTB7ADmOBqQgpq N3K5QuQNqAYB6PpyARYjcNAqCW74xMQn4JnpSJdOF1yZs15urNwNJTVPOeG0sfeiNHdRwEoT+a NV4= X-IronPort-AV: E=Sophos;i="5.69,229,1571731200"; d="scan'208";a="43419447" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 22 Nov 2019 00:25:08 -0800 IronPort-SDR: YhhMFZe3ywNjSzhTdd2x3arn9CtNAJVVPriao7GXIZq5YaOAxU1hZQTlZKE4j5EFGoPYDR8WKn HZ98PlOroRaiJSi8TVPS4aOuEx7FZNSzmTxTVGCVcOpSj4nG1onkzZugkwvwrC/ymmYAZfM7NM Chqj9fIaCi3+4/fM+oxsRUO2/FMD5bp2DDBXkZzrAwJTmTDrIDs7Tqy1Ci7bm02/HvVsjudkHQ wAN+pPxqU1/f4WGoqvrS/R2DK3F7ulFuAoOuPSfvz5KF3WPYEoMWJuYTuCeE+lM9eWa/Fltky+ 0nM= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v6 17/48] Input: atmel_mxt_ts - allow input name to be specified in platform data Date: Fri, 22 Nov 2019 17:23:31 +0900 Message-ID: <20191122082402.18173-18-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191122082402.18173-1-jiada_wang@mentor.com> References: <20191122082402.18173-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 362b7630ec6e..9ee3b6d40c8c 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_count_u32(dev, keymap_property); if (n_keys <= 0) { -- 2.17.1