Linux LED subsystem development
 help / color / mirror / Atom feed
From: Daniel Scally <dan.scally@ideasonboard.com>
To: linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org
Cc: pavel@ucw.cz, lee@kernel.org, hdegoede@redhat.com,
	markgross@kernel.org, sboyd@kernel.org, hpa@redhat.com,
	Daniel Scally <dan.scally@ideasonboard.com>
Subject: [PATCH 1/8] platform/x86: int3472: Add platform data for LEDs
Date: Wed, 22 Mar 2023 16:09:19 +0000	[thread overview]
Message-ID: <20230322160926.948687-2-dan.scally@ideasonboard.com> (raw)
In-Reply-To: <20230322160926.948687-1-dan.scally@ideasonboard.com>

Some of the LEDs that can be provided by the TPS68470 PMIC come with
various configuration registers that must be set to appropriate values.
Add a platform data struct so that those data can be defined and
passed to the tps68470-led platform device.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
---
 drivers/platform/x86/intel/int3472/tps68470.c |  2 ++
 drivers/platform/x86/intel/int3472/tps68470.h |  2 ++
 include/linux/platform_data/tps68470.h        | 11 +++++++++++
 3 files changed, 15 insertions(+)

diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c
index 82ef022f8916..53b0459f278a 100644
--- a/drivers/platform/x86/intel/int3472/tps68470.c
+++ b/drivers/platform/x86/intel/int3472/tps68470.c
@@ -194,6 +194,8 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client)
 		cells[1].platform_data = (void *)board_data->tps68470_regulator_pdata;
 		cells[1].pdata_size = sizeof(struct tps68470_regulator_platform_data);
 		cells[2].name = "tps68470-led";
+		cells[2].platform_data = (void *)board_data->tps68470_led_pdata;
+		cells[2].pdata_size = sizeof(struct tps68470_led_platform_data);
 		cells[3].name = "tps68470-gpio";
 
 		for (i = 0; i < board_data->n_gpiod_lookups; i++)
diff --git a/drivers/platform/x86/intel/int3472/tps68470.h b/drivers/platform/x86/intel/int3472/tps68470.h
index 35915e701593..ce50687db6fb 100644
--- a/drivers/platform/x86/intel/int3472/tps68470.h
+++ b/drivers/platform/x86/intel/int3472/tps68470.h
@@ -13,10 +13,12 @@
 
 struct gpiod_lookup_table;
 struct tps68470_regulator_platform_data;
+struct tps68470_led_platform_data;
 
 struct int3472_tps68470_board_data {
 	const char *dev_name;
 	const struct tps68470_regulator_platform_data *tps68470_regulator_pdata;
+	const struct tps68470_led_platform_data *tps68470_led_pdata;
 	unsigned int n_gpiod_lookups;
 	struct gpiod_lookup_table *tps68470_gpio_lookup_tables[];
 };
diff --git a/include/linux/platform_data/tps68470.h b/include/linux/platform_data/tps68470.h
index e605a2cab07f..5d55ad5c17ed 100644
--- a/include/linux/platform_data/tps68470.h
+++ b/include/linux/platform_data/tps68470.h
@@ -37,4 +37,15 @@ struct tps68470_clk_platform_data {
 	struct tps68470_clk_consumer consumers[];
 };
 
+struct tps68470_led_platform_data {
+	u8 iledctl_ctrlb;
+	u8 wledmaxf;
+	u8 wledto;
+	u8 wledc1;
+	u8 wledc2;
+	u8 wledctl_mode;
+	bool wledctl_disled1;
+	bool wledctl_disled2;
+};
+
 #endif
-- 
2.34.1


  reply	other threads:[~2023-03-22 16:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 16:09 [PATCH 0/8] Add WLED support to TPS68470 LED driver Daniel Scally
2023-03-22 16:09 ` Daniel Scally [this message]
2023-03-22 17:14   ` [PATCH 1/8] platform/x86: int3472: Add platform data for LEDs Hans de Goede
2023-03-22 16:09 ` [PATCH 2/8] platform/x86: int3472: Init LED registers using platform data Daniel Scally
2023-03-22 17:16   ` Hans de Goede
2023-03-22 16:09 ` [PATCH 3/8] platform/x86: int3472: Add TPS68470 LED Board Data Daniel Scally
2023-03-22 17:17   ` Hans de Goede
2023-03-22 16:09 ` [PATCH 4/8] platform/x86: int3472: Add tps68470-led as clock consumer Daniel Scally
2023-03-22 17:19   ` Hans de Goede
2023-03-22 16:09 ` [PATCH 5/8] leds: tps68470: Refactor tps68470_brightness_get() Daniel Scally
2023-03-22 17:22   ` Hans de Goede
2023-03-23  7:43     ` Dan Scally
2023-03-23  9:52       ` Hans de Goede
2023-03-23  9:53         ` Dan Scally
2023-03-22 16:09 ` [PATCH 6/8] leds: tps68470: Support the WLED driver Daniel Scally
2023-03-22 17:24   ` Hans de Goede
2023-03-23 11:22   ` Pavel Machek
2023-03-23 16:25     ` Dan Scally
2023-03-27 13:23       ` Hans de Goede
2023-03-22 16:09 ` [PATCH 7/8] platform/x86: int3472: Support LED lookups in board data Daniel Scally
2023-03-22 17:25   ` Hans de Goede
2023-03-22 16:09 ` [PATCH 8/8] platform/x86: int3472: Define LED lookup data for MS Surface Go Daniel Scally
2023-03-22 17:34   ` Hans de Goede
2023-03-23 10:31     ` Dan Scally
2023-03-23 11:15       ` Hans de Goede
2023-03-22 17:40 ` [PATCH 0/8] Add WLED support to TPS68470 LED driver Hans de Goede

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=20230322160926.948687-2-dan.scally@ideasonboard.com \
    --to=dan.scally@ideasonboard.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@redhat.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sboyd@kernel.org \
    /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