mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul.cercueil@bootlin.com>
To: "Rafael J. Wysocki (Intel)" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v5 1/1] ACPI: platform: Add basic support for ACPI 6.5 fixed clock resources
Date: Fri, 27 Nov 2026 15:20:33 +0100	[thread overview]
Message-ID: <83bea8441ea9b1fee1ec5144c335b5cd8e2de168.camel@bootlin.com> (raw)
In-Reply-To: <CAJZ5v0g3e26eZG1_yRQzMfPvPYiiv0cHZE70V+_U+NR4kxEpJg@mail.gmail.com>

[...]

> > > > +static void acpi_platform_init_clocks(struct acpi_device *adev)
> > > > +{
> > > > +       struct device *dev = &adev->dev;
> > > 
> > > Note that &adev->dev is not a real device.  It is a "firmware node",
> > > quite like a DT one, but I guess it may be used for registering
> > > clocks.
> > > 
> > > How is a platform device driver going to use those clocks though?
> > 
> > They just use clk_get(). It searches the clock by device name, which works
> > here,
> 
> And they would pass the platform device as dev I suppose?

Yes, I like the fact that it does not change the API - on the driver side you
just use clk_get(&pdev->dev, NULL) or clk_get(&pdev->dev, "acpi-clk1") like you
would do with a clock resource from DT.

> > I guess because the "firmware node" device has the same name as the real
> > device.
> 
> For platform devices created by acpi_create_platform_device(), yes, it
> does, but if that is going to be relied on, that assumption needs to
> be documented in a very visible way.
> 
> Generally speaking though, they should rather pass the ACPI companion
> of the platform device as dev, in which case that the name equality
> doesn't matter, and so the clkdev could be created during the struct
> acpi_device registration (and the corresponding cleanup would occur
> during the struct acpi_device removal which is rare).

I think I should update clk_get() then.

It gets passed a "struct device" pointer, if it has an ACPI companion, I can
just recurse on the ACPI companion's device struct.

Btw - I'm working on the v6 and I added the cleanup on acpi_device removal. Is
there a way to test a ACPI device removal from userspace? Looking at
Documentation/ABI/testing/sysfs-bus-acpi it seems to only be for ACPI devices
which have a _AJ0 method?

Cheers,
-Paul

  reply	other threads:[~2026-11-27 14:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 16:10 [PATCH v5 0/1] ACPI: platform: ACPI 6.5 fixed clock support Paul Cercueil
2026-11-20 16:10 ` [PATCH v5 1/1] ACPI: platform: Add basic support for ACPI 6.5 fixed clock resources Paul Cercueil
2026-11-25 20:22   ` Rafael J. Wysocki (Intel)
2026-11-27 10:04     ` Paul Cercueil
2026-11-27 12:43       ` Rafael J. Wysocki (Intel)
2026-11-27 14:20         ` Paul Cercueil [this message]
2026-11-27 14:24           ` Rafael J. Wysocki (Intel)

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=83bea8441ea9b1fee1ec5144c335b5cd8e2de168.camel@bootlin.com \
    --to=paul.cercueil@bootlin.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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

all inboxes | Powered by JetHome®