diff mbox series

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

Message ID 20201029172734.17261-1-steven.lawrance@softathome.com
State Accepted
Commit e04072536efcbe504596ea980077eb63c52082b0
Delegated to: Tom Rini
Headers show
Series drivers: led: bcm6858: set the correct led polarity register | expand

Commit Message

Steven Lawrance Oct. 29, 2020, 5:27 p.m. UTC
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: Steven Lawrance <steven.lawrance@softathome.com>
---
 drivers/led/led_bcm6858.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Philippe Reynes Nov. 13, 2020, 9:30 a.m. UTC | #1
Le 29/10/2020 à 18:27, Steven Lawrance a écrit :

> 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: Steven Lawrance <steven.lawrance@softathome.com>
Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>

> ---
>   drivers/led/led_bcm6858.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/led/led_bcm6858.c b/drivers/led/led_bcm6858.c
> index b415d8b2b4..511185ffad 100644
> --- a/drivers/led/led_bcm6858.c
> +++ b/drivers/led/led_bcm6858.c
> @@ -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;
Tom Rini Nov. 20, 2020, 1:36 a.m. UTC | #2
On Thu, Oct 29, 2020 at 06:27:34PM +0100, Steven Lawrance wrote:

> 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: Steven Lawrance <steven.lawrance@softathome.com>
> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/led/led_bcm6858.c b/drivers/led/led_bcm6858.c
index b415d8b2b4..511185ffad 100644
--- a/drivers/led/led_bcm6858.c
+++ b/drivers/led/led_bcm6858.c
@@ -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;