Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3366897ybb; Tue, 31 Mar 2020 03:55:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvv69yN2pegwSQ7TA0RVlT9f4QYYS17XU1QMXOQeSmE5INZTxQozjHkJex/+Vop9w8qoK4O X-Received: by 2002:a9d:3d65:: with SMTP id a92mr11554135otc.326.1585652124906; Tue, 31 Mar 2020 03:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585652124; cv=none; d=google.com; s=arc-20160816; b=l4zOLonWpB1b4b552vhxV3AbX+esOkdGb63z6OAj12/yqSvXAd/8vE4F90k0CZNQ1L CcRN7xu3oCqFG1WI8B3ZFAP9TgR2IZMz9iSAuM6RO7wZSpeZBzWfnBXI9UKnF6y5Ck/S ZXQXyljdbvfd/40BR1jyYkLpZH89aaOV2S5h/oUjxMafpHHJH2Em4sTUx2zhWpk2rUr/ 6raO9JJRMf2G/s3mvyjlArCidqMHe2V0fOKeenPVlk5ankCaWmLDl0ylG5DMjj5nbqcM JsRlPAA1xAftBCuA/I6KYOGkVTQzMrJ1fzYcnxysoHTeFw2ALtdFxLZvOqURNSFtDuO7 U7yg== 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=mDhUdTKhA3H3EgckAC8g2GjtV/I3tyQHYTbaQU4favI=; b=Zeu4RJRadaf6YWSXeftfj4RitrtvyEJFykL0KK67DXLp+ri3gwq/tNd6CCaGt1J6+l AJaorj/ebdTF5KBcuUFnnd+CqJXsMmM6jVYfWtybjLmIN/Pwjy0/EuhCIprYhqoqw2JA JkTiZIoFz65V0bfCc6PMenvIDSRdXVuVdzLeSSd/KTNzIsr3e0IBuYKPDfOkL3BkFjNh fsq3oE7W5RCdjysrVgfV377MuM697/b8IVKzNhkse/i5Pu2YWB2xH1PlUrsSiApTq/dV JKJgdXROIY5qZsv0JSeLAgyWfimnD70JLQHZO1fzuSkOAt+LMXYoWo381zsO8L/4mqbF S1ng== 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 f207si7323821oib.65.2020.03.31.03.55.13; Tue, 31 Mar 2020 03:55:24 -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 S1730906AbgCaKxZ (ORCPT + 99 others); Tue, 31 Mar 2020 06:53:25 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43597 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730426AbgCaKxY (ORCPT ); Tue, 31 Mar 2020 06:53:24 -0400 IronPort-SDR: J8JX3sESXb7yNN3hda2C3tA4bpBqE/TK35rPiPHBtEYT3AFOKCKmbnqSeu8piSo2SIHPOnbLU4 avtGniSkqGFqtKSEwj7bumL4XQ2qtZUe4XyT85s15PY+Owv7gYnepOKK9/4aBXhg2gxRlPFqc7 +yDej5FKhC4u21Sb4b/kEaNM2mLKTUd/4CZTfxZYqqU2RsWGhhJ6YcaSQUlAKPvB8XekKjUFRu c8ZERE6p9KQaL0AXY1D+NhF1nGKfIIf4aX1sE3eoT39XX9zjYpDWXOibVjPuCfY8OSagx1Q2S6 CbM= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330822" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:53:24 -0800 IronPort-SDR: 42v7p3t7yIVCpzJt2ENQU1YFWZjoKthTSWkiKSxUGxeyd2bptu6jscayHqlGk6WR409rzV2c9k k7n6RaJNTNHilXLfQjyRDxQnGXhhQvw+jRd8KmRo2xJY53DnsxvIYfSZr+OkCp/m4ZmbRPb+g3 Hv8GavJ2IbhtpkEIcmjFyWcoVz12qSCRGfV1KEN4vNcTZhI/qsWuEPzMabdBNdUkNUG8u4qu18 IGuRBe8lfUxxphNQMYx+3X7gaj84KafxdGLYxsQ9sJSQm4UAaNVVFzrRwrJzLmkGTE/cL2F2To emE= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 39/55] input: atmel_mxt_ts: export GPIO reset line via sysfs Date: Tue, 31 Mar 2020 03:50:35 -0700 Message-ID: <20200331105051.58896-40-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: "George G. Davis" N.B. Modifying the atmel_mxt_ts GPIO reset line during operation will cause problems with normal driver operation. This feature is provided as a diagnostic debug aid. It does not take into consideration any pending operations which may be in progress. Modifying the atmel_mxt_ts GPIO reset line at any time will inevitably cause the driver to fail. Signed-off-by: George G. Davis Signed-off-by: Rajeev Kumar Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 11e65f32b1a2..cfeeacdd4084 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -4091,6 +4091,19 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) return error; } + if (data->reset_gpio) { + error = gpiod_export(data->reset_gpio, 0); + if (error) + return error; + + error = gpiod_export_link(&client->dev, "reset", + data->reset_gpio); + if (error) { + gpiod_unexport(data->reset_gpio); + return error; + } + } + if (data->suspend_mode == MXT_SUSPEND_REGULATOR) { error = mxt_acquire_irq(data); if (error) @@ -4123,6 +4136,10 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) err_free_object: mxt_free_input_device(data); mxt_free_object_table(data); + if (data->reset_gpio) { + sysfs_remove_link(&client->dev.kobj, "reset"); + gpiod_unexport(data->reset_gpio); + } return error; } @@ -4132,6 +4149,10 @@ static int mxt_remove(struct i2c_client *client) disable_irq(data->irq); sysfs_remove_group(&client->dev.kobj, &mxt_fw_attr_group); + if (data->reset_gpio) { + sysfs_remove_link(&client->dev.kobj, "reset"); + gpiod_unexport(data->reset_gpio); + } mxt_debug_msg_remove(data); mxt_sysfs_remove(data); mxt_free_input_device(data); -- 2.17.1