1 From 75bd07aef47e1a984229e6ec702e8b9aee0226e4 Mon Sep 17 00:00:00 2001
2 From: Kate Hsuan <hpa@redhat.com>
3 Date: Fri, 31 May 2024 13:41:20 +0200
4 Subject: leds: rgb: leds-ktd202x: I2C ID tables for KTD2026 and 2027
6 Add an i2c_device_id id_table to match manually instantiated
7 (non device-tree / ACPI instantiated) KTD202x controllers as
8 found on some x86 boards.
10 This table shows the maximum support LED channel for KTD2026
11 (three LEDs) and KTD-2027 (4 LEDs).
13 Link: https://www.kinet-ic.com/uploads/KTD2026-7-04h.pdf
14 Signed-off-by: Kate Hsuan <hpa@redhat.com>
15 Reviewed-by: Hans de Goede <hdegoede@redhat.com>
16 Reviewed-by: Andy Shevchenko <andy@kernel.org>
17 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
18 Link: https://lore.kernel.org/r/20240531114124.45346-3-hdegoede@redhat.com
19 Signed-off-by: Lee Jones <lee@kernel.org>
21 drivers/leds/rgb/leds-ktd202x.c | 8 ++++++++
22 1 file changed, 8 insertions(+)
24 (limited to 'drivers/leds/rgb')
26 --- a/drivers/leds/rgb/leds-ktd202x.c
27 +++ b/drivers/leds/rgb/leds-ktd202x.c
28 @@ -606,6 +606,13 @@ static void ktd202x_shutdown(struct i2c_
29 regmap_write(chip->regmap, KTD202X_REG_RESET_CONTROL, KTD202X_RSTR_RESET);
32 +static const struct i2c_device_id ktd202x_id[] = {
33 + {"ktd2026", KTD2026_NUM_LEDS},
34 + {"ktd2027", KTD2027_NUM_LEDS},
37 +MODULE_DEVICE_TABLE(i2c, ktd202x_id);
39 static const struct of_device_id ktd202x_match_table[] = {
40 { .compatible = "kinetic,ktd2026", .data = (void *)KTD2026_NUM_LEDS },
41 { .compatible = "kinetic,ktd2027", .data = (void *)KTD2027_NUM_LEDS },
42 @@ -621,6 +628,7 @@ static struct i2c_driver ktd202x_driver
43 .probe = ktd202x_probe,
44 .remove = ktd202x_remove,
45 .shutdown = ktd202x_shutdown,
46 + .id_table = ktd202x_id,
48 module_i2c_driver(ktd202x_driver);