From: fenglinw@codeaurora.org
To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org
Cc: collinsd@codeaurora.org, aghayal@codeaurora.org,
wruan@codeaurora.org, subbaram@codeaurora.org,
kgunda@codeaurora.org, Fenglin Wu <fenglinw@codeaurora.org>
Subject: [PATCH V1] pinctrl: qcom: spmi-gpio: Update GPIO EN_CTL when setting pin config
Date: Tue, 12 Sep 2017 08:32:46 +0800 [thread overview]
Message-ID: <20170912003331.3092-1-fenglinw@codeaurora.org> (raw)
From: Fenglin Wu <fenglinw@codeaurora.org>
GPIO is expected to be disabled iff PIN_CONFIG_BIAS_HIGH_IMPEDANCE is
configured. Update is_enabled flag in config_set() so that it can
reflect GPIO status correctly. Also modify EN_CTL register based on
is_enabled flag in config_set() to configure the GPIO properly.
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
---
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index c2c0bab..a0edaa8 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -453,6 +453,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
pad = pctldev->desc->pins[pin].drv_data;
+ pad->is_enabled = true;
for (i = 0; i < nconfs; i++) {
param = pinconf_to_config_param(configs[i]);
arg = pinconf_to_config_argument(configs[i]);
@@ -600,6 +601,10 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
return ret;
}
+ val = pad->is_enabled << PMIC_GPIO_REG_MASTER_EN_SHIFT;
+
+ ret = pmic_gpio_write(state, pad, PMIC_GPIO_REG_EN_CTL, val);
+
return ret;
}
--
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
next reply other threads:[~2017-09-12 0:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 0:32 fenglinw [this message]
2017-09-19 8:20 ` [PATCH V1] pinctrl: qcom: spmi-gpio: Update GPIO EN_CTL when setting pin config Linus Walleij
2017-10-05 16:27 ` Bjorn Andersson
2017-10-09 5:34 ` Fenglin Wu
2017-10-09 5:56 ` Bjorn Andersson
2017-10-10 0:17 ` Fenglin Wu
2017-10-11 5:48 ` Bjorn Andersson
2017-10-11 8:24 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170912003331.3092-1-fenglinw@codeaurora.org \
--to=fenglinw@codeaurora.org \
--cc=aghayal@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=collinsd@codeaurora.org \
--cc=kgunda@codeaurora.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=subbaram@codeaurora.org \
--cc=wruan@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).