linux/drivers/leds
Zahari Petkov 348a7ccdb9 leds: pca963x: Fix open-drain initialization
[ Upstream commit 697529091a ]

Before commit bb29b9cccd ("leds: pca963x: Add bindings to invert
polarity") Mode register 2 was initialized directly with either 0x01
or 0x05 for open-drain or totem pole (push-pull) configuration.

Afterwards, MODE2 initialization started using bitwise operations on
top of the default MODE2 register value (0x05). Using bitwise OR for
setting OUTDRV with 0x01 and 0x05 does not produce correct results.
When open-drain is used, instead of setting OUTDRV to 0, the driver
keeps it as 1:

Open-drain: 0x05 | 0x01 -> 0x05 (0b101 - incorrect)
Totem pole: 0x05 | 0x05 -> 0x05 (0b101 - correct but still wrong)

Now OUTDRV setting uses correct bitwise operations for initialization:

Open-drain: 0x05 & ~0x04 -> 0x01 (0b001 - correct)
Totem pole: 0x05 | 0x04 -> 0x05 (0b101 - correct)

Additional MODE2 register definitions are introduced now as well.

Fixes: bb29b9cccd ("leds: pca963x: Add bindings to invert polarity")
Signed-off-by: Zahari Petkov <zahari@balena.io>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:36:24 +01:00
..
trigger
Kconfig
Makefile
led-class-flash.c
led-class.c
led-core.c
led-triggers.c
leds-88pm860x.c
leds-aat1290.c
leds-adp5520.c
leds-an30259a.c
leds-apu.c
leds-as3645a.c
leds-asic3.c
leds-bcm6328.c
leds-bcm6358.c
leds-bd2802.c
leds-blinkm.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c
leds-cr0014114.c
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-fsg.c
leds-gpio-register.c
leds-gpio.c
leds-hp6xx.c
leds-ipaq-micro.c
leds-is31fl32xx.c
leds-is31fl319x.c
leds-ktd2692.c
leds-lm355x.c
leds-lm3530.c
leds-lm3532.c
leds-lm3533.c
leds-lm3601x.c
leds-lm3642.c
leds-lm3692x.c
leds-lm3697.c
leds-lm36274.c
leds-locomo.c
leds-lp55xx-common.c
leds-lp55xx-common.h
leds-lp3944.c
leds-lp3952.c
leds-lp5521.c
leds-lp5523.c
leds-lp5562.c
leds-lp8501.c
leds-lp8788.c
leds-lp8860.c
leds-lt3593.c
leds-max8997.c
leds-max77650.c led: max77650: add of_match table 2020-02-05 21:22:49 +00:00
leds-max77693.c
leds-mc13783.c
leds-menf21bmc.c
leds-mlxcpld.c
leds-mlxreg.c
leds-mt6323.c
leds-net48xx.c
leds-netxbig.c
leds-nic78bx.c
leds-ns2.c
leds-ot200.c
leds-pca955x.c
leds-pca963x.c leds: pca963x: Fix open-drain initialization 2020-02-24 08:36:24 +01:00
leds-pca9532.c
leds-pm8058.c
leds-powernv.c
leds-pwm.c
leds-rb532.c
leds-regulator.c
leds-s3c24xx.c
leds-sc27xx-bltc.c
leds-spi-byte.c
leds-ss4200.c
leds-sunfire.c
leds-syscon.c
leds-tca6507.c
leds-ti-lmu-common.c
leds-tlc591xx.c
leds-wm831x-status.c
leds-wm8350.c
leds-wrap.c
leds.h
uleds.c