mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@freescale.com>
To: Arokux X <arokux@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Greg KH <gregkh@linuxfoundation.org>, <kishon@ti.com>,
	<linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>
Subject: Re: When USB PHY framework should be used?
Date: Fri, 11 Oct 2013 09:42:40 +0800	[thread overview]
Message-ID: <20131011014239.GC14116@shlinux1.ap.freescale.net> (raw)
In-Reply-To: <CAPNxggauvgpWR5HK4Z-Osv7-mB-Tf3-vfyXQDMiTx08K2M=nJQ@mail.gmail.com>

On Thu, Oct 10, 2013 at 09:21:36PM +0200, Arokux X wrote:
> Hi,
> 
> recently I have been working on mainlining a simple bus glue driver
> for the USB EHCI for the Allwinner family of the ARM SoCs aka sunxi.
> The patches are almost ready and can be found at [1] and will be
> submitted once completely ready. The most interesting patch is [2]
> which is a driver itself.
> 
> Currently everything works. Recently Maxime Ripard brought the reset
> framework to my attention which I am going to use, since each of the
> PHYs has a reset bit. Right now those bits are treated as clocks.
> 
> Later I am going to add the OHCI support. OHCI and EHCI will be
> different drivers in different modules but they will share the same
> PHY. I do not quite understand how can I correctly use reset framework
> in the case of the common PHY. Imagine a situation if EHCI and OHCI
> drivers got loaded and deassert the (same) reset bit. Then a user
> decides to rmmod one of the drivers. This will cause it to assert the
> reset bit, which will make the other driver to fail. So it is clear
> there is a need for some central manager for the reset bit which is
> going to be poked by both EHCI and OHCI.
> 
> Maxime Ripard also brought to my attention the new USB phy framework
> which was merged into usb-next. However I'm not sure it should be used
> in my driver since as far as I understand a PHY of a USB Host
> Controller I'm dealing with is built into the controller itself. The
> only parts of the driver that touche a PHY are reset bits (different
> for each controller) and some initialization bits [3]. In addition the
> in the doc file phy.txt I read
> 
> "This framework will be of use only to devices that use external PHY
> (PHY functionality is not embedded within the controller)."

More exactly, it your PHY is not the same register mapping with controller's
you can use it.

> 
> So can you please give me some hints about the possibilities to share
> single reset bit? Should I use PHY framework, or create some kind of a
> common module that is going to be used by EHCI and OHCI. In addition I
> wanted to ask where I should normally put a common code like [4].

For your situation, you may need to create a controller driver, and call
ehci, ohci, and phy init at this probe routine, in that way, your ohci
and ehci controller will need to be unloaded together.

-- 

Best Regards,
Peter Chen


  reply	other threads:[~2013-10-11  1:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-10 19:21 Arokux X
2013-10-11  1:42 ` Peter Chen [this message]
2013-10-11  6:07 ` Kishon Vijay Abraham I
2013-10-11 17:22   ` Arokux X
2013-10-12  1:19     ` Chen Peter-B29397
2013-10-12 10:07     ` Kishon Vijay Abraham I
2013-10-14 18:17       ` Arokux X
2013-10-20 22:23         ` Arokux X
2013-10-21  9:02         ` Kishon Vijay Abraham I
2013-10-21 11:19           ` Arokux X
2013-10-21 12:44             ` Kishon Vijay Abraham I
2013-10-22 10:50             ` Maxime Ripard

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=20131011014239.GC14116@shlinux1.ap.freescale.net \
    --to=peter.chen@freescale.com \
    --cc=arokux@gmail.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=stern@rowland.harvard.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome