diff options
author | Quentin Schulz <quentin.schulz@free-electrons.com> | 2017-12-05 09:46:45 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-12-07 04:07:45 -0500 |
commit | a0a4b4c2420e0af6171a2be1965bdd983d35953c (patch) | |
tree | 93f37900d4b602f2a48a00fde8443fc45e0386f5 /drivers/pinctrl/pinctrl-axp209.c | |
parent | 48e706fbc546d63148a762aadf92f412eefe8b8e (diff) |
pinctrl: axp209: add programmable ADC muxing value
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>
Diffstat (limited to 'drivers/pinctrl/pinctrl-axp209.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-axp209.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-axp209.c b/drivers/pinctrl/pinctrl-axp209.c index db8e319b6e11..9bb8722ba90f 100644 --- a/drivers/pinctrl/pinctrl-axp209.c +++ b/drivers/pinctrl/pinctrl-axp209.c | |||
@@ -49,6 +49,7 @@ struct axp20x_pctrl_desc { | |||
49 | /* Stores the pins supporting ADC function. Bit offset is pin number. */ | 49 | /* Stores the pins supporting ADC function. Bit offset is pin number. */ |
50 | u8 adc_mask; | 50 | u8 adc_mask; |
51 | u8 gpio_status_offset; | 51 | u8 gpio_status_offset; |
52 | u8 adc_mux; | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | struct axp20x_pinctrl_function { | 55 | struct axp20x_pinctrl_function { |
@@ -79,6 +80,7 @@ static const struct axp20x_pctrl_desc axp20x_data = { | |||
79 | .ldo_mask = BIT(0) | BIT(1), | 80 | .ldo_mask = BIT(0) | BIT(1), |
80 | .adc_mask = BIT(0) | BIT(1), | 81 | .adc_mask = BIT(0) | BIT(1), |
81 | .gpio_status_offset = 4, | 82 | .gpio_status_offset = 4, |
83 | .adc_mux = AXP20X_MUX_ADC, | ||
82 | }; | 84 | }; |
83 | 85 | ||
84 | static int axp20x_gpio_get_reg(unsigned int offset) | 86 | static int axp20x_gpio_get_reg(unsigned int offset) |
@@ -334,7 +336,7 @@ static void axp20x_build_funcs_groups(struct platform_device *pdev) | |||
334 | * See comment in axp20x_pmx_set_mux. | 336 | * See comment in axp20x_pmx_set_mux. |
335 | */ | 337 | */ |
336 | pctl->funcs[AXP20X_FUNC_ADC].name = "adc"; | 338 | pctl->funcs[AXP20X_FUNC_ADC].name = "adc"; |
337 | pctl->funcs[AXP20X_FUNC_ADC].muxval = AXP20X_MUX_ADC; | 339 | pctl->funcs[AXP20X_FUNC_ADC].muxval = pctl->desc->adc_mux; |
338 | 340 | ||
339 | /* Every pin supports GPIO_OUT and GPIO_IN functions */ | 341 | /* Every pin supports GPIO_OUT and GPIO_IN functions */ |
340 | for (i = 0; i <= AXP20X_FUNC_GPIO_IN; i++) { | 342 | for (i = 0; i <= AXP20X_FUNC_GPIO_IN; i++) { |