From patchwork Fri May 8 05:56:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11535625 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 A8DB0913 for ; Fri, 8 May 2020 06:00:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A34020736 for ; Fri, 8 May 2020 06:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728341AbgEHGAU (ORCPT ); Fri, 8 May 2020 02:00:20 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:38783 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbgEHGAS (ORCPT ); Fri, 8 May 2020 02:00:18 -0400 IronPort-SDR: enc+2YIacoKSQ0MflvY7GQwYfg5JC8NkPtN+0P7iXrRkeU8N3xh0yX3DqX1DZYP+zqyUQq+wGR XrUkTUfnRoVb8Vmajs63hOZLxsauwYGzXswiLp+inN7/sWIHGdwgdBEy3rakhG5nzHK3bwk8LE hDuzVGtiQta+2RoEGvAcqfQJzKHntiGCGyg1KJ9Dr0TlJ6lett4QJ6JpDscvOHPvvnQwVqZqTB ddyt8dT04lj8Ft4BHqnRPcq2gC9OtpdmVT0ePJJi4iN9+EKZKWtM08JKcHxkh38hjIjcfq7IHw VIY= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="50670179" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 07 May 2020 22:00:16 -0800 IronPort-SDR: S+uGaswKwNUwfZgUd4ZVN3StrEB+ElB7K608YOL3bzvDVeXxufi6kSH8w0HrKmSfTW3XIsDIk2 TmQ2AoYEd6/meblGfaMGrms1L63Q/ih5WwBfSKjUk2SnZY7M/CnZEVZK3fh/XY5DUugcMzL8Kp 7Pw4YzszPdp3TNu7sSqX2T9CnQKY66kyHphzQH2ltIowXafEgZeRrTqYvxsIoeRSQ3SKwI/08h NcMPBqk02bdYM39A9jUWRLwugwPGC44OLA081/v3sFLhRy8leTP/JZqPfKmP98wLUIbAAOFPIs Pa8= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 52/56] Input: atmel_mxt_ts: use gpiod_set_value_cansleep for reset pin Date: Thu, 7 May 2020 22:56:52 -0700 Message-ID: <20200508055656.96389-53-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508055656.96389-1-jiada_wang@mentor.com> References: <20200508055656.96389-1-jiada_wang@mentor.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Balasubramani Vivekanandan In case of remote display, touch controller will be also remote. In such cases, the reset pin of the touch controller will be controlled through bridging ICs like Deserilizer and Serializer. Therefore accessing the gpio pins require transactions with the external IC. Using the function gpiod_set_value will print a warning like below WARNING: CPU: 0 PID: 576 at drivers/gpio/gpiolib.c:1441 gpiod_set_value+0x34/0x60() CPU: 0 PID: 576 Comm: modprobe Not tainted 3.14.79-08377-g84ea22f-dirty #4 Backtrace: [<80011c58>] (dump_backtrace) from [<80011e60>] (show_stack+0x18/0x1c) [<80011e48>] (show_stack) from [<8052d7ac>] (dump_stack+0x7c/0x9c) [<8052d730>] (dump_stack) from [<800241bc>] (warn_slowpath_common+0x74/0x9c) [<80024148>] (warn_slowpath_common) from [<80024288>] (warn_slowpath_null+0x24/0x2c) [<80024264>] (warn_slowpath_null) from [<8029e070>] (gpiod_set_value+0x34/0x60) [<8029e03c>] (gpiod_set_value) from [<7f492e98>] (mxt_probe+0x1e0/0x718 [atmel_mxt_ts]) [<7f492cb8>] (mxt_probe [atmel_mxt_ts]) from [<803c4d34>] (i2c_device_probe+0xcc/0xec) [<803c4c68>] (i2c_device_probe) from [<803252a0>] (driver_probe_device+0xc0/0x200) Signed-off-by: Balasubramani Vivekanandan Signed-off-by: Vladimir Zapolskiy Signed-off-by: Sanjeev Chugh Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index d134a8b9b3ca..20d6ada778e5 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2476,7 +2476,7 @@ static void mxt_regulator_enable(struct mxt_data *data) if (!data->reg_vdd || !data->reg_avdd) return; - gpiod_set_value(data->reset_gpio, 0); + gpiod_set_value_cansleep(data->reset_gpio, 0); error = regulator_enable(data->reg_vdd); if (error) @@ -2494,7 +2494,7 @@ static void mxt_regulator_enable(struct mxt_data *data) * voltage */ msleep(MXT_REGULATOR_DELAY); - gpiod_set_value(data->reset_gpio, 1); + gpiod_set_value_cansleep(data->reset_gpio, 1); msleep(MXT_CHG_DELAY); retry_wait: @@ -4305,7 +4305,7 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id) disable_irq(data->irq); } else if (data->reset_gpio) { msleep(MXT_RESET_GPIO_TIME); - gpiod_set_value(data->reset_gpio, 1); + gpiod_set_value_cansleep(data->reset_gpio, 1); msleep(MXT_RESET_INVALID_CHG); } else { dev_dbg(&client->dev,