Skip to content

Commit adfd462

Browse files
m-kurbanovlag-linaro
authored andcommitted
leds: aw200xx: Fix write to DIM parameter
If write only DIM value to the page 4, LED brightness will not be updated, as both DIM and FADE need to be written to the page 4. Therefore, write DIM to the page 1. Fixes: 36a87f3 ("leds: Add AW20xx driver") Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20231125200519.1750-2-ddrokosov@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 6dec659 commit adfd462

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/leds/leds-aw200xx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
#define AW200XX_LED2REG(x, columns) \
7575
((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns))))
7676

77+
/* DIM current configuration register on page 1 */
78+
#define AW200XX_REG_DIM_PAGE1(x, columns) \
79+
AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns))
80+
7781
/*
7882
* DIM current configuration register (page 4).
7983
* The even address for current DIM configuration.
@@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr,
153157

154158
if (dim >= 0) {
155159
ret = regmap_write(chip->regmap,
156-
AW200XX_REG_DIM(led->num, columns), dim);
160+
AW200XX_REG_DIM_PAGE1(led->num, columns),
161+
dim);
157162
if (ret)
158163
goto out_unlock;
159164
}

0 commit comments

Comments
 (0)