Re: [PATCH 5/5] iio: addac: ad74413r: add support for reset-gpio

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

 



On Mon, 2022-11-14 at 19:44 +0000, Jonathan Cameron wrote:
> On Mon, 14 Nov 2022 13:52:26 +0000
> "Tanislav, Cosmin" <Cosmin.Tanislav@xxxxxxxxxx> wrote:
> 
> > > -----Original Message-----
> > > From: Jonathan Cameron <jic23@xxxxxxxxxx>
> > > Sent: Saturday, November 12, 2022 7:07 PM
> > > To: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
> > > Cc: Tanislav, Cosmin <Cosmin.Tanislav@xxxxxxxxxx>; Lars-Peter
> > > Clausen
> > > <lars@xxxxxxxxxx>; Hennerich, Michael
> > > <Michael.Hennerich@xxxxxxxxxx>;
> > > devicetree@xxxxxxxxxxxxxxx; Rob Herring <robh+dt@xxxxxxxxxx>;
> > > linux-
> > > iio@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> > > Subject: Re: [PATCH 5/5] iio: addac: ad74413r: add support for
> > > reset-gpio
> > > 
> > > [External]
> > > 
> > > On Fri, 11 Nov 2022 15:39:21 +0100
> > > Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> wrote:
> > >   
> > > > We have a board where the reset pin of the ad74412 is connected
> > > > to a
> > > > gpio, but also pulled low by default. Hence to get the chip out
> > > > of
> > > > reset, the driver needs to know about that gpio and set it high
> > > > before
> > > > attempting to communicate with it.  
> > > 
> > > I'm a little confused on polarity here.  The pin is a !reset so
> > > we need to drive it low briefly to trigger a reset.
> > > I'm guessing for your board the pin is set to active low? (an
> > > example
> > > in the dt would have made that clearer) Hence the pulse
> > > in here to 1 is actually briefly driving it low before restoring
> > > to high?
> > > 
> > > For a pin documented as !reset that seems backwards though you
> > > have
> > > called it reset so that is fine, but this description doesn't
> > > make that
> > > celar.  
> > 
> > My opinion is that the driver shouldn't exactly know the polarity
> > of the reset,
> > and just assume that setting the reset GPIO to 1 means putting it
> > in reset,
> > and setting it to 0 means bringing out of reset.
> 
> Agreed. I'd just like a comment + example in the dt-binding to make
> the point
> that the pin is !reset.
> 
> Preferably with an example in the dt binding of the common case of it
> being wired
> up to an active low pin.
> 
> The main oddity here is the need to pulse it rather than request it
> directly as
> in the reset state and then just set that to off.
> 
> 

Agreed... In theory we should be able to request the gpio with
GPIOD_OUT_HIGH and then just bring the device out of reset

- Nuno Sá





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux