devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code
@ 2024-10-04  7:59 Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Linus Walleij @ 2024-10-04  7:59 UTC (permalink / raw)
  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
  Cc: linux-leds, devicetree, Linus Walleij

This brings over the few know-how items and little things
I found about the BCMBCA LEDs in my previous duplicate driver.

This was tested on the BCM6846-based Genexis XG6846B.

The main addition is the ability to define the number shifting
bits in the serial shift register which is necessary if the
previous boot stages have not set up the hardware properly
before.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Changes in v3:
- Mention in the DT binding that hardware defaults will be used if the
  property is missing.
- Link to v2: https://lore.kernel.org/r/20240928-bcm63138-leds-v2-0-f6aa4d4d6ef2@linaro.org

Changes in v2:
- Drop the u32 $ref in the schema, -bits is a standard suffix.
- Fix algorithm for shift register configuration.
- Fix spelling errors and numbering errors.
- Link to v1: https://lore.kernel.org/r/20240920-bcm63138-leds-v1-0-c150871324a0@linaro.org

---
Linus Walleij (4):
      dt-bindings: leds: bcm63138: Add shift register bits
      leds: bcm63138: Use scopes and guards
      leds: bcm63138: Handle shift register config
      leds: bcm63138: Add some register defines

 .../devicetree/bindings/leds/leds-bcm63138.yaml    | 11 +++++++++
 drivers/leds/blink/leds-bcm63138.c                 | 28 ++++++++++++----------
 2 files changed, 27 insertions(+), 12 deletions(-)
---
base-commit: 5724faee6be4109d7a3168625357e4127f42b5d2
change-id: 20240920-bcm63138-leds-1bc5f41c47cd

Best regards,
-- 
Linus Walleij <linus.walleij@linaro.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits
  2024-10-04  7:59 [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
@ 2024-10-04  7:59 ` Linus Walleij
  2024-10-04 16:15   ` Florian Fainelli
  2024-10-05 18:08   ` Rob Herring (Arm)
  2024-10-04  7:59 ` [PATCH v3 2/4] leds: bcm63138: Use scopes and guards Linus Walleij
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Linus Walleij @ 2024-10-04  7:59 UTC (permalink / raw)
  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
  Cc: linux-leds, devicetree, Linus Walleij

The BCM63138 family of serial LED controllers has a register
where we can set up bits for the shift registers. These are
the number of rounds the bits need to be shifted before all
bits have been shifted through the external shift registers.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Mention that HW defaults will be used if the shift
  register property is missing.
ChangeLog v1->v2:
- Drop the $ref to u32 since the new property is suffixed
  with "-bits" and thus get standard treatment.
---
 Documentation/devicetree/bindings/leds/leds-bcm63138.yaml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/leds-bcm63138.yaml b/Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
index bb20394fca5c..62326507c1aa 100644
--- a/Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
+++ b/Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
@@ -41,6 +41,16 @@ properties:
   "#size-cells":
     const: 0
 
+  brcm,serial-shift-bits:
+    minimum: 1
+    maximum: 32
+    description:
+      This describes the number of 8-bit serial shifters connected to the LED
+      controller block. The hardware is typically using 8-bit shift registers
+      with 8 LEDs per shift register, so 4 shifters results in 32 LEDs or 2
+      shifters give 16 LEDs etc, but the hardware supports any odd number of
+      registers. If left unspecified, the hardware boot-time default is used.
+
 patternProperties:
   "^led@[a-f0-9]+$":
     type: object
@@ -71,6 +81,7 @@ examples:
     leds@ff800800 {
         compatible = "brcm,bcm4908-leds", "brcm,bcm63138-leds";
         reg = <0xff800800 0xdc>;
+        brcm,serial-shift-bits = <16>;
 
         #address-cells = <1>;
         #size-cells = <0>;

-- 
2.46.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 2/4] leds: bcm63138: Use scopes and guards
  2024-10-04  7:59 [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
@ 2024-10-04  7:59 ` Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 3/4] leds: bcm63138: Handle shift register config Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 4/4] leds: bcm63138: Add some register defines Linus Walleij
  3 siblings, 0 replies; 10+ messages in thread
From: Linus Walleij @ 2024-10-04  7:59 UTC (permalink / raw)
  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
  Cc: linux-leds, devicetree, Linus Walleij

Use scoped helpers and guards to handle DT node iterations
and spinlocks. This cuts some lines of code and eliminates
common mistakes (such as the missing of_node_put()).

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/leds/blink/leds-bcm63138.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds-bcm63138.c
index 3a5e0b98bfbc..374f68f4f277 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 <rafal@milecki.pl>
  */
+#include <linux/cleanup.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/leds.h>
@@ -125,17 +126,14 @@ static void bcm63138_leds_brightness_set(struct led_classdev *led_cdev,
 {
 	struct bcm63138_led *led = container_of(led_cdev, struct bcm63138_led, cdev);
 	struct bcm63138_leds *leds = led->leds;
-	unsigned long flags;
 
-	spin_lock_irqsave(&leds->lock, flags);
+	guard(spinlock_irqsave)(&leds->lock);
 
 	bcm63138_leds_enable_led(leds, led, value);
 	if (!value)
 		bcm63138_leds_set_flash_rate(leds, led, 0);
 	else
 		bcm63138_leds_set_bright(leds, led, value);
-
-	spin_unlock_irqrestore(&leds->lock, flags);
 }
 
 static int bcm63138_leds_blink_set(struct led_classdev *led_cdev,
@@ -144,7 +142,6 @@ static int bcm63138_leds_blink_set(struct led_classdev *led_cdev,
 {
 	struct bcm63138_led *led = container_of(led_cdev, struct bcm63138_led, cdev);
 	struct bcm63138_leds *leds = led->leds;
-	unsigned long flags;
 	u8 value;
 
 	if (!*delay_on && !*delay_off) {
@@ -179,13 +176,11 @@ static int bcm63138_leds_blink_set(struct led_classdev *led_cdev,
 		return -EINVAL;
 	}
 
-	spin_lock_irqsave(&leds->lock, flags);
+	guard(spinlock_irqsave)(&leds->lock);
 
 	bcm63138_leds_enable_led(leds, led, BCM63138_MAX_BRIGHTNESS);
 	bcm63138_leds_set_flash_rate(leds, led, value);
 
-	spin_unlock_irqrestore(&leds->lock, flags);
-
 	return 0;
 }
 
@@ -259,7 +254,6 @@ 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;
-	struct device_node *child;
 
 	leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL);
 	if (!leds)
@@ -280,7 +274,7 @@ static int bcm63138_leds_probe(struct platform_device *pdev)
 	bcm63138_leds_write(leds, BCM63138_SERIAL_LED_POLARITY, 0);
 	bcm63138_leds_write(leds, BCM63138_PARALLEL_LED_POLARITY, 0);
 
-	for_each_available_child_of_node(np, child) {
+	for_each_available_child_of_node_scoped(np, child) {
 		bcm63138_leds_create_led(leds, child);
 	}
 

-- 
2.46.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 3/4] leds: bcm63138: Handle shift register config
  2024-10-04  7:59 [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
  2024-10-04  7:59 ` [PATCH v3 2/4] leds: bcm63138: Use scopes and guards Linus Walleij
@ 2024-10-04  7:59 ` Linus Walleij
  2024-10-04 16:15   ` Florian Fainelli
  2024-10-04  7:59 ` [PATCH v3 4/4] leds: bcm63138: Add some register defines Linus Walleij
  3 siblings, 1 reply; 10+ messages in thread
From: Linus Walleij @ 2024-10-04  7:59 UTC (permalink / raw)
  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
  Cc: linux-leds, devicetree, Linus Walleij

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 <linus.walleij@linaro.org>
---
 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..9fe1af156c80 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 <rafal@milecki.pl>
  */
+#include <linux/bits.h>
 #include <linux/cleanup.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -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(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.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v3 4/4] leds: bcm63138: Add some register defines
  2024-10-04  7:59 [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
                   ` (2 preceding siblings ...)
  2024-10-04  7:59 ` [PATCH v3 3/4] leds: bcm63138: Handle shift register config Linus Walleij
@ 2024-10-04  7:59 ` Linus Walleij
  2024-10-04 16:24   ` Florian Fainelli
  3 siblings, 1 reply; 10+ messages in thread
From: Linus Walleij @ 2024-10-04  7:59 UTC (permalink / raw)
  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
  Cc: linux-leds, devicetree, Linus Walleij

The Power LUT (Look-up Table) register base was missing, also
add the bit define for sending serial LED data in reverse order,
and use the BIT() macro to define the bits in the control
register.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/leds/blink/leds-bcm63138.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds-bcm63138.c
index 9fe1af156c80..190d9774164b 100644
--- a/drivers/leds/blink/leds-bcm63138.c
+++ b/drivers/leds/blink/leds-bcm63138.c
@@ -21,8 +21,9 @@
 #define BCM63138_LEDS_PER_REG				(32 / BCM63138_LED_BITS)	/* 8 */
 
 #define BCM63138_GLB_CTRL				0x00
-#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		0x00000002
-#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		0x00000008
+#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		BIT(1)
+#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		BIT(3)
+#define  BCM63138_GLB_CTRL_SERIAL_LED_MSB_FIRST		BIT(4)
 #define BCM63138_MASK					0x04
 #define BCM63138_HW_LED_EN				0x08
 #define BCM63138_SERIAL_LED_SHIFT_SEL			0x0c
@@ -35,6 +36,7 @@
 #define BCM63138_BRIGHT_CTRL3				0x28
 #define BCM63138_BRIGHT_CTRL4				0x2c
 #define BCM63138_POWER_LED_CFG				0x30
+#define BCM63138_POWER_LUT				0x34 /* -> b0 */
 #define BCM63138_HW_POLARITY				0xb4
 #define BCM63138_SW_DATA				0xb8
 #define BCM63138_SW_POLARITY				0xbc

-- 
2.46.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits
  2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
@ 2024-10-04 16:15   ` Florian Fainelli
  2024-10-05 18:08   ` Rob Herring (Arm)
  1 sibling, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2024-10-04 16:15 UTC (permalink / raw)
  To: Linus Walleij, Pavel Machek, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, William Zhang, Anand Gore,
	Kursad Oney, Rafał Miłecki,
	Broadcom internal kernel review list
  Cc: linux-leds, devicetree

On 10/4/24 00:59, Linus Walleij wrote:
> The BCM63138 family of serial LED controllers has a register
> where we can set up bits for the shift registers. These are
> the number of rounds the bits need to be shifted before all
> bits have been shifted through the external shift registers.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 3/4] leds: bcm63138: Handle shift register config
  2024-10-04  7:59 ` [PATCH v3 3/4] leds: bcm63138: Handle shift register config Linus Walleij
@ 2024-10-04 16:15   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2024-10-04 16:15 UTC (permalink / raw)
  To: Linus Walleij, Pavel Machek, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, William Zhang, Anand Gore,
	Kursad Oney, Rafał Miłecki,
	Broadcom internal kernel review list
  Cc: linux-leds, devicetree

On 10/4/24 00:59, Linus Walleij wrote:
> 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 <linus.walleij@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 4/4] leds: bcm63138: Add some register defines
  2024-10-04  7:59 ` [PATCH v3 4/4] leds: bcm63138: Add some register defines Linus Walleij
@ 2024-10-04 16:24   ` Florian Fainelli
  2024-10-10 13:41     ` Lee Jones
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2024-10-04 16:24 UTC (permalink / raw)
  To: Linus Walleij, Pavel Machek, Lee Jones, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, William Zhang, Anand Gore,
	Kursad Oney, Rafał Miłecki,
	Broadcom internal kernel review list
  Cc: linux-leds, devicetree

On 10/4/24 00:59, Linus Walleij wrote:
> The Power LUT (Look-up Table) register base was missing, also
> add the bit define for sending serial LED data in reverse order,
> and use the BIT() macro to define the bits in the control
> register.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>   drivers/leds/blink/leds-bcm63138.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds-bcm63138.c
> index 9fe1af156c80..190d9774164b 100644
> --- a/drivers/leds/blink/leds-bcm63138.c
> +++ b/drivers/leds/blink/leds-bcm63138.c
> @@ -21,8 +21,9 @@
>   #define BCM63138_LEDS_PER_REG				(32 / BCM63138_LED_BITS)	/* 8 */
>   
>   #define BCM63138_GLB_CTRL				0x00
> -#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		0x00000002
> -#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		0x00000008
> +#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		BIT(1)

Want to add:

#define BCM63138_GLB_CTRL_SERIAL_LED_CLK_POL	BIT(2)

while at it?

> +#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		BIT(3)
> +#define  BCM63138_GLB_CTRL_SERIAL_LED_MSB_FIRST		BIT(4)
>   #define BCM63138_MASK					0x04
>   #define BCM63138_HW_LED_EN				0x08
>   #define BCM63138_SERIAL_LED_SHIFT_SEL			0x0c
> @@ -35,6 +36,7 @@
>   #define BCM63138_BRIGHT_CTRL3				0x28
>   #define BCM63138_BRIGHT_CTRL4				0x2c
>   #define BCM63138_POWER_LED_CFG				0x30
> +#define BCM63138_POWER_LUT				0x34 /* -> b0 */

Maybe BCM63138_POWER_LUT_BASE0, because it is an array on some chips, 
like 63138 and at offset 0x74 we have BCM63138_POWER_LUT_BASE1.
-- 
Florian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits
  2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
  2024-10-04 16:15   ` Florian Fainelli
@ 2024-10-05 18:08   ` Rob Herring (Arm)
  1 sibling, 0 replies; 10+ messages in thread
From: Rob Herring (Arm) @ 2024-10-05 18:08 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Krzysztof Kozlowski, Anand Gore, devicetree,
	Broadcom internal kernel review list, linux-leds, Pavel Machek,
	Kursad Oney, Conor Dooley, Florian Fainelli, Lee Jones,
	William Zhang, Rafał Miłecki


On Fri, 04 Oct 2024 09:59:22 +0200, Linus Walleij wrote:
> The BCM63138 family of serial LED controllers has a register
> where we can set up bits for the shift registers. These are
> the number of rounds the bits need to be shifted before all
> bits have been shifted through the external shift registers.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v2->v3:
> - Mention that HW defaults will be used if the shift
>   register property is missing.
> ChangeLog v1->v2:
> - Drop the $ref to u32 since the new property is suffixed
>   with "-bits" and thus get standard treatment.
> ---
>  Documentation/devicetree/bindings/leds/leds-bcm63138.yaml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v3 4/4] leds: bcm63138: Add some register defines
  2024-10-04 16:24   ` Florian Fainelli
@ 2024-10-10 13:41     ` Lee Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Jones @ 2024-10-10 13:41 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Linus Walleij, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, William Zhang, Anand Gore, Kursad Oney,
	Rafał Miłecki, Broadcom internal kernel review list,
	linux-leds, devicetree

On Fri, 04 Oct 2024, Florian Fainelli wrote:

> On 10/4/24 00:59, Linus Walleij wrote:
> > The Power LUT (Look-up Table) register base was missing, also
> > add the bit define for sending serial LED data in reverse order,
> > and use the BIT() macro to define the bits in the control
> > register.
> > 
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> >   drivers/leds/blink/leds-bcm63138.c | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/leds/blink/leds-bcm63138.c b/drivers/leds/blink/leds-bcm63138.c
> > index 9fe1af156c80..190d9774164b 100644
> > --- a/drivers/leds/blink/leds-bcm63138.c
> > +++ b/drivers/leds/blink/leds-bcm63138.c
> > @@ -21,8 +21,9 @@
> >   #define BCM63138_LEDS_PER_REG				(32 / BCM63138_LED_BITS)	/* 8 */
> >   #define BCM63138_GLB_CTRL				0x00
> > -#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		0x00000002
> > -#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		0x00000008
> > +#define  BCM63138_GLB_CTRL_SERIAL_LED_DATA_PPOL		BIT(1)
> 
> Want to add:
> 
> #define BCM63138_GLB_CTRL_SERIAL_LED_CLK_POL	BIT(2)
> 
> while at it?
> 
> > +#define  BCM63138_GLB_CTRL_SERIAL_LED_EN_POL		BIT(3)
> > +#define  BCM63138_GLB_CTRL_SERIAL_LED_MSB_FIRST		BIT(4)
> >   #define BCM63138_MASK					0x04
> >   #define BCM63138_HW_LED_EN				0x08
> >   #define BCM63138_SERIAL_LED_SHIFT_SEL			0x0c
> > @@ -35,6 +36,7 @@
> >   #define BCM63138_BRIGHT_CTRL3				0x28
> >   #define BCM63138_BRIGHT_CTRL4				0x2c
> >   #define BCM63138_POWER_LED_CFG				0x30
> > +#define BCM63138_POWER_LUT				0x34 /* -> b0 */
> 
> Maybe BCM63138_POWER_LUT_BASE0, because it is an array on some chips, like
> 63138 and at offset 0x74 we have BCM63138_POWER_LUT_BASE1.

This set is on hold until we have some response to this.

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-10-10 13:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04  7:59 [PATCH v3 0/4] leds: bcm63138: Add some new bindings and code Linus Walleij
2024-10-04  7:59 ` [PATCH v3 1/4] dt-bindings: leds: bcm63138: Add shift register bits Linus Walleij
2024-10-04 16:15   ` Florian Fainelli
2024-10-05 18:08   ` Rob Herring (Arm)
2024-10-04  7:59 ` [PATCH v3 2/4] leds: bcm63138: Use scopes and guards Linus Walleij
2024-10-04  7:59 ` [PATCH v3 3/4] leds: bcm63138: Handle shift register config Linus Walleij
2024-10-04 16:15   ` Florian Fainelli
2024-10-04  7:59 ` [PATCH v3 4/4] leds: bcm63138: Add some register defines Linus Walleij
2024-10-04 16:24   ` Florian Fainelli
2024-10-10 13:41     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).