Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp69456pxb; Tue, 21 Sep 2021 19:01:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRAkZNHNBeBlDryZ8QOdKvkb+wIky2svsnW2+RZ0ahqeGMbyh1AvUQr17t5PzSaATcWh2V X-Received: by 2002:a6b:7710:: with SMTP id n16mr2394988iom.101.1632276106784; Tue, 21 Sep 2021 19:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632276106; cv=none; d=google.com; s=arc-20160816; b=zu0o9SuS3T3jYPojbW0VbEF++g0v8yBX4ajyAAdMK4kJb8FZezo21YZZAiivtNqlpK hr9Q9Ramxcr4w9T7mFLMtqo5AEYnUG+xwJJQCUVUnJnCOZbOnNRNXYmwn6/AW3CToF34 WMtpMxSShVbvadQHbg2UypxynLtNWcYc+p4jBZOF+obiZPJJ8eS9i0k0zcjKtShVstWm sOEnrWv65u8YnCbCg2jBXl1CaWjva/MVPgiyjDkXMuWsxIMgthl+IeqwBZw7ELi2RQkV 8cHXL7NuWjqsBjHVo6j6w9qyWek+GZVXbOZIgk8glKKiFAaUQNeU9es6Ybl2Xw5lmPhp G38w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=i6tk9/R5e/Ojy6WWFzxM+f+lVDyX3vnnXj9ScwFQosA=; b=YH/ZflZoKbw3mx0WI70M/Uj+V+E3hyBP+LBJ21PJ/+dTGzX265pzz4myHUyYbpcNMa iLV7pJVJ1Zmlz+fTNH2v9Iee7nSjz6qeX8lXr6Kg5OkLW4aLhEhxqoXJ9znIQmgFQ71+ S+pJ/KY7Vt+ugSlaiFK4zqizr7NjarDdk5KwvvoqGmGT+IA0ZQQgczcmhweJd7nRrklm KR+1Ql6K2RF6cLKglv2Mzm5orZWgG/rry7IidKkRR6eXD4V/1JHNu3PmpZ1VTPl4tyYm BFDDuLQWTWJ45QW6FQPtWVZH/6i4w1hPX20YXP0Ly5HWWfb64N3SjGDHacPyMx7JFuLg DREA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iKwHVJeD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i22si715280jaj.107.2021.09.21.19.01.35; Tue, 21 Sep 2021 19:01:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iKwHVJeD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235804AbhIUVzf (ORCPT + 99 others); Tue, 21 Sep 2021 17:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235754AbhIUVyz (ORCPT ); Tue, 21 Sep 2021 17:54:55 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2980C0613C1 for ; Tue, 21 Sep 2021 14:53:23 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id y201so1342734oie.3 for ; Tue, 21 Sep 2021 14:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=i6tk9/R5e/Ojy6WWFzxM+f+lVDyX3vnnXj9ScwFQosA=; b=iKwHVJeDUTwT7OoRAPKQahj97WQjqdqoLeQy2o0iK3/oDZZzglw6URXU53MAvCzhs7 1DCiY7elhL2tOG6hUN1E/+Xs98WB4S0j+0Z/Bxk7ueC1qtVy4+SXoQC+YHRTdADNBzFf Jb6QbevDqyX/VTVNohTkAfRNq9TrDPUm2WdpxfU/dkJIi5dzrMIVJc/VxUUJ7df4JK3T 16wr7W7IDPyiNtbomZaIEKM531sKQxlJ5mQ7pU3iKWsBasXxrcAHR6By6ABt5N9lMZLn KfMbEzoJrMxMSIsAkb1pvbUwT+hFVx/DhfgZR08jaGztY7Rr/w/ISgCY2lXF0qzldBcp blZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=i6tk9/R5e/Ojy6WWFzxM+f+lVDyX3vnnXj9ScwFQosA=; b=qidrDVNizDAcB+7xcyA89AL+flFwSNogrNVAPiKIgthouWf2mYAHUYHu/TeZCuNvsS MLzK6KigylU/i1U59v0nSDRL399duxK3DG7ExGimIKspE3MyZQMouGR87yKf+gPUlMGB cnZuOEJicpkw+7Mxd+/lf0h7A5bb7Up8HYfL4L5s1B3cpQeJe2TZDcNVNvJVLssKmVG5 QFaowqGQNok9YJWgVRKOOPjqZvHCHIvi2UgrzjiHwrz8N/LGQ1EOeZFe9uyg5Ppa8xLn BlM/LvEIXtOXo6MyukD31ndb2hpP4+8AtYfTmaGD5RhDh4/ol2lwaGwyVrUAxHzzs8h4 JxSg== X-Gm-Message-State: AOAM531syfS/Wpk/wbhmbagD/qW0nhxrytzVTfhe3Oaggj+LwSmPFo1+ XhGhtIeVmEbI7k3a+7sSg46l/A== X-Received: by 2002:aca:b6d5:: with SMTP id g204mr5530134oif.29.1632261203217; Tue, 21 Sep 2021 14:53:23 -0700 (PDT) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id u27sm71423otj.6.2021.09.21.14.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 14:53:22 -0700 (PDT) Date: Tue, 21 Sep 2021 16:53:21 -0500 From: Bjorn Andersson To: Subbaraman Narayanamurthy Cc: Andy Gross , Linus Walleij , Rob Herring , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] pinctrl: qcom: spmi-gpio: add support to enable/disable output Message-ID: References: <1631588246-4811-1-git-send-email-quic_subbaram@quicinc.com> <1631588246-4811-3-git-send-email-quic_subbaram@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1631588246-4811-3-git-send-email-quic_subbaram@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 13 Sep 21:57 CDT 2021, Subbaraman Narayanamurthy wrote: > Currently, if the GPIO is configured as output in the bootloader > and user changes the mode to input in HLOS, it would end up > getting configured as input/output. Functionally, this is fine; > however, there may be some requirements where the output needs > to be disabled so that it can be used only for input. > > Add support to enable/disable output mode through "output-enable" > or "output-disable" pinctrl properties. > > Signed-off-by: Subbaraman Narayanamurthy Reviewed-by: Bjorn Andersson Regards, Bjorn > --- > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > index 98bf0e2..39a18aa 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0-only > /* > - * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. > + * Copyright (c) 2012-2014, 2021, The Linux Foundation. All rights reserved. > */ > > #include > @@ -424,6 +424,9 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev, > return -EINVAL; > arg = 1; > break; > + case PIN_CONFIG_OUTPUT_ENABLE: > + arg = pad->output_enabled; > + break; > case PIN_CONFIG_OUTPUT: > arg = pad->out_value; > break; > @@ -503,6 +506,9 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin, > case PIN_CONFIG_INPUT_ENABLE: > pad->input_enabled = arg ? true : false; > break; > + case PIN_CONFIG_OUTPUT_ENABLE: > + pad->output_enabled = arg ? true : false; > + break; > case PIN_CONFIG_OUTPUT: > pad->output_enabled = true; > pad->out_value = arg; > -- > 2.7.4 >