Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753080AbbEQNKK (ORCPT ); Sun, 17 May 2015 09:10:10 -0400 Received: from down.free-electrons.com ([37.187.137.238]:35248 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752358AbbEQNKD (ORCPT ); Sun, 17 May 2015 09:10:03 -0400 Date: Sun, 17 May 2015 15:06:57 +0200 From: Maxime Ripard To: Jens Kuske Cc: Emilio =?iso-8859-1?Q?L=F3pez?= , Mike Turquette , Linus Walleij , Rob Herring , Chen-Yu Tsai , Vishnu Patekar , Hans de Goede , 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 Message-ID: <20150517130657.GD4004@lukather> References: <1431707940-19372-1-git-send-email-jenskuske@gmail.com> <1431707940-19372-4-git-send-email-jenskuske@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AouxlZHmRoNegvUM" Content-Disposition: inline In-Reply-To: <1431707940-19372-4-git-send-email-jenskuske@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4167 Lines: 115 --AouxlZHmRoNegvUM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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. >=20 > The sun4i PLL5 clock doesn't have a output for the base factor clock, > so we still have to use the name field there. >=20 > Signed-off-by: Jens Kuske > --- > drivers/clk/sunxi/clk-sunxi.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) >=20 > 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 =3D { > .name =3D "pll5", > }; > =20 > -static const struct factors_data sun4i_pll6_data __initconst =3D { > - .enable =3D 31, > - .table =3D &sun4i_pll5_config, > - .getter =3D sun4i_get_pll5_factors, > - .name =3D "pll6", > -}; > - > static const struct factors_data sun6i_a31_pll6_data __initconst =3D { > .enable =3D 31, > .table =3D &sun6i_a31_pll6_config, > .getter =3D sun6i_a31_get_pll6_factors, > - .name =3D "pll6x2", > }; > =20 > static const struct factors_data sun5i_a13_ahb_data __initconst =3D { > @@ -1099,7 +1091,7 @@ static const struct divs_data pll5_divs_data __init= const =3D { > }; > =20 > static const struct divs_data pll6_divs_data __initconst =3D { > - .factors =3D &sun4i_pll6_data, > + .factors =3D &sun4i_pll5_data, > .ndivs =3D 4, > .div =3D { > { .shift =3D 0, .table =3D pll6_sata_tbl, .gate =3D 14 }, /* M, SATA */ > @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct devi= ce_node *node, > struct clk_gate *gate =3D NULL; > struct clk_fixed_factor *fix_factor; > struct clk_divider *divider; > + struct factors_data factors =3D *data->factors; > void __iomem *reg; > int ndivs =3D SUNXI_DIVS_MAX_QTY, i =3D 0; > int flags, clkflags; > @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct dev= ice_node *node, > if (data->ndivs) > ndivs =3D data->ndivs; > =20 > + /* Try to find a name for base factor clock */ > + for (i =3D 0; i < ndivs; i++) { > + if (data->div[i].self) { I'm not sure we should expect the factor clock to have a self factor. what about taking the first output and taking the substring up to the first "_" ? Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --AouxlZHmRoNegvUM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVWJJxAAoJEBx+YmzsjxAgHy0QAL39fecc36ElVHCuwrp3ER50 bilPBuIltAm7SRQtEnZ/hvf590SjXiJXidRHuMdMlfxLgKo18QlWw7Wc8/yvBKYG lolSvXx9Wg4W0uCu3R1IIGw69XNfcNEmlBVOUZ/7+XI0uuaP6IM4l/d22Y0gKGhy 9SA2BdtXTDLxumYV24v2hae7VNV5PvI4WPoqojBDUA/Sa7+eOY8Fr/G9dwz+5jmH Z/UCKP3dT1U6W0T/FPLC3ucKWhearXvQ7I87ZT7/vfr1pDgkxsskSiKjYeedQW33 jjvynlzgsfsCSRP61W3GU49T5Pm6xIu0Ii2CO3ZErUX+tuiEFhQsWcgnoVU9oSAO bw++KdJNoGDUYrPZB1/4PAPgjNqd9lMs9U3JRJejDjya3BwDleYEp72rprHnic+T xwZXbzdtZHX7VupyVcPyZROuU33y2mmjfXn8OIxFqc0tvbCwEVu49N0YWcXfzsUK ah4eeZ43zRR8ZhQT73RLph6YNwSghX2JP06dI2yU/gUrqlKLx42NDWnRsXcKyCZC S51yAn1pYDIF1j+9UH+Zl3XE2kK4wJXG07LFQRCKSALSjCR4twDcTTQfPW1zc5jw /bnvnDLjV8XehW2QUih0C7xd4/3RfqHwzBbhQ7fr2mSueYE48CEMc5Jo0rbEDd2B +l4ZX2Hds6ygEEFVh8kR =8qTO -----END PGP SIGNATURE----- --AouxlZHmRoNegvUM-- -- 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/