[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56EAA8E2.7070904@cogentembedded.com>
Date: Thu, 17 Mar 2016 15:53:54 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: David Lechner <david@...hnology.com>
Cc: Petr Kulhavy <petr@...ix.com>, Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
Russell King <linux@....linux.org.uk>,
Sekhar Nori <nsekhar@...com>,
Kevin Hilman <khilman@...nel.org>,
Kishon Vijay Abraham I <kishon@...com>,
Alan Stern <stern@...land.harvard.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bin Liu <b-liu@...com>,
Andreas Färber <afaerber@...e.de>,
Tony Lindgren <tony@...mide.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 09/11] usb: ohci-da8xx: Remove code that references
mach
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 <david@...hnology.com>
> ---
>
> 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 <linux/jiffies.h>
> #include <linux/platform_device.h>
> #include <linux/clk.h>
> -
> -#include <mach/da8xx.h>
> +#include <linux/phy/phy.h>
> #include <linux/platform_data/usb-davinci.h>
>
> #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
Powered by blists - more mailing lists