Skip to contentSkip to conversation

drivers: led: bcm6858: set the correct led polarity register

PATCH New Steven Lawrance 3 participants 3 messages Oct 29, 2020 – Nov 20, 2020 Broadcom bcmbca Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: led: bcm6858: set the correct led polarity register

This change sets the output (hardware) polarity register instead of the input (software) polarity register for the bcm6858 LED controller. The logic was inverted (a LED configued active high behaved as active low).

---
 drivers/led/led_bcm6858.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/led/led_bcm6858.c +4 -4
index b415d8b2b4..511185ffad 100644
@@ -40,8 +40,8 @@
 #define LED_FLASH_RATE_CONTROL_REG0	0x10
 /* Soft LED input register */
 #define LED_SW_LED_IP_REG		0xb8
-/* Soft LED input polarity register */
-#define LED_SW_LED_IP_PPOL_REG		0xbc
+/* Parallel LED Output Polarity Register */
+#define LED_PLED_OP_PPOL_REG		0xc0
 
 struct bcm6858_led_priv {
 	void __iomem *regs;
@@ -198,9 +198,9 @@ static int bcm6858_led_probe(struct udevice *dev)
 
 		/* configure the polarity */
 		if (dev_read_bool(dev, "active-low"))
-			clrbits_32(regs + LED_SW_LED_IP_PPOL_REG, 1 << pin);
+			clrbits_32(regs + LED_PLED_OP_PPOL_REG, 1 << pin);
 		else
-			setbits_32(regs + LED_SW_LED_IP_PPOL_REG, 1 << pin);
+			setbits_32(regs + LED_PLED_OP_PPOL_REG, 1 << pin);
 	}
 
 	return 0;
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 drivers: led: bcm6858: set the correct led polarity register

Le 29/10/2020 ? 18:27, Steven Lawrance a ?crit?:

Quoted 5 lines

This change sets the output (hardware) polarity register instead of the input (software) polarity register for the bcm6858 LED controller. The logic was inverted (a LED configued active high behaved as active low).

Quoted 31 lines
---
  drivers/led/led_bcm6858.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/led/led_bcm6858.c +4 -4
index b415d8b2b4..511185ffad 100644
@@ -40,8 +40,8 @@
  #define LED_FLASH_RATE_CONTROL_REG0	0x10
  /* Soft LED input register */
  #define LED_SW_LED_IP_REG		0xb8
-/* Soft LED input polarity register */
-#define LED_SW_LED_IP_PPOL_REG		0xbc
+/* Parallel LED Output Polarity Register */
+#define LED_PLED_OP_PPOL_REG		0xc0
 
  struct bcm6858_led_priv {
  	void __iomem *regs;
@@ -198,9 +198,9 @@ static int bcm6858_led_probe(struct udevice *dev)
 
  		/* configure the polarity */
  		if (dev_read_bool(dev, "active-low"))
-			clrbits_32(regs + LED_SW_LED_IP_PPOL_REG, 1 << pin);
+			clrbits_32(regs + LED_PLED_OP_PPOL_REG, 1 << pin);
  		else
-			setbits_32(regs + LED_SW_LED_IP_PPOL_REG, 1 << pin);
+			setbits_32(regs + LED_PLED_OP_PPOL_REG, 1 << pin);
  	}
 
  	return 0;
#2 lore raw

PATCH 1/1 drivers: led: bcm6858: set the correct led polarity register

In reply to Steven Lawrance
Quoted 6 lines · Steven Lawrance

This change sets the output (hardware) polarity register instead of the input (software) polarity register for the bcm6858 LED controller. The logic was inverted (a LED configued active high behaved as active low).

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201119/efea604c/attachment.sig>