Re: [PATCH] media: i2c: ar0521: Use cansleep version of gpiod_set_value()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexander,

Alexander Shiyan <eagle.alexander923@xxxxxxxxx> writes:

> If we use GPIO reset from I2C port expander, we must use *_cansleep()
> variant of GPIO functions.
> This was not done in ar0521_power_on()/ar0521_power_off() functions.
> Let's fix that.

Definitely.

> Signed-off-by: Alexander Shiyan <eagle.alexander923@xxxxxxxxx>
> Fixes: 852b50aeed15 ("media: On Semi AR0521 sensor driver")
> Cc: stable@xxxxxxxxxxxxxxx

Acked-by: Krzysztof Hałasa <khalasa@xxxxxxx>

> +++ b/drivers/media/i2c/ar0521.c
> @@ -844,7 +844,8 @@ static int ar0521_power_off(struct device *dev)
>         clk_disable_unprepare(sensor->extclk);
>
>         if (sensor->reset_gpio)
> -               gpiod_set_value(sensor->reset_gpio, 1); /* assert RESET signal */
> +               /* assert RESET signal */
> +               gpiod_set_value_cansleep(sensor->reset_gpio, 1);
>
>         for (i = ARRAY_SIZE(ar0521_supply_names) - 1; i >= 0; i--) {
>                 if (sensor->supplies[i])
> @@ -878,7 +879,7 @@ static int ar0521_power_on(struct device *dev)
>
>         if (sensor->reset_gpio)
>                 /* deassert RESET signal */
> -               gpiod_set_value(sensor->reset_gpio, 0);
> +               gpiod_set_value_cansleep(sensor->reset_gpio, 0);
>         usleep_range(4500, 5000); /* min 45000 clocks */
>
>         for (cnt = 0; cnt < ARRAY_SIZE(initial_regs); cnt++) {

-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux