Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / led / led_bcm6858.c
index 27a76fc..511185f 100644 (file)
 #include <dm.h>
 #include <errno.h>
 #include <led.h>
+#include <log.h>
 #include <asm/io.h>
 #include <dm/lists.h>
+#include <linux/bitops.h>
 
 #define LEDS_MAX               32
 #define LEDS_WAIT              100
@@ -38,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;
@@ -196,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;