[PATCH 07/13] gpio: msm_gpio: add .set_flags op
Dan Carpenter
dan.carpenter at linaro.org
Wed Jan 31 16:35:02 CET 2024
On Wed, Jan 31, 2024 at 03:16:59PM +0000, Caleb Connolly wrote:
> diff --git a/drivers/gpio/msm_gpio.c b/drivers/gpio/msm_gpio.c
> index 80cd28bb231f..0230305af299 100644
> --- a/drivers/gpio/msm_gpio.c
> +++ b/drivers/gpio/msm_gpio.c
> @@ -72,6 +72,23 @@ static int msm_gpio_direction_output(struct udevice *dev, unsigned int gpio,
> return 0;
> }
>
> +static int msm_gpio_set_flags(struct udevice *dev, unsigned int gpio, ulong flags)
> +{
> + if (flags & GPIOD_IS_OUT_ACTIVE) {
> + return msm_gpio_direction_output(dev, gpio, 1);
> + } else if (flags & GPIOD_IS_OUT) {
> + return msm_gpio_direction_output(dev, gpio, 0);
> + } else if (flags & GPIOD_IS_IN) {
> + return msm_gpio_direction_input(dev, gpio);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> + if (flags & GPIOD_PULL_UP)
> + return msm_gpio_set_value(dev, gpio, 1);
> + else if (flags & GPIOD_PULL_DOWN)
> + return msm_gpio_set_value(dev, gpio, 0);
These lines are unreachable code.
> + }
> +
> + return 0;
> +}
regards,
dan carpenter
More information about the U-Boot
mailing list