[PATCH v2 06/11] leds: aw200xx: add delay after software reset

Dmitry Rokosov posted 11 patches 2 years, 1 month ago
There is a newer version of this series
[PATCH v2 06/11] leds: aw200xx: add delay after software reset
Posted by Dmitry Rokosov 2 years, 1 month ago
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(+)

diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c
index a2a31b8e623e..77760406abbf 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 1 ms */
+	fsleep(1000);
+
 	regcache_mark_dirty(chip->regmap);
 	return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR);
 }
-- 
2.36.0
Re: [PATCH v2 06/11] leds: aw200xx: add delay after software reset
Posted by Andy Shevchenko 2 years, 1 month ago
On Wed, Oct 18, 2023 at 9:30 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.

For the "us" unit you chose "XXXus" style, why is "ms" different?

...

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

Ditto.

-- 
With Best Regards,
Andy Shevchenko