From mboxrd@z Thu Jan 1 00:00:00 1970 From: khilman@deeprootsystems.com (Kevin Hilman) Date: Wed, 08 Dec 2010 15:12:26 -0800 Subject: [PATCH 05/11] OMAP2+: clockdomains: split the clkdm hwsup enable/disable function In-Reply-To: <20101208061838.30541.36426.stgit@twilight.localdomain> (Paul Walmsley's message of "Tue, 07 Dec 2010 23:18:39 -0700") References: <20101208061657.30541.79824.stgit@twilight.localdomain> <20101208061838.30541.36426.stgit@twilight.localdomain> Message-ID: <871v5rg8px.fsf@deeprootsystems.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Paul Walmsley writes: > Split _omap2_clkdm_set_hwsup() into _disable_hwsup() and _enable_hwsup(). > > While here, also document that the autodeps are deprecated and that they > should be removed at the earliest opportunity. > > Signed-off-by: Paul Walmsley [...] > @@ -222,28 +231,50 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm) > } > } > > -/* > - * _omap2_clkdm_set_hwsup - set the hwsup idle transition bit > +/** > + * _enable_hwsup - set the hwsup idle transition bit > + * @clkdm: struct clockdomain * > + * > + * XXX fix doco hmm, 'doco' must be a new lingo I haven't learned yet. > + * Internal helper for actually switching the bit that controls hwsup > + * idle transitions for clkdm. > + */ > +static void _enable_hwsup(struct clockdomain *clkdm) > +{ > + u32 bits, v; > + > + if (cpu_is_omap24xx()) > + bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; > + else if (cpu_is_omap34xx() || cpu_is_omap44xx()) > + bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; > + else > + BUG(); > + > + bits = bits << __ffs(clkdm->clktrctrl_mask); > + > + v = __raw_readl(clkdm->clkstctrl_reg); > + v &= ~(clkdm->clktrctrl_mask); > + v |= bits; > + __raw_writel(v, clkdm->clkstctrl_reg); > + > +} > + > +/** > + * _disable_hwsup - set the hwsup idle transition bit > * @clkdm: struct clockdomain * > - * @enable: int 0 to disable, 1 to enable > * > + * XXX fix doco here too Kevin