summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorXelus22 <17491233+Xelus22@users.noreply.github.com>2023-04-30 12:35:27 +1000
committerGitHub <noreply@github.com>2023-04-30 12:35:27 +1000
commit6a619e64037d54e04148e1ee7e1c170533d49236 (patch)
tree63cfeb58eea709ebc807d5371be5031bbef6c2cc /quantum
parent0d9e37d638820dc926f32e59976c4591df9bfee5 (diff)
[Core] Clean up ISSI drivers, Add IS31FL3736 support (#20572)
Co-authored-by: Pablo Martínez <58857054+elpekenin@users.noreply.github.com>
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgb_matrix/rgb_matrix.h2
-rw-r--r--quantum/rgb_matrix/rgb_matrix_drivers.c49
2 files changed, 50 insertions, 1 deletions
diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h
index 6b373d0bcd..9ea248b66d 100644
--- a/quantum/rgb_matrix/rgb_matrix.h
+++ b/quantum/rgb_matrix/rgb_matrix.h
@@ -28,6 +28,8 @@
# include "is31fl3731.h"
#elif defined(IS31FL3733)
# include "is31fl3733.h"
+#elif defined(IS31FL3736)
+# include "is31fl3736.h"
#elif defined(IS31FL3737)
# include "is31fl3737.h"
#elif defined(IS31FL3741)
diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c
index 415c66f115..d65121baf4 100644
--- a/quantum/rgb_matrix/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix/rgb_matrix_drivers.c
@@ -23,7 +23,7 @@
* be here if shared between boards.
*/
-#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) || defined(IS31FLCOMMON) || defined(CKLED2001)
+#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3736) || defined(IS31FL3737) || defined(IS31FL3741) || defined(IS31FLCOMMON) || defined(CKLED2001)
# include "i2c_master.h"
// TODO: Remove this at some later date
@@ -72,6 +72,18 @@ static void init(void) {
# endif
# endif
+# elif defined(IS31FL3736)
+ IS31FL3736_init(DRIVER_ADDR_1);
+# if defined(DRIVER_ADDR_2)
+ IS31FL3736_init(DRIVER_ADDR_2);
+# if defined(DRIVER_ADDR_3)
+ IS31FL3736_init(DRIVER_ADDR_3);
+# if defined(DRIVER_ADDR_4)
+ IS31FL3736_init(DRIVER_ADDR_4);
+# endif
+# endif
+# endif
+
# elif defined(IS31FL3737)
IS31FL3737_init(DRIVER_ADDR_1);
# if defined(DRIVER_ADDR_2)
@@ -120,6 +132,8 @@ static void init(void) {
IS31FL3731_set_led_control_register(index, enabled, enabled, enabled);
# elif defined(IS31FL3733)
IS31FL3733_set_led_control_register(index, enabled, enabled, enabled);
+# elif defined(IS31FL3736)
+ IS31FL3736_set_led_control_register(index, enabled, enabled, enabled);
# elif defined(IS31FL3737)
IS31FL3737_set_led_control_register(index, enabled, enabled, enabled);
# elif defined(IS31FL3741)
@@ -156,6 +170,18 @@ static void init(void) {
# endif
# endif
+# elif defined(IS31FL3736)
+ IS31FL3736_update_led_control_registers(DRIVER_ADDR_1, 0);
+# if defined(DRIVER_ADDR_2)
+ IS31FL3736_update_led_control_registers(DRIVER_ADDR_2, 1);
+# if defined(DRIVER_ADDR_3)
+ IS31FL3736_update_led_control_registers(DRIVER_ADDR_3, 2);
+# if defined(DRIVER_ADDR_4)
+ IS31FL3736_update_led_control_registers(DRIVER_ADDR_4, 3);
+# endif
+# endif
+# endif
+
# elif defined(IS31FL3737)
IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, 0);
# if defined(DRIVER_ADDR_2)
@@ -242,6 +268,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
.set_color_all = IS31FL3733_set_color_all,
};
+# elif defined(IS31FL3736)
+static void flush(void) {
+ IS31FL3736_update_pwm_buffers(DRIVER_ADDR_1, 0);
+# if defined(DRIVER_ADDR_2)
+ IS31FL3736_update_pwm_buffers(DRIVER_ADDR_2, 1);
+# if defined(DRIVER_ADDR_3)
+ IS31FL3736_update_pwm_buffers(DRIVER_ADDR_3, 2);
+# if defined(DRIVER_ADDR_4)
+ IS31FL3736_update_pwm_buffers(DRIVER_ADDR_4, 3);
+# endif
+# endif
+# endif
+}
+
+const rgb_matrix_driver_t rgb_matrix_driver = {
+ .init = init,
+ .flush = flush,
+ .set_color = IS31FL3736_set_color,
+ .set_color_all = IS31FL3736_set_color_all,
+};
+
# elif defined(IS31FL3737)
static void flush(void) {
IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, 0);