* [PATCH] mmc: sdhci-cadence: enable probing from ACPI
@ 2026-11-03 9:35 Paul Cercueil
2026-11-04 14:30 ` Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Paul Cercueil @ 2026-11-03 9:35 UTC (permalink / raw)
To: Tanmay Kathpalia, Adrian Hunter, Ulf Hansson
Cc: linux-mmc, linux-kernel, Thomas Petazzoni, Paul Cercueil
Use the device property API instead of the OF-specific property API.
This way, the driver will also probe from ACPI.
Note the change in the core's probe function for SD6HC. We can't have
named clocks in ACPI.
Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
---
drivers/mmc/host/sdhci-cadence-core.c | 22 ++++++++++++----------
drivers/mmc/host/sdhci-cadence-phy-v6.c | 10 +++++-----
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/mmc/host/sdhci-cadence-core.c b/drivers/mmc/host/sdhci-cadence-core.c
index 745455743b01..c5a4fa8e2fc6 100644
--- a/drivers/mmc/host/sdhci-cadence-core.c
+++ b/drivers/mmc/host/sdhci-cadence-core.c
@@ -5,6 +5,7 @@
* Copyright (C) 2026 Altera Corporation
*/
+#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/dma-mapping.h>
@@ -145,26 +146,26 @@ static int sdhci_cdns4_write_phy_reg(struct sdhci_cdns_priv *priv, u8 addr, u8 d
return ret;
}
-static unsigned int sdhci_cdns4_phy_param_count(struct device_node *np)
+static unsigned int sdhci_cdns4_phy_param_count(struct device *dev)
{
unsigned int count = 0;
int i;
for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++)
- if (of_property_present(np, sdhci_cdns4_phy_cfgs[i].property))
+ if (device_property_present(dev, sdhci_cdns4_phy_cfgs[i].property))
count++;
return count;
}
-static void sdhci_cdns4_phy_param_parse(struct device_node *np, struct sdhci_cdns4_phy *phy)
+static void sdhci_cdns4_phy_param_parse(struct device *dev, struct sdhci_cdns4_phy *phy)
{
struct sdhci_cdns4_phy_param *p = phy->phy_params;
u32 val;
int ret, i;
for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++) {
- ret = of_property_read_u32(np, sdhci_cdns4_phy_cfgs[i].property, &val);
+ ret = device_property_read_u32(dev, sdhci_cdns4_phy_cfgs[i].property, &val);
if (ret)
continue;
@@ -204,7 +205,7 @@ static int sdhci_cdns_set_dma_mask(struct sdhci_host *host)
struct device *dev = mmc_dev(host->mmc);
int ret;
- data = of_device_get_match_data(dev);
+ data = device_get_match_data(dev);
if (!data || !data->dma_mask)
return 0;
@@ -649,13 +650,13 @@ static int sdhci_cdns4_phy_probe(struct platform_device *pdev, struct sdhci_cdns
struct sdhci_cdns4_phy *phy;
unsigned int nr_phy_params;
- nr_phy_params = sdhci_cdns4_phy_param_count(dev->of_node);
+ nr_phy_params = sdhci_cdns4_phy_param_count(dev);
phy = devm_kzalloc(dev, struct_size(phy, phy_params, nr_phy_params), GFP_KERNEL);
if (!phy)
return -ENOMEM;
phy->nr_phy_params = nr_phy_params;
- sdhci_cdns4_phy_param_parse(dev->of_node, phy);
+ sdhci_cdns4_phy_param_parse(dev, phy);
priv->phy = phy;
return sdhci_cdns4_phy_init(priv);
@@ -673,7 +674,8 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
static const u16 version = SDHCI_SPEC_400 << SDHCI_SPEC_VER_SHIFT;
- if (of_device_is_compatible(dev->of_node, "cdns,sd6hc")) {
+ /* Note: ACPI only provides one unnamed clock */
+ if (!has_acpi_companion(dev) && device_is_compatible(dev, "cdns,sd6hc")) {
clk = devm_clk_get_enabled(dev, "ciu");
if (IS_ERR(clk))
return dev_err_probe(dev, PTR_ERR(clk), "failed to enable ciu clock\n");
@@ -687,7 +689,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
return PTR_ERR(clk);
}
- data = of_device_get_match_data(dev);
+ data = device_get_match_data(dev);
if (!data)
return dev_err_probe(dev, -EINVAL, "missing platform driver data\n");
@@ -723,7 +725,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
* For SD6HC, sdhci_add_host() will automatically read capabilities
* and version from the host controller registers.
*/
- if (of_device_is_compatible(dev->of_node, "cdns,sd4hc")) {
+ if (device_is_compatible(dev, "cdns,sd4hc")) {
__sdhci_read_caps(host, &version, NULL, NULL);
ret = sdhci_cdns4_phy_probe(pdev, priv);
if (ret)
diff --git a/drivers/mmc/host/sdhci-cadence-phy-v6.c b/drivers/mmc/host/sdhci-cadence-phy-v6.c
index 22d56bb46d75..551a0e3b58ad 100644
--- a/drivers/mmc/host/sdhci-cadence-phy-v6.c
+++ b/drivers/mmc/host/sdhci-cadence-phy-v6.c
@@ -880,17 +880,17 @@ int sdhci_cdns6_phy_probe(struct platform_device *pdev, struct sdhci_cdns_priv *
* Cadence-recommended defaults (2500 ps IO-cell delays, 24 ps DLL
* delay element) that are valid for typical SoC packaging.
*/
- ret = of_property_read_u32(dev->of_node, "cdns,iocell-input-delay-ps",
- &phy->iocell_input_delay);
+ ret = device_property_read_u32(dev, "cdns,iocell-input-delay-ps",
+ &phy->iocell_input_delay);
if (ret)
phy->iocell_input_delay = SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
- ret = of_property_read_u32(dev->of_node, "cdns,iocell-output-delay-ps",
- &phy->iocell_output_delay);
+ ret = device_property_read_u32(dev, "cdns,iocell-output-delay-ps",
+ &phy->iocell_output_delay);
if (ret)
phy->iocell_output_delay = SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
- ret = of_property_read_u32(dev->of_node, "cdns,delay-element-ps", &phy->delay_element);
+ ret = device_property_read_u32(dev, "cdns,delay-element-ps", &phy->delay_element);
if (ret) {
phy->delay_element = SDHCI_CDNS6_PHY_DEFAULT_DELAY_ELEMENT;
} else if (!phy->delay_element) {
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-cadence: enable probing from ACPI
2026-11-03 9:35 [PATCH] mmc: sdhci-cadence: enable probing from ACPI Paul Cercueil
@ 2026-11-04 14:30 ` Adrian Hunter
2026-11-04 14:38 ` Paul Cercueil
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2026-11-04 14:30 UTC (permalink / raw)
To: Paul Cercueil, Tanmay Kathpalia, Ulf Hansson
Cc: linux-mmc, linux-kernel, Thomas Petazzoni
On 03/11/2026 11:35, Paul Cercueil wrote:
> Use the device property API instead of the OF-specific property API.
> This way, the driver will also probe from ACPI.
>
> Note the change in the core's probe function for SD6HC. We can't have
> named clocks in ACPI.
Do you mean in the future? ACPI does not provide clocks at all
at the moment does it? Otherwise, clocks registered directly by
clk_register_clkdev() can have names. Maybe I misunderstand,
but perhaps clarify the commit message.
>
> Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
Nevertheless:
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-cadence-core.c | 22 ++++++++++++----------
> drivers/mmc/host/sdhci-cadence-phy-v6.c | 10 +++++-----
> 2 files changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-cadence-core.c b/drivers/mmc/host/sdhci-cadence-core.c
> index 745455743b01..c5a4fa8e2fc6 100644
> --- a/drivers/mmc/host/sdhci-cadence-core.c
> +++ b/drivers/mmc/host/sdhci-cadence-core.c
> @@ -5,6 +5,7 @@
> * Copyright (C) 2026 Altera Corporation
> */
>
> +#include <linux/acpi.h>
> #include <linux/bitfield.h>
> #include <linux/bits.h>
> #include <linux/dma-mapping.h>
> @@ -145,26 +146,26 @@ static int sdhci_cdns4_write_phy_reg(struct sdhci_cdns_priv *priv, u8 addr, u8 d
> return ret;
> }
>
> -static unsigned int sdhci_cdns4_phy_param_count(struct device_node *np)
> +static unsigned int sdhci_cdns4_phy_param_count(struct device *dev)
> {
> unsigned int count = 0;
> int i;
>
> for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++)
> - if (of_property_present(np, sdhci_cdns4_phy_cfgs[i].property))
> + if (device_property_present(dev, sdhci_cdns4_phy_cfgs[i].property))
> count++;
>
> return count;
> }
>
> -static void sdhci_cdns4_phy_param_parse(struct device_node *np, struct sdhci_cdns4_phy *phy)
> +static void sdhci_cdns4_phy_param_parse(struct device *dev, struct sdhci_cdns4_phy *phy)
> {
> struct sdhci_cdns4_phy_param *p = phy->phy_params;
> u32 val;
> int ret, i;
>
> for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++) {
> - ret = of_property_read_u32(np, sdhci_cdns4_phy_cfgs[i].property, &val);
> + ret = device_property_read_u32(dev, sdhci_cdns4_phy_cfgs[i].property, &val);
> if (ret)
> continue;
>
> @@ -204,7 +205,7 @@ static int sdhci_cdns_set_dma_mask(struct sdhci_host *host)
> struct device *dev = mmc_dev(host->mmc);
> int ret;
>
> - data = of_device_get_match_data(dev);
> + data = device_get_match_data(dev);
> if (!data || !data->dma_mask)
> return 0;
>
> @@ -649,13 +650,13 @@ static int sdhci_cdns4_phy_probe(struct platform_device *pdev, struct sdhci_cdns
> struct sdhci_cdns4_phy *phy;
> unsigned int nr_phy_params;
>
> - nr_phy_params = sdhci_cdns4_phy_param_count(dev->of_node);
> + nr_phy_params = sdhci_cdns4_phy_param_count(dev);
> phy = devm_kzalloc(dev, struct_size(phy, phy_params, nr_phy_params), GFP_KERNEL);
> if (!phy)
> return -ENOMEM;
>
> phy->nr_phy_params = nr_phy_params;
> - sdhci_cdns4_phy_param_parse(dev->of_node, phy);
> + sdhci_cdns4_phy_param_parse(dev, phy);
> priv->phy = phy;
>
> return sdhci_cdns4_phy_init(priv);
> @@ -673,7 +674,8 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> static const u16 version = SDHCI_SPEC_400 << SDHCI_SPEC_VER_SHIFT;
>
> - if (of_device_is_compatible(dev->of_node, "cdns,sd6hc")) {
> + /* Note: ACPI only provides one unnamed clock */
> + if (!has_acpi_companion(dev) && device_is_compatible(dev, "cdns,sd6hc")) {
> clk = devm_clk_get_enabled(dev, "ciu");
> if (IS_ERR(clk))
> return dev_err_probe(dev, PTR_ERR(clk), "failed to enable ciu clock\n");
> @@ -687,7 +689,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
> return PTR_ERR(clk);
> }
>
> - data = of_device_get_match_data(dev);
> + data = device_get_match_data(dev);
> if (!data)
> return dev_err_probe(dev, -EINVAL, "missing platform driver data\n");
>
> @@ -723,7 +725,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
> * For SD6HC, sdhci_add_host() will automatically read capabilities
> * and version from the host controller registers.
> */
> - if (of_device_is_compatible(dev->of_node, "cdns,sd4hc")) {
> + if (device_is_compatible(dev, "cdns,sd4hc")) {
> __sdhci_read_caps(host, &version, NULL, NULL);
> ret = sdhci_cdns4_phy_probe(pdev, priv);
> if (ret)
> diff --git a/drivers/mmc/host/sdhci-cadence-phy-v6.c b/drivers/mmc/host/sdhci-cadence-phy-v6.c
> index 22d56bb46d75..551a0e3b58ad 100644
> --- a/drivers/mmc/host/sdhci-cadence-phy-v6.c
> +++ b/drivers/mmc/host/sdhci-cadence-phy-v6.c
> @@ -880,17 +880,17 @@ int sdhci_cdns6_phy_probe(struct platform_device *pdev, struct sdhci_cdns_priv *
> * Cadence-recommended defaults (2500 ps IO-cell delays, 24 ps DLL
> * delay element) that are valid for typical SoC packaging.
> */
> - ret = of_property_read_u32(dev->of_node, "cdns,iocell-input-delay-ps",
> - &phy->iocell_input_delay);
> + ret = device_property_read_u32(dev, "cdns,iocell-input-delay-ps",
> + &phy->iocell_input_delay);
> if (ret)
> phy->iocell_input_delay = SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
>
> - ret = of_property_read_u32(dev->of_node, "cdns,iocell-output-delay-ps",
> - &phy->iocell_output_delay);
> + ret = device_property_read_u32(dev, "cdns,iocell-output-delay-ps",
> + &phy->iocell_output_delay);
> if (ret)
> phy->iocell_output_delay = SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
>
> - ret = of_property_read_u32(dev->of_node, "cdns,delay-element-ps", &phy->delay_element);
> + ret = device_property_read_u32(dev, "cdns,delay-element-ps", &phy->delay_element);
> if (ret) {
> phy->delay_element = SDHCI_CDNS6_PHY_DEFAULT_DELAY_ELEMENT;
> } else if (!phy->delay_element) {
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-cadence: enable probing from ACPI
2026-11-04 14:30 ` Adrian Hunter
@ 2026-11-04 14:38 ` Paul Cercueil
2026-11-04 16:05 ` Adrian Hunter
0 siblings, 1 reply; 5+ messages in thread
From: Paul Cercueil @ 2026-11-04 14:38 UTC (permalink / raw)
To: Adrian Hunter, Tanmay Kathpalia, Ulf Hansson
Cc: linux-mmc, linux-kernel, Thomas Petazzoni
Hi Adrian,
Le mercredi 04 novembre 2026 à 16:30 +0200, Adrian Hunter a écrit :
> On 03/11/2026 11:35, Paul Cercueil wrote:
> > Use the device property API instead of the OF-specific property API.
> > This way, the driver will also probe from ACPI.
> >
> > Note the change in the core's probe function for SD6HC. We can't have
> > named clocks in ACPI.
>
> Do you mean in the future? ACPI does not provide clocks at all
> at the moment does it? Otherwise, clocks registered directly by
> clk_register_clkdev() can have names. Maybe I misunderstand,
> but perhaps clarify the commit message.
I sent another patch in parallel of this one, that adds basic support for clock
resources introduced in ACPI 6.5:
https://lore.kernel.org/linux-acpi/20261103084718.8222-1-paul.cercueil@bootlin.com/T/#u
> >
> > Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
>
> Nevertheless:
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Thank you!
Cheers,
-Paul
> > ---
> > drivers/mmc/host/sdhci-cadence-core.c | 22 ++++++++++++----------
> > drivers/mmc/host/sdhci-cadence-phy-v6.c | 10 +++++-----
> > 2 files changed, 17 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-cadence-core.c b/drivers/mmc/host/sdhci-
> > cadence-core.c
> > index 745455743b01..c5a4fa8e2fc6 100644
> > --- a/drivers/mmc/host/sdhci-cadence-core.c
> > +++ b/drivers/mmc/host/sdhci-cadence-core.c
> > @@ -5,6 +5,7 @@
> > * Copyright (C) 2026 Altera Corporation
> > */
> >
> > +#include <linux/acpi.h>
> > #include <linux/bitfield.h>
> > #include <linux/bits.h>
> > #include <linux/dma-mapping.h>
> > @@ -145,26 +146,26 @@ static int sdhci_cdns4_write_phy_reg(struct
> > sdhci_cdns_priv *priv, u8 addr, u8 d
> > return ret;
> > }
> >
> > -static unsigned int sdhci_cdns4_phy_param_count(struct device_node *np)
> > +static unsigned int sdhci_cdns4_phy_param_count(struct device *dev)
> > {
> > unsigned int count = 0;
> > int i;
> >
> > for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++)
> > - if (of_property_present(np,
> > sdhci_cdns4_phy_cfgs[i].property))
> > + if (device_property_present(dev,
> > sdhci_cdns4_phy_cfgs[i].property))
> > count++;
> >
> > return count;
> > }
> >
> > -static void sdhci_cdns4_phy_param_parse(struct device_node *np, struct
> > sdhci_cdns4_phy *phy)
> > +static void sdhci_cdns4_phy_param_parse(struct device *dev, struct
> > sdhci_cdns4_phy *phy)
> > {
> > struct sdhci_cdns4_phy_param *p = phy->phy_params;
> > u32 val;
> > int ret, i;
> >
> > for (i = 0; i < ARRAY_SIZE(sdhci_cdns4_phy_cfgs); i++) {
> > - ret = of_property_read_u32(np,
> > sdhci_cdns4_phy_cfgs[i].property, &val);
> > + ret = device_property_read_u32(dev,
> > sdhci_cdns4_phy_cfgs[i].property, &val);
> > if (ret)
> > continue;
> >
> > @@ -204,7 +205,7 @@ static int sdhci_cdns_set_dma_mask(struct sdhci_host
> > *host)
> > struct device *dev = mmc_dev(host->mmc);
> > int ret;
> >
> > - data = of_device_get_match_data(dev);
> > + data = device_get_match_data(dev);
> > if (!data || !data->dma_mask)
> > return 0;
> >
> > @@ -649,13 +650,13 @@ static int sdhci_cdns4_phy_probe(struct
> > platform_device *pdev, struct sdhci_cdns
> > struct sdhci_cdns4_phy *phy;
> > unsigned int nr_phy_params;
> >
> > - nr_phy_params = sdhci_cdns4_phy_param_count(dev->of_node);
> > + nr_phy_params = sdhci_cdns4_phy_param_count(dev);
> > phy = devm_kzalloc(dev, struct_size(phy, phy_params,
> > nr_phy_params), GFP_KERNEL);
> > if (!phy)
> > return -ENOMEM;
> >
> > phy->nr_phy_params = nr_phy_params;
> > - sdhci_cdns4_phy_param_parse(dev->of_node, phy);
> > + sdhci_cdns4_phy_param_parse(dev, phy);
> > priv->phy = phy;
> >
> > return sdhci_cdns4_phy_init(priv);
> > @@ -673,7 +674,8 @@ static int sdhci_cdns_probe(struct platform_device
> > *pdev)
> > struct device *dev = &pdev->dev;
> > static const u16 version = SDHCI_SPEC_400 << SDHCI_SPEC_VER_SHIFT;
> >
> > - if (of_device_is_compatible(dev->of_node, "cdns,sd6hc")) {
> > + /* Note: ACPI only provides one unnamed clock */
> > + if (!has_acpi_companion(dev) && device_is_compatible(dev,
> > "cdns,sd6hc")) {
> > clk = devm_clk_get_enabled(dev, "ciu");
> > if (IS_ERR(clk))
> > return dev_err_probe(dev, PTR_ERR(clk), "failed to
> > enable ciu clock\n");
> > @@ -687,7 +689,7 @@ static int sdhci_cdns_probe(struct platform_device
> > *pdev)
> > return PTR_ERR(clk);
> > }
> >
> > - data = of_device_get_match_data(dev);
> > + data = device_get_match_data(dev);
> > if (!data)
> > return dev_err_probe(dev, -EINVAL, "missing platform driver
> > data\n");
> >
> > @@ -723,7 +725,7 @@ static int sdhci_cdns_probe(struct platform_device
> > *pdev)
> > * For SD6HC, sdhci_add_host() will automatically read capabilities
> > * and version from the host controller registers.
> > */
> > - if (of_device_is_compatible(dev->of_node, "cdns,sd4hc")) {
> > + if (device_is_compatible(dev, "cdns,sd4hc")) {
> > __sdhci_read_caps(host, &version, NULL, NULL);
> > ret = sdhci_cdns4_phy_probe(pdev, priv);
> > if (ret)
> > diff --git a/drivers/mmc/host/sdhci-cadence-phy-v6.c
> > b/drivers/mmc/host/sdhci-cadence-phy-v6.c
> > index 22d56bb46d75..551a0e3b58ad 100644
> > --- a/drivers/mmc/host/sdhci-cadence-phy-v6.c
> > +++ b/drivers/mmc/host/sdhci-cadence-phy-v6.c
> > @@ -880,17 +880,17 @@ int sdhci_cdns6_phy_probe(struct platform_device
> > *pdev, struct sdhci_cdns_priv *
> > * Cadence-recommended defaults (2500 ps IO-cell delays, 24 ps DLL
> > * delay element) that are valid for typical SoC packaging.
> > */
> > - ret = of_property_read_u32(dev->of_node, "cdns,iocell-input-delay-
> > ps",
> > - &phy->iocell_input_delay);
> > + ret = device_property_read_u32(dev, "cdns,iocell-input-delay-ps",
> > + &phy->iocell_input_delay);
> > if (ret)
> > phy->iocell_input_delay =
> > SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
> >
> > - ret = of_property_read_u32(dev->of_node, "cdns,iocell-output-delay-
> > ps",
> > - &phy->iocell_output_delay);
> > + ret = device_property_read_u32(dev, "cdns,iocell-output-delay-ps",
> > + &phy->iocell_output_delay);
> > if (ret)
> > phy->iocell_output_delay =
> > SDHCI_CDNS6_PHY_DEFAULT_IOCELL_DELAY;
> >
> > - ret = of_property_read_u32(dev->of_node, "cdns,delay-element-ps",
> > &phy->delay_element);
> > + ret = device_property_read_u32(dev, "cdns,delay-element-ps", &phy-
> > >delay_element);
> > if (ret) {
> > phy->delay_element = SDHCI_CDNS6_PHY_DEFAULT_DELAY_ELEMENT;
> > } else if (!phy->delay_element) {
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-cadence: enable probing from ACPI
2026-11-04 14:38 ` Paul Cercueil
@ 2026-11-04 16:05 ` Adrian Hunter
2026-11-04 16:18 ` Paul Cercueil
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Hunter @ 2026-11-04 16:05 UTC (permalink / raw)
To: Paul Cercueil, Tanmay Kathpalia, Ulf Hansson
Cc: linux-mmc, linux-kernel, Thomas Petazzoni
On 04/11/2026 16:38, Paul Cercueil wrote:
> Hi Adrian,
>
> Le mercredi 04 novembre 2026 à 16:30 +0200, Adrian Hunter a écrit :
>> On 03/11/2026 11:35, Paul Cercueil wrote:
>>> Use the device property API instead of the OF-specific property API.
>>> This way, the driver will also probe from ACPI.
>>>
>>> Note the change in the core's probe function for SD6HC. We can't have
>>> named clocks in ACPI.
>>
>> Do you mean in the future? ACPI does not provide clocks at all
>> at the moment does it? Otherwise, clocks registered directly by
>> clk_register_clkdev() can have names. Maybe I misunderstand,
>> but perhaps clarify the commit message.
>
> I sent another patch in parallel of this one, that adds basic support for clock
> resources introduced in ACPI 6.5:
>
> https://lore.kernel.org/linux-acpi/20261103084718.8222-1-paul.cercueil@bootlin.com/T/#u
>
Would have been worth mentioning that in a cover letter.
Seems like it gives the clock a name
+ snprintf(name, sizeof(name), "%s-clk%u", dev_name(dev), data->idx++);
+
+ err = devm_clk_hw_register_clkdev(dev, clk, name, dev_name(dev));
but clk_find() doesn't look like it would match then - the comment says:
* An entry with a NULL ID is assumed to be a wildcard.
* If an entry has a device ID, it must match
* If an entry has a connection ID, it must match <------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: sdhci-cadence: enable probing from ACPI
2026-11-04 16:05 ` Adrian Hunter
@ 2026-11-04 16:18 ` Paul Cercueil
0 siblings, 0 replies; 5+ messages in thread
From: Paul Cercueil @ 2026-11-04 16:18 UTC (permalink / raw)
To: Adrian Hunter, Tanmay Kathpalia, Ulf Hansson
Cc: linux-mmc, linux-kernel, Thomas Petazzoni
Le mercredi 04 novembre 2026 à 18:05 +0200, Adrian Hunter a écrit :
> On 04/11/2026 16:38, Paul Cercueil wrote:
> > Hi Adrian,
> >
> > Le mercredi 04 novembre 2026 à 16:30 +0200, Adrian Hunter a écrit :
> > > On 03/11/2026 11:35, Paul Cercueil wrote:
> > > > Use the device property API instead of the OF-specific property API.
> > > > This way, the driver will also probe from ACPI.
> > > >
> > > > Note the change in the core's probe function for SD6HC. We can't have
> > > > named clocks in ACPI.
> > >
> > > Do you mean in the future? ACPI does not provide clocks at all
> > > at the moment does it? Otherwise, clocks registered directly by
> > > clk_register_clkdev() can have names. Maybe I misunderstand,
> > > but perhaps clarify the commit message.
> >
> > I sent another patch in parallel of this one, that adds basic support for
> > clock
> > resources introduced in ACPI 6.5:
> >
> > https://lore.kernel.org/linux-acpi/20261103084718.8222-1-paul.cercueil@bootlin.com/T/#u
> >
> Would have been worth mentioning that in a cover letter.
>
> Seems like it gives the clock a name
>
> + snprintf(name, sizeof(name), "%s-clk%u", dev_name(dev), data-
> >idx++);
> +
> + err = devm_clk_hw_register_clkdev(dev, clk, name,
> dev_name(dev));
>
> but clk_find() doesn't look like it would match then - the comment says:
> * An entry with a NULL ID is assumed to be a wildcard.
> * If an entry has a device ID, it must match
> * If an entry has a connection ID, it must match <------
You're missing part 3 ;)
https://lore.kernel.org/linux-arm-kernel/20261103084915.8405-1-paul.cercueil@bootlin.com/T/#u
I also considered not giving them a name (which wouldn't require the clkdev
patch), but thought that there's probably some ACPI tables out there that
provide more than one fixed clock for the same device, so it felt like the
safest option.
Cheers,
-Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-04 16:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 9:35 [PATCH] mmc: sdhci-cadence: enable probing from ACPI Paul Cercueil
2026-11-04 14:30 ` Adrian Hunter
2026-11-04 14:38 ` Paul Cercueil
2026-11-04 16:05 ` Adrian Hunter
2026-11-04 16:18 ` Paul Cercueil
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®