From: jenskuske@gmail.com (Jens Kuske)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor clock name from devicetree
Date: Mon, 18 May 2015 11:22:32 +0200 [thread overview]
Message-ID: <5559AF58.60508@gmail.com> (raw)
In-Reply-To: <20150517130657.GD4004@lukather>
On 05/17/15 15:06, Maxime Ripard wrote:
> On Fri, May 15, 2015 at 06:38:53PM +0200, Jens Kuske wrote:
>> Currently, the sunxi clock driver gets the name for the base factor clock
>> of divs clocks from the name field in factors_data. This prevents reusing
>> of the factor clock for clocks with same properties, but different name.
>>
>> This commit makes the divs setup function try to get a name from
>> clock-output-names in the devicetree. It also removes the name field where
>> possible and merges the sun4i PLL5 and PLL6 clocks.
>>
>> The sun4i PLL5 clock doesn't have a output for the base factor clock,
>> so we still have to use the name field there.
>>
>> Signed-off-by: Jens Kuske <jenskuske@gmail.com>
>> ---
>> drivers/clk/sunxi/clk-sunxi.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
>> index 17cba4d..afe560c 100644
>> --- a/drivers/clk/sunxi/clk-sunxi.c
>> +++ b/drivers/clk/sunxi/clk-sunxi.c
>> @@ -708,18 +708,10 @@ static const struct factors_data sun4i_pll5_data __initconst = {
>> .name = "pll5",
>> };
>>
>> -static const struct factors_data sun4i_pll6_data __initconst = {
>> - .enable = 31,
>> - .table = &sun4i_pll5_config,
>> - .getter = sun4i_get_pll5_factors,
>> - .name = "pll6",
>> -};
>> -
>> static const struct factors_data sun6i_a31_pll6_data __initconst = {
>> .enable = 31,
>> .table = &sun6i_a31_pll6_config,
>> .getter = sun6i_a31_get_pll6_factors,
>> - .name = "pll6x2",
>> };
>>
>> static const struct factors_data sun5i_a13_ahb_data __initconst = {
>> @@ -1099,7 +1091,7 @@ static const struct divs_data pll5_divs_data __initconst = {
>> };
>>
>> static const struct divs_data pll6_divs_data __initconst = {
>> - .factors = &sun4i_pll6_data,
>> + .factors = &sun4i_pll5_data,
>> .ndivs = 4,
>> .div = {
>> { .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
>> @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> struct clk_gate *gate = NULL;
>> struct clk_fixed_factor *fix_factor;
>> struct clk_divider *divider;
>> + struct factors_data factors = *data->factors;
>> void __iomem *reg;
>> int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
>> int flags, clkflags;
>> @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> if (data->ndivs)
>> ndivs = data->ndivs;
>>
>> + /* Try to find a name for base factor clock */
>> + for (i = 0; i < ndivs; i++) {
>> + if (data->div[i].self) {
>
> I'm not sure we should expect the factor clock to have a self factor.
Maybe not, but in that case it would fall back to the name provided in
the factors_data struct, as it is the case for sun4i pll5.
> what about taking the first output and taking the substring up to the
> first "_" ?
That only works for the sun[457]i pll5 & pll6, for sun[68]i the base
clock name would have to be "pll6x2".
Jens
WARNING: multiple messages have this Message-ID (diff)
From: Jens Kuske <jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: "Emilio López" <emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org>,
"Mike Turquette"
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Linus Walleij"
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Rob Herring" <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Chen-Yu Tsai" <wens-jdAy2FN1RRM@public.gmane.org>,
"Vishnu Patekar"
<vishnupatekar0510-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"Hans de Goede"
<hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor clock name from devicetree
Date: Mon, 18 May 2015 11:22:32 +0200 [thread overview]
Message-ID: <5559AF58.60508@gmail.com> (raw)
In-Reply-To: <20150517130657.GD4004@lukather>
On 05/17/15 15:06, Maxime Ripard wrote:
> On Fri, May 15, 2015 at 06:38:53PM +0200, Jens Kuske wrote:
>> Currently, the sunxi clock driver gets the name for the base factor clock
>> of divs clocks from the name field in factors_data. This prevents reusing
>> of the factor clock for clocks with same properties, but different name.
>>
>> This commit makes the divs setup function try to get a name from
>> clock-output-names in the devicetree. It also removes the name field where
>> possible and merges the sun4i PLL5 and PLL6 clocks.
>>
>> The sun4i PLL5 clock doesn't have a output for the base factor clock,
>> so we still have to use the name field there.
>>
>> Signed-off-by: Jens Kuske <jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> ---
>> drivers/clk/sunxi/clk-sunxi.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
>> index 17cba4d..afe560c 100644
>> --- a/drivers/clk/sunxi/clk-sunxi.c
>> +++ b/drivers/clk/sunxi/clk-sunxi.c
>> @@ -708,18 +708,10 @@ static const struct factors_data sun4i_pll5_data __initconst = {
>> .name = "pll5",
>> };
>>
>> -static const struct factors_data sun4i_pll6_data __initconst = {
>> - .enable = 31,
>> - .table = &sun4i_pll5_config,
>> - .getter = sun4i_get_pll5_factors,
>> - .name = "pll6",
>> -};
>> -
>> static const struct factors_data sun6i_a31_pll6_data __initconst = {
>> .enable = 31,
>> .table = &sun6i_a31_pll6_config,
>> .getter = sun6i_a31_get_pll6_factors,
>> - .name = "pll6x2",
>> };
>>
>> static const struct factors_data sun5i_a13_ahb_data __initconst = {
>> @@ -1099,7 +1091,7 @@ static const struct divs_data pll5_divs_data __initconst = {
>> };
>>
>> static const struct divs_data pll6_divs_data __initconst = {
>> - .factors = &sun4i_pll6_data,
>> + .factors = &sun4i_pll5_data,
>> .ndivs = 4,
>> .div = {
>> { .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
>> @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> struct clk_gate *gate = NULL;
>> struct clk_fixed_factor *fix_factor;
>> struct clk_divider *divider;
>> + struct factors_data factors = *data->factors;
>> void __iomem *reg;
>> int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
>> int flags, clkflags;
>> @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> if (data->ndivs)
>> ndivs = data->ndivs;
>>
>> + /* Try to find a name for base factor clock */
>> + for (i = 0; i < ndivs; i++) {
>> + if (data->div[i].self) {
>
> I'm not sure we should expect the factor clock to have a self factor.
Maybe not, but in that case it would fall back to the name provided in
the factors_data struct, as it is the case for sun4i pll5.
> what about taking the first output and taking the substring up to the
> first "_" ?
That only works for the sun[457]i pll5 & pll6, for sun[68]i the base
clock name would have to be "pll6x2".
Jens
WARNING: multiple messages have this Message-ID (diff)
From: Jens Kuske <jenskuske@gmail.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: "Emilio López" <emilio@elopez.com.ar>,
"Mike Turquette" <mturquette@linaro.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Chen-Yu Tsai" <wens@csie.org>,
"Vishnu Patekar" <vishnupatekar0510@gmail.com>,
"Hans de Goede" <hdegoede@redhat.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com
Subject: Re: [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor clock name from devicetree
Date: Mon, 18 May 2015 11:22:32 +0200 [thread overview]
Message-ID: <5559AF58.60508@gmail.com> (raw)
In-Reply-To: <20150517130657.GD4004@lukather>
On 05/17/15 15:06, Maxime Ripard wrote:
> On Fri, May 15, 2015 at 06:38:53PM +0200, Jens Kuske wrote:
>> Currently, the sunxi clock driver gets the name for the base factor clock
>> of divs clocks from the name field in factors_data. This prevents reusing
>> of the factor clock for clocks with same properties, but different name.
>>
>> This commit makes the divs setup function try to get a name from
>> clock-output-names in the devicetree. It also removes the name field where
>> possible and merges the sun4i PLL5 and PLL6 clocks.
>>
>> The sun4i PLL5 clock doesn't have a output for the base factor clock,
>> so we still have to use the name field there.
>>
>> Signed-off-by: Jens Kuske <jenskuske@gmail.com>
>> ---
>> drivers/clk/sunxi/clk-sunxi.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
>> index 17cba4d..afe560c 100644
>> --- a/drivers/clk/sunxi/clk-sunxi.c
>> +++ b/drivers/clk/sunxi/clk-sunxi.c
>> @@ -708,18 +708,10 @@ static const struct factors_data sun4i_pll5_data __initconst = {
>> .name = "pll5",
>> };
>>
>> -static const struct factors_data sun4i_pll6_data __initconst = {
>> - .enable = 31,
>> - .table = &sun4i_pll5_config,
>> - .getter = sun4i_get_pll5_factors,
>> - .name = "pll6",
>> -};
>> -
>> static const struct factors_data sun6i_a31_pll6_data __initconst = {
>> .enable = 31,
>> .table = &sun6i_a31_pll6_config,
>> .getter = sun6i_a31_get_pll6_factors,
>> - .name = "pll6x2",
>> };
>>
>> static const struct factors_data sun5i_a13_ahb_data __initconst = {
>> @@ -1099,7 +1091,7 @@ static const struct divs_data pll5_divs_data __initconst = {
>> };
>>
>> static const struct divs_data pll6_divs_data __initconst = {
>> - .factors = &sun4i_pll6_data,
>> + .factors = &sun4i_pll5_data,
>> .ndivs = 4,
>> .div = {
>> { .shift = 0, .table = pll6_sata_tbl, .gate = 14 }, /* M, SATA */
>> @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> struct clk_gate *gate = NULL;
>> struct clk_fixed_factor *fix_factor;
>> struct clk_divider *divider;
>> + struct factors_data factors = *data->factors;
>> void __iomem *reg;
>> int ndivs = SUNXI_DIVS_MAX_QTY, i = 0;
>> int flags, clkflags;
>> @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
>> if (data->ndivs)
>> ndivs = data->ndivs;
>>
>> + /* Try to find a name for base factor clock */
>> + for (i = 0; i < ndivs; i++) {
>> + if (data->div[i].self) {
>
> I'm not sure we should expect the factor clock to have a self factor.
Maybe not, but in that case it would fall back to the name provided in
the factors_data struct, as it is the case for sun4i pll5.
> what about taking the first output and taking the substring up to the
> first "_" ?
That only works for the sun[457]i pll5 & pll6, for sun[68]i the base
clock name would have to be "pll6x2".
Jens
next prev parent reply other threads:[~2015-05-18 9:22 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 16:38 [PATCH v2 00/10] ARM: sunxi: Introduce Allwinner H3 support Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` [PATCH v2 01/10] Documentation: sunxi: Update Allwinner SoC documentation Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 12:52 ` Maxime Ripard
2015-05-17 12:52 ` Maxime Ripard
2015-05-17 12:52 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 02/10] clk: sunxi: Add support for multiple parents to gates Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 12:50 ` Maxime Ripard
2015-05-17 12:50 ` Maxime Ripard
2015-05-17 12:50 ` Maxime Ripard
2015-05-18 9:11 ` Jens Kuske
2015-05-18 9:11 ` Jens Kuske
2015-05-18 9:11 ` Jens Kuske
2015-05-19 7:53 ` Maxime Ripard
2015-05-19 7:53 ` Maxime Ripard
2015-05-19 7:53 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor clock name from devicetree Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
[not found] ` <1431707940-19372-4-git-send-email-jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-05-16 2:10 ` Chen-Yu Tsai
2015-05-18 9:15 ` Jens Kuske
2015-05-18 9:15 ` Jens Kuske
2015-05-18 9:15 ` Jens Kuske
2015-05-18 14:45 ` Chen-Yu Tsai
2015-05-18 14:45 ` Chen-Yu Tsai
2015-05-18 14:45 ` Chen-Yu Tsai
2015-05-17 13:06 ` Maxime Ripard
2015-05-17 13:06 ` Maxime Ripard
2015-05-17 13:06 ` Maxime Ripard
2015-05-18 9:22 ` Jens Kuske [this message]
2015-05-18 9:22 ` Jens Kuske
2015-05-18 9:22 ` Jens Kuske
2015-05-19 8:26 ` Maxime Ripard
2015-05-19 8:26 ` Maxime Ripard
2015-05-19 8:26 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 04/10] pinctrl: sunxi: Prepare for building SoC specific drivers as modules Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 14:19 ` Maxime Ripard
2015-05-17 14:19 ` Maxime Ripard
2015-05-17 14:19 ` Maxime Ripard
2015-05-18 9:32 ` Jens Kuske
2015-05-18 9:32 ` Jens Kuske
2015-05-18 9:32 ` Jens Kuske
2015-05-19 7:55 ` Maxime Ripard
2015-05-19 7:55 ` Maxime Ripard
2015-05-19 8:02 ` Chen-Yu Tsai
2015-05-19 8:02 ` Chen-Yu Tsai
2015-05-19 8:02 ` Chen-Yu Tsai
2015-05-19 8:16 ` Maxime Ripard
2015-05-19 8:16 ` Maxime Ripard
2015-05-19 8:16 ` Maxime Ripard
2015-05-19 14:58 ` Linus Walleij
2015-05-19 14:58 ` Linus Walleij
2015-05-19 14:58 ` Linus Walleij
2015-05-15 16:38 ` [PATCH v2 05/10] ARM: sunxi: Introduce Allwinner H3 support Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 14:21 ` Maxime Ripard
2015-05-17 14:21 ` Maxime Ripard
2015-05-17 14:21 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 06/10] clk: sunxi: Add H3 clocks support Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 14:27 ` Maxime Ripard
2015-05-17 14:27 ` Maxime Ripard
2015-05-17 14:27 ` Maxime Ripard
2015-05-18 9:45 ` Jens Kuske
2015-05-18 9:45 ` Jens Kuske
2015-05-18 9:45 ` Jens Kuske
2015-05-19 8:50 ` Maxime Ripard
2015-05-19 8:50 ` Maxime Ripard
2015-05-19 8:50 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 07/10] pinctrl: sunxi: Add H3 PIO controller support Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-16 15:32 ` Paul Bolle
2015-05-16 15:32 ` Paul Bolle
2015-05-16 15:32 ` Paul Bolle
2015-05-17 14:30 ` Maxime Ripard
2015-05-17 14:30 ` Maxime Ripard
2015-05-17 14:30 ` Maxime Ripard
2015-05-18 9:52 ` Jens Kuske
2015-05-18 9:52 ` Jens Kuske
2015-05-18 9:52 ` Jens Kuske
2015-05-19 14:04 ` Linus Walleij
2015-05-19 14:04 ` Linus Walleij
2015-05-19 14:04 ` Linus Walleij
2015-05-19 15:03 ` Maxime Ripard
2015-05-19 15:03 ` Maxime Ripard
2015-05-19 15:03 ` Maxime Ripard
2015-05-15 16:38 ` [PATCH v2 08/10] reset: sunxi: Add compatible for Allwinner H3 bus resets Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-17 14:31 ` Maxime Ripard
2015-05-17 14:31 ` Maxime Ripard
2015-05-17 14:31 ` Maxime Ripard
2015-05-18 9:55 ` Jens Kuske
2015-05-18 9:55 ` Jens Kuske
2015-05-18 9:55 ` Jens Kuske
2015-05-15 16:38 ` [PATCH v2 09/10] ARM: dts: sunxi: Add Allwinner H3 DTSI Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:38 ` Jens Kuske
2015-05-15 16:39 ` [PATCH v2 10/10] ARM: dts: sun8i: Add Orange Pi Plus support Jens Kuske
2015-05-15 16:39 ` Jens Kuske
2015-05-15 16:39 ` Jens Kuske
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5559AF58.60508@gmail.com \
--to=jenskuske@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.