[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231125200519.1750-2-ddrokosov@salutedevices.com>
Date: Sat, 25 Nov 2023 23:05:09 +0300
From: Dmitry Rokosov <ddrokosov@...utedevices.com>
To: <lee@...nel.org>, <pavel@....cz>, <robh+dt@...nel.org>,
<krzysztof.kozlowski+dt@...aro.org>, <conor+dt@...nel.org>,
<andy.shevchenko@...il.com>
CC: <kernel@...rdevices.ru>, <rockosov@...il.com>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-leds@...r.kernel.org>,
Martin Kurbanov <mmkurbanov@...utedevices.com>,
Dmitry Rokosov <ddrokosov@...utedevices.com>
Subject: [PATCH v5 01/11] leds: aw200xx: fix write to DIM parameter
From: Martin Kurbanov <mmkurbanov@...utedevices.com>
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: 36a87f371b7a ("leds: Add AW20xx driver")
Signed-off-by: Martin Kurbanov <mmkurbanov@...utedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@...utedevices.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
drivers/leds/leds-aw200xx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/leds-aw200xx.c b/drivers/leds/leds-aw200xx.c
index ef4eda6a09ee..842a22087b16 100644
--- a/drivers/leds/leds-aw200xx.c
+++ b/drivers/leds/leds-aw200xx.c
@@ -74,6 +74,10 @@
#define AW200XX_LED2REG(x, columns) \
((x) + (((x) / (columns)) * (AW200XX_DSIZE_COLUMNS_MAX - (columns))))
+/* DIM current configuration register on page 1 */
+#define AW200XX_REG_DIM_PAGE1(x, columns) \
+ AW200XX_REG(AW200XX_PAGE1, AW200XX_LED2REG(x, columns))
+
/*
* DIM current configuration register (page 4).
* The even address for current DIM configuration.
@@ -153,7 +157,8 @@ static ssize_t dim_store(struct device *dev, struct device_attribute *devattr,
if (dim >= 0) {
ret = regmap_write(chip->regmap,
- AW200XX_REG_DIM(led->num, columns), dim);
+ AW200XX_REG_DIM_PAGE1(led->num, columns),
+ dim);
if (ret)
goto out_unlock;
}
--
2.36.0
Powered by blists - more mailing lists