* [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs
@ 2016-01-08 20:25 Stephen Boyd
2016-01-11 4:33 ` Andy Gross
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Boyd @ 2016-01-08 20:25 UTC (permalink / raw)
To: linux-arm-kernel
The ULT type of MPPs don't have a pullup. Skip configuring the
pullup on these types of pins.
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 2f18323571a6..2a3e5490a483 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -117,6 +117,7 @@
* @output_enabled: Set to true if MPP output logic is enabled.
* @input_enabled: Set to true if MPP input buffer logic is enabled.
* @paired: Pin operates in paired mode
+ * @has_pullup: Pin has support to configure pullup
* @num_sources: Number of power-sources supported by this MPP.
* @power_source: Current power-source used.
* @amux_input: Set the source for analog input.
@@ -134,6 +135,7 @@ struct pmic_mpp_pad {
bool output_enabled;
bool input_enabled;
bool paired;
+ bool has_pullup;
unsigned int num_sources;
unsigned int power_source;
unsigned int amux_input;
@@ -477,11 +479,14 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
if (ret < 0)
return ret;
- val = pad->pullup << PMIC_MPP_REG_PULL_SHIFT;
+ if (pad->has_pullup) {
+ val = pad->pullup << PMIC_MPP_REG_PULL_SHIFT;
- ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_PULL_CTL, val);
- if (ret < 0)
- return ret;
+ ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_PULL_CTL,
+ val);
+ if (ret < 0)
+ return ret;
+ }
val = pad->amux_input & PMIC_MPP_REG_AIN_ROUTE_MASK;
@@ -534,7 +539,8 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
seq_printf(s, " %-7s", pmic_mpp_functions[pad->function]);
seq_printf(s, " vin-%d", pad->power_source);
seq_printf(s, " %d", pad->aout_level);
- seq_printf(s, " %-8s", biases[pad->pullup]);
+ if (pad->has_pullup)
+ seq_printf(s, " %-8s", biases[pad->pullup]);
seq_printf(s, " %-4s", pad->out_value ? "high" : "low");
if (pad->dtest)
seq_printf(s, " dtest%d", pad->dtest);
@@ -748,12 +754,16 @@ static int pmic_mpp_populate(struct pmic_mpp_state *state,
pad->power_source = val >> PMIC_MPP_REG_VIN_SHIFT;
pad->power_source &= PMIC_MPP_REG_VIN_MASK;
- val = pmic_mpp_read(state, pad, PMIC_MPP_REG_DIG_PULL_CTL);
- if (val < 0)
- return val;
+ if (subtype != PMIC_MPP_SUBTYPE_ULT_4CH_NO_ANA_OUT &&
+ subtype != PMIC_MPP_SUBTYPE_ULT_4CH_NO_SINK) {
+ val = pmic_mpp_read(state, pad, PMIC_MPP_REG_DIG_PULL_CTL);
+ if (val < 0)
+ return val;
- pad->pullup = val >> PMIC_MPP_REG_PULL_SHIFT;
- pad->pullup &= PMIC_MPP_REG_PULL_MASK;
+ pad->pullup = val >> PMIC_MPP_REG_PULL_SHIFT;
+ pad->pullup &= PMIC_MPP_REG_PULL_MASK;
+ pad->has_pullup = true;
+ }
val = pmic_mpp_read(state, pad, PMIC_MPP_REG_AIN_CTL);
if (val < 0)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs
2016-01-08 20:25 [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs Stephen Boyd
@ 2016-01-11 4:33 ` Andy Gross
2016-01-14 8:52 ` Linus Walleij
2016-01-27 14:07 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Andy Gross @ 2016-01-11 4:33 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jan 08, 2016 at 12:25:53PM -0800, Stephen Boyd wrote:
> The ULT type of MPPs don't have a pullup. Skip configuring the
> pullup on these types of pins.
>
> Cc: Andy Gross <andy.gross@linaro.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs
2016-01-08 20:25 [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs Stephen Boyd
2016-01-11 4:33 ` Andy Gross
@ 2016-01-14 8:52 ` Linus Walleij
2016-01-27 14:07 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-01-14 8:52 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jan 8, 2016 at 9:25 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> The ULT type of MPPs don't have a pullup. Skip configuring the
> pullup on these types of pins.
>
> Cc: Andy Gross <andy.gross@linaro.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
I take it that this is not a regression so it will have to wait until
kernel v4.6 at this point. I will queue new patches after the merge
window, if I forget it please remind me.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs
2016-01-08 20:25 [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs Stephen Boyd
2016-01-11 4:33 ` Andy Gross
2016-01-14 8:52 ` Linus Walleij
@ 2016-01-27 14:07 ` Linus Walleij
2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-01-27 14:07 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jan 8, 2016 at 9:25 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> The ULT type of MPPs don't have a pullup. Skip configuring the
> pullup on these types of pins.
>
> Cc: Andy Gross <andy.gross@linaro.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Patch applied with Andy's review tag.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-27 14:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-08 20:25 [PATCH] pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs Stephen Boyd
2016-01-11 4:33 ` Andy Gross
2016-01-14 8:52 ` Linus Walleij
2016-01-27 14:07 ` Linus Walleij
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).