From: Antti Laakso <antti.laakso@linux.intel.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: linux-gpio@vger.kernel.org, platform-driver-x86@vger.kernel.org,
linusw@kernel.org, sakari.ailus@linux.intel.com,
mchehab@kernel.org, dan.scally@ideasonboard.com,
hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
hverkuil+cisco@kernel.org, sre@kernel.org, hao.yao@intel.com,
jason.z.chen@intel.com, jimmy.su@intel.com,
miguel.vadillo@intel.com, kees@kernel.org, ribalda@chromium.org,
linux-media@vger.kernel.org
Subject: Re: [PATCH 3/5] platform: int3472: Add gpio platform data
Date: Wed, 11 Mar 2026 13:17:03 +0200 [thread overview]
Message-ID: <abFPL17lzDfbz9or@alaakso-DESK> (raw)
In-Reply-To: <CAMRc=Me73BrokqUnPmWa59_rCnAM-cu+2Kpu8qxc7pbN6kN5+Q@mail.gmail.com>
Hi Bartosz,
On Tue, Mar 10, 2026 at 06:32:31AM -0700, Bartosz Golaszewski wrote:
> On Tue, 10 Mar 2026 13:44:25 +0100, Antti Laakso
> <antti.laakso@linux.intel.com> said:
> > The tps68470 supports i2c daisy chain, which need to be configured by
> > gpio-tps68470 driver. Add daisy chain information to platform data.
> >
> > Signed-off-by: Antti Laakso <antti.laakso@linux.intel.com>
> > ---
> > drivers/platform/x86/intel/int3472/tps68470.c | 2 ++
> > drivers/platform/x86/intel/int3472/tps68470.h | 1 +
> > include/linux/platform_data/tps68470.h | 4 ++++
> > 3 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c
> > index a496075c0d2a..b02bc675cabe 100644
> > --- a/drivers/platform/x86/intel/int3472/tps68470.c
> > +++ b/drivers/platform/x86/intel/int3472/tps68470.c
> > @@ -197,6 +197,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-gpio";
> > + cells[2].platform_data = (void *)board_data->tps68470_gpio_pdata;
> > + cells[2].pdata_size = sizeof(*board_data->tps68470_gpio_pdata);
> >
> > for (i = 0; i < board_data->n_gpiod_lookups; i++)
> > gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]);
> > diff --git a/drivers/platform/x86/intel/int3472/tps68470.h b/drivers/platform/x86/intel/int3472/tps68470.h
> > index 35915e701593..c1c4290eb6d5 100644
> > --- a/drivers/platform/x86/intel/int3472/tps68470.h
> > +++ b/drivers/platform/x86/intel/int3472/tps68470.h
> > @@ -17,6 +17,7 @@ struct tps68470_regulator_platform_data;
> > struct int3472_tps68470_board_data {
> > const char *dev_name;
> > const struct tps68470_regulator_platform_data *tps68470_regulator_pdata;
> > + const struct tps68470_gpio_platform_data *tps68470_gpio_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..7330dab7a711 100644
> > --- a/include/linux/platform_data/tps68470.h
> > +++ b/include/linux/platform_data/tps68470.h
> > @@ -27,6 +27,10 @@ struct tps68470_regulator_platform_data {
> > const struct regulator_init_data *reg_init_data[TPS68470_NUM_REGULATORS];
> > };
> >
> > +struct tps68470_gpio_platform_data {
> > + const bool daisy_chain_enable;
> > +};
> > +
> > struct tps68470_clk_consumer {
> > const char *consumer_dev_name;
> > const char *consumer_con_id;
> > --
> > 2.53.0
> >
> >
>
> I know this is the pattern used in this driver but why not start converting
> it gradually to more modern APIs?
>
> You could do:
>
> static const struct property_entry tps68470_gpio_props[] = {
> PROPERTY_ENTRY_BOOL("daisy-chain-enable"),
> { }
> };
>
> static const struct software_node tps68470_gpio_swnode = {
> .properties = tps68470_gpio_props,
> };
>
> static int skl_int3472_tps68470_probe(struct i2c_client *client)
> {
> ...
> cells[2].swnode = &tps68470_gpio_swnode;
> ...
> }
>
> And avoid both modifying the public header as well as using ugly platform
> data. In the GPIO driver you'd just need:
>
> if (device_property_present(&pdev->dev, "daisy-chain-enable"))
>
> Bartosz
Thanks for suggestion, I'll use software node in v2.
Antti
next prev parent reply other threads:[~2026-03-11 11:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 12:44 [PATCH 0/5] platform: int3472: Add MSI prestige 14 AI EVO data Antti Laakso
2026-03-10 12:44 ` [PATCH 1/5] media: i2c: ov5675: Wait for endpoint Antti Laakso
2026-03-10 13:03 ` Hans de Goede
2026-03-10 13:08 ` Sakari Ailus
2026-03-10 13:12 ` Hans de Goede
2026-03-10 12:44 ` [PATCH 2/5] media: ipu-bridge: Add ov5675 sensor Antti Laakso
2026-03-10 13:06 ` Hans de Goede
2026-03-10 13:25 ` Dan Scally
2026-03-10 12:44 ` [PATCH 3/5] platform: int3472: Add gpio platform data Antti Laakso
2026-03-10 13:06 ` Hans de Goede
2026-03-10 13:32 ` Bartosz Golaszewski
2026-03-11 11:17 ` Antti Laakso [this message]
2026-03-10 14:27 ` Dan Scally
2026-03-10 12:44 ` [PATCH 4/5] gpio: tps68470: Add i2c daisy chain support Antti Laakso
2026-03-10 13:07 ` Hans de Goede
2026-03-10 14:33 ` Dan Scally
2026-03-10 12:44 ` [PATCH 5/5] platform: int3472: Add MSI prestige board data Antti Laakso
2026-03-10 13:09 ` Hans de Goede
2026-03-10 13:17 ` Sakari Ailus
2026-03-10 14:24 ` Hans de Goede
2026-03-10 14:32 ` Dan Scally
2026-03-10 15:02 ` Hans de Goede
2026-03-11 11:20 ` Antti Laakso
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=abFPL17lzDfbz9or@alaakso-DESK \
--to=antti.laakso@linux.intel.com \
--cc=brgl@kernel.org \
--cc=dan.scally@ideasonboard.com \
--cc=hansg@kernel.org \
--cc=hao.yao@intel.com \
--cc=hverkuil+cisco@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jason.z.chen@intel.com \
--cc=jimmy.su@intel.com \
--cc=kees@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=miguel.vadillo@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=ribalda@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sre@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