diff mbox series

[v1,07/11] leds: aw200xx: add delay after software reset

Message ID 20231006160437.15627-8-ddrokosov@salutedevices.com
State Superseded
Headers show
Series leds: aw200xx: several driver updates | expand

Commit Message

Dmitry Rokosov Oct. 6, 2023, 4:04 p.m. UTC
From: George Stark <gnstark@salutedevices.com>

According to datasheets of aw200xx devices software reset takes at
least 1 ms so add delay after reset before issuing commands to device.

Signed-off-by: George Stark <gnstark@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 drivers/leds/leds-aw200xx.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andy Shevchenko Oct. 6, 2023, 6:01 p.m. UTC | #1
On Fri, Oct 6, 2023 at 7:05 PM Dmitry Rokosov
<ddrokosov@salutedevices.com> wrote:
>
> From: George Stark <gnstark@salutedevices.com>
>
> According to datasheets of aw200xx devices software reset takes at
> least 1 ms so add delay after reset before issuing commands to device.

> +       /* according to datasheet software reset takes at least 1ms */

Please, be consistent in all patches in all commit messages and code
comments on how you supply physical units (w/ space or w/o, take also
into consideration traditional scientific practices).

> +       usleep_range(1000, 2000);

fsleep() ?
Dmitry Rokosov Oct. 9, 2023, 1:14 p.m. UTC | #2
On Fri, Oct 06, 2023 at 09:01:39PM +0300, Andy Shevchenko wrote:
> On Fri, Oct 6, 2023 at 7:05 PM Dmitry Rokosov
> <ddrokosov@salutedevices.com> wrote:
> >
> > From: George Stark <gnstark@salutedevices.com>
> >
> > According to datasheets of aw200xx devices software reset takes at
> > least 1 ms so add delay after reset before issuing commands to device.
> 
> > +       /* according to datasheet software reset takes at least 1ms */
> 
> Please, be consistent in all patches in all commit messages and code
> comments on how you supply physical units (w/ space or w/o, take also
> into consideration traditional scientific practices).
> 
> > +       usleep_range(1000, 2000);
> 
> fsleep() ?

Good catch! Thank you for pointing!
diff mbox series

Patch

diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c
index 5b6907eb6299..a1ef0b0a62fc 100644
--- a/drivers/leds/leds-aw200xx.c
+++ b/drivers/leds/leds-aw200xx.c
@@ -321,6 +321,9 @@  static int aw200xx_chip_reset(const struct aw200xx *const chip)
 	if (ret)
 		return ret;
 
+	/* according to datasheet software reset takes at least 1ms */
+	usleep_range(1000, 2000);
+
 	regcache_mark_dirty(chip->regmap);
 	return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR);
 }