Commit ca3167f2 authored by Hans de Goede's avatar Hans de Goede Committed by Lee Jones

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: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230430195952.862527-5-hdegoede@redhat.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 5b916aa7
......@@ -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];
......
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