summaryrefslogtreecommitdiff
path: root/driver/charger/rt946x.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/charger/rt946x.c')
-rw-r--r--driver/charger/rt946x.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index 3d5722ae09..d38690892a 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -1114,6 +1114,24 @@ int mt6370_db_set_voltages(int vbst, int vpos, int vneg)
return rv;
}
+/* MT6370 BACKLIGHT LED */
+
+int mt6370_backlight_set_dim(uint16_t dim)
+{
+ int rv;
+
+ /* datasheet suggests that update BLDIM2 first then BLDIM */
+ rv = rt946x_write8(MT6370_BACKLIGHT_BLDIM2, dim & MT6370_MASK_BLDIM2);
+
+ if (rv)
+ return rv;
+
+ rv = rt946x_write8(MT6370_BACKLIGHT_BLDIM,
+ (dim >> MT6370_SHIFT_BLDIM_MSB) & MT6370_MASK_BLDIM);
+
+ return rv;
+}
+
/* MT6370 RGB LED */
int mt6370_led_set_dim_mode(enum mt6370_led_index index,