diff mbox

[1/9] clk: davinci: psc-dm365: use two lookup entries for the aemif clock

Message ID 20180625152920.11549-2-brgl@bgdev.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Bartosz Golaszewski June 25, 2018, 3:29 p.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to be able to get the clock both from the board file by its
con_id and from the aemif driver by dev_id.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/clk/davinci/psc-dm365.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Lechner June 25, 2018, 3:53 p.m. UTC | #1
On 06/25/2018 10:29 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We want to be able to get the clock both from the board file by its
> con_id and from the aemif driver by dev_id.

What about the other SoCs? Don't they need this change as well?

> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>   drivers/clk/davinci/psc-dm365.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/davinci/psc-dm365.c b/drivers/clk/davinci/psc-dm365.c
> index 8c73086cc676..c75424f4ea3b 100644
> --- a/drivers/clk/davinci/psc-dm365.c
> +++ b/drivers/clk/davinci/psc-dm365.c
> @@ -21,7 +21,8 @@ LPSC_CLKDEV1(mmcsd1_clkdev,		NULL,		"da830-mmc.1");
>   LPSC_CLKDEV1(asp0_clkdev,		NULL,		"davinci-mcbsp");
>   LPSC_CLKDEV1(usb_clkdev,		"usb",		NULL);
>   LPSC_CLKDEV1(spi2_clkdev,		NULL,		"spi_davinci.2");
> -LPSC_CLKDEV1(aemif_clkdev,		"aemif",	NULL);
> +LPSC_CLKDEV2(aemif_clkdev,		"aemif",	NULL,
> +					NULL,		"ti-aemif");
>   LPSC_CLKDEV1(mmcsd0_clkdev,		NULL,		"da830-mmc.0");
>   LPSC_CLKDEV1(i2c_clkdev,		NULL,		"i2c_davinci.1");
>   LPSC_CLKDEV1(uart0_clkdev,		NULL,		"serial8250.0");
>
Bartosz Golaszewski June 25, 2018, 4:01 p.m. UTC | #2
2018-06-25 17:53 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/25/2018 10:29 AM, Bartosz Golaszewski wrote:
>>
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> We want to be able to get the clock both from the board file by its
>> con_id and from the aemif driver by dev_id.
>
>
> What about the other SoCs? Don't they need this change as well?
>

So I double checked and turns out I missed one other board that's
affected by this series and calls clk_get() from machine code:
dm644x-evm.

I'll fix it in v2.

Thanks,
Bart

>
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> ---
>>   drivers/clk/davinci/psc-dm365.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/davinci/psc-dm365.c
>> b/drivers/clk/davinci/psc-dm365.c
>> index 8c73086cc676..c75424f4ea3b 100644
>> --- a/drivers/clk/davinci/psc-dm365.c
>> +++ b/drivers/clk/davinci/psc-dm365.c
>> @@ -21,7 +21,8 @@ LPSC_CLKDEV1(mmcsd1_clkdev,           NULL,
>> "da830-mmc.1");
>>   LPSC_CLKDEV1(asp0_clkdev,             NULL,           "davinci-mcbsp");
>>   LPSC_CLKDEV1(usb_clkdev,              "usb",          NULL);
>>   LPSC_CLKDEV1(spi2_clkdev,             NULL,           "spi_davinci.2");
>> -LPSC_CLKDEV1(aemif_clkdev,             "aemif",        NULL);
>> +LPSC_CLKDEV2(aemif_clkdev,             "aemif",        NULL,
>> +                                       NULL,           "ti-aemif");
>>   LPSC_CLKDEV1(mmcsd0_clkdev,           NULL,           "da830-mmc.0");
>>   LPSC_CLKDEV1(i2c_clkdev,              NULL,           "i2c_davinci.1");
>>   LPSC_CLKDEV1(uart0_clkdev,            NULL,           "serial8250.0");
>>
>
David Lechner June 25, 2018, 4:06 p.m. UTC | #3
On 06/25/2018 11:01 AM, Bartosz Golaszewski wrote:
> 2018-06-25 17:53 GMT+02:00 David Lechner <david@lechnology.com>:
>> On 06/25/2018 10:29 AM, Bartosz Golaszewski wrote:
>>>
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> We want to be able to get the clock both from the board file by its
>>> con_id and from the aemif driver by dev_id.
>>
>>
>> What about the other SoCs? Don't they need this change as well?
>>
> 
> So I double checked and turns out I missed one other board that's
> affected by this series and calls clk_get() from machine code:
> dm644x-evm.
> 
> I'll fix it in v2.

The ti-aemif platform driver also does clk_get(). Don't you need
lookups to make that work as well? For example, DA830 doesn't have
a clock lookup for aemif at all.
Bartosz Golaszewski June 25, 2018, 4:09 p.m. UTC | #4
2018-06-25 18:06 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/25/2018 11:01 AM, Bartosz Golaszewski wrote:
>>
>> 2018-06-25 17:53 GMT+02:00 David Lechner <david@lechnology.com>:
>>>
>>> On 06/25/2018 10:29 AM, Bartosz Golaszewski wrote:
>>>>
>>>>
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> We want to be able to get the clock both from the board file by its
>>>> con_id and from the aemif driver by dev_id.
>>>
>>>
>>>
>>> What about the other SoCs? Don't they need this change as well?
>>>
>>
>> So I double checked and turns out I missed one other board that's
>> affected by this series and calls clk_get() from machine code:
>> dm644x-evm.
>>
>> I'll fix it in v2.
>
>
> The ti-aemif platform driver also does clk_get(). Don't you need
> lookups to make that work as well? For example, DA830 doesn't have
> a clock lookup for aemif at all.
>

Right, I'll check that too.

Thanks,
Bart
Bartosz Golaszewski June 26, 2018, 8:27 a.m. UTC | #5
2018-06-25 18:06 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/25/2018 11:01 AM, Bartosz Golaszewski wrote:
>>
>> 2018-06-25 17:53 GMT+02:00 David Lechner <david@lechnology.com>:
>>>
>>> On 06/25/2018 10:29 AM, Bartosz Golaszewski wrote:
>>>>
>>>>
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> We want to be able to get the clock both from the board file by its
>>>> con_id and from the aemif driver by dev_id.
>>>
>>>
>>>
>>> What about the other SoCs? Don't they need this change as well?
>>>
>>
>> So I double checked and turns out I missed one other board that's
>> affected by this series and calls clk_get() from machine code:
>> dm644x-evm.
>>
>> I'll fix it in v2.
>
>
> The ti-aemif platform driver also does clk_get(). Don't you need
> lookups to make that work as well? For example, DA830 doesn't have
> a clock lookup for aemif at all.
>

This seems like a bug: in arch/arm/mach-davinci/aemif.c in current
mainline we do call clk_get() for 'aemif' and it's called indirectly
from board-da830-evm.c via davinci_aemif_setup().

I'll address this too in v2.

Bart
diff mbox

Patch

diff --git a/drivers/clk/davinci/psc-dm365.c b/drivers/clk/davinci/psc-dm365.c
index 8c73086cc676..c75424f4ea3b 100644
--- a/drivers/clk/davinci/psc-dm365.c
+++ b/drivers/clk/davinci/psc-dm365.c
@@ -21,7 +21,8 @@  LPSC_CLKDEV1(mmcsd1_clkdev,		NULL,		"da830-mmc.1");
 LPSC_CLKDEV1(asp0_clkdev,		NULL,		"davinci-mcbsp");
 LPSC_CLKDEV1(usb_clkdev,		"usb",		NULL);
 LPSC_CLKDEV1(spi2_clkdev,		NULL,		"spi_davinci.2");
-LPSC_CLKDEV1(aemif_clkdev,		"aemif",	NULL);
+LPSC_CLKDEV2(aemif_clkdev,		"aemif",	NULL,
+					NULL,		"ti-aemif");
 LPSC_CLKDEV1(mmcsd0_clkdev,		NULL,		"da830-mmc.0");
 LPSC_CLKDEV1(i2c_clkdev,		NULL,		"i2c_davinci.1");
 LPSC_CLKDEV1(uart0_clkdev,		NULL,		"serial8250.0");