linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Yauhen Kharuzhy <jekhor@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>, linux-leds@vger.kernel.org
Subject: [PATCH 4/5] leds: cht-wcove: Set default trigger for charging LED
Date: Thu, 13 Apr 2023 17:18:07 +0200	[thread overview]
Message-ID: <20230413151808.20900-5-hdegoede@redhat.com> (raw)
In-Reply-To: <20230413151808.20900-1-hdegoede@redhat.com>

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>
---
 drivers/leds/leds-cht-wcove.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/leds/leds-cht-wcove.c b/drivers/leds/leds-cht-wcove.c
index 2b6c6f39d406..597bfbe19cc2 100644
--- a/drivers/leds/leds-cht-wcove.c
+++ b/drivers/leds/leds-cht-wcove.c
@@ -339,6 +339,25 @@ 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;
+	case INTEL_CHT_WC_LENOVO_YT3_X90:
+		leds->leds[0].cdev.default_trigger = "bq27500-1-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];
 
-- 
2.39.1


  parent reply	other threads:[~2023-04-13 15:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 15:18 [PATCH 0/5] leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver Hans de Goede
2023-04-13 15:18 ` [PATCH 1/5] " Hans de Goede
2023-04-14 12:44   ` Pavel Machek
2023-04-19 13:04     ` Hans de Goede
2023-04-20 12:17     ` Hans de Goede
2023-04-13 15:18 ` [PATCH 2/5] leds: cht-wcove: Add suspend/resume handling Hans de Goede
2023-04-14 12:46   ` Pavel Machek
2023-04-13 15:18 ` [PATCH 3/5] leds: cht-wcove: Add support for breathing mode use hw_pattern sysfs API Hans de Goede
2023-04-16 15:17   ` Jacek Anaszewski
2023-04-16 20:31     ` Hans de Goede
2023-04-17 20:00       ` Jacek Anaszewski
2023-04-19 13:05         ` Hans de Goede
2023-04-13 15:18 ` Hans de Goede [this message]
2023-04-13 15:18 ` [PATCH 5/5] leds: cht-wcove: Use breathing when LED_INIT_DEFAULT_TRIGGER is set Hans de Goede
2023-04-15 20:32 ` [PATCH 0/5] leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver Yauhen Kharuzhy
2023-04-16 13:04   ` Hans de Goede
2023-04-25 13:37     ` Hans de Goede
2023-04-26 11:12       ` Yauhen Kharuzhy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413151808.20900-5-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=jekhor@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).