Commit 047da762 authored by Yauhen Kharuzhy's avatar Yauhen Kharuzhy Committed by Lee Jones

leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver

Add support for LEDs connected to the Intel Cherry Trail Whiskey Cove
PMIC. Charger and general-purpose LEDs are supported. Hardware blinking
is implemented, breathing is not.

This driver was tested with Lenovo Yoga Book notebook.

Changes by Hans de Goede (in response to review of v2):
- Since the PMIC is connected to the battery any changes we make to
  the LED settings are permanent, even surviving reboot / poweroff.
  Save LED1 register settings on probe() and if auto-/hw-control was
  enabled on probe() restore the settings on remove() and shutdown().
- Delay switching LED1 to software control mode to first brightness write.
- Use dynamically allocated drvdata instead of a global drvdata variable.
- Ensure the LED is on when activating blinking.
- Fix CHT_WC_LED_EFF_BREATHING val ((3 << 1) rather then BIT(3)).

Link: https://lore.kernel.org/r/20190212205901.13037-2-jekhor@gmail.comSigned-off-by: default avatarYauhen Kharuzhy <jekhor@gmail.com>
Co-developed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230430195952.862527-2-hdegoede@redhat.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 38b24e25
...@@ -65,7 +65,7 @@ Phones usually have multi-color status LED. ...@@ -65,7 +65,7 @@ Phones usually have multi-color status LED.
* Power management * Power management
Good: "platform:*:charging" (allwinner sun50i) Good: "platform:*:charging" (allwinner sun50i, leds-cht-wcove)
* Screen * Screen
......
...@@ -122,6 +122,17 @@ config LEDS_BCM6358 ...@@ -122,6 +122,17 @@ config LEDS_BCM6358
This option enables support for LEDs connected to the BCM6358 This option enables support for LEDs connected to the BCM6358
LED HW controller accessed via MMIO registers. LED HW controller accessed via MMIO registers.
config LEDS_CHT_WCOVE
tristate "LED support for Intel Cherry Trail Whiskey Cove PMIC"
depends on LEDS_CLASS
depends on INTEL_SOC_PMIC_CHTWC
help
This option enables support for charger and general purpose LEDs
connected to the Intel Cherrytrail Whiskey Cove PMIC.
To compile this driver as a module, choose M here: the module
will be called leds-cht-wcove.
config LEDS_CPCAP config LEDS_CPCAP
tristate "LED Support for Motorola CPCAP" tristate "LED Support for Motorola CPCAP"
depends on LEDS_CLASS depends on LEDS_CLASS
......
...@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o ...@@ -20,6 +20,7 @@ obj-$(CONFIG_LEDS_BCM6358) += leds-bcm6358.o
obj-$(CONFIG_LEDS_BD2606MVV) += leds-bd2606mvv.o obj-$(CONFIG_LEDS_BD2606MVV) += leds-bd2606mvv.o
obj-$(CONFIG_LEDS_BD2802) += leds-bd2802.o obj-$(CONFIG_LEDS_BD2802) += leds-bd2802.o
obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o obj-$(CONFIG_LEDS_BLINKM) += leds-blinkm.o
obj-$(CONFIG_LEDS_CHT_WCOVE) += leds-cht-wcove.o
obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o
......
This diff is collapsed.
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