mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
pinctrl: as3722: Set pin to output mode for some function
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]> Acked-by: Lee Jones <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
8385af02ba
commit
f8720e5ec7
2 changed files with 21 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue