pinctrl: as3722: Set pin to output mode for some function
Subsystems (2)
PATCH 1/1 pinctrl: as3722: Set pin to output mode for some function
From: Mallikarjun Kasoju <[email protected]>
If pins are used for function output like pwm, clk32k, power good etc then set it as output mode default.
--- drivers/pinctrl/pinctrl-as3722.c | 20 ++++++++++++++++++++ include/linux/mfd/as3722.h | 1 + 2 files changed, 21 insertions(+)
drivers/pinctrl/pinctrl-as3722.c +20 -0
@@ -250,6 +250,26 @@ static int as3722_pinctrl_enable(struct pinctrl_dev *pctldev, unsigned function,return ret; } as_pci->gpio_control[group].io_function = function; + +switch (val) { +case AS3722_GPIO_IOSF_SD0_OUT : +case AS3722_GPIO_IOSF_PWR_GOOD_OUT : +case AS3722_GPIO_IOSF_Q32K_OUT : +case AS3722_GPIO_IOSF_PWM_OUT : +case AS3722_GPIO_IOSF_SD6_LOW_VOLT_LOW : + ret =as3722_update_bits (as_pci->as3722, gpio_cntr_reg, +AS3722_GPIO_MODE_MASK ,AS3722_GPIO_MODE_OUTPUT_VDDH ); +if (ret <0 ) { +dev_err (as_pci->dev,"GPIO%d_CTRL update failed %d\n" , + group, ret); +return ret; + } + as_pci->gpio_control[group].mode_prop = +AS3722_GPIO_MODE_OUTPUT_VDDH ; +break ; +default : +break ; + }return ret; }
include/linux/mfd/as3722.h +1 -0
@@ -316,6 +316,7 @@#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3)#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4)#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) +#define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6)#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7)#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8)#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9)
Signature · 1 line
1.7.9.5
Quoted 11 lines · Laxman Dewangan
From: Mallikarjun Kasoju <[email protected]>
If pins are used for function output like pwm, clk32k, power good etc then set it as output mode default.
Signed-off-by Mallikarjun Kasoju <[email protected]>Signed-off-by Laxman Dewangan <[email protected]>--- drivers/pinctrl/pinctrl-as3722.c | 20 ++++++++++++++++++++ include/linux/mfd/as3722.h | 1 + 2 files changed, 21 insertions(+)
For the MFD change:
Lee Jones <[email protected]>
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Lee Jones
Acked-byQuoted 12 lines
Quoted 11 lines
From: Mallikarjun Kasoju <[email protected]>
If pins are used for function output like pwm, clk32k, power good etc then set it as output mode default.
Signed-off-by Mallikarjun Kasoju <[email protected]>Signed-off-by Laxman Dewangan <[email protected]>--- drivers/pinctrl/pinctrl-as3722.c | 20 ++++++++++++++++++++ include/linux/mfd/as3722.h | 1 + 2 files changed, 21 insertions(+)
Quoted 2 lines
For the MFD change:
Lee Jones <[email protected]>
Whoops.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 7 lines · Laxman Dewangan
From: Mallikarjun Kasoju <[email protected]>
If pins are used for function output like pwm, clk32k, power good etc then set it as output mode default.
Signed-off-by Mallikarjun Kasoju <[email protected]>Signed-off-by Laxman Dewangan <[email protected]>
Patch applied with Lee's ACK.
Yours,
Linus Walleij