linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: Update firmware interface API
@ 2020-11-20 23:38 Jeremy Linton
  2020-11-24 14:25 ` Ulf Hansson
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremy Linton @ 2020-11-20 23:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-kernel, adrian.hunter, ulf.hansson, Jeremy Linton

The device_* calls were added a few years ago to abstract
DT/ACPI/fwnode firmware interfaces. Lets convert the two
sdhci caps fields to use the generic calls rather than the OF
specific ones. This has the side effect of allowing
ACPI based devices to quirk themselves when the caps field
is broken.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
 drivers/mmc/host/sdhci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 592a55a34b58..feba64fbde16 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
 	if (host->v4_mode)
 		sdhci_do_enable_v4_mode(host);
 
-	of_property_read_u64(mmc_dev(host->mmc)->of_node,
-			     "sdhci-caps-mask", &dt_caps_mask);
-	of_property_read_u64(mmc_dev(host->mmc)->of_node,
-			     "sdhci-caps", &dt_caps);
+	device_property_read_u64_array(mmc_dev(host->mmc),
+				       "sdhci-caps-mask", &dt_caps_mask, 1);
+	device_property_read_u64_array(mmc_dev(host->mmc),
+				       "sdhci-caps", &dt_caps, 1);
 
 	v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
 	host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci: Update firmware interface API
  2020-11-20 23:38 [PATCH] mmc: sdhci: Update firmware interface API Jeremy Linton
@ 2020-11-24 14:25 ` Ulf Hansson
  2020-11-24 14:51   ` Adrian Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2020-11-24 14:25 UTC (permalink / raw)
  To: Jeremy Linton; +Cc: linux-mmc, Linux Kernel Mailing List, Adrian Hunter

On Sat, 21 Nov 2020 at 00:39, Jeremy Linton <jeremy.linton@arm.com> wrote:
>
> The device_* calls were added a few years ago to abstract
> DT/ACPI/fwnode firmware interfaces. Lets convert the two
> sdhci caps fields to use the generic calls rather than the OF
> specific ones. This has the side effect of allowing
> ACPI based devices to quirk themselves when the caps field
> is broken.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 592a55a34b58..feba64fbde16 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
>         if (host->v4_mode)
>                 sdhci_do_enable_v4_mode(host);
>
> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
> -                            "sdhci-caps-mask", &dt_caps_mask);
> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
> -                            "sdhci-caps", &dt_caps);
> +       device_property_read_u64_array(mmc_dev(host->mmc),
> +                                      "sdhci-caps-mask", &dt_caps_mask, 1);
> +       device_property_read_u64_array(mmc_dev(host->mmc),
> +                                      "sdhci-caps", &dt_caps, 1);
>
>         v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
>         host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci: Update firmware interface API
  2020-11-24 14:25 ` Ulf Hansson
@ 2020-11-24 14:51   ` Adrian Hunter
  2020-11-25  3:26     ` Jeremy Linton
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2020-11-24 14:51 UTC (permalink / raw)
  To: Ulf Hansson, Jeremy Linton; +Cc: linux-mmc, Linux Kernel Mailing List

On 24/11/20 4:25 pm, Ulf Hansson wrote:
> On Sat, 21 Nov 2020 at 00:39, Jeremy Linton <jeremy.linton@arm.com> wrote:
>>
>> The device_* calls were added a few years ago to abstract
>> DT/ACPI/fwnode firmware interfaces. Lets convert the two
>> sdhci caps fields to use the generic calls rather than the OF
>> specific ones. This has the side effect of allowing
>> ACPI based devices to quirk themselves when the caps field
>> is broken.
>>
>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> 
> Applied for next, thanks!
> 
> Kind regards
> Uffe
> 
> 
>> ---
>>  drivers/mmc/host/sdhci.c | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 592a55a34b58..feba64fbde16 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
>>         if (host->v4_mode)
>>                 sdhci_do_enable_v4_mode(host);
>>
>> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
>> -                            "sdhci-caps-mask", &dt_caps_mask);
>> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
>> -                            "sdhci-caps", &dt_caps);
>> +       device_property_read_u64_array(mmc_dev(host->mmc),
>> +                                      "sdhci-caps-mask", &dt_caps_mask, 1);
>> +       device_property_read_u64_array(mmc_dev(host->mmc),
>> +                                      "sdhci-caps", &dt_caps, 1);

But why not use device_property_read_u64()?

>>
>>         v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
>>         host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
>> --
>> 2.26.2
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: sdhci: Update firmware interface API
  2020-11-24 14:51   ` Adrian Hunter
@ 2020-11-25  3:26     ` Jeremy Linton
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Linton @ 2020-11-25  3:26 UTC (permalink / raw)
  To: Adrian Hunter, Ulf Hansson; +Cc: linux-mmc, Linux Kernel Mailing List

Hi,

On 11/24/20 8:51 AM, Adrian Hunter wrote:
> On 24/11/20 4:25 pm, Ulf Hansson wrote:
>> On Sat, 21 Nov 2020 at 00:39, Jeremy Linton <jeremy.linton@arm.com> wrote:
>>>
>>> The device_* calls were added a few years ago to abstract
>>> DT/ACPI/fwnode firmware interfaces. Lets convert the two
>>> sdhci caps fields to use the generic calls rather than the OF
>>> specific ones. This has the side effect of allowing
>>> ACPI based devices to quirk themselves when the caps field
>>> is broken.
>>>
>>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>>
>> Applied for next, thanks!
>>
>> Kind regards
>> Uffe
>>
>>
>>> ---
>>>   drivers/mmc/host/sdhci.c | 8 ++++----
>>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index 592a55a34b58..feba64fbde16 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -3992,10 +3992,10 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
>>>          if (host->v4_mode)
>>>                  sdhci_do_enable_v4_mode(host);
>>>
>>> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
>>> -                            "sdhci-caps-mask", &dt_caps_mask);
>>> -       of_property_read_u64(mmc_dev(host->mmc)->of_node,
>>> -                            "sdhci-caps", &dt_caps);
>>> +       device_property_read_u64_array(mmc_dev(host->mmc),
>>> +                                      "sdhci-caps-mask", &dt_caps_mask, 1);
>>> +       device_property_read_u64_array(mmc_dev(host->mmc),
>>> +                                      "sdhci-caps", &dt_caps, 1);
> 
> But why not use device_property_read_u64()?

That would be more concise in this case.

I will post and update.

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-25  3:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-20 23:38 [PATCH] mmc: sdhci: Update firmware interface API Jeremy Linton
2020-11-24 14:25 ` Ulf Hansson
2020-11-24 14:51   ` Adrian Hunter
2020-11-25  3:26     ` Jeremy Linton

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).