All of lore.kernel.org
 help / color / mirror / Atom feed
From: marex@denx.de (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/8] MXS: Add USB PHY driver
Date: Wed, 16 May 2012 15:35:44 +0200	[thread overview]
Message-ID: <201205161535.44525.marex@denx.de> (raw)
In-Reply-To: <20120516050605.GB19137@b20223-02.ap.freescale.net>

Dear Richard Zhao,

> On Wed, May 16, 2012 at 06:30:14AM +0200, Marek Vasut wrote:
> > Dear Richard Zhao,
> > 
> > > Hi Marek,
> > > 
> > > On Tue, May 15, 2012 at 10:23:36AM +0200, Marek Vasut wrote:
> > > > Add driver that controls the built-in USB PHY in the i.MX233/i.MX28.
> > > > This enables the PHY upon powerup and shuts it down on shutdown.
> > > > 
> > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > > Cc: Chen Peter-B29397 <B29397@freescale.com>
> > > > Cc: Detlev Zundel <dzu@denx.de>
> > > > Cc: Fabio Estevam <festevam@gmail.com>
> > > > Cc: Li Frank-B20596 <B20596@freescale.com>
> > > > Cc: Linux USB <linux-usb@vger.kernel.org>
> > > > Cc: Liu JunJie-B08287 <B08287@freescale.com>
> > > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > > Cc: Shawn Guo <shawn.guo@linaro.org>
> > > > Cc: Shi Make-B15407 <B15407@freescale.com>
> > > > Cc: Stefano Babic <sbabic@denx.de>
> > > > Cc: Subodh Nijsure <snijsure@grid-net.com>
> > > > Cc: Wolfgang Denk <wd@denx.de>
> > > > ---
> > > > 
> > > >  drivers/usb/otg/Kconfig   |   10 ++
> > > >  drivers/usb/otg/Makefile  |    1 +
> > > >  drivers/usb/otg/mxs-phy.c |  313
> > > >  +++++++++++++++++++++++++++++++++++++++++++++
> > > 
> > > imx is more common.
> > 
> > But is this really present also in the mx3/mx5 chips ? Or is this only
> > mx233/mx28/mx6q specific ?
> 
> I don't mean phy only, but all naming in the series. mx23/28 (mxs) are
> still imx.

Sure, but mixing sigmatel stuff with mxc stuff is quite confusing.

[...]

> > > > +	otg->phy		= &phy->phy;
> > > > +	otg->set_vbus		= mxs_otg_set_vbus;
> > > > +	otg->set_host		= mxs_otg_set_host;
> > > > +	otg->set_peripheral	= mxs_otg_set_peripheral;
> > > > +
> > > > +	platform_set_drvdata(pdev, phy);
> > > > +
> > > > +	ATOMIC_INIT_NOTIFIER_HEAD(&phy->phy.notifier);
> > > > +
> > > > +	/* Register the transceiver with kernel. */
> > > > +	ret = usb_set_transceiver(&phy->phy);
> > > 
> > > In my code, I don't plan to call it for host phy, to achieve multi-phy
> > > support.
> > 
> > We're not sure how the multi-phy support will look like at all yet. I
> > think Peter and Filipe are in a tough dispute on that.
> 
> Using DT phandler, my code can connect phy and usb drivers. We might
> not have to pend on phy lib.
> Sure, somehow it cause dependency between phy driver and ci13xxx_imx
> driver. phy driver must set usb_phy as  drv data and ci13xxx_imx use
> it. It's one reason why I didn't put it to otg folder. The other reason
> is, otg folder may not be a good place to hold phy. Maybe drivers/usb/phy
> will be better?

That's exactly where I'd like to know Felipe's opinion. I don't think it's a 
good idea to create the dependency between this driver any PHY in any way. It 
kind-of defies the purpose of phy lib.

[...]

> > > > +static void __exit mxs_phy_exit(void)
> > > > +{
> > > > +	platform_driver_unregister(&mxs_phy_driver);
> > > > +}
> > > > +
> > > > +arch_initcall(mxs_phy_init);
> > > 
> > > postcor_initcall? It make possible hack in machine init code.
> > 
> > Good idea.
> > 
> > Thanks for the review, now how should we put these codes of ours
> > together? Will you integrate my code into yours or shall I do it the
> > other way around?
> 
> either way works for me. but I hope it support imx6 and use DT bindings
> and other things maybe in next branch.

Fine with me, I asked in the other patch where I can get the mx28 DT-enabled 
tree please?

> > Alas, I'd prefer for the PHY to stay separate in drivers/usb/otg,
> 
> I explained it above.
> 
> > maybe we can
> > also recycle some my mxs binding code for ci13xxx in some way or another,
> > as it has MXS specific hacks in it.
> 
> what hack do you mean?

The .notify_event stuff in my ci13xxx_mxs, where it reads the PCD bit.

> > I think the ci13xxx binding for the rest of i.MX
> > (aka mxc) will looks different, won't it? But either way, my mxs/ci13xxx
> > binding glue will have to wait until we finish negotiating the
> > phy_notify stuff with Greg.
> 
> Sure. At the same time, we may create new version patch and see response.

But if this ci13xxx_imx will only support mxs at first, it is kinda confusing.

> Thanks
> Richard
> 
> > > Thanks
> > > Richard
> > > 
> > > > +module_exit(mxs_phy_exit);
> > > > +
> > > > +MODULE_ALIAS("platform:mxs-usb-phy");
> > > > +MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
> > > > +MODULE_DESCRIPTION("Freescale i.MX28 USB PHY driver");
> > > > +MODULE_LICENSE("GPL");

  parent reply	other threads:[~2012-05-16 13:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15  8:23 [RFC PATCH 0/8 V8] MXS: Add i.MX28 USB Host driver Marek Vasut
2012-05-15  8:23 ` [PATCH 1/8] MXS: Make clk_disable return integer Marek Vasut
2012-05-16  0:55   ` Richard Zhao
2012-05-16  1:01     ` Marek Vasut
2012-05-15  8:23 ` [PATCH 2/8] MXS: Add USB EHCI and USB PHY clock handling Marek Vasut
2012-05-16  0:56   ` Richard Zhao
2012-05-15  8:23 ` [PATCH 3/8] MXS: Fixup i.MX233 USB base address name Marek Vasut
2012-05-16  0:58   ` Richard Zhao
2012-05-16  1:02     ` Marek Vasut
2012-05-15  8:23 ` [PATCH 4/8] MXS: Add data shared between imx-otg and EHCI driver Marek Vasut
2012-05-16  1:00   ` Richard Zhao
2012-05-15  8:23 ` [PATCH 5/8] MXS: Add USB PHY driver Marek Vasut
2012-05-16  3:33   ` Richard Zhao
2012-05-16  4:30     ` Marek Vasut
2012-05-16  5:06       ` Richard Zhao
2012-05-16  7:18         ` Richard Zhao
2012-05-16 13:36           ` Marek Vasut
2012-05-16 13:35         ` Marek Vasut [this message]
2012-05-16 10:35   ` Peter Chen
2012-05-16 13:37     ` Marek Vasut
     [not found] ` <1337070219-3630-1-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-05-15  8:23   ` [PATCH 6/8] CI13xxx: Add i.MX233/i.MX28 binding code Marek Vasut
2012-05-15  8:23     ` Marek Vasut
     [not found]     ` <1337070219-3630-7-git-send-email-marex-ynQEQJNshbs@public.gmane.org>
2012-05-16  8:36       ` Felipe Balbi
2012-05-16  8:36         ` Felipe Balbi
     [not found]         ` <20120516083613.GG17359-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-05-16 13:41           ` Marek Vasut
2012-05-16 13:41             ` Marek Vasut
     [not found]             ` <201205161541.17508.marex-ynQEQJNshbs@public.gmane.org>
2012-05-18 11:34               ` Felipe Balbi
2012-05-18 11:34                 ` Felipe Balbi
2012-05-15  8:23 ` [PATCH 7/8] MXS: Add platform registration hooks for USB EHCI Marek Vasut
2012-05-15  8:23 ` [PATCH 8/8] MXS: Enable USB on M28EVK Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2012-04-17 10:15 [RFC PATCH 0/8] MXS: Add i.MX28 USB Host driver Marek Vasut
2012-04-17 10:15 ` [PATCH 5/8] MXS: Add USB PHY driver Marek Vasut
2012-04-17 17:51   ` Sascha Hauer
2012-04-19 11:40   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201205161535.44525.marex@denx.de \
    --to=marex@denx.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.