> -----Original Message----- > From: Linus Walleij > Sent: Friday, September 20, 2024 2:59 PM > To: Pavel Machek ; Lee Jones ; Rob > Herring ; Krzysztof Kozlowski ; > Conor Dooley ; William Zhang > ; Anand Gore > ; Kursad Oney > ; Florian Fainelli > ; Rafał Miłecki ; > Broadcom internal kernel review list list@broadcom.com> > Cc: linux-leds@vger.kernel.org; devicetree@vger.kernel.org; Linus Walleij > > Subject: [PATCH 3/4] leds: bcm63128: Handle shift register config typo: bcm63128 -> bcm63138 > > This adds code to optionally read the width of the shift register > chain from the device tree and use it to set up the register > controlling the shifter hardware. > > If the property is not present, the boot-time default is used so > existing device trees keep working as this is what they assume. > > Signed-off-by: Linus Walleij > --- > drivers/leds/blink/leds-bcm63138.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds- > bcm63138.c > index 374f68f4f277..bf170a5bb12a 100644 > --- a/drivers/leds/blink/leds-bcm63138.c > +++ b/drivers/leds/blink/leds-bcm63138.c > @@ -2,6 +2,7 @@ > /* > * Copyright (C) 2021 Rafał Miłecki > */ > +#include > #include > #include > #include > @@ -254,6 +255,7 @@ static int bcm63138_leds_probe(struct > platform_device *pdev) > struct device_node *np = dev_of_node(&pdev->dev); > struct device *dev = &pdev->dev; > struct bcm63138_leds *leds; > + u32 shift_bits; > > leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL); > if (!leds) > @@ -267,6 +269,12 @@ static int bcm63138_leds_probe(struct > platform_device *pdev) > > spin_lock_init(&leds->lock); > > + /* If this property is not present, we use boot defaults */ > + if (!of_property_read_u32(np, "brcm,serial-shift-bits", &shift_bits)) { > + bcm63138_leds_write(leds, > BCM63138_SERIAL_LED_SHIFT_SEL, > + GENMASK(32 - shift_bits - 1, 0)); > + } > + > bcm63138_leds_write(leds, BCM63138_GLB_CTRL, > BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL | > BCM63138_GLB_CTRL_SERIAL_LED_EN_POL); > > -- > 2.46.0