Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp754842ybg; Thu, 19 Mar 2020 08:11:43 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvgjE3zaIaPJX017XzCDtFRLsA3sIqA/fWOnOXOKCtRm9BILTOL/IhqUydg7pQM92QdVz9W X-Received: by 2002:a9d:4798:: with SMTP id b24mr2737990otf.243.1584630703492; Thu, 19 Mar 2020 08:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630703; cv=none; d=google.com; s=arc-20160816; b=VXbeBlFDfVj0mrysqJsVpt5xAuh3VPsI8LREiXd5955HfZhcFt7bN/8MgAquCVKF1U xkPn4wfLtnY3SoxyCkngRenTkpmErC4ZZ8xQRht20kIOwCIHBBGmY/Kh+lOwPMZU4Uyk d54jwfAlnRW/zBQmBtfX2kbt7AYctyezpEyQEM56GRmJh5VfTtklM0WXp9JEnJSlFkFd upg9J/lAbTJA/sKSLc3d02mU2GIu4PIFSftAip4HcdPJCP5EE9GwoNGatqR4TffhRQ4W vIPV0CMsv8mAaGbE/NajfVCOI373xOYx0Lnhjz0d9/fsmIVLaPM5GwxzhBMSEnRMKTrk Irxw== 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=6cK4Ns4WODftOp3PYM2rl8PHMJ8VnC7sTnYn6hT97bU=; b=B9u0pH65Y1sjg28AKZLufZiHo53kZYmD1ojNS3ZxZC/oWs4kmSRg7o07pQHnJSz1Ex Mk0xYROHFEgdtBLB11/ejprsTnAaa5MwaGuJXrfHx6qrH9eKLsdWM6bB1rsuyDJGeMdF Uth2JxYMil6DGRh0d3beFeS0irBY28103HUs9yPeA3mo6R3cKJpnD2xRFe610+gSCaHN aRroaxynzABo//GDxVA+LVo0RpeVet03gzhWJVu83mXlCta7vY3kv3CmYH4lCBqzU+cS NwDMsmb0I7x9nIixA01AcwuuwrlVd58/u2fkp7l/Z3qCC/Zn320uhjSzQifzivdf0/66 NE9w== 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 18si1188422oin.182.2020.03.19.08.11.18; Thu, 19 Mar 2020 08:11:43 -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 S1728077AbgCSPJG (ORCPT + 99 others); Thu, 19 Mar 2020 11:09:06 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:5956 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726912AbgCSPJG (ORCPT ); Thu, 19 Mar 2020 11:09:06 -0400 IronPort-SDR: Amn3w9kvJCY9IGucDbC/S6ntif9zKsG1WCyIhjyvxXqbcpi3BxAPMUp96fOvkeSSG5gmwnpglS STULuLssD/H927p9RGe341Rttv0XeZVUXfQfYmeONqG8WGe12zOvHgpMc5JDVqeJeagvY+3uUr S1aynOznvosnE9m6XOi2kwfAtA8froZCPBUf9bhL+8gZncNFg11/0gaWJOy6/wRoKoeMiAoFtF BPZkasYSRFaL+vvKR2a6mwHHoIqgVATze2WjBlzpj9SK4264rFWlDE3JtIhus6Uc0yNDysmQcY 0e4= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="46926859" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:01:36 -0800 IronPort-SDR: +FOnKRzCPSsw49JPLxcC5GqTzcUHT7kOftklaPsUwd3J9WicnG0u60PAWq/LqQ6zUThSrcHvAo uYkkRpYfjlaunoIFB4WAJX9co8YgQ5a5j5orF07UGvbE/rkO3wG8yV9PIo5qnEWGXvNg24LlVE 4Idwf35ogDGGrlI8/IxyJSdd5l0aKrUjwHs8w8tjMJ8QhoA2Bps8BYd5nIVgSsYLdBTUj1S1mm o5powKlRhSpcafkR29VsEyFpmuTUKsvvUZcOMFLJY/TJz/JADqmSFMy8r40M6ZlJTkX3qLnkcQ bcA= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 19/52] Input: atmel_mxt_ts - allow input name to be specified in platform data Date: Thu, 19 Mar 2020 07:59:43 -0700 Message-ID: <20200319150016.61398-20-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319150016.61398-1-jiada_wang@mentor.com> References: <20200319150016.61398-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 3ef98e14c94e..c884c254ad2d 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