* [RFC] [PATCH 0/2] clock helper for determining flags properties
@ 2014-05-13 11:57 Gabriel FERNANDEZ
2014-05-13 11:57 ` [PATCH 1/2] clk: of: " Gabriel FERNANDEZ
2014-05-13 11:57 ` [PATCH 2/2] drivers: clk: st: authorize propagate rate change for clockgenD0 Gabriel FERNANDEZ
0 siblings, 2 replies; 9+ messages in thread
From: Gabriel FERNANDEZ @ 2014-05-13 11:57 UTC (permalink / raw)
To: mturquette, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
galak, rdunlap
Cc: devicetree, linux-doc, linux-kernel, linux-arm-kernel, kernel,
Lee Jones, Gabriel Fernandez
The first patch provides a helper to get flags properties of a clock node.
This patch is limited to CLK_SET_RATE_PARENT flag for e.g.
The second patch provides an example of use of this clock helper.
Gabriel Fernandez (2):
clk: of: helper for determining flags properties
drivers: clk: st: authorize propagate rate change for clockgenD0
arch/arm/boot/dts/stih407-clock.dtsi | 1 +
drivers/clk/clk.c | 11 +++++++++++
drivers/clk/st/clk-flexgen.c | 2 ++
include/linux/clk-provider.h | 6 ++++++
4 files changed, 20 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-13 11:57 [RFC] [PATCH 0/2] clock helper for determining flags properties Gabriel FERNANDEZ
@ 2014-05-13 11:57 ` Gabriel FERNANDEZ
[not found] ` <1399982253-21079-2-git-send-email-gabriel.fernandez-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-05-13 11:57 ` [PATCH 2/2] drivers: clk: st: authorize propagate rate change for clockgenD0 Gabriel FERNANDEZ
1 sibling, 1 reply; 9+ messages in thread
From: Gabriel FERNANDEZ @ 2014-05-13 11:57 UTC (permalink / raw)
To: mturquette, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
galak, rdunlap
Cc: devicetree, linux-doc, linux-kernel, linux-arm-kernel, kernel,
Lee Jones, Gabriel Fernandez
The patch provides a helper to get flags properties of
a clock node.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
---
drivers/clk/clk.c | 11 +++++++++++
include/linux/clk-provider.h | 6 ++++++
2 files changed, 17 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 4d56220..cae8985 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
}
EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
+unsigned long of_clk_get_flags(struct device_node *np)
+{
+ unsigned long flags = 0;
+
+ if (of_property_read_bool(np, "set-rate-parent"))
+ flags |= CLK_SET_RATE_PARENT;
+
+ return flags;
+}
+EXPORT_SYMBOL_GPL(of_clk_get_flags);
+
struct clock_provider {
of_clk_init_cb_t clk_init_cb;
struct device_node *np;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 59e2eb5..650bc10 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -519,6 +519,7 @@ int of_clk_get_parent_count(struct device_node *np);
const char *of_clk_get_parent_name(struct device_node *np, int index);
void of_clk_init(const struct of_device_id *matches);
+unsigned long of_clk_get_flags(struct device_node *np);
#else /* !CONFIG_OF */
@@ -546,6 +547,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
{
return NULL;
}
+static inline unsigned long of_clk_get_flags(struct device_node *np)
+{
+ return NULL;
+}
+
#define of_clk_init(matches) \
{ while (0); }
#endif /* CONFIG_OF */
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] drivers: clk: st: authorize propagate rate change for clockgenD0
2014-05-13 11:57 [RFC] [PATCH 0/2] clock helper for determining flags properties Gabriel FERNANDEZ
2014-05-13 11:57 ` [PATCH 1/2] clk: of: " Gabriel FERNANDEZ
@ 2014-05-13 11:57 ` Gabriel FERNANDEZ
1 sibling, 0 replies; 9+ messages in thread
From: Gabriel FERNANDEZ @ 2014-05-13 11:57 UTC (permalink / raw)
To: mturquette, robh+dt, pawel.moll, mark.rutland, ijc+devicetree,
galak, rdunlap
Cc: devicetree, linux-doc, linux-kernel, linux-arm-kernel, kernel,
Lee Jones, Gabriel Fernandez, Gabriel Fernandez
This patch allows the spread of change rate only for clockgenD0
clocks.
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
---
arch/arm/boot/dts/stih407-clock.dtsi | 1 +
drivers/clk/st/clk-flexgen.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/arch/arm/boot/dts/stih407-clock.dtsi b/arch/arm/boot/dts/stih407-clock.dtsi
index 5f1c83c..7fad261 100644
--- a/arch/arm/boot/dts/stih407-clock.dtsi
+++ b/arch/arm/boot/dts/stih407-clock.dtsi
@@ -204,6 +204,7 @@
"CLK_PCM_1",
"CLK_PCM_2",
"CLK_SPDIFF";
+ set-rate-parent;
};
};
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c
index f3ed700..5629988 100644
--- a/drivers/clk/st/clk-flexgen.c
+++ b/drivers/clk/st/clk-flexgen.c
@@ -306,6 +306,8 @@ void __init st_of_flexgen_setup(struct device_node *np)
if (*clk_name == '\0')
continue;
+ flex_flags = of_clk_get_flags(np);
+
clk = clk_register_flexgen(clk_name, parents, num_parents,
reg, rlock, i, flex_flags);
--
1.9.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
[not found] ` <1399982253-21079-2-git-send-email-gabriel.fernandez-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2014-05-13 12:20 ` Mark Rutland
2014-05-13 15:11 ` Sebastian Hesselbarth
0 siblings, 1 reply; 9+ messages in thread
From: Mark Rutland @ 2014-05-13 12:20 UTC (permalink / raw)
To: Gabriel FERNANDEZ
Cc: mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org, Lee Jones,
Gabriel Fernandez
On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
> The patch provides a helper to get flags properties of
> a clock node.
>
> Signed-off-by: Gabriel Fernandez <gabriel.fernandez-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> drivers/clk/clk.c | 11 +++++++++++
> include/linux/clk-provider.h | 6 ++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 4d56220..cae8985 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
> }
> EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
>
> +unsigned long of_clk_get_flags(struct device_node *np)
> +{
> + unsigned long flags = 0;
> +
> + if (of_property_read_bool(np, "set-rate-parent"))
> + flags |= CLK_SET_RATE_PARENT;
NAK.
This is _not_ a hardware property. This flag describes internals of the
Linux clock framework, and is thus not suitable for DT.
You've also failed to document the property.
What are you trying to achieve here, and why do you think this is the
best way of achieving that?
Cheers,
Mark.
> +
> + return flags;
> +}
> +EXPORT_SYMBOL_GPL(of_clk_get_flags);
> +
> struct clock_provider {
> of_clk_init_cb_t clk_init_cb;
> struct device_node *np;
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 59e2eb5..650bc10 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -519,6 +519,7 @@ int of_clk_get_parent_count(struct device_node *np);
> const char *of_clk_get_parent_name(struct device_node *np, int index);
>
> void of_clk_init(const struct of_device_id *matches);
> +unsigned long of_clk_get_flags(struct device_node *np);
>
> #else /* !CONFIG_OF */
>
> @@ -546,6 +547,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
> {
> return NULL;
> }
> +static inline unsigned long of_clk_get_flags(struct device_node *np)
> +{
> + return NULL;
> +}
> +
> #define of_clk_init(matches) \
> { while (0); }
> #endif /* CONFIG_OF */
> --
> 1.9.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-13 12:20 ` Mark Rutland
@ 2014-05-13 15:11 ` Sebastian Hesselbarth
2014-05-13 20:49 ` Mike Turquette
0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Hesselbarth @ 2014-05-13 15:11 UTC (permalink / raw)
To: Mark Rutland, Gabriel FERNANDEZ
Cc: mturquette@linaro.org, robh+dt@kernel.org, Pawel Moll,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
rdunlap@infradead.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@stlinux.com,
Lee Jones, Gabriel Fernandez
On 05/13/2014 02:20 PM, Mark Rutland wrote:
> On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
>> The patch provides a helper to get flags properties of
>> a clock node.
>>
>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
>> ---
>> drivers/clk/clk.c | 11 +++++++++++
>> include/linux/clk-provider.h | 6 ++++++
>> 2 files changed, 17 insertions(+)
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index 4d56220..cae8985 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
>> }
>> EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
>>
>> +unsigned long of_clk_get_flags(struct device_node *np)
>> +{
>> + unsigned long flags = 0;
>> +
>> + if (of_property_read_bool(np, "set-rate-parent"))
>> + flags |= CLK_SET_RATE_PARENT;
>
> NAK.
>
> This is _not_ a hardware property. This flag describes internals of the
> Linux clock framework, and is thus not suitable for DT.
Mark,
while I agree above property is not a hardware property, it is at least
some kind of use-case property. If not by DT, we will have to allow some
way to describe master-slave relationships between clocks in a driver
independent way.
> You've also failed to document the property.
>
> What are you trying to achieve here, and why do you think this is the
> best way of achieving that?
I cannot tell from the commit msgs, but consider clk-si5351 which is a
driver for an external programmable clock with N PLLs and M outputs. Now
connect a video clock consumer and an audio clock consumer to two
different outputs and those to one PLL (as you want audio clock derived
from video clock, typical HDMI scenario).
Now, there should be a way to tell the generic driver which outputs are
allowed to change the PLLs rate and which don't. Otherwise, the clock
chip would be pretty useless as e.g. your audio clock consumer will
overwrite the rate the video clock consumer has chosen.
BTW, clk-si5351 has vendor-specific properties to specify which output
clocks are pll-masters for some kernel cycles already.
Sebastian
>> +
>> + return flags;
>> +}
>> +EXPORT_SYMBOL_GPL(of_clk_get_flags);
>> +
>> struct clock_provider {
>> of_clk_init_cb_t clk_init_cb;
>> struct device_node *np;
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index 59e2eb5..650bc10 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -519,6 +519,7 @@ int of_clk_get_parent_count(struct device_node *np);
>> const char *of_clk_get_parent_name(struct device_node *np, int index);
>>
>> void of_clk_init(const struct of_device_id *matches);
>> +unsigned long of_clk_get_flags(struct device_node *np);
>>
>> #else /* !CONFIG_OF */
>>
>> @@ -546,6 +547,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
>> {
>> return NULL;
>> }
>> +static inline unsigned long of_clk_get_flags(struct device_node *np)
>> +{
>> + return NULL;
>> +}
>> +
>> #define of_clk_init(matches) \
>> { while (0); }
>> #endif /* CONFIG_OF */
>> --
>> 1.9.1
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-13 15:11 ` Sebastian Hesselbarth
@ 2014-05-13 20:49 ` Mike Turquette
2014-05-13 21:31 ` Sebastian Hesselbarth
2014-05-14 7:53 ` Gabriel Fernandez
0 siblings, 2 replies; 9+ messages in thread
From: Mike Turquette @ 2014-05-13 20:49 UTC (permalink / raw)
To: Sebastian Hesselbarth, Mark Rutland, Gabriel FERNANDEZ
Cc: robh+dt@kernel.org, Pawel Moll, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, rdunlap@infradead.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@stlinux.com,
Lee Jones, Gabriel Fernandez
Quoting Sebastian Hesselbarth (2014-05-13 08:11:55)
> On 05/13/2014 02:20 PM, Mark Rutland wrote:
> > On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
> >> The patch provides a helper to get flags properties of
> >> a clock node.
> >>
> >> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> >> ---
> >> drivers/clk/clk.c | 11 +++++++++++
> >> include/linux/clk-provider.h | 6 ++++++
> >> 2 files changed, 17 insertions(+)
> >>
> >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> >> index 4d56220..cae8985 100644
> >> --- a/drivers/clk/clk.c
> >> +++ b/drivers/clk/clk.c
> >> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
> >> }
> >> EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
> >>
> >> +unsigned long of_clk_get_flags(struct device_node *np)
> >> +{
> >> + unsigned long flags = 0;
> >> +
> >> + if (of_property_read_bool(np, "set-rate-parent"))
> >> + flags |= CLK_SET_RATE_PARENT;
> >
> > NAK.
> >
> > This is _not_ a hardware property. This flag describes internals of the
> > Linux clock framework, and is thus not suitable for DT.
>
> Mark,
>
> while I agree above property is not a hardware property, it is at least
> some kind of use-case property. If not by DT, we will have to allow some
> way to describe master-slave relationships between clocks in a driver
> independent way.
I agree with Mark.
Generally this stuff belongs in a clock driver. Of course there are the
integration issues you pointed out. More on that below.
As an aside, CLK_SET_RATE_PARENT is a headache, since propagation of the
operation up to the parent clock really should be the default behavior
for .set_rate (and in fact this is the case for the new-ish
.determine_rate op). Some history on those decisions can be found at [1]
and [2].
>
> > You've also failed to document the property.
> >
> > What are you trying to achieve here, and why do you think this is the
> > best way of achieving that?
>
> I cannot tell from the commit msgs, but consider clk-si5351 which is a
> driver for an external programmable clock with N PLLs and M outputs. Now
> connect a video clock consumer and an audio clock consumer to two
> different outputs and those to one PLL (as you want audio clock derived
> from video clock, typical HDMI scenario).
>
> Now, there should be a way to tell the generic driver which outputs are
> allowed to change the PLLs rate and which don't. Otherwise, the clock
> chip would be pretty useless as e.g. your audio clock consumer will
> overwrite the rate the video clock consumer has chosen.
This is really a job for the "coordinated clock rate changes" that are
currently in development. These specify clock sub-tree snapshots of
parent and rate configurations that are predefined. These combinations
can be specified in DT. That helps a lot with clock configurations that
change per board, or for cases where many combinations of parents and
dividers can yield the same output rate, but only a subset of those were
validated by the silicon validation team or had proper timing closure so
we don't want to rely on the "walk up the tree" algorithm.
Regards,
Mike
[1] http://marc.info/?l=linux-kernel&m=136847508109344&w=2
[2] http://marc.info/?l=linux-kernel&m=137477559110865&w=2
>
> BTW, clk-si5351 has vendor-specific properties to specify which output
> clocks are pll-masters for some kernel cycles already.
>
> Sebastian
>
> >> +
> >> + return flags;
> >> +}
> >> +EXPORT_SYMBOL_GPL(of_clk_get_flags);
> >> +
> >> struct clock_provider {
> >> of_clk_init_cb_t clk_init_cb;
> >> struct device_node *np;
> >> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> >> index 59e2eb5..650bc10 100644
> >> --- a/include/linux/clk-provider.h
> >> +++ b/include/linux/clk-provider.h
> >> @@ -519,6 +519,7 @@ int of_clk_get_parent_count(struct device_node *np);
> >> const char *of_clk_get_parent_name(struct device_node *np, int index);
> >>
> >> void of_clk_init(const struct of_device_id *matches);
> >> +unsigned long of_clk_get_flags(struct device_node *np);
> >>
> >> #else /* !CONFIG_OF */
> >>
> >> @@ -546,6 +547,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
> >> {
> >> return NULL;
> >> }
> >> +static inline unsigned long of_clk_get_flags(struct device_node *np)
> >> +{
> >> + return NULL;
> >> +}
> >> +
> >> #define of_clk_init(matches) \
> >> { while (0); }
> >> #endif /* CONFIG_OF */
> >> --
> >> 1.9.1
> >>
> >>
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-13 20:49 ` Mike Turquette
@ 2014-05-13 21:31 ` Sebastian Hesselbarth
2014-05-14 7:53 ` Gabriel Fernandez
1 sibling, 0 replies; 9+ messages in thread
From: Sebastian Hesselbarth @ 2014-05-13 21:31 UTC (permalink / raw)
To: Mike Turquette, Mark Rutland, Gabriel FERNANDEZ
Cc: robh+dt@kernel.org, Pawel Moll, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, rdunlap@infradead.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@stlinux.com,
Lee Jones, Gabriel Fernandez
On 05/13/2014 10:49 PM, Mike Turquette wrote:
> Quoting Sebastian Hesselbarth (2014-05-13 08:11:55)
>> On 05/13/2014 02:20 PM, Mark Rutland wrote:
>>> You've also failed to document the property.
>>>
>>> What are you trying to achieve here, and why do you think this is the
>>> best way of achieving that?
>>
>> I cannot tell from the commit msgs, but consider clk-si5351 which is a
>> driver for an external programmable clock with N PLLs and M outputs. Now
>> connect a video clock consumer and an audio clock consumer to two
>> different outputs and those to one PLL (as you want audio clock derived
>> from video clock, typical HDMI scenario).
>>
>> Now, there should be a way to tell the generic driver which outputs are
>> allowed to change the PLLs rate and which don't. Otherwise, the clock
>> chip would be pretty useless as e.g. your audio clock consumer will
>> overwrite the rate the video clock consumer has chosen.
>
> This is really a job for the "coordinated clock rate changes" that are
> currently in development. These specify clock sub-tree snapshots of
> parent and rate configurations that are predefined. These combinations
> can be specified in DT. That helps a lot with clock configurations that
> change per board, or for cases where many combinations of parents and
> dividers can yield the same output rate, but only a subset of those were
> validated by the silicon validation team or had proper timing closure so
> we don't want to rely on the "walk up the tree" algorithm.
Ah! Great to hear there is work on that already. Thanks for the heads
up!
Sebastian
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-13 20:49 ` Mike Turquette
2014-05-13 21:31 ` Sebastian Hesselbarth
@ 2014-05-14 7:53 ` Gabriel Fernandez
2014-05-15 4:47 ` Mike Turquette
1 sibling, 1 reply; 9+ messages in thread
From: Gabriel Fernandez @ 2014-05-14 7:53 UTC (permalink / raw)
To: Mike Turquette
Cc: Sebastian Hesselbarth, Mark Rutland, Gabriel FERNANDEZ,
robh+dt@kernel.org, Pawel Moll, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, rdunlap@infradead.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@stlinux.com,
Lee Jones
Hi,
On 13 May 2014 22:49, Mike Turquette <mturquette@linaro.org> wrote:
> Quoting Sebastian Hesselbarth (2014-05-13 08:11:55)
>> On 05/13/2014 02:20 PM, Mark Rutland wrote:
>> > On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
>> >> The patch provides a helper to get flags properties of
>> >> a clock node.
>> >>
>> >> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
>> >> ---
>> >> drivers/clk/clk.c | 11 +++++++++++
>> >> include/linux/clk-provider.h | 6 ++++++
>> >> 2 files changed, 17 insertions(+)
>> >>
>> >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> >> index 4d56220..cae8985 100644
>> >> --- a/drivers/clk/clk.c
>> >> +++ b/drivers/clk/clk.c
>> >> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
>> >> }
>> >> EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
>> >>
>> >> +unsigned long of_clk_get_flags(struct device_node *np)
>> >> +{
>> >> + unsigned long flags = 0;
>> >> +
>> >> + if (of_property_read_bool(np, "set-rate-parent"))
>> >> + flags |= CLK_SET_RATE_PARENT;
>> >
>> > NAK.
>> >
>> > This is _not_ a hardware property. This flag describes internals of the
>> > Linux clock framework, and is thus not suitable for DT.
>>
>> Mark,
>>
>> while I agree above property is not a hardware property, it is at least
>> some kind of use-case property. If not by DT, we will have to allow some
>> way to describe master-slave relationships between clocks in a driver
>> independent way.
>
> I agree with Mark.
>
> Generally this stuff belongs in a clock driver. Of course there are the
> integration issues you pointed out. More on that below.
>
> As an aside, CLK_SET_RATE_PARENT is a headache, since propagation of the
> operation up to the parent clock really should be the default behavior
> for .set_rate (and in fact this is the case for the new-ish
> .determine_rate op). Some history on those decisions can be found at [1]
> and [2].
>
My issue is exactly the same as Marc, it's for solve some case with
PCM and HDMI clocks.
>>
>> > You've also failed to document the property.
>> >
>> > What are you trying to achieve here, and why do you think this is the
>> > best way of achieving that?
>>
>> I cannot tell from the commit msgs, but consider clk-si5351 which is a
>> driver for an external programmable clock with N PLLs and M outputs. Now
>> connect a video clock consumer and an audio clock consumer to two
>> different outputs and those to one PLL (as you want audio clock derived
>> from video clock, typical HDMI scenario).
>>
>> Now, there should be a way to tell the generic driver which outputs are
>> allowed to change the PLLs rate and which don't. Otherwise, the clock
>> chip would be pretty useless as e.g. your audio clock consumer will
>> overwrite the rate the video clock consumer has chosen.
>
> This is really a job for the "coordinated clock rate changes" that are
> currently in development. These specify clock sub-tree snapshots of
> parent and rate configurations that are predefined. These combinations
> can be specified in DT. That helps a lot with clock configurations that
> change per board, or for cases where many combinations of parents and
> dividers can yield the same output rate, but only a subset of those were
> validated by the silicon validation team or had proper timing closure so
> we don't want to rely on the "walk up the tree" algorithm.
>
> Regards,
> Mike
Ok i think this work will be the best solutions for my issue.
Where i can find some threads about that ?
Thanks a lot.
Best Regards.
Gabriel.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] clk: of: helper for determining flags properties
2014-05-14 7:53 ` Gabriel Fernandez
@ 2014-05-15 4:47 ` Mike Turquette
0 siblings, 0 replies; 9+ messages in thread
From: Mike Turquette @ 2014-05-15 4:47 UTC (permalink / raw)
To: Gabriel Fernandez
Cc: Mark Rutland, devicetree@vger.kernel.org, kernel@stlinux.com,
Pawel Moll, ijc+devicetree@hellion.org.uk, rdunlap@infradead.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
robh+dt@kernel.org, galak@codeaurora.org, Lee Jones,
Gabriel FERNANDEZ, linux-arm-kernel@lists.infradead.org,
Sebastian Hesselbarth
Quoting Gabriel Fernandez (2014-05-14 00:53:58)
> Hi,
>
> On 13 May 2014 22:49, Mike Turquette <mturquette@linaro.org> wrote:
> > Quoting Sebastian Hesselbarth (2014-05-13 08:11:55)
> >> On 05/13/2014 02:20 PM, Mark Rutland wrote:
> >> > On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
> >> >> The patch provides a helper to get flags properties of
> >> >> a clock node.
> >> >>
> >> >> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@linaro.org>
> >> >> ---
> >> >> drivers/clk/clk.c | 11 +++++++++++
> >> >> include/linux/clk-provider.h | 6 ++++++
> >> >> 2 files changed, 17 insertions(+)
> >> >>
> >> >> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> >> >> index 4d56220..cae8985 100644
> >> >> --- a/drivers/clk/clk.c
> >> >> +++ b/drivers/clk/clk.c
> >> >> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
> >> >> }
> >> >> EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
> >> >>
> >> >> +unsigned long of_clk_get_flags(struct device_node *np)
> >> >> +{
> >> >> + unsigned long flags = 0;
> >> >> +
> >> >> + if (of_property_read_bool(np, "set-rate-parent"))
> >> >> + flags |= CLK_SET_RATE_PARENT;
> >> >
> >> > NAK.
> >> >
> >> > This is _not_ a hardware property. This flag describes internals of the
> >> > Linux clock framework, and is thus not suitable for DT.
> >>
> >> Mark,
> >>
> >> while I agree above property is not a hardware property, it is at least
> >> some kind of use-case property. If not by DT, we will have to allow some
> >> way to describe master-slave relationships between clocks in a driver
> >> independent way.
> >
> > I agree with Mark.
> >
> > Generally this stuff belongs in a clock driver. Of course there are the
> > integration issues you pointed out. More on that below.
> >
> > As an aside, CLK_SET_RATE_PARENT is a headache, since propagation of the
> > operation up to the parent clock really should be the default behavior
> > for .set_rate (and in fact this is the case for the new-ish
> > .determine_rate op). Some history on those decisions can be found at [1]
> > and [2].
> >
>
>
> My issue is exactly the same as Marc, it's for solve some case with
> PCM and HDMI clocks.
>
> >>
> >> > You've also failed to document the property.
> >> >
> >> > What are you trying to achieve here, and why do you think this is the
> >> > best way of achieving that?
> >>
> >> I cannot tell from the commit msgs, but consider clk-si5351 which is a
> >> driver for an external programmable clock with N PLLs and M outputs. Now
> >> connect a video clock consumer and an audio clock consumer to two
> >> different outputs and those to one PLL (as you want audio clock derived
> >> from video clock, typical HDMI scenario).
> >>
> >> Now, there should be a way to tell the generic driver which outputs are
> >> allowed to change the PLLs rate and which don't. Otherwise, the clock
> >> chip would be pretty useless as e.g. your audio clock consumer will
> >> overwrite the rate the video clock consumer has chosen.
> >
> > This is really a job for the "coordinated clock rate changes" that are
> > currently in development. These specify clock sub-tree snapshots of
> > parent and rate configurations that are predefined. These combinations
> > can be specified in DT. That helps a lot with clock configurations that
> > change per board, or for cases where many combinations of parents and
> > dividers can yield the same output rate, but only a subset of those were
> > validated by the silicon validation team or had proper timing closure so
> > we don't want to rely on the "walk up the tree" algorithm.
> >
> > Regards,
> > Mike
>
> Ok i think this work will be the best solutions for my issue.
>
> Where i can find some threads about that ?
Hi Gabriel,
Glad that it sounds interesting to you. There isn't a dedicated
discussion thread but I did outline some of the ideas earlier today on a
separate thread[1]. It's being actively worked on and maybe an RFC can
hit the list soon.
Regards,
Mike
[1] http://www.spinics.net/lists/arm-kernel/msg331462.html
>
> Thanks a lot.
>
> Best Regards.
>
> Gabriel.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-05-15 4:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13 11:57 [RFC] [PATCH 0/2] clock helper for determining flags properties Gabriel FERNANDEZ
2014-05-13 11:57 ` [PATCH 1/2] clk: of: " Gabriel FERNANDEZ
[not found] ` <1399982253-21079-2-git-send-email-gabriel.fernandez-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-05-13 12:20 ` Mark Rutland
2014-05-13 15:11 ` Sebastian Hesselbarth
2014-05-13 20:49 ` Mike Turquette
2014-05-13 21:31 ` Sebastian Hesselbarth
2014-05-14 7:53 ` Gabriel Fernandez
2014-05-15 4:47 ` Mike Turquette
2014-05-13 11:57 ` [PATCH 2/2] drivers: clk: st: authorize propagate rate change for clockgenD0 Gabriel FERNANDEZ
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).