summaryrefslogtreecommitdiff
path: root/drivers/leds
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-04-30 22:59:51 +0300
committerLee Jones <lee@kernel.org>2023-05-25 14:16:17 +0300
commitca3167f238f347b39567ba46af6ac4f0d732aacf (patch)
treec64ef76676c63a2c9804b2099feff2a7aff28617 /drivers/leds
parent5b916aa755551058c0e88e45a8c7db31d7718d59 (diff)
downloadlinux-ca3167f238f347b39567ba46af6ac4f0d732aacf.tar.xz
leds: cht-wcove: Set default trigger for charging LED
Set a default trigger for the charging LED based on the machine-model as set by the PMIC MFD driver. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230430195952.862527-5-hdegoede@redhat.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-cht-wcove.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c
index 36fb4c2c3c13..ee9fb4bee018 100644
--- a/drivers/leds/leds-cht-wcove.c
+++ b/drivers/leds/leds-cht-wcove.c
@@ -351,6 +351,22 @@ static int cht_wc_leds_probe(struct platform_device *pdev)
if (ret < 0)
return ret;
+ /* Set LED1 default trigger based on machine model */
+ switch (pmic->cht_wc_model) {
+ case INTEL_CHT_WC_GPD_WIN_POCKET:
+ leds->leds[0].cdev.default_trigger = "max170xx_battery-charging-blink-full-solid";
+ break;
+ case INTEL_CHT_WC_XIAOMI_MIPAD2:
+ leds->leds[0].cdev.default_trigger = "bq27520-0-charging-blink-full-solid";
+ break;
+ case INTEL_CHT_WC_LENOVO_YOGABOOK1:
+ leds->leds[0].cdev.default_trigger = "bq27542-0-charging-blink-full-solid";
+ break;
+ default:
+ dev_warn(&pdev->dev, "Unknown model, no default charging trigger\n");
+ break;
+ }
+
for (i = 0; i < CHT_WC_LED_COUNT; i++) {
struct cht_wc_led *led = &leds->leds[i];