Skip to content

Commit

Permalink
pinctrl: axp209: add programmable ADC muxing value
Browse files Browse the repository at this point in the history
To prepare for patches that will add support for a new PMIC that has a
different GPIO adc muxing value, add an adc_mux within axp20x_pctl
structure and use it.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Quentin Schulz authored and Linus Walleij committed Dec 7, 2017
1 parent 48e706f commit a0a4b4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pinctrl/pinctrl-axp209.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct axp20x_pctrl_desc {
/* Stores the pins supporting ADC function. Bit offset is pin number. */
u8 adc_mask;
u8 gpio_status_offset;
u8 adc_mux;
};

struct axp20x_pinctrl_function {
Expand Down Expand Up @@ -79,6 +80,7 @@ static const struct axp20x_pctrl_desc axp20x_data = {
.ldo_mask = BIT(0) | BIT(1),
.adc_mask = BIT(0) | BIT(1),
.gpio_status_offset = 4,
.adc_mux = AXP20X_MUX_ADC,
};

static int axp20x_gpio_get_reg(unsigned int offset)
Expand Down Expand Up @@ -334,7 +336,7 @@ static void axp20x_build_funcs_groups(struct platform_device *pdev)
* See comment in axp20x_pmx_set_mux.
*/
pctl->funcs[AXP20X_FUNC_ADC].name = "adc";
pctl->funcs[AXP20X_FUNC_ADC].muxval = AXP20X_MUX_ADC;
pctl->funcs[AXP20X_FUNC_ADC].muxval = pctl->desc->adc_mux;

/* Every pin supports GPIO_OUT and GPIO_IN functions */
for (i = 0; i <= AXP20X_FUNC_GPIO_IN; i++) {
Expand Down

0 comments on commit a0a4b4c

Please sign in to comment.