From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Mallon Subject: Re: [PATCH v4 09/10] pwm: Add PXA support Date: Thu, 15 Mar 2012 11:13:46 +1100 Message-ID: <4F61343A.80103@gmail.com> References: <1331740593-10807-1-git-send-email-thierry.reding@avionic-design.de> <1331740593-10807-10-git-send-email-thierry.reding@avionic-design.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1331740593-10807-10-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Thierry Reding Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sascha Hauer , Arnd Bergmann , Matthias Kaehlcke , Kurt Van Dijck , Rob Herring , Grant Likely , Colin Cross , Olof Johansson , Stephen Warren , Richard Purdie , Mark Brown , Mitch Bradley , Mike Frysinger , Eric Miao , Lars-Peter Clausen List-Id: linux-tegra@vger.kernel.org On 15/03/12 02:56, Thierry Reding wrote: > Signed-off-by: Thierry Reding > --- > Changes in v3: > - update PWM ops for changes in patch 2 Couple of quick notes, mostly for future work. > + /* NOTE: the clock to PWM has to be enabled first > + * before writing to the registers > + */ > + clk_enable(pc->clk); Should be fixed to also call clk_prepare (and clk_unprepare after clk_disable). Could be done in a follow up patch. > + __raw_writel(prescale, pc->mmio_base + offset + PWMCR); > + __raw_writel(dc, pc->mmio_base + offset + PWMDCR); > + __raw_writel(pv, pc->mmio_base + offset + PWMPCR); Should we fix this driver to use readl/writel instead of the __raw variants? The memory is properly ioremaped, and to my understanding the __raw memory accessors should be avoided outside of core code. This could be done in a follow up patch if you want to keep this patch as mostly just a move of the code. ~Ryan