From 76daf29ef0820438902eb64027c403cc3e37b892 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 14 Sep 2023 17:02:40 +1000 Subject: Add and use PWM frequency defines for ISSI LED drivers (#22009) --- drivers/led/issi/is31fl3736.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/led/issi/is31fl3736.c') diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index a070836b38..c8c035854f 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c @@ -48,7 +48,7 @@ #define IS31FL3736_REG_SWPULLUP 0x0F // PG3 #define IS31FL3736_REG_CSPULLUP 0x10 // PG3 -#ifndef IS31FL3736_TIMEOUT +#ifndef IS31FL3736_I2C_TIMEOUT # define IS31FL3736_I2C_TIMEOUT 100 #endif @@ -56,6 +56,10 @@ # define IS31FL3736_I2C_PERSISTENCE 0 #endif +#ifndef IS31FL3736_PWM_FREQUENCY +# define IS31FL3736_PWM_FREQUENCY IS31FL3736_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3736B only +#endif + #ifndef IS31FL3736_SWPULLUP # define IS31FL3736_SWPULLUP IS31FL3736_PUR_0R #endif @@ -159,7 +163,7 @@ void is31fl3736_init(uint8_t addr) { // Set global current to maximum. is31fl3736_write_register(addr, IS31FL3736_REG_GLOBALCURRENT, IS31FL3736_GLOBALCURRENT); // Disable software shutdown. - is31fl3736_write_register(addr, IS31FL3736_REG_CONFIGURATION, 0x01); + is31fl3736_write_register(addr, IS31FL3736_REG_CONFIGURATION, ((IS31FL3736_PWM_FREQUENCY & 0b111) << 3) | 0x01); // Wait 10ms to ensure the device has woken up. wait_ms(10); -- cgit v1.2.3