leds: aw200xx: Add delay after software reset
authorGeorge Stark <gnstark@salutedevices.com>
Sat, 25 Nov 2023 20:05:14 +0000 (23:05 +0300)
committerLee Jones <lee@kernel.org>
Wed, 13 Dec 2023 11:28:58 +0000 (11:28 +0000)
According to the datasheets of AW200xx devices, the software reset takes
at least 1ms. Therefore, it is required to add a delay after the
reset before issuing commands to the device.

Signed-off-by: George Stark <gnstark@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Link: https://lore.kernel.org/r/20231125200519.1750-7-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-aw200xx.c

index 1756b012a0b7b4d6dac015a8d9edd09d40d7efdc..d4877722eb564752a6d3b390de3efe323ea53188 100644 (file)
@@ -321,6 +321,9 @@ static int aw200xx_chip_reset(const struct aw200xx *const chip)
        if (ret)
                return ret;
 
+       /* According to the datasheet software reset takes at least 1ms */
+       fsleep(1000);
+
        regcache_mark_dirty(chip->regmap);
        return regmap_write(chip->regmap, AW200XX_REG_FCD, AW200XX_FCD_CLEAR);
 }