Re: [PATCH] v4l: mt9p031: Convert to the gpiod API

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

 



Hi Laurent,

Thanks for the patch.

On Sun, Mar 8, 2015 at 1:40 PM, Laurent Pinchart
<laurent.pinchart@xxxxxxxxxxxxxxxx> wrote:
> This simplifies platform data and DT integration.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> ---
>  drivers/media/i2c/mt9p031.c | 31 +++++++++++--------------------
>  include/media/mt9p031.h     |  2 --
>  2 files changed, 11 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index 89ae2b4..1757ef6 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -15,12 +15,11 @@
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/device.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/i2c.h>
>  #include <linux/log2.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_gpio.h>
>  #include <linux/of_graph.h>
>  #include <linux/pm.h>
>  #include <linux/regulator/consumer.h>
> @@ -136,7 +135,7 @@ struct mt9p031 {
>         struct aptina_pll pll;
>         unsigned int clk_div;
>         bool use_pll;
> -       int reset;
> +       struct gpio_desc *reset;
>
>         struct v4l2_ctrl_handler ctrls;
>         struct v4l2_ctrl *blc_auto;
> @@ -309,9 +308,9 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
>  {
>         int ret;
>
> -       /* Ensure RESET_BAR is low */
> -       if (gpio_is_valid(mt9p031->reset)) {
> -               gpio_set_value(mt9p031->reset, 0);
> +       /* Ensure RESET_BAR is active */
> +       if (mt9p031->reset) {
> +               gpiod_set_value(mt9p031->reset, 1);
>                 usleep_range(1000, 2000);
>         }
>
> @@ -332,8 +331,8 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
>         }
>
>         /* Now RESET_BAR must be high */
> -       if (gpio_is_valid(mt9p031->reset)) {
> -               gpio_set_value(mt9p031->reset, 1);
> +       if (mt9p031->reset) {
> +               gpiod_set_value(mt9p031->reset, 0);
>                 usleep_range(1000, 2000);
>         }
>
As per the data sheet reset needs to be low initially and then high,
you just reversed it.

Thanks,
--Prabhakar Lad
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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