linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Mark Gross <markgross@kernel.org>,
	Andy Shevchenko <andy@infradead.org>,
	Daniel Scally <djrscally@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Kate Hsuan <hpa@redhat.com>,
	linux-media@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH 05/12] regulator: Introduce tps68470-regulator driver
Date: Fri, 15 Oct 2021 21:48:24 +0200	[thread overview]
Message-ID: <c595b143-d7ed-e76b-7734-e03d14e0f76e@redhat.com> (raw)
In-Reply-To: <YWnZIZTPiuAIazV+@sirena.org.uk>

Hi,

On 10/15/21 9:40 PM, Mark Brown wrote:
> On Fri, Oct 15, 2021 at 09:27:50PM +0200, Hans de Goede wrote:
>> On 10/15/21 8:58 PM, Mark Brown wrote:
> 
>>> I am very confused about why it's in the driver without a DMI quirk
>>> and/or clear comments about why and saying that this is a terrible
>>> example to copy.
> 
>> The DMI quirks live in the ACPI glue code under drivers/platform/x86,
>> that code instantiates the MFD cell and sets the platform-data
>> as part of the cell.
> 
> I can't see how the quirking gets propagated through into the driver and
> I'd really expect that in a situation like this the platform data would
> be passed through as platform data from the code doing the quirks,

That is exactly what is happening here. The platform_data in this
case is just an array of regulator_init_data pointers (one per
regulator in the PMIC):

struct tps68470_regulator_platform_data {
        const struct regulator_init_data *reg_init_data[TPS68470_NUM_REGULATORS];
};

This struct gets filled by platform specific code under drivers/platform/x86
(in later patches in the series).

And the regulator code in this patch consumes this like this:

                if (pdata && pdata->reg_init_data[i])
                        config.init_data = pdata->reg_init_data[i];
                else
                        config.init_data = &tps68470_init[i];

                rdev = devm_regulator_register(&pdev->dev, &regulators[i], &config);

So we have the code doing the quirks determining the regulator_init_data
and passing this through platform_data, which AFAICT is exactly what
you want?

Regards,

Hans


  reply	other threads:[~2021-10-15 19:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 16:21 [PATCH 00/12] Add support for X86/ACPI camera sensor/PMIC setup with clk and regulator platform data Hans de Goede
2021-10-08 16:21 ` [PATCH 01/12] ACPI: Add has_unmet_acpi_deps() helper function Hans de Goede
2021-10-08 16:21 ` [PATCH 02/12] media: i2c: ov8865: Add an has_unmet_acpi_deps() check Hans de Goede
2021-10-08 18:41   ` Laurent Pinchart
2021-10-08 18:48     ` Hans de Goede
2021-10-08 18:58       ` Laurent Pinchart
2021-10-09 15:31         ` Hans de Goede
2021-10-08 16:21 ` [PATCH 03/12] media: i2c: ov5693: " Hans de Goede
2021-10-08 16:21 ` [PATCH 04/12] platform_data: Add linux/platform_data/tps68470.h file Hans de Goede
2021-10-08 16:21 ` [PATCH 05/12] regulator: Introduce tps68470-regulator driver Hans de Goede
2021-10-11 10:42   ` Mark Brown
2021-10-11 11:43     ` Hans de Goede
2021-10-15 16:46       ` Mark Brown
2021-10-15 18:50         ` Hans de Goede
2021-10-15 18:58           ` Mark Brown
2021-10-15 19:27             ` Hans de Goede
2021-10-15 19:40               ` Mark Brown
2021-10-15 19:48                 ` Hans de Goede [this message]
2021-10-15 19:59                   ` Mark Brown
2021-10-15 20:14                     ` Hans de Goede
2021-10-15 22:29                       ` Mark Brown
2021-10-16 10:18                         ` Hans de Goede
2021-10-08 16:21 ` [PATCH 06/12] clk: Introduce clk-tps68470 driver Hans de Goede
2021-10-08 16:21 ` [PATCH 07/12] platform/x86: int3472: Enable I2c daisy chain Hans de Goede
2021-10-08 16:21 ` [PATCH 08/12] platform/x86: int3472: Split into 2 drivers Hans de Goede
2021-10-08 16:21 ` [PATCH 09/12] platform/x86: int3472: Add get_sensor_adev_and_name() helper Hans de Goede
2021-10-08 16:21 ` [PATCH 10/12] platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell Hans de Goede
2021-10-08 16:21 ` [PATCH 11/12] platform/x86: int3472: Pass tps68470_regulator_platform_data " Hans de Goede
2021-10-08 16:21 ` [PATCH 12/12] platform/x86: int3472: Call acpi_dev_clear_dependencies() on successful probe 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=c595b143-d7ed-e76b-7734-e03d14e0f76e@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy@infradead.org \
    --cc=broonie@kernel.org \
    --cc=djrscally@gmail.com \
    --cc=hpa@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lenb@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sakari.ailus@linux.intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).