pinctrl/rockchip: support setting input-enable param
commit 42d90a1e5caf73138ddde42da5a9fe2b543f9a2c upstream. Handle the PIN_CONFIG_INPUT_ENABLE param for configuring GPIOs as input. Signed-off-by: Caleb Connolly <kc@postmarketos.org> Link: https://lore.kernel.org/r/20220328005005.72492-3-kc@postmarketos.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2027647245
commit
97a40c2201
@@ -2141,7 +2141,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||||||
param = pinconf_to_config_param(configs[i]);
|
param = pinconf_to_config_param(configs[i]);
|
||||||
arg = pinconf_to_config_argument(configs[i]);
|
arg = pinconf_to_config_argument(configs[i]);
|
||||||
|
|
||||||
if (param == (PIN_CONFIG_OUTPUT | PIN_CONFIG_INPUT_ENABLE)) {
|
if (param == PIN_CONFIG_OUTPUT || param == PIN_CONFIG_INPUT_ENABLE) {
|
||||||
/*
|
/*
|
||||||
* Check for gpio driver not being probed yet.
|
* Check for gpio driver not being probed yet.
|
||||||
* The lock makes sure that either gpio-probe has completed
|
* The lock makes sure that either gpio-probe has completed
|
||||||
@@ -2193,6 +2193,16 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
break;
|
break;
|
||||||
|
case PIN_CONFIG_INPUT_ENABLE:
|
||||||
|
rc = rockchip_set_mux(bank, pin - bank->pin_base,
|
||||||
|
RK_FUNC_GPIO);
|
||||||
|
if (rc != RK_FUNC_GPIO)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
rc = gpio->direction_input(gpio, pin - bank->pin_base);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
break;
|
||||||
case PIN_CONFIG_DRIVE_STRENGTH:
|
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||||
/* rk3288 is the first with per-pin drive-strength */
|
/* rk3288 is the first with per-pin drive-strength */
|
||||||
if (!info->ctrl->drv_calc_reg)
|
if (!info->ctrl->drv_calc_reg)
|
||||||
|
|||||||
Reference in New Issue
Block a user