History log of /linux-master/drivers/leds/leds-aw200xx.c
Revision Date Author Comments
# d0532248 19-Jan-2024 Colin Ian King <colin.i.king@gmail.com>

leds: aw200xx: Make read-only array coeff_table static const

Don't populate the read-only array coeff_table on the stack at
run time, instead make it static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240119232630.2752239-1-colin.i.king@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 634fea79 25-Nov-2023 George Stark <gnstark@salutedevices.com>

leds: aw200xx: Add support for aw20108 device

Add support for the Awinic aw20108 device, which belongs to the same LED
drivers family. The new device supports 108 LEDs using a matrix of 12x9
outputs."

Signed-off-by: George Stark <gnstark@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Link: https://lore.kernel.org/r/20231125200519.1750-10-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 150bca53 25-Nov-2023 George Stark <gnstark@salutedevices.com>

leds: aw200xx: Improve autodim calculation method

It is highly recommended to leverage the DIV_ROUND_UP() function as a
more refined and mathematically precise alternative to employing a
coarse division method.

Signed-off-by: George Stark <gnstark@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-9-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 96b43a10 25-Nov-2023 George Stark <gnstark@salutedevices.com>

leds: aw200xx: Enable disable_locking flag in regmap config

In the driver regmap is always used under mutex so regmap's inner lock
can be disabled.

Signed-off-by: George Stark <gnstark@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-8-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# d883a5ab 25-Nov-2023 George Stark <gnstark@salutedevices.com>

leds: aw200xx: Add delay after software reset

According to the datasheets of AW200xx devices, the software reset takes
at least 1ms. Therefore, it is required to add a delay after the
reset before issuing commands to the device.

Signed-off-by: George Stark <gnstark@salutedevices.com>
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Link: https://lore.kernel.org/r/20231125200519.1750-7-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# 2b8db572 25-Nov-2023 George Stark <gnstark@salutedevices.com>

leds: aw200xx: Calculate dts property display_rows in the driver

Get rid of device tree property "awinic,display-rows". The property
value actually means number of current switches and depends on how LEDs
are connected to the device. It should be calculated manually by max
used LED number. In the same way it is computed automatically now.
Max used LED is taken from LED definition subnodes.

Signed-off-by: George Stark <gnstark@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-5-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# d882762f 25-Nov-2023 Dmitry Rokosov <ddrokosov@salutedevices.com>

leds: aw200xx: Support HWEN hardware control

HWEN is hardware control, which is used for enable/disable aw200xx chip.
It's high active, internally pulled down to GND.

After HWEN pin set high the chip begins to load the OTP information,
which takes 200us to complete. About 200us wait time is needed for
internal oscillator startup and display SRAM initialization. After
display SRAM initialization, the registers in page 1 to page 5 can be
configured via i2c interface.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Link: https://lore.kernel.org/r/20231125200519.1750-3-ddrokosov@salutedevices.com
Signed-off-by: Lee Jones <lee@kernel.org>


# adfd4621 25-Nov-2023 Martin Kurbanov <mmkurbanov@salutedevices.com>

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: 36a87f371b7a ("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>


# 65e9b513 29-Sep-2023 Mark Brown <broonie@kernel.org>

leds: aw200xx: Convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230929-leds-maple-v1-2-ba5f9dcb1e75@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>


# ff861ca9 15-Sep-2023 Kees Cook <keescook@chromium.org>

leds: aw200xx: Annotate struct aw200xx with __counted_by

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct aw200xx.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20230915200938.never.767-kees@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>


# 07a476e0 26-Jun-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

leds: aw200xx: Switch back to use struct i2c_driver::probe

struct i2c_driver::probe_new is about to go away. Switch the driver to
use the probe callback with the same prototype.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230626090254.556206-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>


# ad5152b8 23-Jun-2023 Dan Carpenter <dan.carpenter@linaro.org>

leds: aw200xx: Fix error code in probe()

The "ret" variable is zero/success here. Don't return that, return
-EINVAL instead.

Fixes: 36a87f371b7a ("leds: Add AW20xx driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/4d791b69-01c7-4532-818c-63712d3f63e1@moroto.mountain
Signed-off-by: Lee Jones <lee@kernel.org>


# 36a87f37 19-May-2023 Martin Kurbanov <mmkurbanov@sberdevices.ru>

leds: Add AW20xx driver

This commit adds support for AWINIC AW20036/AW20054/AW20072 LED driver.
This driver supports following AW200XX features:
- Individual 64-level DIM currents

Signed-off-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20230519130403.212479-3-mmkurbanov@sberdevices.ru
Signed-off-by: Lee Jones <lee@kernel.org>