Re: [PATCH 4/7] ARM: S5P64X0: Add clkdev support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mr. Kukjin Kim,

On Thu, May 26, 2011 at 3:15 AM, Kukjin Kim <kgene.kim@xxxxxxxxxxx> wrote:
> On 05/19/11 14:18, Thomas Abraham wrote:
>>
>> Add clkdev support for Samsung's s5p64x0 platforms.
>>
>> Signed-off-by: Thomas Abraham<thomas.ab@xxxxxxxxxxx>
>> ---
>>  arch/arm/Kconfig                            |    1 +
>>  arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 ++++++++++++++++++++
>>  arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 +++++++++++++++++++
>>  arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +++++++
>>  arch/arm/plat-s5p/s5p-time.c                |    9 +++++++++
>>  5 files changed, 56 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h
>
> (snip)
>
> I wonder why following is included in this, "S5P64X0: Add clkdev support".

For clock lookups (using clk_get) based on clkdev, the platform
devices should be registered before calling the clk_get function. In
this case, the clk_get is called when platform devices
(s3c_device_timer[]) is not registered. So these platform devices can
be assigned a init_name which is then used by clk_dev to lookup the
clocks. So, that is the reason for modifying the clock lookup in
s5p-time.c file.

Thanks,
Thomas.

>
>> diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c
>> index 8090403..d9efd29 100644
>> --- a/arch/arm/plat-s5p/s5p-time.c
>> +++ b/arch/arm/plat-s5p/s5p-time.c
>> @@ -408,6 +408,7 @@ static void __init s5p_timer_resources(void)
>>
>>        unsigned long event_id = timer_source.event_id;
>>        unsigned long source_id = timer_source.source_id;
>> +       char devname[15];
>>
>>        timerclk = clk_get(NULL, "timers");
>>        if (IS_ERR(timerclk))
>> @@ -415,6 +416,10 @@ static void __init s5p_timer_resources(void)
>>
>>        clk_enable(timerclk);
>>
>> +       sprintf(devname, "s3c24xx-pwm.%lu", event_id);
>> +       s3c_device_timer[event_id].id = event_id;
>> +       s3c_device_timer[event_id].dev.init_name = devname;
>> +
>>        tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
>>        if (IS_ERR(tin_event))
>>                panic("failed to get pwm-tin clock for event timer");
>> @@ -425,6 +430,10 @@ static void __init s5p_timer_resources(void)
>>
>>        clk_enable(tin_event);
>>
>> +       sprintf(devname, "s3c24xx-pwm.%lu", source_id);
>> +       s3c_device_timer[source_id].id = source_id;
>> +       s3c_device_timer[source_id].dev.init_name = devname;
>> +
>>        tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
>>        if (IS_ERR(tin_source))
>>                panic("failed to get pwm-tin clock for source timer");
>
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@xxxxxxxxxxx>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc"
> in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux