Re: [PATCH v3 2/2] serial: sc16is7xx: hardware reset chip if reset-gpios is defined in DT

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

 



On Wed, Jun 12, 2024 at 3:57 PM Lech Perczak
<lech.perczak@xxxxxxxxxxxxxxx> wrote:
> W dniu 12.06.2024 o 15:14, Hui Wang pisze:
> > Some boards connect a GPIO to the reset pin, and the reset pin needs
> > to be setup correctly before accessing the chip.
> >
> > Add a function to handle the chip reset. If the reset-gpios is defined
> > in the DT, do hardware reset through this GPIO, othwerwise do software

otherwise

> > reset as before.

...


> > +       if (reset_gpio) {
> > +               /* The minimum reset pulse width is 3 us. */
> > +               udelay(5);
>
> Prefer usleep_range() over that, since maximum reset time isn't all that critical.

For this little sleep the usleep_range() won't gain much. OTOH one may
use flseep() and let the sane default to be used.

> > +               gpiod_set_value_cansleep(reset_gpio, 0);
> > +               /* Deassert GPIO */
>
> This comment should go one line above or be removed entirely.
>
> > +       } else {
> > +               /* Software reset */
> > +               regmap_write(regmap, SC16IS7XX_IOCONTROL_REG,
> > +                            SC16IS7XX_IOCONTROL_SRESET_BIT);
> > +       }

-- 
With Best Regards,
Andy Shevchenko





[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