Commit e0407253 authored by Steven Lawrance's avatar Steven Lawrance Committed by Tom Rini
Browse files

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).
Signed-off-by: default avatarSteven Lawrance <steven.lawrance@softathome.com>
Reviewed-by: default avatarPhilippe Reynes <philippe.reynes@softathome.com>
parent c904a0b7
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
#define LED_FLASH_RATE_CONTROL_REG0 0x10 #define LED_FLASH_RATE_CONTROL_REG0 0x10
/* Soft LED input register */ /* Soft LED input register */
#define LED_SW_LED_IP_REG 0xb8 #define LED_SW_LED_IP_REG 0xb8
/* Soft LED input polarity register */ /* Parallel LED Output Polarity Register */
#define LED_SW_LED_IP_PPOL_REG 0xbc #define LED_PLED_OP_PPOL_REG 0xc0
struct bcm6858_led_priv { struct bcm6858_led_priv {
void __iomem *regs; void __iomem *regs;
...@@ -198,9 +198,9 @@ static int bcm6858_led_probe(struct udevice *dev) ...@@ -198,9 +198,9 @@ static int bcm6858_led_probe(struct udevice *dev)
/* configure the polarity */ /* configure the polarity */
if (dev_read_bool(dev, "active-low")) 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 else
setbits_32(regs + LED_SW_LED_IP_PPOL_REG, 1 << pin); setbits_32(regs + LED_PLED_OP_PPOL_REG, 1 << pin);
} }
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment