From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v6 3/8] ARM: sunxi: Move the clock protection to machine hooks Date: Wed, 23 Apr 2014 15:31:06 +0200 Message-ID: <4987444.Zp0Prbn0Y8@wuerfel> References: <1397724379-15398-1-git-send-email-maxime.ripard@free-electrons.com> <201404231439.02913.arnd@arndb.de> <20140423131720.GS24905@lukather> Reply-To: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: In-Reply-To: <20140423131720.GS24905@lukather> List-Post: , List-Help: , List-Archive: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Subscribe: , List-Unsubscribe: , To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Maxime Ripard , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mike Turquette , andriy.shevchenko-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Emilio Lopez , dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, zhuzhenhua-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org, Vinod Koul , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, kevin.z.m.zh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, sunny-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org, shuge-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org, Dan Williams List-Id: devicetree@vger.kernel.org On Wednesday 23 April 2014 15:17:20 Maxime Ripard wrote: > > > +#include > > > #include > > > #include > > > > > > @@ -19,9 +20,17 @@ > > > > > > static void __init sun4i_dt_init(void) > > > { > > > + struct clk *clk; > > > + > > > sunxi_setup_restart(); > > > > > > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); > > > + > > > + /* Make sure the clocks we absolutely need are enabled */ > > > + /* DDR clock */ > > > + clk = clk_get(NULL, "pll5_ddr"); > > > + if (!IS_ERR(clk)) > > > + clk_prepare_enable(clk); > > > } > > > > Isn't there already DT syntax to do the same? If not, should there be? > > I don't think there is, and I gave some thought about it too. But > something a la regulator-always-on wouldn't work with clocks with > multiple outputs (like pll5), because you might need to leave only one > of the output enabled, but not the others, and I couldn't think of a > nice way to do so. > > If you have one, I'd be happy to implement it. We had a discussion a while ago about encoding default settings for clock providers in the clock provider nodes. I don't remember the details unfortunately. Mike, can you explain how this should be done? Arnd