Re: [PATCH v3 01/13] USB: s3c-hsotg: Add platform data callbacks for phy control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 11, 2012 at 04:31:59PM +0200, Marek Szyprowski wrote:
> Hi Felipe,
> 
> On Wednesday, April 11, 2012 4:12 PM Felipe Balbi wrote:
> 
> > On Wed, Apr 11, 2012 at 03:37:40PM +0200, Lukasz Majewski wrote:
> > > > On Fri, Mar 23, 2012 at 12:48:47PM +0100, Lukasz Majewski wrote:
> > > > > From: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
> > > > >
> > > > > The s3c-hsotg driver controls S3C64XX specific registers directly
> > > > > but this driver can be to EXYNOS also. This removes arch specific
> > > > > parts from driver using platform data callbacks.
> > > > >
> > > > > Signed-off-by: Joonyoung Shim <jy0922.shim@xxxxxxxxxxx>
> > > > > Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> > > > > ---
> > > > >  drivers/usb/gadget/s3c-hsotg.c |   94
> > > > > ++++++---------------------------------- 1 files changed, 14
> > > > > insertions(+), 80 deletions(-)
> > > > >
> > > > > diff --git a/drivers/usb/gadget/s3c-hsotg.c
> > > > > b/drivers/usb/gadget/s3c-hsotg.c index 105b206..0e8e2f4 100644
> > > > > --- a/drivers/usb/gadget/s3c-hsotg.c
> > > > > +++ b/drivers/usb/gadget/s3c-hsotg.c
> > > > > @@ -35,9 +35,9 @@
> > > > >
> > > > >  #include <plat/regs-usb-hsotg-phy.h>
> > > > >  #include <plat/regs-usb-hsotg.h>
> > > > > -#include <mach/regs-sys.h>
> > > > >  #include <plat/udc-hs.h>
> > > > >  #include <plat/cpu.h>
> > > > > +#include <plat/usb-phy.h>
> > > >
> > > > please put platform_data under <linux/platform_data/>
> > >
> > > But this code is phy related and used by other Samsung's devices (e.g.
> > > exynos4, host controllers, etc.).
> > >
> > > Following files are using it:
> > >
> > > ./arch/arm/mach-exynos/setup-usb-phy.c:20:#include <plat/usb-phy.h>
> > > ./arch/arm/mach-exynos/dev-ohci.c:21:#include <plat/usb-phy.h>
> > > ./arch/arm/mach-s5pv210/setup-usb-phy.c:19:#include <plat/usb-phy.h>
> > > ./arch/arm/mach-s5pv210/setup-usb-phy.c~:20:#include <plat/usb-phy.h>
> > > ./arch/arm/mach-s3c64xx/setup-usb-phy.c:21:#include <plat/usb-phy.h>
> > > ./arch/arm/plat-samsung/devs.c:62:#include <plat/usb-phy.h>
> > > ./drivers/usb/gadget/s3c-hsotg.c.orig:41:#include <plat/usb-phy.h>
> > > ./drivers/usb/gadget/s3c-hsotg.c:42:#include <plat/usb-phy.h>
> > > ./drivers/usb/host/ehci-s5p.c:18:#include <plat/usb-phy.h>
> > > ./drivers/usb/host/ohci-exynos.c:17:#include <plat/usb-phy.h>
> > 
> > The idea is just so drivers don't depend on ARCH-specific includes. I
> > really want to make sure all of those drivers compile on all archs so
> > we can better use linux-next.
> 
> plat/usb-phy.h is available on all Samsung sub-platforms which have USB block.

yes, but we want this same s3c-hsotg.c driver to be re-used by anyone
who's got a designware core USB2 IP on they SoC, so cutting down on the
dependencies with ARCH-related code will shortly become a must. We might
as well start it now.

> The current version of the driver has some magic SoC registests hardcoded.
> Lukasz's patch fixed this by using a common helper for managing PHY block.

that's all great, don't get me wrong.

> This is a first step to get the driver more platform independent. Once we
> get the s3c-hsotg driver working correctly on all Samsung platforms 
> (S3C64xx, S5PV210, Exynos4) without any hacks, Lukasz will separate Samsung
> custom stuff from the DWC2 core to let others to integrate their support.

At some point you will need to write a proper PHY driver using
drivers/usb/otg layer for that part. I _do_ understand it's temporary,
but since you're moving platform_data to other location, move it to
somewhere everybody (read, every ARCH) can access so it's easier to drop
"depends on ARCH_XXXX" from Kconfig later.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux