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

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

 



Hi Prabhakar,

On Tuesday 10 March 2015 18:29:22 Lad, Prabhakar wrote:
> On Sun, Mar 8, 2015 at 1:40 PM, Laurent Pinchart 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

[snip]

> > @@ -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.

The gpiod_ API will take the GPIO active-low flag into account, so the above 
gpiod_set_value(0) call will set the GPIO level to 1.

-- 
Regards,

Laurent Pinchart

--
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