Commit ae6d54fd authored by Stephen Boyd's avatar Stephen Boyd Committed by Linus Walleij

pinctrl: qcom: spmi-mpp: Skip pullup on ULT type MPPs

The ULT type of MPPs don't have a pullup. Skip configuring the
pullup on these types of pins.

Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Reviewed-by: default avatarAndy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 23c3960d
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
* @output_enabled: Set to true if MPP output logic is enabled. * @output_enabled: Set to true if MPP output logic is enabled.
* @input_enabled: Set to true if MPP input buffer logic is enabled. * @input_enabled: Set to true if MPP input buffer logic is enabled.
* @paired: Pin operates in paired mode * @paired: Pin operates in paired mode
* @has_pullup: Pin has support to configure pullup
* @num_sources: Number of power-sources supported by this MPP. * @num_sources: Number of power-sources supported by this MPP.
* @power_source: Current power-source used. * @power_source: Current power-source used.
* @amux_input: Set the source for analog input. * @amux_input: Set the source for analog input.
...@@ -134,6 +135,7 @@ struct pmic_mpp_pad { ...@@ -134,6 +135,7 @@ struct pmic_mpp_pad {
bool output_enabled; bool output_enabled;
bool input_enabled; bool input_enabled;
bool paired; bool paired;
bool has_pullup;
unsigned int num_sources; unsigned int num_sources;
unsigned int power_source; unsigned int power_source;
unsigned int amux_input; unsigned int amux_input;
...@@ -477,11 +479,14 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin, ...@@ -477,11 +479,14 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (pad->has_pullup) {
val = pad->pullup << PMIC_MPP_REG_PULL_SHIFT; val = pad->pullup << PMIC_MPP_REG_PULL_SHIFT;
ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_PULL_CTL, val); ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_DIG_PULL_CTL,
val);
if (ret < 0) if (ret < 0)
return ret; return ret;
}
val = pad->amux_input & PMIC_MPP_REG_AIN_ROUTE_MASK; val = pad->amux_input & PMIC_MPP_REG_AIN_ROUTE_MASK;
...@@ -534,6 +539,7 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev, ...@@ -534,6 +539,7 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
seq_printf(s, " %-7s", pmic_mpp_functions[pad->function]); seq_printf(s, " %-7s", pmic_mpp_functions[pad->function]);
seq_printf(s, " vin-%d", pad->power_source); seq_printf(s, " vin-%d", pad->power_source);
seq_printf(s, " %d", pad->aout_level); seq_printf(s, " %d", pad->aout_level);
if (pad->has_pullup)
seq_printf(s, " %-8s", biases[pad->pullup]); seq_printf(s, " %-8s", biases[pad->pullup]);
seq_printf(s, " %-4s", pad->out_value ? "high" : "low"); seq_printf(s, " %-4s", pad->out_value ? "high" : "low");
if (pad->dtest) if (pad->dtest)
...@@ -748,12 +754,16 @@ static int pmic_mpp_populate(struct pmic_mpp_state *state, ...@@ -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 = val >> PMIC_MPP_REG_VIN_SHIFT;
pad->power_source &= PMIC_MPP_REG_VIN_MASK; pad->power_source &= PMIC_MPP_REG_VIN_MASK;
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); val = pmic_mpp_read(state, pad, PMIC_MPP_REG_DIG_PULL_CTL);
if (val < 0) if (val < 0)
return val; return val;
pad->pullup = val >> PMIC_MPP_REG_PULL_SHIFT; pad->pullup = val >> PMIC_MPP_REG_PULL_SHIFT;
pad->pullup &= PMIC_MPP_REG_PULL_MASK; pad->pullup &= PMIC_MPP_REG_PULL_MASK;
pad->has_pullup = true;
}
val = pmic_mpp_read(state, pad, PMIC_MPP_REG_AIN_CTL); val = pmic_mpp_read(state, pad, PMIC_MPP_REG_AIN_CTL);
if (val < 0) if (val < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment