[-,v0,2/2] DaVinci - vpfe capture - Make clocks configurable

Message ID 1259687940-31435-2-git-send-email-m-karicheri2@ti.com (mailing list archive)
State RFC, archived
Headers

Commit Message

m-karicheri2@ti.com Dec. 1, 2009, 5:19 p.m. UTC
  From: Muralidharan Karicheri <m-karicheri2@ti.com>

Adding the clocks in vpfe capture configuration

Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com>
---
 arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++
 arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
  

Comments

Hiremath, Vaibhav Dec. 3, 2009, 6:40 a.m. UTC | #1
> -----Original Message-----
> From: Karicheri, Muralidharan
> Sent: Tuesday, December 01, 2009 10:49 PM
> To: linux-media@vger.kernel.org; hverkuil@xs4all.nl;
> khilman@deeprootsystems.com
> Cc: davinci-linux-open-source@linux.davincidsp.com; Hiremath,
> Vaibhav; Karicheri, Muralidharan
> Subject: [PATCH - v0 2/2] DaVinci - vpfe capture - Make clocks
> configurable
> 
> From: Muralidharan Karicheri <m-karicheri2@ti.com>
> 
> Adding the clocks in vpfe capture configuration
> 
> Signed-off-by: Muralidharan Karicheri <m-karicheri2@ti.com>
> ---
>  arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++
>  arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++
>  2 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-davinci/board-dm355-evm.c
> b/arch/arm/mach-davinci/board-dm355-evm.c
> index a9b650d..a28985c 100644
> --- a/arch/arm/mach-davinci/board-dm355-evm.c
> +++ b/arch/arm/mach-davinci/board-dm355-evm.c
> @@ -239,6 +239,8 @@ static struct vpfe_config vpfe_cfg = {
>  	.sub_devs = vpfe_sub_devs,
>  	.card_name = "DM355 EVM",
>  	.ccdc = "DM355 CCDC",
> +	.num_clocks = 2,
> +	.clocks = {"vpss_master", "vpss_slave"},
[Hiremath, Vaibhav] Hi Murali,

I was talking to Sekhar about this and actually he made some good points about this implementation. 

If we consider specific IP, then the required clocks would remain always be the same. There might be some devices which may not be using some clocks (so as that specific feature).

Actually we are trying to create one more wrapper for clock configuration. Just to illustrate I am putting some other generic drivers examples - 

Omap-hsmmc.c - 

This driver requires 2 clocks, interface and functional. The devices which would be using this driver have to define clock with names "ick" and "fck".

VPFE-Capture (Considering only current implementation) - 

Currently we have vpfe_capture.c file (master/bridge driver) which is handling clk_get/put, and platform data is providing the details about it. 
Ideally we should handle it in respective ccdc driver file, since he has all the knowledge about required number of clocks and its name. This way we don't have to maintain/pass clock information in platform data.

I would appreciate any comments/thoughts/pointers here.

Thanks,
Vaibhav

>  };
> 
>  static struct platform_device *davinci_evm_devices[] __initdata = {
> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
> b/arch/arm/mach-davinci/board-dm644x-evm.c
> index fd0398b..45beb99 100644
> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> @@ -250,6 +250,8 @@ static struct vpfe_config vpfe_cfg = {
>  	.sub_devs = vpfe_sub_devs,
>  	.card_name = "DM6446 EVM",
>  	.ccdc = "DM6446 CCDC",
> +	.num_clocks = 2,
> +	.clocks = {"vpss_master", "vpss_slave"},
>  };
> 
>  static struct platform_device rtc_dev = {
> --
> 1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
m-karicheri2@ti.com Dec. 3, 2009, 3:55 p.m. UTC | #2
>I was talking to Sekhar about this and actually he made some good points
>about this implementation.
>
>If we consider specific IP, then the required clocks would remain always be
>the same. There might be some devices which may not be using some clocks
>(so as that specific feature).
>
>Actually we are trying to create one more wrapper for clock configuration.
>Just to illustrate I am putting some other generic drivers examples -
>
>Omap-hsmmc.c -
>
>This driver requires 2 clocks, interface and functional. The devices which
>would be using this driver have to define clock with names "ick" and "fck".
>
>VPFE-Capture (Considering only current implementation) -
>
>Currently we have vpfe_capture.c file (master/bridge driver) which is
>handling clk_get/put, and platform data is providing the details about it.
>Ideally we should handle it in respective ccdc driver file, since he has
>all the knowledge about required number of clocks and its name. This way we
>don't have to maintain/pass clock information in platform data.
>
>I would appreciate any comments/thoughts/pointers here.
>
Though I agree that this clock could be set by the ccdc driver, I am not sure if the same clock is used by an IP on different SOCs. For example take
the case of ccdc on DM6446 which is also used on OMAP 35xx SOC. Do they use
vpss master and slave clocks as is done on DM6446? If this is true, then we
could set the clock inside ccdc driver. 

Let me know so that I can re-work the patch and send it to the list.

Murali
>Thanks,
>Vaibhav
>
>>  };
>>
>>  static struct platform_device *davinci_evm_devices[] __initdata = {
>> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
>> b/arch/arm/mach-davinci/board-dm644x-evm.c
>> index fd0398b..45beb99 100644
>> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
>> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
>> @@ -250,6 +250,8 @@ static struct vpfe_config vpfe_cfg = {
>>  	.sub_devs = vpfe_sub_devs,
>>  	.card_name = "DM6446 EVM",
>>  	.ccdc = "DM6446 CCDC",
>> +	.num_clocks = 2,
>> +	.clocks = {"vpss_master", "vpss_slave"},
>>  };
>>
>>  static struct platform_device rtc_dev = {
>> --
>> 1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
m-karicheri2@ti.com Dec. 4, 2009, 11:12 p.m. UTC | #3
Vaibhav,

Could you confirm my question below? I need to submit a patch on Monday.

>>Currently we have vpfe_capture.c file (master/bridge driver) which is
>>handling clk_get/put, and platform data is providing the details about it.
>>Ideally we should handle it in respective ccdc driver file, since he has
>>all the knowledge about required number of clocks and its name. This way
>we
>>don't have to maintain/pass clock information in platform data.
>>
>>I would appreciate any comments/thoughts/pointers here.
>>

>Though I agree that this clock could be set by the ccdc driver, I am not
>sure if the same clock is used by an IP on different SOCs. For example take
>the case of ccdc on DM6446 which is also used on OMAP 35xx SOC. Do they use
>vpss master and slave clocks as is done on DM6446? If this is true, then we
>could set the clock inside ccdc driver.
>
>Let me know so that I can re-work the patch and send it to the list.
>
>Murali
>>Thanks,
>>Vaibhav
>>
>>>  };
>>>
>>>  static struct platform_device *davinci_evm_devices[] __initdata = {
>>> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
>>> b/arch/arm/mach-davinci/board-dm644x-evm.c
>>> index fd0398b..45beb99 100644
>>> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
>>> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
>>> @@ -250,6 +250,8 @@ static struct vpfe_config vpfe_cfg = {
>>>  	.sub_devs = vpfe_sub_devs,
>>>  	.card_name = "DM6446 EVM",
>>>  	.ccdc = "DM6446 CCDC",
>>> +	.num_clocks = 2,
>>> +	.clocks = {"vpss_master", "vpss_slave"},
>>>  };
>>>
>>>  static struct platform_device rtc_dev = {
>>> --
>>> 1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Hiremath, Vaibhav Dec. 8, 2009, 5:27 p.m. UTC | #4
> -----Original Message-----
> From: linux-media-owner@vger.kernel.org [mailto:linux-media-
> owner@vger.kernel.org] On Behalf Of Karicheri, Muralidharan
> Sent: Thursday, December 03, 2009 9:25 PM
> To: Hiremath, Vaibhav; linux-media@vger.kernel.org;
> hverkuil@xs4all.nl; khilman@deeprootsystems.com
> Cc: davinci-linux-open-source@linux.davincidsp.com
> Subject: RE: [PATCH - v0 2/2] DaVinci - vpfe capture - Make clocks
> configurable
> 
> >I was talking to Sekhar about this and actually he made some good
> points
> >about this implementation.
> >
> >If we consider specific IP, then the required clocks would remain
> always be
> >the same. There might be some devices which may not be using some
> clocks
> >(so as that specific feature).
> >
> >Actually we are trying to create one more wrapper for clock
> configuration.
> >Just to illustrate I am putting some other generic drivers examples
> -
> >
> >Omap-hsmmc.c -
> >
> >This driver requires 2 clocks, interface and functional. The
> devices which
> >would be using this driver have to define clock with names "ick"
> and "fck".
> >
> >VPFE-Capture (Considering only current implementation) -
> >
> >Currently we have vpfe_capture.c file (master/bridge driver) which
> is
> >handling clk_get/put, and platform data is providing the details
> about it.
> >Ideally we should handle it in respective ccdc driver file, since
> he has
> >all the knowledge about required number of clocks and its name.
> This way we
> >don't have to maintain/pass clock information in platform data.
> >
> >I would appreciate any comments/thoughts/pointers here.
> >
> Though I agree that this clock could be set by the ccdc driver, I am
> not sure if the same clock is used by an IP on different SOCs. For
> example take
> the case of ccdc on DM6446 which is also used on OMAP 35xx SOC. Do
> they use
> vpss master and slave clocks as is done on DM6446? If this is true,
> then we
> could set the clock inside ccdc driver.
> 
> Let me know so that I can re-work the patch and send it to the list.
> 
[Hiremath, Vaibhav] Murali,

They might be using different naming conventions but the number of clocks will always remain the same. If not, then they are not same IP and most probably will not use same driver.

Just to clarify more on your Q, AM3517 also uses 2 clocks 

- vpfe_ck (functional clock)
- vpfe_pck (external clock, pixel clock)

Whereas you are referring them as master and slave clock.

Thanks,
Vaibhav


> Murali
> >Thanks,
> >Vaibhav
> >
> >>  };
> >>
> >>  static struct platform_device *davinci_evm_devices[] __initdata
> = {
> >> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
> >> b/arch/arm/mach-davinci/board-dm644x-evm.c
> >> index fd0398b..45beb99 100644
> >> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
> >> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
> >> @@ -250,6 +250,8 @@ static struct vpfe_config vpfe_cfg = {
> >>  	.sub_devs = vpfe_sub_devs,
> >>  	.card_name = "DM6446 EVM",
> >>  	.ccdc = "DM6446 CCDC",
> >> +	.num_clocks = 2,
> >> +	.clocks = {"vpss_master", "vpss_slave"},
> >>  };
> >>
> >>  static struct platform_device rtc_dev = {
> >> --
> >> 1.6.0.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
m-karicheri2@ti.com Dec. 8, 2009, 8:09 p.m. UTC | #5
Vaibhav,

I have posted a re-worked patch with clocks configuration moved
to ccdc. From your response below, I understand the clocks
are being called differently on different SoCs even though they
use the same IP. So IMO, it is better to customize it on a SoC 
by defining the clock names in the respective platform file as
done by my original patch. This will avoid confusion since we need to
keep the name in sync with hardware signal names.

-Murali
>[Hiremath, Vaibhav] Murali,
>
>They might be using different naming conventions but the number of clocks
>will always remain the same. If not, then they are not same IP and most
>probably will not use same driver.
>
>Just to clarify more on your Q, AM3517 also uses 2 clocks
>
>- vpfe_ck (functional clock)
>- vpfe_pck (external clock, pixel clock)
>

>Whereas you are referring them as master and slave clock.
>
>Thanks,
>Vaibhav
>
>
>> Murali
>> >Thanks,
>> >Vaibhav
>> >
>> >>  };
>> >>
>> >>  static struct platform_device *davinci_evm_devices[] __initdata
>> = {
>> >> diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c
>> >> b/arch/arm/mach-davinci/board-dm644x-evm.c
>> >> index fd0398b..45beb99 100644
>> >> --- a/arch/arm/mach-davinci/board-dm644x-evm.c
>> >> +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
>> >> @@ -250,6 +250,8 @@ static struct vpfe_config vpfe_cfg = {
>> >>  	.sub_devs = vpfe_sub_devs,
>> >>  	.card_name = "DM6446 EVM",
>> >>  	.ccdc = "DM6446 CCDC",
>> >> +	.num_clocks = 2,
>> >> +	.clocks = {"vpss_master", "vpss_slave"},
>> >>  };
>> >>
>> >>  static struct platform_device rtc_dev = {
>> >> --
>> >> 1.6.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-
>> media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index a9b650d..a28985c 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -239,6 +239,8 @@  static struct vpfe_config vpfe_cfg = {
 	.sub_devs = vpfe_sub_devs,
 	.card_name = "DM355 EVM",
 	.ccdc = "DM355 CCDC",
+	.num_clocks = 2,
+	.clocks = {"vpss_master", "vpss_slave"},
 };
 
 static struct platform_device *davinci_evm_devices[] __initdata = {
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index fd0398b..45beb99 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -250,6 +250,8 @@  static struct vpfe_config vpfe_cfg = {
 	.sub_devs = vpfe_sub_devs,
 	.card_name = "DM6446 EVM",
 	.ccdc = "DM6446 CCDC",
+	.num_clocks = 2,
+	.clocks = {"vpss_master", "vpss_slave"},
 };
 
 static struct platform_device rtc_dev = {