Skip to content

Commit 9540989

Browse files
AngeloGioacchino Del Regnolag-linaro
authored andcommitted
leds: leds-mt6323: Add support for MT6331 leds
Add the register offsets for MT6331. The hwspec is the same as MT6323. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Pavel Machek <pavel@ucw.cz> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230601110813.2373764-8-angelogioacchino.delregno@collabora.com
1 parent 4c58b6d commit 9540989

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

drivers/leds/leds-mt6323.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,17 @@ static const struct mt6323_regs mt6323_registers = {
529529
.isink_en_ctrl = 0x356,
530530
};
531531

532+
static const struct mt6323_regs mt6331_registers = {
533+
.top_ckpdn = (const u16[]){ 0x138, 0x13e, 0x144 },
534+
.num_top_ckpdn = 3,
535+
.top_ckcon = (const u16[]){ 0x14c, 0x14a },
536+
.num_top_ckcon = 2,
537+
.isink_con = (const u16[]){ 0x40c, 0x40e, 0x410, 0x412, 0x414 },
538+
.num_isink_con = 5,
539+
.isink_max_regs = 4, /* ISINK[0..3] */
540+
.isink_en_ctrl = 0x43a,
541+
};
542+
532543
static const struct mt6323_hwspec mt6323_spec = {
533544
.max_period = 10000,
534545
.max_leds = 4,
@@ -541,8 +552,14 @@ static const struct mt6323_data mt6323_pdata = {
541552
.spec = &mt6323_spec,
542553
};
543554

555+
static const struct mt6323_data mt6331_pdata = {
556+
.regs = &mt6331_registers,
557+
.spec = &mt6323_spec,
558+
};
559+
544560
static const struct of_device_id mt6323_led_dt_match[] = {
545561
{ .compatible = "mediatek,mt6323-led", .data = &mt6323_pdata},
562+
{ .compatible = "mediatek,mt6331-led", .data = &mt6331_pdata },
546563
{},
547564
};
548565
MODULE_DEVICE_TABLE(of, mt6323_led_dt_match);

0 commit comments

Comments
 (0)