Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3367486ybb; Tue, 31 Mar 2020 03:56:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsJ8AS9lRifdTrKMjlsg3ycTR+A83uEGqWbXPi8QQm0MYMjTU6A77Z1Z30G1uF1QH896ePV X-Received: by 2002:aca:5712:: with SMTP id l18mr1629554oib.178.1585652177074; Tue, 31 Mar 2020 03:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585652177; cv=none; d=google.com; s=arc-20160816; b=BKQraRU+C2c0ywJaJSYeuV6A8SoQxHRLAu334RYpd1eBt4rGrnFpvhU+EKCteIcigB LCTsoD8IHCZJQmljlVqzB1dMsVVKVVWcsEPWtB7e2hSqQzyfKKi2fw/uBxNL6U8k238k H1mR2tOH6FPdvYpRy5+IO9SAB7/o2YSzQzo/L0bEUcB24yeMYDCzhwLBFLZ3tr6lezFN qyZftU193Xfzx37TBviUoKcd41d9DFQnG2Eit3PFNSSgux0C4tRw44D1oKckM++UJuGC o9MyRFyQ9YlIaqRSbaN4CIbsfY0p3c1Wxc4zqEAWkoPfjDim051oBuqI/AMtsY8Oj16z CXDg== 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=RGbP/e+/jlds1qig19Y2R3M7KPua2aQkYDKHcGZInJk=; b=hPA3CT/GIlZFUr9EnUvGkl8fFt+79bj/T/lO5dq3kCNDrYW6DsuZKZNK32l0l6gYAI T2UpGImYJTmPhONT99Zak7O/XOJ1wEhVLFVR+GmL5v40lGz/aCncCSjlCCFJVpp08wB0 /joLOAMJJc76aa1mtbZ+YXUHe/baBf2zaUcKcciONv48s8gwZaJD8joclE6tCMArh2fK xV/QidbQ6jlFTOQLM6M8DMQg/CTYmQqljY0IGC3a6Co71WrEPacE3oh2xDrG5rKLsFRO dwbh/oJvi7AXRBBWCBt4ecyvluPDGV+ymETDQAG+y8x5ljQ3VAH/RQWdEAQCzpuGzpJy KC/Q== 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 i15si7814009ots.121.2020.03.31.03.56.05; Tue, 31 Mar 2020 03:56:17 -0700 (PDT) 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 S1730515AbgCaKwk (ORCPT + 99 others); Tue, 31 Mar 2020 06:52:40 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43589 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730410AbgCaKwk (ORCPT ); Tue, 31 Mar 2020 06:52:40 -0400 IronPort-SDR: IlEyzTrZ/iHDjmRfOyAUKck7waKJubEXq9VDLpCi2uXxlcQ6j0fnro7nL6PBFVAZMefqNW9fvg fVnv6bHkcQKKyRdUMEqDfSyfn5TH+USfjkNm7AsrD1f1Eiv+mCASIB1n6BeI2ecsTzVRkxi1SK vyZlWCpMHJJjsa8pory1WmcdkjwnosXM/RnBkCc/Tw4C4EGAQHTFzRCVKjjBx2b/qMBYZt4Jpy mzgqHTVVpWNQbXfzqHmIfF0EkOvjZCdbLWsXmyTzPAOlgs2TgwkU08vY7A9/6EVH4d50Uf3kff ju4= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330777" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:52:20 -0800 IronPort-SDR: VCb3GzgQuZMCQk4GyI3gjJkVazkmEJORCNejFtqLBC8fK9Hj9iZw+7cQIqly5V8C1FzTqhtJXV wt7HH04b26EVKW2Hczyx/X9+28rtCcbdFxvweFAyx16oqqcON83otFGrW+jiYFpd1rI2gM2WUH x4U0gQZkNHZTelzh/t1fN4axxFL3WxiuQeyCzCVPE8j/qbQiLnWXBQEoWKkLnEDl2b/CsKqtpg 6eheewasmf2TJBxY28RsPNsUvYP11MReoASOlFmUQI/sP9O+Mq6bmo9wP1JOmyAPoXiSuiwhyD iI8= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 22/55] Input: atmel_mxt_ts - allow input name to be specified in platform data Date: Tue, 31 Mar 2020 03:50:18 -0700 Message-ID: <20200331105051.58896-23-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331105051.58896-1-jiada_wang@mentor.com> References: <20200331105051.58896-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 [jiada: Separate Documentation/ portion change to another commit] Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index d1865250f492..dfc20c0ca0a5 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