mbox

[v9,00/20] OMAP USB Host cleanup

Message ID 1358937492-8129-1-git-send-email-rogerq@ti.com
State New
Headers show

Pull-request

git://github.com/rogerq/linux.git linux-usbhost14-part

Message

Roger Quadros Jan. 23, 2013, 10:37 a.m. UTC
Hi Samuel,

I think this series is in a pretty good shape to pull now :). I've added
Reviewed-by and Acked-by tags. You can please pull from below.

NOTE: the first patch is a stable fix so Greg KH might want to pick it up for 3.8-rc.

The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:

  Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)

are available in the git repository at:
  git://github.com/rogerq/linux.git linux-usbhost14-part

This patchset addresses the following

- Consolidate USB Host platform data.
- Avoid addressing clocks one by one by name and use a for loop + bunch
  of cleanups.
- Get number of channels/ports dynamically either from revision register
  or from platform data. Avoids getting clocks that are not present.
- Add OMAP5 and HSIC mode (Not tested).

v9:
- Addressed clock framework related comments from Russell King.
- Removed 2 clock data patches from the series as they will be taken care
  of by Paul Walmsey.

v8:
- Re-arranged patch "USB-ehci-omap-Don-t-free-gpios-that-we-didn-t-reques.patch"
  to be the first since it is a candidate for stable.
- Fixed issues raised by Felipe, i.e. indentation and use of switch ()

v7:
- Updated patch 4 to not hold a spinlock when using clk_get().
- Updated patches 3 and 11 to return -EADDRNOTAVAIL on failure of
  demv_request_and_ioremap().

v6:
- Added USB Host platform data consolidation patch as the first patch.
  based on request from Tony.
- Rebased on v3.8-rc3.

v5:
- Rebased on top of todays arm-soc/for-next.
- Removed the clock merging patch from the list.
- Updated patches 14, 19 and 20 to accomodate the above change.
- Added patch 22 to fix a build warning.

v4:
- Added appropriate maintainers in to/cc.
- minor print message fix in patch 23 to maintain consistency.

v3:
- Rebased on arm-soc/for-next commit f979306c4d38d213c6977aaf3b1115e8ded71e3a.
- Rearranged patch that get rids of cpu_is_omap..() macros.
- Coding style fixes.

v2:
- Clocks are allocated dynamically based on number of ports available
  on the platform.
- Reduced console spam if non critical clocks are not found on the platform.
- Get rid of cpu_is_.. macros from USB host driver.

cheers,
-roger

---
Roger Quadros (20):
      USB: ehci-omap: Don't free gpios that we didn't request
      mfd: omap-usb-host: Consolidate OMAP USB-HS platform data
      mfd: omap-usb-tll: Fix channel count detection
      mfd: omap-usb-tll: Use devm_kzalloc/ioremap and clean up error path
      mfd: omap-usb-tll: Clean up clock handling
      mfd: omap-usb-tll: introduce and use mode_needs_tll()
      mfd: omap-usb-tll: Check for missing platform data in probe
      mfd: omap-usb-tll: Fix error message
      mfd: omap-usb-tll: serialize access to TLL device
      mfd: omap-usb-tll: Add OMAP5 revision and HSIC support
      mfd: omap_usb_host: Avoid missing platform data checks in suspend/resume
      mfd: omap-usb-host: Use devm_kzalloc() and devm_request_and_ioremap()
      mfd: omap-usb-host: know about number of ports from revision register
      mfd: omap-usb-host: override number of ports from platform data
      mfd: omap-usb-host: cleanup clock management code
      mfd: omap-usb-host: Manage HSIC clocks for HSIC mode
      mfd: omap-usb-host: Get rid of unnecessary spinlock
      mfd: omap-usb-host: clean up omap_usbhs_init()
      mfd: omap-usb-host: Don't spam console on clk_set_parent failure
      mdf: omap-usb-host: get rid of build warning

 arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
 arch/arm/mach-omap2/board-3630sdp.c        |    2 +-
 arch/arm/mach-omap2/board-am3517crane.c    |    2 +-
 arch/arm/mach-omap2/board-am3517evm.c      |    2 +-
 arch/arm/mach-omap2/board-cm-t35.c         |    2 +-
 arch/arm/mach-omap2/board-cm-t3517.c       |    2 +-
 arch/arm/mach-omap2/board-devkit8000.c     |    2 +-
 arch/arm/mach-omap2/board-igep0020.c       |    4 +-
 arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
 arch/arm/mach-omap2/board-omap3stalker.c   |    2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c |    2 +-
 arch/arm/mach-omap2/board-omap4panda.c     |    2 +-
 arch/arm/mach-omap2/board-overo.c          |    2 +-
 arch/arm/mach-omap2/board-zoom.c           |    2 +-
 arch/arm/mach-omap2/usb-host.c             |   29 +--
 arch/arm/mach-omap2/usb.h                  |   20 +-
 drivers/mfd/omap-usb-host.c                |  558 +++++++++++++++++-----------
 drivers/mfd/omap-usb-tll.c                 |  243 +++++++------
 drivers/usb/host/ehci-omap.c               |   14 +-
 include/linux/platform_data/usb-omap.h     |   24 +-
 22 files changed, 497 insertions(+), 425 deletions(-)

Comments

Roger Quadros Jan. 31, 2013, 10:31 a.m. UTC | #1
Hi Samuel,

Could you please pull this if it looks OK? Thanks :).

cheers,
-roger

On 01/23/2013 12:37 PM, Roger Quadros wrote:
> Hi Samuel,
> 
> I think this series is in a pretty good shape to pull now :). I've added
> Reviewed-by and Acked-by tags. You can please pull from below.
> 
> NOTE: the first patch is a stable fix so Greg KH might want to pick it up for 3.8-rc.
> 
> The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:
> 
>   Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)
> 
> are available in the git repository at:
>   git://github.com/rogerq/linux.git linux-usbhost14-part
> 
> This patchset addresses the following
> 
> - Consolidate USB Host platform data.
> - Avoid addressing clocks one by one by name and use a for loop + bunch
>   of cleanups.
> - Get number of channels/ports dynamically either from revision register
>   or from platform data. Avoids getting clocks that are not present.
> - Add OMAP5 and HSIC mode (Not tested).
> 
> v9:
> - Addressed clock framework related comments from Russell King.
> - Removed 2 clock data patches from the series as they will be taken care
>   of by Paul Walmsey.
> 
> v8:
> - Re-arranged patch "USB-ehci-omap-Don-t-free-gpios-that-we-didn-t-reques.patch"
>   to be the first since it is a candidate for stable.
> - Fixed issues raised by Felipe, i.e. indentation and use of switch ()
> 
> v7:
> - Updated patch 4 to not hold a spinlock when using clk_get().
> - Updated patches 3 and 11 to return -EADDRNOTAVAIL on failure of
>   demv_request_and_ioremap().
> 
> v6:
> - Added USB Host platform data consolidation patch as the first patch.
>   based on request from Tony.
> - Rebased on v3.8-rc3.
> 
> v5:
> - Rebased on top of todays arm-soc/for-next.
> - Removed the clock merging patch from the list.
> - Updated patches 14, 19 and 20 to accomodate the above change.
> - Added patch 22 to fix a build warning.
> 
> v4:
> - Added appropriate maintainers in to/cc.
> - minor print message fix in patch 23 to maintain consistency.
> 
> v3:
> - Rebased on arm-soc/for-next commit f979306c4d38d213c6977aaf3b1115e8ded71e3a.
> - Rearranged patch that get rids of cpu_is_omap..() macros.
> - Coding style fixes.
> 
> v2:
> - Clocks are allocated dynamically based on number of ports available
>   on the platform.
> - Reduced console spam if non critical clocks are not found on the platform.
> - Get rid of cpu_is_.. macros from USB host driver.
> 
> cheers,
> -roger
> 
> ---
> Roger Quadros (20):
>       USB: ehci-omap: Don't free gpios that we didn't request
>       mfd: omap-usb-host: Consolidate OMAP USB-HS platform data
>       mfd: omap-usb-tll: Fix channel count detection
>       mfd: omap-usb-tll: Use devm_kzalloc/ioremap and clean up error path
>       mfd: omap-usb-tll: Clean up clock handling
>       mfd: omap-usb-tll: introduce and use mode_needs_tll()
>       mfd: omap-usb-tll: Check for missing platform data in probe
>       mfd: omap-usb-tll: Fix error message
>       mfd: omap-usb-tll: serialize access to TLL device
>       mfd: omap-usb-tll: Add OMAP5 revision and HSIC support
>       mfd: omap_usb_host: Avoid missing platform data checks in suspend/resume
>       mfd: omap-usb-host: Use devm_kzalloc() and devm_request_and_ioremap()
>       mfd: omap-usb-host: know about number of ports from revision register
>       mfd: omap-usb-host: override number of ports from platform data
>       mfd: omap-usb-host: cleanup clock management code
>       mfd: omap-usb-host: Manage HSIC clocks for HSIC mode
>       mfd: omap-usb-host: Get rid of unnecessary spinlock
>       mfd: omap-usb-host: clean up omap_usbhs_init()
>       mfd: omap-usb-host: Don't spam console on clk_set_parent failure
>       mdf: omap-usb-host: get rid of build warning
> 
>  arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-3630sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-am3517crane.c    |    2 +-
>  arch/arm/mach-omap2/board-am3517evm.c      |    2 +-
>  arch/arm/mach-omap2/board-cm-t35.c         |    2 +-
>  arch/arm/mach-omap2/board-cm-t3517.c       |    2 +-
>  arch/arm/mach-omap2/board-devkit8000.c     |    2 +-
>  arch/arm/mach-omap2/board-igep0020.c       |    4 +-
>  arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
>  arch/arm/mach-omap2/board-omap3stalker.c   |    2 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c |    2 +-
>  arch/arm/mach-omap2/board-omap4panda.c     |    2 +-
>  arch/arm/mach-omap2/board-overo.c          |    2 +-
>  arch/arm/mach-omap2/board-zoom.c           |    2 +-
>  arch/arm/mach-omap2/usb-host.c             |   29 +--
>  arch/arm/mach-omap2/usb.h                  |   20 +-
>  drivers/mfd/omap-usb-host.c                |  558 +++++++++++++++++-----------
>  drivers/mfd/omap-usb-tll.c                 |  243 +++++++------
>  drivers/usb/host/ehci-omap.c               |   14 +-
>  include/linux/platform_data/usb-omap.h     |   24 +-
>  22 files changed, 497 insertions(+), 425 deletions(-)
>
Samuel Ortiz Feb. 3, 2013, 5:01 p.m. UTC | #2
Hi Roger,

On Wed, Jan 23, 2013 at 12:37:52PM +0200, Roger Quadros wrote:
> Hi Samuel,
> 
> I think this series is in a pretty good shape to pull now :). I've added
> Reviewed-by and Acked-by tags. You can please pull from below.
> 
> NOTE: the first patch is a stable fix so Greg KH might want to pick it up for 3.8-rc.
> 
> The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:
> 
>   Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)
> 
> are available in the git repository at:
>   git://github.com/rogerq/linux.git linux-usbhost14-part
> 
> This patchset addresses the following
> 
> - Consolidate USB Host platform data.
> - Avoid addressing clocks one by one by name and use a for loop + bunch
>   of cleanups.
> - Get number of channels/ports dynamically either from revision register
>   or from platform data. Avoids getting clocks that are not present.
> - Add OMAP5 and HSIC mode (Not tested).
> 
> v9:
> - Addressed clock framework related comments from Russell King.
> - Removed 2 clock data patches from the series as they will be taken care
>   of by Paul Walmsey.
Applied all 20 patches, thanks.

Cheers,
Samuel.
Roger Quadros Feb. 14, 2013, 10:18 a.m. UTC | #3
Hi Greg,

On 01/23/2013 12:37 PM, Roger Quadros wrote:
> Let's have a single platform data structure for the OMAP's High-Speed
> USB host subsystem instead of having 3 separate ones i.e. one for
> board data, one for USB Host (UHH) module and one for USB-TLL module.
> 
> This makes the code much simpler and avoids creating multiple copies of
> platform data.
> 
> CC: Alan Stern <stern@rowland.harvard.edu>
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> For the ehci-omap.c part:
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Could you please ACK the drivers/usb/host/ehci-omap.c part
so that this can go through the MFD tree. Thanks.

The reason it needs to go through MFD is that it depends on
a platform header change which Samuel and Tony have agreed to share.

cheers,
-roger

> ---
>  arch/arm/mach-omap2/board-3430sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-3630sdp.c        |    2 +-
>  arch/arm/mach-omap2/board-am3517crane.c    |    2 +-
>  arch/arm/mach-omap2/board-am3517evm.c      |    2 +-
>  arch/arm/mach-omap2/board-cm-t35.c         |    2 +-
>  arch/arm/mach-omap2/board-cm-t3517.c       |    2 +-
>  arch/arm/mach-omap2/board-devkit8000.c     |    2 +-
>  arch/arm/mach-omap2/board-igep0020.c       |    4 +-
>  arch/arm/mach-omap2/board-omap3beagle.c    |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c       |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c   |    2 +-
>  arch/arm/mach-omap2/board-omap3stalker.c   |    2 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c |    2 +-
>  arch/arm/mach-omap2/board-omap4panda.c     |    2 +-
>  arch/arm/mach-omap2/board-overo.c          |    2 +-
>  arch/arm/mach-omap2/board-zoom.c           |    2 +-
>  arch/arm/mach-omap2/usb-host.c             |   29 ++-----------
>  arch/arm/mach-omap2/usb.h                  |   20 +--------
>  drivers/mfd/omap-usb-host.c                |   63 +++++++++++----------------
>  drivers/mfd/omap-usb-tll.c                 |   11 ++---
>  drivers/usb/host/ehci-omap.c               |    6 +-
>  include/linux/platform_data/usb-omap.h     |   23 ++--------
>  22 files changed, 61 insertions(+), 125 deletions(-)
> 

<snip>

> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index e9d9b09..b96a4bf 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -107,7 +107,7 @@ static int omap_ehci_init(struct usb_hcd *hcd)
>  {
>  	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
>  	int			rc;
> -	struct ehci_hcd_omap_platform_data	*pdata;
> +	struct usbhs_omap_platform_data	*pdata;
>  
>  	pdata = hcd->self.controller->platform_data;
>  
> @@ -151,7 +151,7 @@ static int omap_ehci_init(struct usb_hcd *hcd)
>  }
>  
>  static void disable_put_regulator(
> -		struct ehci_hcd_omap_platform_data *pdata)
> +		struct usbhs_omap_platform_data *pdata)
>  {
>  	int i;
>  
> @@ -176,7 +176,7 @@ static void disable_put_regulator(
>  static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  {
>  	struct device				*dev = &pdev->dev;
> -	struct ehci_hcd_omap_platform_data	*pdata = dev->platform_data;
> +	struct usbhs_omap_platform_data		*pdata = dev->platform_data;
>  	struct resource				*res;
>  	struct usb_hcd				*hcd;
>  	void __iomem				*regs;
> diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
> index ef65b67..04c7537 100644
> --- a/include/linux/platform_data/usb-omap.h
> +++ b/include/linux/platform_data/usb-omap.h
> @@ -38,30 +38,15 @@ enum usbhs_omap_port_mode {
>  	OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
>  };
>  
> -struct usbtll_omap_platform_data {
> -	enum usbhs_omap_port_mode		port_mode[OMAP3_HS_USB_PORTS];
> -};
> -
> -struct ehci_hcd_omap_platform_data {
> +struct usbhs_omap_platform_data {
>  	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
>  	int				reset_gpio_port[OMAP3_HS_USB_PORTS];
>  	struct regulator		*regulator[OMAP3_HS_USB_PORTS];
> -	unsigned			phy_reset:1;
> -};
> -
> -struct ohci_hcd_omap_platform_data {
> -	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
> -	unsigned			es2_compatibility:1;
> -};
> -
> -struct usbhs_omap_platform_data {
> -	enum usbhs_omap_port_mode		port_mode[OMAP3_HS_USB_PORTS];
> -
> -	struct ehci_hcd_omap_platform_data	*ehci_data;
> -	struct ohci_hcd_omap_platform_data	*ohci_data;
>  
>  	/* OMAP3 <= ES2.1 have a single ulpi bypass control bit */
> -	unsigned				single_ulpi_bypass:1;
> +	unsigned			single_ulpi_bypass:1;
> +	unsigned			es2_compatibility:1;
> +	unsigned			phy_reset:1;
>  };
>  
>  /*-------------------------------------------------------------------------*/
>
Greg KH Feb. 14, 2013, 3:03 p.m. UTC | #4
On Thu, Feb 14, 2013 at 12:18:17PM +0200, Roger Quadros wrote:
> Hi Greg,
> 
> On 01/23/2013 12:37 PM, Roger Quadros wrote:
> > Let's have a single platform data structure for the OMAP's High-Speed
> > USB host subsystem instead of having 3 separate ones i.e. one for
> > board data, one for USB Host (UHH) module and one for USB-TLL module.
> > 
> > This makes the code much simpler and avoids creating multiple copies of
> > platform data.
> > 
> > CC: Alan Stern <stern@rowland.harvard.edu>
> > 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> > Reviewed-by: Felipe Balbi <balbi@ti.com>
> > For the ehci-omap.c part:
> > Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 
> Could you please ACK the drivers/usb/host/ehci-omap.c part
> so that this can go through the MFD tree. Thanks.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>