Patchwork [0/3] otg-for-v3.10-v1: separate phy code and add DT helper

login
register
mail settings
Submitter Marc Kleine-Budde
Date Feb. 27, 2013, 2:16 p.m.
Message ID <1361974590-21237-1-git-send-email-mkl@pengutronix.de>
Download mbox
Permalink /patch/223609/
State New
Headers show

Pull-request

git://git.pengutronix.de/git/mkl/linux.git tags/otg-for-v3.10-v1

Comments

Marc Kleine-Budde - Feb. 27, 2013, 2:16 p.m.
Hello,

this series depends on the bugfix patch "USB otg: use try_module_get in all
usb_get_phy functions and add missing module_put" (a.k.a tags/otg-for-v3.9-v1)
posted earlier and is inteded for v3.10. It separates the phy from the otg code
and adds DT helper functions. Further mxs-phy uses the new usb_add_phy_dev()
function to register it's phy.

regards,
Marc


The following changes since commit 6bef020b4aebd7886281fb7fb37c788d5a365eea:

  USB otg: use try_module_get in all usb_get_phy functions and add missing module_put (2013-02-27 12:53:15 +0100)

are available in the git repository at:

  git://git.pengutronix.de/git/mkl/linux.git tags/otg-for-v3.10-v1

for you to fetch changes up to 8a4c9f8489b2fce9e7bf0eb43fdb160ab51adc2c:

  USB mxs-phy: Register phy with framework (2013-02-27 13:48:21 +0100)

----------------------------------------------------------------
USB otg, phy: separate phy and add DT helper

Move phy related code into separate file and add device tree helper functions.

----------------------------------------------------------------
Michael Grzeschik (1):
      USB: add devicetree helpers for determining dr_mode and phy_type

Sascha Hauer (2):
      USB: move bulk of otg/otg.c to phy/phy.c
      USB mxs-phy: Register phy with framework

 drivers/usb/otg/mxs-phy.c |    9 +
 drivers/usb/otg/otg.c     |  427 -------------------------------------------
 drivers/usb/phy/Makefile  |    2 +
 drivers/usb/phy/of.c      |   47 +++++
 drivers/usb/phy/phy.c     |  438 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/usb-common.c  |   37 ++++
 include/linux/usb/of.h    |   27 +++
 include/linux/usb/otg.h   |    8 +
 include/linux/usb/phy.h   |    9 +
 9 files changed, 577 insertions(+), 427 deletions(-)
 create mode 100644 drivers/usb/phy/of.c
 create mode 100644 drivers/usb/phy/phy.c
 create mode 100644 include/linux/usb/of.h
Felipe Balbi - Feb. 28, 2013, 7:57 a.m.
On Wed, Feb 27, 2013 at 03:16:29PM +0100, Marc Kleine-Budde wrote:
> From: Michael Grzeschik <m.grzeschik@pengutronix.de>
> 
> This adds two little devicetree helper functions for determining the dr_mode
> (host, peripheral, otg, dual-role) and phy_type (utmi, ulpi,...) from the
> devicetree.
> 
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

causes build breakage:

include/linux/usb/of.h:21:32: error: return type is an incomplete type
include/linux/usb/of.h: In function ‘of_usb_get_dr_mode’:
include/linux/usb/of.h:23:9: error: ‘USB_DR_MODE_UNKNOWN’ undeclared (first use in this function)
include/linux/usb/of.h:23:9: note: each undeclared identifier is reported only once for each function it appears in
include/linux/usb/of.h:23:2: warning: ‘return’ with a value, in function returning void [enabled by default]
make[1]: *** [drivers/usb/usb-common.o] Error 1
Felipe Balbi - Feb. 28, 2013, 8:01 a.m.
hi,

On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
> From: Sascha Hauer <s.hauer@pengutronix.de>
> 
> We now have usb_add_phy_dev(), so use it to register with the framework
> to be able to find the phy from the USB driver.
> 
> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
> Reviewed-by: Peter Chen <peter.chen@freescale.com>
> Acked-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

any chance you can move away from {write,read}[bwl]_relaxed() so we can
build this driver on other architectures ?
Marc Kleine-Budde - Feb. 28, 2013, 9:21 a.m.
On 02/28/2013 09:01 AM, Felipe Balbi wrote:
> hi,
> 
> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>
>> We now have usb_add_phy_dev(), so use it to register with the framework
>> to be able to find the phy from the USB driver.
>>
>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>> Acked-by: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> any chance you can move away from {write,read}[bwl]_relaxed() so we can
> build this driver on other architectures ?

The hardware is in the ARM imx2{2,8} only. Another option would be to
add an "depends on ARCH_ARM".

Marc
Marc Kleine-Budde - Feb. 28, 2013, 9:23 a.m.
On 02/28/2013 08:57 AM, Felipe Balbi wrote:
> On Wed, Feb 27, 2013 at 03:16:29PM +0100, Marc Kleine-Budde wrote:
>> From: Michael Grzeschik <m.grzeschik@pengutronix.de>
>>
>> This adds two little devicetree helper functions for determining the dr_mode
>> (host, peripheral, otg, dual-role) and phy_type (utmi, ulpi,...) from the
>> devicetree.
>>
>> Cc: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> causes build breakage:
> 
> include/linux/usb/of.h:21:32: error: return type is an incomplete type
> include/linux/usb/of.h: In function ‘of_usb_get_dr_mode’:
> include/linux/usb/of.h:23:9: error: ‘USB_DR_MODE_UNKNOWN’ undeclared (first use in this function)
> include/linux/usb/of.h:23:9: note: each undeclared identifier is reported only once for each function it appears in
> include/linux/usb/of.h:23:2: warning: ‘return’ with a value, in function returning void [enabled by default]
> make[1]: *** [drivers/usb/usb-common.o] Error 1

Doh! That occurs only for non DT kernels, but who doesn't use device
tree these days?

Fixed,
Marc
Alexander Shishkin - Feb. 28, 2013, 9:40 a.m.
Marc Kleine-Budde <mkl@pengutronix.de> writes:

> On 02/28/2013 09:01 AM, Felipe Balbi wrote:
>> hi,
>> 
>> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>>
>>> We now have usb_add_phy_dev(), so use it to register with the framework
>>> to be able to find the phy from the USB driver.
>>>
>>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>>> Acked-by: Felipe Balbi <balbi@ti.com>
>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> 
>> any chance you can move away from {write,read}[bwl]_relaxed() so we can
>> build this driver on other architectures ?
>
> The hardware is in the ARM imx2{2,8} only. Another option would be to
> add an "depends on ARCH_ARM".

Doesn't mean that we shouldn't be able to compile-test the driver.

Regards,
--
Alex
Marc Kleine-Budde - Feb. 28, 2013, 10:55 a.m.
On 02/28/2013 10:40 AM, Alexander Shishkin wrote:
> Marc Kleine-Budde <mkl@pengutronix.de> writes:
> 
>> On 02/28/2013 09:01 AM, Felipe Balbi wrote:
>>> hi,
>>>
>>> On Wed, Feb 27, 2013 at 03:16:30PM +0100, Marc Kleine-Budde wrote:
>>>> From: Sascha Hauer <s.hauer@pengutronix.de>
>>>>
>>>> We now have usb_add_phy_dev(), so use it to register with the framework
>>>> to be able to find the phy from the USB driver.
>>>>
>>>> Reviewed-by: Kishon Vijay Abraham I <kishon@ti.com>
>>>> Reviewed-by: Peter Chen <peter.chen@freescale.com>
>>>> Acked-by: Felipe Balbi <balbi@ti.com>
>>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>>>
>>> any chance you can move away from {write,read}[bwl]_relaxed() so we can
>>> build this driver on other architectures ?
>>
>> The hardware is in the ARM imx2{2,8} only. Another option would be to
>> add an "depends on ARCH_ARM".
> 
> Doesn't mean that we shouldn't be able to compile-test the driver.

Fixed in the just posted otg-for-v3.10-v2 series.

Marc
Felipe Balbi - Feb. 28, 2013, 11:16 a.m.
On Thu, Feb 28, 2013 at 10:23:03AM +0100, Marc Kleine-Budde wrote:
> On 02/28/2013 08:57 AM, Felipe Balbi wrote:
> > On Wed, Feb 27, 2013 at 03:16:29PM +0100, Marc Kleine-Budde wrote:
> >> From: Michael Grzeschik <m.grzeschik@pengutronix.de>
> >>
> >> This adds two little devicetree helper functions for determining the dr_mode
> >> (host, peripheral, otg, dual-role) and phy_type (utmi, ulpi,...) from the
> >> devicetree.
> >>
> >> Cc: Felipe Balbi <balbi@ti.com>
> >> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> >> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > 
> > causes build breakage:
> > 
> > include/linux/usb/of.h:21:32: error: return type is an incomplete type
> > include/linux/usb/of.h: In function ‘of_usb_get_dr_mode’:
> > include/linux/usb/of.h:23:9: error: ‘USB_DR_MODE_UNKNOWN’ undeclared (first use in this function)
> > include/linux/usb/of.h:23:9: note: each undeclared identifier is reported only once for each function it appears in
> > include/linux/usb/of.h:23:2: warning: ‘return’ with a value, in function returning void [enabled by default]
> > make[1]: *** [drivers/usb/usb-common.o] Error 1
> 
> Doh! That occurs only for non DT kernels, but who doesn't use device
> tree these days?

x86 and a bunch of ARM-SoC which haven't been converted yet