Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030767AbcCQMyB (ORCPT ); Thu, 17 Mar 2016 08:54:01 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:32880 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756223AbcCQMx6 (ORCPT ); Thu, 17 Mar 2016 08:53:58 -0400 Subject: Re: [PATCH v2 09/11] usb: ohci-da8xx: Remove code that references mach To: David Lechner References: <1458181615-27782-1-git-send-email-david@lechnology.com> <1458181615-27782-10-git-send-email-david@lechnology.com> Cc: Petr Kulhavy , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Sekhar Nori , Kevin Hilman , Kishon Vijay Abraham I , Alan Stern , Greg Kroah-Hartman , Bin Liu , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Tony Lindgren , Robert Jarzmik , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org From: Sergei Shtylyov Message-ID: <56EAA8E2.7070904@cogentembedded.com> Date: Thu, 17 Mar 2016 15:53:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458181615-27782-10-git-send-email-david@lechnology.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1921 Lines: 78 On 3/17/2016 5:26 AM, David Lechner wrote: > Including mach/* is frowned upon in device drivers, so get rid of it. > > This replaces usb20_clk and code that pokes CFGCHIP2 with a proper phy > driver. > > Signed-off-by: David Lechner > --- > > v2 changes: Uses the new phy driver instead of using a second clock. > > > drivers/usb/host/ohci-da8xx.c | 90 +++++++++++++++++++++---------------------- > 1 file changed, 44 insertions(+), 46 deletions(-) > > diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c > index e5c33bc..c648674 100644 > --- a/drivers/usb/host/ohci-da8xx.c > +++ b/drivers/usb/host/ohci-da8xx.c > @@ -15,58 +15,40 @@ > #include > #include > #include > - > -#include > +#include > #include > > #ifndef CONFIG_ARCH_DAVINCI_DA8XX > #error "This file is DA8xx bus glue. Define CONFIG_ARCH_DAVINCI_DA8XX." > #endif > > -#define CFGCHIP2 DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG) > - > static struct clk *usb11_clk; > -static struct clk *usb20_clk; > +static struct phy *usb11_phy; > > /* Over-current indicator change bitmask */ > static volatile u16 ocic_mask; > > -static void ohci_da8xx_clock(int on) > +static int ohci_da8xx_enable(void) > { [...] > + ret = clk_prepare_enable(usb11_clk); > + if (ret) > + return ret; > > - /* Disable USB 1.1 PHY */ > - cfgchip2 &= ~CFGCHIP2_USB1SUSPENDM; > + ret = phy_power_on(usb11_phy); Aren't you supposed to call phy_init() first? > + if (ret) { > + clk_disable_unprepare(usb11_clk); > + return ret; > } > - __raw_writel(cfgchip2, CFGCHIP2); > + > + return 0; > +} > + > +static void ohci_da8xx_disable(void) > +{ > + phy_power_off(usb11_phy); ... and phy_exit() after that? > + clk_disable_unprepare(usb11_clk); > } > > /* [...] MBR, Sergei