ARM: cns3xxx: use ehci platform driver
Subsystems (10)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/24 USB: EHCI: remove IXP4xx EHCI driver
This driver is not registered by any in-tree user. If needed it the EHCI driver can be reinstatied using the ehci-platform driver with caps_offset to 0x100.
---
Changes since v1:
- slightly reworded commit message
drivers/usb/host/ehci-hcd.c | 5 -- drivers/usb/host/ehci-ixp4xx.c | 139 ---------------------------------------- 2 files changed, 144 deletions(-) delete mode 100644 drivers/usb/host/ehci-ixp4xx.c
drivers/usb/host/ehci-hcd.c +0 -5
@@ -1249,11 +1249,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_orion_driver#endif -#ifdef CONFIG_ARCH_IXP4XX -#include "ehci-ixp4xx.c" -#define PLATFORM_DRIVER ixp4xx_ehci_driver -#endif -#ifdef CONFIG_USB_W90X900_EHCI #include "ehci-w90x900.c" #define PLATFORM_DRIVER ehci_hcd_w90x900_driver
drivers/usb/host/ehci-ixp4xx.c deleted +0 -139
139 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 12/24 USB: ohci: move ohci_pci_{suspend,resume} to ohci-hcd.c
In reply to a message not in the archiveAs suggested by Alan Stern, move the ohci-pci.c ohci_pci_{suspend,resume} routines to ohci-hcd.c. Due to their move, also rename them to ohci_{suspend,resume} to make it clear they operate on ohci_hcd. Since they are not necessarily called, annotate them with __maybe_unused.
--- drivers/usb/host/ohci-hcd.c | 39 +++++++++++++++++++++++++++++++++++++++ drivers/usb/host/ohci-pci.c | 43 ++----------------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-)
drivers/usb/host/ohci-hcd.c +39 -0
@@ -981,6 +981,45 @@ static int ohci_restart (struct ohci_hcd *ohci)return 0 ; } +static int __maybe_unused ohci_suspend (struct usb_hcd *hcd,bool do_wakeup) +{ +struct ohci_hcd *ohci =hcd_to_ohci (hcd); +unsigned long flags; +int rc =0 ; + +/* Root hub was already suspended. Disable irq emission and +* mark HW unaccessible, bail out if RH has been resumed. Use +* the spinlock to properly synchronize with possible pending +* RH suspend or resume activity. +*/ +spin_lock_irqsave (&ohci->lock, flags); +if (ohci->rh_state !=OHCI_RH_SUSPENDED ) { + rc = -EINVAL ; + goto bail; + } +ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrdisable); + (void )ohci_readl (ohci, &ohci->regs->intrdisable); + +clear_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); + bail: +spin_unlock_irqrestore (&ohci->lock, flags); + +return rc; +} + + +static int __maybe_unused ohci_resume (struct usb_hcd *hcd,bool hibernated) +{ +set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); + +/* Make sure resume from hibernation re-enumerates everything */ +if (hibernated) +ohci_usb_reset (hcd_to_ohci (hcd)); + +ohci_finish_controller_resume (hcd); +return 0 ; +} +#endif /*-------------------------------------------------------------------------*/
drivers/usb/host/ohci-pci.c +2 -41
55 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Alan Stern
maintainerRe: [PATCH 12/24] USB: ohci: move ohci_pci_{suspend,resume} to ohci-hcd.c
Quoted 21 lines · Florian Fainelli
As suggested by Alan Stern, move the
ohci-pci.cohci_pci_{suspend,resume} routines toohci-hcd.c. Due to their move, also rename them to ohci_{suspend,resume} to make it clear they operate onohci_hcd. Since they are not necessarily called, annotate them with__maybe_unused.Signed-off-by Florian Fainelli <[email protected]>--- drivers/usb/host/ohci-hcd.c | 39 +++++++++++++++++++++++++++++++++++++++ drivers/usb/host/ohci-pci.c | 43 ++----------------------------------------- 2 files changed, 41 insertions(+), 41 deletions(-)drivers/usb/host/ohci-hcd.c +2
-0@@ -981,6 +981,45 @@ static int ohci_restart (struct ohci_hcd *ohci)return 0 ; } +static int __maybe_unused ohci_suspend (struct usb_hcd *hcd,bool do_wakeup) +{
...
drivers/usb/host/ohci-hcd.c static int ohci_restart (struct ohci_hcd *ohci) · line 1023
Quoted 4 lines
drivers/usb/host/ohci-hcd.c +3
-0+ struct ohci_hcd *ohci = hcd_to_ohci (hcd); +} +#endif
How about putting these new routines _after_ this #endif?
Quoted 8 lines
drivers/usb/host/ohci-pci.c +0
-2@@ -298,45 +298,6 @@ static int __devinit ohci_pci_start (struct usb_hcd *hcd)#ifdef CONFIG_PM -static int ohci_pci_suspend (struct usb_hcd *hcd,bool do_wakeup) -{
...
drivers/usb/host/ohci-pci.c static int __devinit ohci_pci_start (struct usb_hcd *hcd) · line 301
Quoted 3 lines
drivers/usb/host/ohci-pci.c +0
-2-} -#endif /* CONFIG_PM */
And then moving these #ifdef and #endif lines along with them?
The point is that one condition is
#if defined(CONFIG_PM) || defined(CONFIG_PCI)
whereas the other is just
#ifdef CONFIG_PM
so they aren't really the same.
Alan Stern
PATCH v2 2/24 MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x.
In reply to a message not in the archiveThe Loongson 1B EHCI driver does nothing more than what the EHCI platform driver already does, so use the generic implementation.
---
No changes since v1
arch/mips/configs/ls1b_defconfig | 1 + arch/mips/loongson1/common/platform.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-)
arch/mips/configs/ls1b_defconfig +1 -0
@@ -76,6 +76,7 @@ CONFIG_HID_GENERIC=m CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y # CONFIG_USB_EHCI_TT_NEWSCHED is not set CONFIG_USB_STORAGE=m CONFIG_USB_SERIAL=m
arch/mips/loongson1/common/platform.c +7 -1
@@ -13,6 +13,7 @@#include <linux/phy.h> #include <linux/serial_8250.h> #include <linux/stmmac.h> +#include <linux/usb/ehci_pdriver.h> #include <asm-generic/sizes.h> #include <loongson1.h>
@@ -107,13 +108,18 @@ static struct resource ls1x_ehci_resources[] = { }, }; +static struct usb_ehci_pdata ls1x_ehci_pdata = { + .port_power_off =1 , +}; +struct platform_device ls1x_ehci_device = { - .name ="ls1x-ehci" , + .name ="ehci-platform" , .id =-1 , .num_resources =ARRAY_SIZE (ls1x_ehci_resources), .resource = ls1x_ehci_resources, .dev = { .dma_mask = &ls1x_ehci_dmamask, + .platform_data = &ls1x_ehci_pdata, }, };
Signature · 1 line
1.7.9.5
PATCH v2 3/24 USB: EHCI: remove Loongson 1B EHCI driver.
In reply to a message not in the archiveThe platform code registering the Loongson 1B EHCI driver has now been converted to register the ehci-platform driver instead, thus obsoleting the ehci-ls1x driver, which can be removed.
---
Changes since v1:
- reworded commit message
drivers/usb/host/ehci-hcd.c | 5 -- drivers/usb/host/ehci-ls1x.c | 147 ------------------------------------------ 2 files changed, 152 deletions(-) delete mode 100644 drivers/usb/host/ehci-ls1x.c
drivers/usb/host/ehci-hcd.c +0 -5
@@ -1319,11 +1319,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_mv_driver#endif -#ifdef CONFIG_MACH_LOONGSON1 -#include "ehci-ls1x.c" -#define PLATFORM_DRIVER ehci_ls1x_driver -#endif -#ifdef CONFIG_MIPS_SEAD3 #include "ehci-sead3.c" #define PLATFORM_DRIVER ehci_hcd_sead3_driver
drivers/usb/host/ehci-ls1x.c deleted +0 -147
147 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 4/24 MIPS: Netlogic: use ehci-platform driver
In reply to a message not in the archiveThe EHCI platform driver is suitable for use by the Netlogic XLR platform since there is nothing specific that the EHCI XLR platform driver does.
---
Changes since v1:
- really change driver name to "ehci-platform"
- slightly reworded commit message
arch/mips/netlogic/xlr/platform.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/mips/netlogic/xlr/platform.c +7 -1
@@ -15,6 +15,7 @@#include <linux/serial_8250.h> #include <linux/serial_reg.h> #include <linux/i2c.h> +#include <linux/usb/ehci_pdriver.h> #include <asm/netlogic/haldefs.h> #include <asm/netlogic/xlr/iomap.h>
@@ -123,8 +124,12 @@ static u64 xls_usb_dmamask = ~(u32)0; }, \ } +static struct usb_ehci_pdata xls_usb_ehci_pdata = { + .caps_offset =0 , +}; +static struct platform_device xls_usb_ehci_device = -USB_PLATFORM_DEV ("ehci-xls" ,0 ,PIC_USB_IRQ ); +USB_PLATFORM_DEV ("ehci-platform" ,0 ,PIC_USB_IRQ );static struct platform_device xls_usb_ohci_device_0 =USB_PLATFORM_DEV ("ohci-xls-0" ,1 ,PIC_USB_IRQ ); static struct platform_device xls_usb_ohci_device_1 =
@@ -172,6 +177,7 @@ int xls_platform_usb_init(void) memres =CPHYSADDR ((unsigned long )usb_mmio); xls_usb_ehci_device.resource[0 ].start = memres; xls_usb_ehci_device.resource[0 ].end = memres +0x400 -1 ; + xls_usb_ehci_device.dev.platform_data = &xls_usb_ehci_pdata; memres +=0x400 ; xls_usb_ohci_device_0.resource[0 ].start = memres;
Signature · 1 line
1.7.9.5
PATCH v2 5/24 USB: EHCI: remove Netlogic XLS EHCI driver
In reply to a message not in the archiveThe platform code has been migrated to register the ehci-platform driver, thus obsoleting the ehci-xls driver, which can be removed.
---
Changes since v1:
- reworded commit message
drivers/usb/host/ehci-hcd.c | 5 -- drivers/usb/host/ehci-xls.c | 142 ------------------------------------------- 2 files changed, 147 deletions(-) delete mode 100644 drivers/usb/host/ehci-xls.c
drivers/usb/host/ehci-hcd.c +0 -5
@@ -1309,11 +1309,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_grlib_driver#endif -#ifdef CONFIG_CPU_XLR -#include "ehci-xls.c" -#define PLATFORM_DRIVER ehci_xls_driver -#endif -#ifdef CONFIG_USB_EHCI_MV #include "ehci-mv.c" #define PLATFORM_DRIVER ehci_mv_driver
drivers/usb/host/ehci-xls.c deleted +0 -142
142 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 6/24 USB: EHCI: add no_io_watchdog platform_data parameter to ehci-platform
In reply to a message not in the archiveEnhance the ehci-platform driver to also accept no_io_watchdog as a platform data parameter. When no_io_watchdog is set to 1, the ehci controller will set ehci->need_io_watchdog to 0. Since most EHCI controllers do need the I/O watchdog to be on, only let those which need it to turn the watchdog off.
---
Changes since v1:
- reworked patch to introduce "no_io_watchdog" instead of "need_io_watchdog"
- reworded commit message accordingly
drivers/usb/host/ehci-platform.c | 2 ++ include/linux/usb/ehci_pdriver.h | 3 +++ 2 files changed, 5 insertions(+)
drivers/usb/host/ehci-platform.c +2 -0
@@ -32,6 +32,8 @@ static int ehci_platform_reset(struct usb_hcd *hcd) ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug; ehci->big_endian_desc = pdata->big_endian_desc; ehci->big_endian_mmio = pdata->big_endian_mmio; +if (pdata->no_io_watchdog) + ehci->need_io_watchdog =0 ; ehci->caps = hcd->regs + pdata->caps_offset; retval =ehci_setup (hcd);
include/linux/usb/ehci_pdriver.h +3 -0
@@ -29,6 +29,8 @@* initialization. * @port_power_off: set to 1 if the controller needs to be powered down * after initialization. +* @no_io_watchdog: set to 1 if the controller does not need the I/O +* watchdog to run. * * These are general configuration options for the EHCI controller. All of * these options are activating more or less workarounds for some hardware.
@@ -41,6 +43,7 @@ struct usb_ehci_pdata { unsigned big_endian_mmio:1; unsigned port_power_on:1; unsigned port_power_off:1; + unsigned no_io_watchdog:1;/* Turn on all power and clocks */ int (*power_on)(struct platform_device *pdev);
Signature · 1 line
1.7.9.5
Alan Stern
maintainerRe: [PATCH 06/24 v2] USB: EHCI: add no_io_watchdog platform_data parameter to ehci-platform
Quoted 10 lines · Florian Fainelli
Enhance the ehci-platform driver to also accept
no_io_watchdogas a platform data parameter. Whenno_io_watchdogis set to 1, the ehci controller will setehci->need_io_watchdogto 0. Since most EHCI controllers do need the I/O watchdog to be on, only let those which need it to turn the watchdog off.Signed-off-by Florian Fainelli <[email protected]>---
Changes since v1:
- reworked patch to introduce "no_io_watchdog" instead of "need_io_watchdog"
- reworded commit message accordingly
Very good except for one thing...
drivers/usb/host/ehci-platform.c static int ehci_platform_reset(struct usb_hcd *hcd) · line 39
Quoted 11 lines
drivers/usb/host/ehci-platform.c +2
-0@@ -32,6 +32,8 @@ static int ehci_platform_reset(struct usb_hcd *hcd) ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug; ehci->big_endian_desc = pdata->big_endian_desc; ehci->big_endian_mmio = pdata->big_endian_mmio; +if (pdata->no_io_watchdog) + ehci->need_io_watchdog =0 ; ehci->caps = hcd->regs + pdata->caps_offset; retval =ehci_setup (hcd);
ehci_setup calls ehci_init, which unconditionally sets need_io_watchdog. Your new "if" statement has to come after this call.
Alan Stern
PATCH v2 7/24 MIPS: Alchemy: use the ehci platform driver
In reply to a message not in the archiveUse the ehci platform driver power_{on,suspend,off} callbacks to perform the USB block gate enabling/disabling as what the ehci-au1xxx.c driver does. Update the db1200 and db1300 defconfigs to now select the EHCI platform driver.
---
Changes since v1:
- update impacted alchemy defconfigs accordingly
arch/mips/alchemy/common/platform.c | 23 ++++++++++++++++++++++- arch/mips/configs/db1200_defconfig | 1 + arch/mips/configs/db1300_defconfig | 1 + 3 files changed, 24 insertions(+), 1 deletion(-)
arch/mips/alchemy/common/platform.c +22 -1
@@ -17,6 +17,7 @@#include <linux/platform_device.h> #include <linux/serial_8250.h> #include <linux/slab.h> +#include <linux/usb/ehci_pdriver.h> #include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1xxx_dbdma.h>
@@ -122,6 +123,25 @@ static void __init alchemy_setup_uarts(int ctype)static u64 alchemy_ohci_dmamask =DMA_BIT_MASK (32 );static u64 __maybe_unused alchemy_ehci_dmamask =DMA_BIT_MASK (32 ); +/* Power on callback for the ehci platform driver */ +static int alchemy_ehci_power_on (struct platform_device *pdev) +{ +return alchemy_usb_control (ALCHEMY_USB_EHCI0 ,1 ); +} + +/* Power off/suspend callback for the ehci platform driver */ +static void alchemy_ehci_power_off (struct platform_device *pdev) +{ +alchemy_usb_control (ALCHEMY_USB_EHCI0 ,0 ); +} + +static struct usb_ehci_pdata alchemy_ehci_pdata = { + .no_io_watchdog =1 , + .power_on = alchemy_ehci_power_on, + .power_off = alchemy_ehci_power_off, + .power_suspend = alchemy_ehci_power_off, +}; +static unsigned long alchemy_ohci_data[][2 ]__initdata = { [ALCHEMY_CPU_AU1000 ] = {AU1000_USB_OHCI_PHYS_ADDR ,AU1000_USB_HOST_INT }, [ALCHEMY_CPU_AU1500 ] = {AU1000_USB_OHCI_PHYS_ADDR ,AU1500_USB_HOST_INT },
@@ -188,9 +208,10 @@ static void __init alchemy_setup_usb(int ctype) res[1 ].start = alchemy_ehci_data[ctype][1 ]; res[1 ].end = res[1 ].start; res[1 ].flags =IORESOURCE_IRQ ; - pdev->name ="au1xxx-ehci" ; + pdev->name ="ehci-platform" ; pdev->id =0 ; pdev->dev.dma_mask = &alchemy_ehci_dmamask; + pdev->dev.platform_data = &alchemy_ehci_pdata;if (platform_device_register (pdev))printk (KERN_INFO "Alchemy USB: cannot add EHCI0\n" );
arch/mips/configs/db1200_defconfig +1 -0
@@ -117,6 +117,7 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # CONFIG_USB_DEVICE_CLASS is not set CONFIG_USB_DYNAMIC_MINORS=y CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y CONFIG_MMC=y
arch/mips/configs/db1300_defconfig +1 -0
@@ -288,6 +288,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y CONFIG_USB=y CONFIG_USB_DYNAMIC_MINORS=y CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y
Signature · 1 line
1.7.9.5
PATCH v2 8/24 USB: EHCI: remove Alchemy EHCI driver
In reply to a message not in the archiveThe platform code has been converted to use the ehci-platform driver instead thus obsoleting the ehci-au1xxx driver, which can be removed.
---
Changes since v1:
- reworded commit message
drivers/usb/host/ehci-au1xxx.c | 184 ---------------------------------------- drivers/usb/host/ehci-hcd.c | 5 -- 2 files changed, 189 deletions(-) delete mode 100644 drivers/usb/host/ehci-au1xxx.c
drivers/usb/host/ehci-au1xxx.c deleted +0 -184
@@ -1,184 +0,0 @@ -/* -* EHCI HCD (Host Controller Driver) for USB. -* -* Bus Glue for AMD Alchemy Au1xxx -* -* Based on "ohci-au1xxx.c" by Matt Porter <[email protected]> -* -* Modified for AMD Alchemy Au1200 EHC -* by K.Boge <[email protected]> -* -* This file is licenced under the GPL. -*/ - -#include <linux/platform_device.h> -#include <asm/mach-au1x00/au1000.h> - - -extern int usb_disabled (void ); - -static int au1xxx_ehci_setup (struct usb_hcd *hcd) -{ -struct ehci_hcd *ehci =hcd_to_ehci (hcd); -int ret; - - ehci->caps = hcd->regs; - ret =ehci_setup (hcd); - - ehci->need_io_watchdog =0 ; -return ret; -} - -static const struct hc_driver ehci_au1xxx_hc_driver = { - .description = hcd_name, - .product_desc ="Au1xxx EHCI" , - .hcd_priv_size =sizeof (struct ehci_hcd ), - -/* -* generic hardware linkage -*/ - .irq = ehci_irq, - .flags =HCD_MEMORY |HCD_USB2 , - -/* -* basic lifecycle operations -* -* FIXME -- ehci_init() doesn't do enough here. -* See ehci-ppc-soc for a complete implementation. -*/ - .reset = au1xxx_ehci_setup, - .start = ehci_run, - .stop = ehci_stop, - .shutdown = ehci_shutdown, - -/* -* managing i/o requests and associated device resources -*/ - .urb_enqueue = ehci_urb_enqueue, - .urb_dequeue = ehci_urb_dequeue, - .endpoint_disable = ehci_endpoint_disable, - .endpoint_reset = ehci_endpoint_reset, - -/* -* scheduling support -*/ - .get_frame_number = ehci_get_frame, - -/* -* root hub support -*/ - .hub_status_data = ehci_hub_status_data, - .hub_control = ehci_hub_control, - .bus_suspend = ehci_bus_suspend, - .bus_resume = ehci_bus_resume, - .relinquish_port = ehci_relinquish_port, - .port_handed_over = ehci_port_handed_over, - - .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, -}; - -static int ehci_hcd_au1xxx_drv_probe (struct platform_device *pdev) -{ -struct usb_hcd *hcd; -struct resource *res; -int ret; - -if (usb_disabled ()) -return -ENODEV ; - -if (pdev->resource[1 ].flags !=IORESOURCE_IRQ ) { -pr_debug ("resource[1] is not IORESOURCE_IRQ" ); -return -ENOMEM ; - } - hcd =usb_create_hcd (&ehci_au1xxx_hc_driver, &pdev->dev,"Au1xxx" ); -if (!hcd) -return -ENOMEM ; - - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); - hcd->rsrc_start = res->start; - hcd->rsrc_len =resource_size (res); - - hcd->regs =devm_request_and_ioremap (&pdev->dev, res); -if (!hcd->regs) { -pr_debug ("devm_request_and_ioremap failed" ); - ret = -ENOMEM ; - goto err1; - } - -if (alchemy_usb_control (ALCHEMY_USB_EHCI0 ,1 )) { -printk (KERN_INFO "%s: controller init failed!\n" , pdev->name); - ret = -ENODEV ; - goto err1; - } - - ret =usb_add_hcd (hcd, pdev->resource[1 ].start, -IRQF_SHARED ); -if (ret ==0 ) { -platform_set_drvdata (pdev, hcd); -return ret; - } - -alchemy_usb_control (ALCHEMY_USB_EHCI0 ,0 ); -err1: -usb_put_hcd (hcd); -return ret; -} - -static int ehci_hcd_au1xxx_drv_remove (struct platform_device *pdev) -{ -struct usb_hcd *hcd =platform_get_drvdata (pdev); - -usb_remove_hcd (hcd); -alchemy_usb_control (ALCHEMY_USB_EHCI0 ,0 ); -usb_put_hcd (hcd); -platform_set_drvdata (pdev,NULL ); - -return 0 ; -} - -#ifdef CONFIG_PM -static int ehci_hcd_au1xxx_drv_suspend (struct device *dev) -{ -struct usb_hcd *hcd =dev_get_drvdata (dev); -bool do_wakeup =device_may_wakeup (dev); -int rc; - - rc =ehci_suspend (hcd, do_wakeup); -alchemy_usb_control (ALCHEMY_USB_EHCI0 ,0 ); - -return rc; -} - -static int ehci_hcd_au1xxx_drv_resume (struct device *dev) -{ -struct usb_hcd *hcd =dev_get_drvdata (dev); - -alchemy_usb_control (ALCHEMY_USB_EHCI0 ,1 ); -ehci_resume (hcd, false); - -return 0 ; -} - -static const struct dev_pm_ops au1xxx_ehci_pmops = { - .suspend = ehci_hcd_au1xxx_drv_suspend, - .resume = ehci_hcd_au1xxx_drv_resume, -}; - -#define AU1XXX_EHCI_PMOPS &au1xxx_ehci_pmops - -#else -#define AU1XXX_EHCI_PMOPS NULL -#endif - -static struct platform_driver ehci_hcd_au1xxx_driver = { - .probe = ehci_hcd_au1xxx_drv_probe, - .remove = ehci_hcd_au1xxx_drv_remove, - .shutdown = usb_hcd_platform_shutdown, - .driver = { - .name ="au1xxx-ehci" , - .owner =THIS_MODULE , - .pm =AU1XXX_EHCI_PMOPS , - } -}; - -MODULE_ALIAS ("platform:au1xxx-ehci" );
drivers/usb/host/ehci-hcd.c +0 -5
@@ -1219,11 +1219,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_hcd_sh_driver#endif -#ifdef CONFIG_MIPS_ALCHEMY -#include "ehci-au1xxx.c" -#define PLATFORM_DRIVER ehci_hcd_au1xxx_driver -#endif -#ifdef CONFIG_USB_EHCI_HCD_OMAP #include "ehci-omap.c" #define PLATFORM_DRIVER ehci_hcd_omap_driver
Signature · 1 line
1.7.9.5
PATCH v2 9/24 ARM: cns3xxx: use ehci platform driver
In reply to a message not in the archive---
No change since v1
arch/arm/mach-cns3xxx/cns3420vb.c | 44 ++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
arch/arm/mach-cns3xxx/cns3420vb.c +43 -1
@@ -24,6 +24,7 @@#include <linux/mtd/mtd.h> #include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> +#include <linux/usb/ehci_pdriver.h> #include <asm/setup.h> #include <asm/mach-types.h> #include <asm/hardware/gic.h>
@@ -32,6 +33,7 @@#include <asm/mach/time.h> #include <mach/cns3xxx.h> #include <mach/irqs.h> +#include <mach/pm.h> #include "core.h" #include "devices.h"
@@ -125,13 +127,53 @@ static struct resource cns3xxx_usb_ehci_resources[] = {static u64 cns3xxx_usb_ehci_dma_mask =DMA_BIT_MASK (32 ); +static int csn3xxx_usb_ehci_power_on (struct platform_device *pdev) +{ +/* +* EHCI and OHCI share the same clock and power, +* resetting twice would cause the 1st controller been reset. +* Therefore only do power up at the first up device, and +* power down at the last down device. +* +* Set USB AHB INCR length to 16 +*/ +if (atomic_inc_return (&usb_pwr_ref) ==1 ) { +cns3xxx_pwr_power_up (1 <<PM_PLL_HM_PD_CTRL_REG_OFFSET_PLL_USB ); +cns3xxx_pwr_clk_en (1 <<PM_CLK_GATE_REG_OFFSET_USB_HOST ); +cns3xxx_pwr_soft_rst (1 <<PM_SOFT_RST_REG_OFFST_USB_HOST ); +__raw_writel ((__raw_readl (MISC_CHIP_CONFIG_REG ) | (0X2 <<24 )), +MISC_CHIP_CONFIG_REG ); + } + +return 0 ; +} + +static void csn3xxx_usb_ehci_power_off (struct platform_device *pdev) +{ +/* +* EHCI and OHCI share the same clock and power, +* resetting twice would cause the 1st controller been reset. +* Therefore only do power up at the first up device, and +* power down@the last down device. +*/ +if (atomic_dec_return (&usb_pwr_ref) ==0 ) +cns3xxx_pwr_clk_dis (1 <<PM_CLK_GATE_REG_OFFSET_USB_HOST ); +} + +static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { + .port_power_off =1 , + .power_on = csn3xxx_usb_ehci_power_on, + .power_off = csn3xxx_usb_ehci_power_off, +}; +static struct platform_device cns3xxx_usb_ehci_device = { - .name ="cns3xxx-ehci" , + .name ="ehci-platform" , .num_resources =ARRAY_SIZE (cns3xxx_usb_ehci_resources), .resource = cns3xxx_usb_ehci_resources, .dev = { .dma_mask = &cns3xxx_usb_ehci_dma_mask, .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &cns3xxx_usb_ehci_pdata, }, };
Signature · 1 line
1.7.9.5
PATCH v2 10/24 USB: EHCI: remove CNS3xxx EHCI platform driver
In reply to a message not in the archiveThe users have been converted to use the ehci platform driver instead, thus making the ehci-cns3xxx driver obsolete, so remove it.
---
Changes since v1:
- only remove the corresponding chunk from ehci-hcd
drivers/usb/host/Kconfig | 6 +- drivers/usb/host/ehci-cns3xxx.c | 155 --------------------------------------- drivers/usb/host/ehci-hcd.c | 5 -- 3 files changed, 5 insertions(+), 161 deletions(-) delete mode 100644 drivers/usb/host/ehci-cns3xxx.c
drivers/usb/host/Kconfig +5 -1
@@ -215,9 +215,13 @@ config USB_W90X900_EHCI Enables support for the W90X900 USB controller config USB_CNS3XXX_EHCI - bool "Cavium CNS3XXX EHCI Module" + bool "Cavium CNS3XXX EHCI Module (DEPRECATED)" depends on USB_EHCI_HCD && ARCH_CNS3XXX + select USB_EHCI_HCD_PLATFORM ---help--- + This option is deprecated now and the driver was removed, use + USB_EHCI_HCD_PLATFORM instead. + Enable support for the CNS3XXX SOC's on-chip EHCI controller. It is needed for high-speed (480Mbit/sec) USB 2.0 device support.
drivers/usb/host/ehci-cns3xxx.c deleted +0 -155
155 lines not on this page · raw message
drivers/usb/host/ehci-hcd.c +0 -5
@@ -1259,11 +1259,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_octeon_driver#endif -#ifdef CONFIG_USB_CNS3XXX_EHCI -#include "ehci-cns3xxx.c" -#define PLATFORM_DRIVER cns3xxx_ehci_driver -#endif -#ifdef CONFIG_ARCH_VT8500 #include "ehci-vt8500.c" #define PLATFORM_DRIVER vt8500_ehci_driver
Signature · 1 line
1.7.9.5
PATCH v2 11/24 USB: ohci: allow platform driver to specify the number of ports
In reply to a message not in the archive---
No changes since v1
drivers/usb/host/ohci-platform.c | 4 ++++ include/linux/usb/ohci_pdriver.h | 2 ++ 2 files changed, 6 insertions(+)
drivers/usb/host/ohci-platform.c +4 -0
@@ -31,6 +31,10 @@ static int ohci_platform_reset(struct usb_hcd *hcd) ohci->flags |=OHCI_QUIRK_FRAME_NO ;ohci_hcd_init (ohci); + +if (pdata->num_ports) + ohci->num_ports = pdata->num_ports; + err =ohci_init (ohci);return err;
include/linux/usb/ohci_pdriver.h +2 -0
@@ -25,6 +25,7 @@* @big_endian_desc: BE descriptors * @big_endian_mmio: BE registers * @no_big_frame_no: no big endian frame_no shift +* @num_ports: number of ports * * These are general configuration options for the OHCI controller. All of * these options are activating more or less workarounds for some hardware.
@@ -33,6 +34,7 @@ struct usb_ohci_pdata { unsigned big_endian_desc:1; unsigned big_endian_mmio:1; unsigned no_big_frame_no:1; +unsigned int num_ports;/* Turn on all power and clocks */ int (*power_on)(struct platform_device *pdev);
Signature · 1 line
1.7.9.5
PATCH v2 15/24 MIPS: PNX8550: use OHCI platform driver
In reply to a message not in the archive---
No changes since v1
arch/mips/pnx8550/common/platform.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
arch/mips/pnx8550/common/platform.c +30 -1
@@ -20,6 +20,7 @@#include <linux/serial.h> #include <linux/serial_pnx8xxx.h> #include <linux/platform_device.h> +#include <linux/usb/ohci_pdriver.h> #include <int.h> #include <usb.h>
@@ -96,12 +97,40 @@ static u64 ohci_dmamask = DMA_BIT_MASK(32);static u64 uart_dmamask =DMA_BIT_MASK (32 ); +static int pnx8550_usb_ohci_power_on (struct platform_device *pdev) +{ +/* +* Set register CLK48CTL to enable and 48MHz +*/ +outl (0x00000003 ,PCI_BASE |0x0004770c ); + +/* +* Set register CLK12CTL to enable and 48MHz +*/ +outl (0x00000003 ,PCI_BASE |0x00047710 ); + +udelay (100 ); + +return 0 ; +} + +static void pnx8550_usb_ohci_power_off (struct platform_device *pdev) +{ +udelay (10 ); +} + +static struct usb_ohci_pdata pnx8550_usb_ohci_pdata = { + .power_on = pnx8550_usb_ohci_power_on, + .power_off = pnx8550_usb_ohci_power_off, +}; +static struct platform_device pnx8550_usb_ohci_device = { - .name ="pnx8550-ohci" , + .name ="ohci-platform" , .id =-1 , .dev = { .dma_mask = &ohci_dmamask, .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &pnx8550_usb_ohci_pdata, }, .num_resources =ARRAY_SIZE (pnx8550_usb_ohci_resources), .resource = pnx8550_usb_ohci_resources,
Signature · 1 line
1.7.9.5
PATCH v2 16/24 USB: OHCI: remove PNX8550 OHCI driver
In reply to a message not in the archiveThe users have been converted to use the platform OHCI driver instead, thus making the ohci-pnx8550 driver obsolete, so remove it.
---
No changes since v1
drivers/usb/host/ohci-hcd.c | 5 - drivers/usb/host/ohci-pnx8550.c | 243 --------------------------------------- 2 files changed, 248 deletions(-) delete mode 100644 drivers/usb/host/ohci-pnx8550.c
drivers/usb/host/ohci-hcd.c +0 -5
@@ -1103,11 +1103,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_au1xxx_driver#endif -#ifdef CONFIG_PNX8550 -#include "ohci-pnx8550.c" -#define PLATFORM_DRIVER ohci_hcd_pnx8550_driver -#endif -#ifdef CONFIG_USB_OHCI_HCD_PPC_SOC #include "ohci-ppc-soc.c" #define PLATFORM_DRIVER ohci_hcd_ppc_soc_driver
drivers/usb/host/ohci-pnx8550.c deleted +0 -243
243 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 17/24 ARM: cns3xxx: use OHCI platform driver
In reply to a message not in the archiveSince both the EHCI and OHCI platform drivers use the same power_{on,off} callbacks, rename them to cns3xx_usb_power_{on,off} to show that they are shared.
---
No changes since v1
arch/arm/mach-cns3xxx/cns3420vb.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
arch/arm/mach-cns3xxx/cns3420vb.c +13 -5
@@ -25,6 +25,7 @@#include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> #include <linux/usb/ehci_pdriver.h> +#include <linux/usb/ohci_pdriver.h> #include <asm/setup.h> #include <asm/mach-types.h> #include <asm/hardware/gic.h>
@@ -127,7 +128,7 @@ static struct resource cns3xxx_usb_ehci_resources[] = {static u64 cns3xxx_usb_ehci_dma_mask =DMA_BIT_MASK (32 ); -static int csn3xxx_usb_ehci_power_on (struct platform_device *pdev) +static int csn3xxx_usb_power_on (struct platform_device *pdev) {/* * EHCI and OHCI share the same clock and power,
@@ -148,7 +149,7 @@ static int csn3xxx_usb_ehci_power_on(struct platform_device *pdev)return 0 ; } -static void csn3xxx_usb_ehci_power_off (struct platform_device *pdev) +static void csn3xxx_usb_power_off (struct platform_device *pdev) {/* * EHCI and OHCI share the same clock and power,
@@ -162,8 +163,8 @@ static void csn3xxx_usb_ehci_power_off(struct platform_device *pdev)static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { .port_power_off =1 , - .power_on = csn3xxx_usb_ehci_power_on, - .power_off = csn3xxx_usb_ehci_power_off, + .power_on = csn3xxx_usb_power_on, + .power_off = csn3xxx_usb_power_off, };static struct platform_device cns3xxx_usb_ehci_device = {
@@ -191,13 +192,20 @@ static struct resource cns3xxx_usb_ohci_resources[] = {static u64 cns3xxx_usb_ohci_dma_mask =DMA_BIT_MASK (32 ); +static struct usb_ohci_pdata cns3xxx_usb_ohci_pdata = { + .num_ports =1 , + .power_on = csn3xxx_usb_power_on, + .power_off = csn3xxx_usb_power_off, +}; +static struct platform_device cns3xxx_usb_ohci_device = { - .name ="cns3xxx-ohci" , + .name ="ohci-platform" , .num_resources =ARRAY_SIZE (cns3xxx_usb_ohci_resources), .resource = cns3xxx_usb_ohci_resources, .dev = { .dma_mask = &cns3xxx_usb_ohci_dma_mask, .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &cns3xxx_usb_ohci_pdata, }, };
Signature · 1 line
1.7.9.5
Alan Stern
maintainerRe: [PATCH 17/24 v2] ARM: cns3xxx: use OHCI platform driver
Quoted 3 lines · Florian Fainelli
Since both the EHCI and OHCI platform drivers use the same power_{on,off} callbacks, rename them to cns3xx_usb_power_{on,off} to show that they are shared.
This is an example of the sort of thing I complained about before. People who read only the patch description and not the title will wonder why this patch adds cns3xxx_usb_ohci_pdata and cns3xxx_usb_ohci_device.
And people who read both will wonder why they talk about different things.
Alan Stern
PATCH v2 18/24 USB: OHCI: remove CNS3xxx OHCI platform driver
In reply to a message not in the archiveAll users have been converted to use the OHCI platform driver instead, thus making ohci-cns3xxx, so remove it.
---
Changes since v1:
- reworded commit message
drivers/usb/host/Kconfig | 6 +- drivers/usb/host/ohci-cns3xxx.c | 166 --------------------------------------- drivers/usb/host/ohci-hcd.c | 5 -- 3 files changed, 5 insertions(+), 172 deletions(-) delete mode 100644 drivers/usb/host/ohci-cns3xxx.c
drivers/usb/host/Kconfig +5 -1
@@ -410,9 +410,13 @@ config USB_OHCI_EXYNOS Enable support for the Samsung Exynos SOC's on-chip OHCI controller. config USB_CNS3XXX_OHCI - bool "Cavium CNS3XXX OHCI Module" + bool "Cavium CNS3XXX OHCI Module (DEPRECATED)" depends on USB_OHCI_HCD && ARCH_CNS3XXX + select USB_OHCI_HCD_PLATFORM ---help--- + This option is deprecated now and the driver was removed, use + USB_OHCI_HCD_PLATFORM instead. + Enable support for the CNS3XXX SOC's on-chip OHCI controller. It is needed for low-speed USB 1.0 device support.
drivers/usb/host/ohci-cns3xxx.c deleted +0 -166
166 lines not on this page · raw message
drivers/usb/host/ohci-hcd.c +0 -5
@@ -1169,11 +1169,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_tilegx_driver#endif -#ifdef CONFIG_USB_CNS3XXX_OHCI -#include "ohci-cns3xxx.c" -#define PLATFORM_DRIVER ohci_hcd_cns3xxx_driver -#endif -#ifdef CONFIG_CPU_XLR #include "ohci-xls.c" #define PLATFORM_DRIVER ohci_xls_driver
Signature · 1 line
1.7.9.5
PATCH v2 19/24 MIPS: Netlogic: convert to use OHCI platform driver
In reply to a message not in the archiveThe OHCI platform driver is suitable for use by the Netlogic XLR platform so use this driver instead of the OHCI XLS platform driver.
---
Changes since v1:
- really make the code register the "ohci-platform" driver instead of "ohci-xls"
arch/mips/netlogic/xlr/platform.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/mips/netlogic/xlr/platform.c +7 -2
@@ -16,6 +16,7 @@#include <linux/serial_reg.h> #include <linux/i2c.h> #include <linux/usb/ehci_pdriver.h> +#include <linux/usb/ohci_pdriver.h> #include <asm/netlogic/haldefs.h> #include <asm/netlogic/xlr/iomap.h>
@@ -128,12 +129,14 @@ static struct usb_ehci_pdata xls_usb_ehci_pdata = { .caps_offset = 0, }; +static struct usb_ohci_pdata xls_usb_ohci_pdata; +static struct platform_device xls_usb_ehci_device =USB_PLATFORM_DEV ("ehci-platform" ,0 ,PIC_USB_IRQ );static struct platform_device xls_usb_ohci_device_0 = -USB_PLATFORM_DEV ("ohci-xls-0" ,1 ,PIC_USB_IRQ ); +USB_PLATFORM_DEV ("ohci-platform" ,1 ,PIC_USB_IRQ );static struct platform_device xls_usb_ohci_device_1 = -USB_PLATFORM_DEV ("ohci-xls-1" ,2 ,PIC_USB_IRQ ); +USB_PLATFORM_DEV ("ohci-platform" ,2 ,PIC_USB_IRQ );static struct platform_device *xls_platform_devices[] = { &xls_usb_ehci_device,
@@ -182,10 +185,12 @@ int xls_platform_usb_init(void) memres +=0x400 ; xls_usb_ohci_device_0.resource[0 ].start = memres; xls_usb_ohci_device_0.resource[0 ].end = memres +0x400 -1 ; + xls_usb_ohci_device_0.dev.platform_data = &xls_usb_ohci_pdata; memres +=0x400 ; xls_usb_ohci_device_1.resource[0 ].start = memres; xls_usb_ohci_device_1.resource[0 ].end = memres +0x400 -1 ; + xls_usb_ohci_device_1.dev.platform_data = &xls_usb_ohci_pdata;return platform_add_devices (xls_platform_devices,ARRAY_SIZE (xls_platform_devices));
Signature · 1 line
1.7.9.5
PATCH v2 20/24 USB: OHCI: remove Netlogic XLS OHCI platform driver
In reply to a message not in the archiveAll users have been converted to use the OHCI platform driver instead, thus making ohci-xls obsolete, remove it.
---
Changes since v1:
- reworded commit message
drivers/usb/host/ohci-hcd.c | 5 -- drivers/usb/host/ohci-xls.c | 152 ------------------------------------------- 2 files changed, 157 deletions(-) delete mode 100644 drivers/usb/host/ohci-xls.c
drivers/usb/host/ohci-hcd.c +0 -5
@@ -1169,11 +1169,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_tilegx_driver#endif -#ifdef CONFIG_CPU_XLR -#include "ohci-xls.c" -#define PLATFORM_DRIVER ohci_xls_driver -#endif -#ifdef CONFIG_USB_OHCI_HCD_PLATFORM #include "ohci-platform.c" #define PLATFORM_DRIVER ohci_platform_driver
drivers/usb/host/ohci-xls.c deleted +0 -152
152 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 21/24 sh: convert boards to use the OHCI platform driver
In reply to a message not in the archive---
No changes since v1
arch/sh/kernel/cpu/sh3/setup-sh7720.c | 6 +++++- arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 6 +++++- arch/sh/kernel/cpu/sh4a/setup-sh7763.c | 6 +++++- arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-)
arch/sh/kernel/cpu/sh3/setup-sh7720.c +5 -1
@@ -20,6 +20,7 @@#include <linux/serial_sci.h> #include <linux/sh_timer.h> #include <linux/sh_intc.h> +#include <linux/usb/ohci_pdriver.h> #include <asm/rtc.h> #include <cpu/serial.h>
@@ -103,12 +104,15 @@ static struct resource usb_ohci_resources[] = {static u64 usb_ohci_dma_mask =0xffffffffUL ; +static struct usb_ohci_pdata usb_ohci_pdata; +static struct platform_device usb_ohci_device = { - .name ="sh_ohci" , + .name ="ohci-platform" , .id =-1 , .dev = { .dma_mask = &usb_ohci_dma_mask, .coherent_dma_mask =0xffffffff , + .platform_data = &usb_ohci_pdata, }, .num_resources =ARRAY_SIZE (usb_ohci_resources), .resource = usb_ohci_resources,
arch/sh/kernel/cpu/sh4a/setup-sh7757.c +5 -1
@@ -19,6 +19,7 @@#include <linux/sh_timer.h> #include <linux/sh_dma.h> #include <linux/sh_intc.h> +#include <linux/usb/ohci_pdriver.h> #include <cpu/dma-register.h> #include <cpu/sh7757.h>
@@ -750,12 +751,15 @@ static struct resource usb_ohci_resources[] = { }, }; +static struct usb_ohci_pdata usb_ohci_pdata; +static struct platform_device usb_ohci_device = { - .name ="sh_ohci" , + .name ="ohci-platform" , .id =-1 , .dev = { .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &usb_ohci_pdata, }, .num_resources =ARRAY_SIZE (usb_ohci_resources), .resource = usb_ohci_resources,
arch/sh/kernel/cpu/sh4a/setup-sh7763.c +5 -1
@@ -16,6 +16,7 @@#include <linux/sh_intc.h> #include <linux/io.h> #include <linux/serial_sci.h> +#include <linux/usb/ohci_pdriver.h> static struct plat_sci_port scif0_platform_data = { .mapbase =0xffe00000 ,
@@ -106,12 +107,15 @@ static struct resource usb_ohci_resources[] = {static u64 usb_ohci_dma_mask =0xffffffffUL ; +static struct usb_ohci_pdata usb_ohci_pdata; +static struct platform_device usb_ohci_device = { - .name ="sh_ohci" , + .name ="ohci-platform" , .id =-1 , .dev = { .dma_mask = &usb_ohci_dma_mask, .coherent_dma_mask =0xffffffff , + .platform_data = &usb_ohci_pdata, }, .num_resources =ARRAY_SIZE (usb_ohci_resources), .resource = usb_ohci_resources,
arch/sh/kernel/cpu/sh4a/setup-sh7786.c +5 -1
@@ -23,6 +23,7 @@#include <linux/sh_timer.h> #include <linux/sh_dma.h> #include <linux/sh_intc.h> +#include <linux/usb/ohci_pdriver.h> #include <cpu/dma-register.h> #include <asm/mmzone.h>
@@ -583,12 +584,15 @@ static struct resource usb_ohci_resources[] = { }, }; +static struct usb_ohci_pdata usb_ohci_pdata; +static struct platform_device usb_ohci_device = { - .name ="sh_ohci" , + .name ="ohci-platform" , .id =-1 , .dev = { .dma_mask = &usb_ohci_device.dev.coherent_dma_mask, .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &usb_ohci_pdata, }, .num_resources =ARRAY_SIZE (usb_ohci_resources), .resource = usb_ohci_resources,
Signature · 1 line
1.7.9.5
PATCH v2 22/24 USB: OHCI: remove OHCI SH platform driver
In reply to a message not in the archiveAll users have been converted to use the OHCI platform driver instead, thus making ohci-sh obsolete, so remove it.
---
No changes since v1
drivers/usb/host/Kconfig | 6 +- drivers/usb/host/ohci-hcd.c | 5 -- drivers/usb/host/ohci-sh.c | 141 ------------------------------------------- 3 files changed, 5 insertions(+), 147 deletions(-) delete mode 100644 drivers/usb/host/ohci-sh.c
drivers/usb/host/Kconfig +5 -1
@@ -397,9 +397,13 @@ config USB_OHCI_HCD_SSB If unsure, say N. config USB_OHCI_SH - bool "OHCI support for SuperH USB controller" + bool "OHCI support for SuperH USB controller (DEPRECATED)" depends on USB_OHCI_HCD && SUPERH + select USB_OHCI_HCD_PLATFORM ---help--- + This option is deprecated now and the driver was removed, use + USB_OHCI_HCD_PLATFORM instead. + Enables support for the on-chip OHCI controller on the SuperH. If you use the PCI OHCI controller, this option is not necessary.
drivers/usb/host/ohci-hcd.c +0 -5
@@ -1123,11 +1123,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_da8xx_driver#endif -#ifdef CONFIG_USB_OHCI_SH -#include "ohci-sh.c" -#define PLATFORM_DRIVER ohci_hcd_sh_driver -#endif -#ifdef CONFIG_USB_OHCI_HCD_PPC_OF #include "ohci-ppc-of.c"
drivers/usb/host/ohci-sh.c deleted +0 -141
141 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 13/24 USB: ohci: remove check for RH already suspended in ohci_suspend
In reply to a message not in the archiveAs suggested by Alan Stern, the code checking for the OHCI Root Hub already suspended is no longer required since the bug it fixes has not been seen in ages, remove that check making ohci_suspend much simpler.
--- drivers/usb/host/ohci-hcd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/usb/host/ohci-hcd.c +2 -9
@@ -985,26 +985,19 @@ static int __maybe_unused ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) {struct ohci_hcd *ohci =hcd_to_ohci (hcd);unsigned long flags; -int rc =0 ; -/* Root hub was already suspended. Disable irq emission and -* mark HW unaccessible, bail out if RH has been resumed. Use +/* Disable irq emission and mark HW unaccessible. Use * the spinlock to properly synchronize with possible pending * RH suspend or resume activity. */ spin_lock_irqsave (&ohci->lock, flags); -if (ohci->rh_state !=OHCI_RH_SUSPENDED ) { - rc = -EINVAL ; - goto bail; - }ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrdisable); (void )ohci_readl (ohci, &ohci->regs->intrdisable);clear_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); - bail:spin_unlock_irqrestore (&ohci->lock, flags); -return rc; +return 0 ; }
Signature · 1 line
1.7.9.5
PATCH 14/24 USB: ohci: merge ohci_finish_controller_resume with ohci_resume
In reply to a message not in the archiveMerge ohci_finish_controller_resume with ohci_resume as suggested by Alan Stern. Since ohci_finish_controller_resume no longer exists, update the various OHCI drivers to call ohci_resume() instead. Some drivers used to set themselves the bit HCD_FLAG_HW_ACCESSIBLE, which is now handled by ohci_resume().
--- drivers/usb/host/ohci-at91.c | 2 +- drivers/usb/host/ohci-ep93xx.c | 2 +- drivers/usb/host/ohci-exynos.c | 5 +---- drivers/usb/host/ohci-hcd.c | 41 +++++++++++++++++++++++++++++++++++-- drivers/usb/host/ohci-hub.c | 42 -------------------------------------- drivers/usb/host/ohci-omap.c | 2 +- drivers/usb/host/ohci-platform.c | 2 +- drivers/usb/host/ohci-pxa27x.c | 2 +- drivers/usb/host/ohci-s3c2410.c | 3 +-- drivers/usb/host/ohci-spear.c | 2 +- drivers/usb/host/ohci-tmio.c | 2 +- 11 files changed, 48 insertions(+), 57 deletions(-)
drivers/usb/host/ohci-at91.c +1 -1
@@ -705,7 +705,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)if (!clocked)at91_start_clock (); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#else
drivers/usb/host/ohci-ep93xx.c +1 -1
@@ -194,7 +194,7 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)ep93xx_start_hc (&pdev->dev); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif
drivers/usb/host/ohci-exynos.c +1 -4
@@ -252,10 +252,7 @@ static int exynos_ohci_resume(struct device *dev)if (pdata && pdata->phy_init) pdata->phy_init (pdev,S5P_USB_PHY_HOST ); -/* Mark hardware accessible again as we are out of D3 state by now */ -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); - -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
drivers/usb/host/ohci-hcd.c +39 -2
52 lines not on this page · raw message
drivers/usb/host/ohci-hub.c +0 -42
48 lines not on this page · raw message
drivers/usb/host/ohci-omap.c +1 -1
@@ -530,7 +530,7 @@ static int ohci_omap_resume(struct platform_device *dev) ohci->next_statechange = jiffies;omap_ohci_clock_power (1 ); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
drivers/usb/host/ohci-platform.c +1 -1
@@ -203,7 +203,7 @@ static int ohci_platform_resume(struct device *dev)return err; } -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
drivers/usb/host/ohci-pxa27x.c +1 -1
@@ -591,7 +591,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct device *dev)/* Select Power Management Mode */ pxa27x_ohci_select_pmm (ohci, inf->port_mode); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
drivers/usb/host/ohci-s3c2410.c +1 -2
@@ -524,8 +524,7 @@ static int ohci_hcd_s3c2410_drv_resume(struct device *dev)s3c2410_start_hc (pdev, hcd); -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
drivers/usb/host/ohci-spear.c +1 -1
@@ -231,7 +231,7 @@ static int spear_ohci_hcd_drv_resume(struct platform_device *dev) ohci->next_statechange = jiffies;spear_start_ohci (ohci_p); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif
drivers/usb/host/ohci-tmio.c +1 -1
@@ -352,7 +352,7 @@ static int ohci_hcd_tmio_drv_resume(struct platform_device *dev)spin_unlock_irqrestore (&tmio->lock, flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
Signature · 1 line
1.7.9.5
Re: [PATCH 14/24] USB: ohci: merge ohci_finish_controller_resume with ohci_resume
On Friday, October 05, 2012 12:18 AM Florian Fainelli wrote
Quoted 8 lines
Merge
ohci_finish_controller_resumewithohci_resumeas suggested by Alan Stern. Sinceohci_finish_controller_resumeno longer exists, update the various OHCI drivers to callohci_resume()instead. Some drivers used to set themselves the bitHCD_FLAG_HW_ACCESSIBLE, which is now handled byohci_resume().Signed-off-by Florian Fainelli <[email protected]>
For drivers/usb/host/ohci-exynos.c, it looks good.
Best regards,
Jingoo Han
Quoted 252 lines
--- drivers/usb/host/ohci-at91.c | 2 +- drivers/usb/host/ohci-ep93xx.c | 2 +- drivers/usb/host/ohci-exynos.c | 5 +---- drivers/usb/host/ohci-hcd.c | 41 +++++++++++++++++++++++++++++++++++-- drivers/usb/host/ohci-hub.c | 42 -------------------------------------- drivers/usb/host/ohci-omap.c | 2 +- drivers/usb/host/ohci-platform.c | 2 +- drivers/usb/host/ohci-pxa27x.c | 2 +- drivers/usb/host/ohci-s3c2410.c | 3 +-- drivers/usb/host/ohci-spear.c | 2 +- drivers/usb/host/ohci-tmio.c | 2 +- 11 files changed, 48 insertions(+), 57 deletions(-)drivers/usb/host/ohci-at91.c +1
-1@@ -705,7 +705,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)if (!clocked)at91_start_clock (); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#else drivers/usb/host/ohci-ep93xx.c +1
-1@@ -194,7 +194,7 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)ep93xx_start_hc (&pdev->dev); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif drivers/usb/host/ohci-exynos.c +1
-4@@ -252,10 +252,7 @@ static int exynos_ohci_resume(struct device *dev)if (pdata && pdata->phy_init) pdata->phy_init (pdev,S5P_USB_PHY_HOST ); -/* Mark hardware accessible again as we are out of D3 state by now */ -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); - -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-hcd.c +39
-2@@ -1003,13 +1003,50 @@ static int __maybe_unused ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)static int __maybe_unused ohci_resume (struct usb_hcd *hcd,bool hibernated) { +struct ohci_hcd *ohci =hcd_to_ohci (hcd); +int port; +bool need_reinit = false; +set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags);/* Make sure resume from hibernation re-enumerates everything */ if (hibernated) -ohci_usb_reset (hcd_to_ohci (hcd)); +ohci_usb_reset (ohci); + +/* See if the controller is already running or has been reset */ + ohci->hc_control =ohci_readl (ohci, &ohci->regs->control); +if (ohci->hc_control & (OHCI_CTRL_IR |OHCI_SCHED_ENABLES )) { + need_reinit = true; + }else { +switch (ohci->hc_control &OHCI_CTRL_HCFS ) { +case OHCI_USB_OPER : +case OHCI_USB_RESET : + need_reinit = true; + } + } + +/* If needed, reinitialize and suspend the root hub */ +if (need_reinit) { +spin_lock_irq (&ohci->lock); +ohci_rh_resume (ohci); +ohci_rh_suspend (ohci,0 ); +spin_unlock_irq (&ohci->lock); + } + +/* Normally just turn on port power and enable interrupts */ +else { +ohci_dbg (ohci,"powerup ports\n" ); +for (port =0 ; port < ohci->num_ports; port++) +ohci_writel (ohci,RH_PS_PPS , + &ohci->regs->roothub.portstatus[port]); + +ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrenable); +ohci_readl (ohci, &ohci->regs->intrenable); +msleep (20 ); + } + +usb_hcd_resume_root_hub (hcd); -ohci_finish_controller_resume (hcd);return 0 ; }drivers/usb/host/ohci-hub.c +0
-42@@ -316,48 +316,6 @@ static int ohci_bus_resume (struct usb_hcd *hcd)return rc; } -/* Carry out the final steps of resuming the controller device */ -static void __maybe_unused ohci_finish_controller_resume (struct usb_hcd *hcd) -{ -struct ohci_hcd *ohci =hcd_to_ohci (hcd); -int port; -bool need_reinit = false; - -/* See if the controller is already running or has been reset */ - ohci->hc_control =ohci_readl (ohci, &ohci->regs->control); -if (ohci->hc_control & (OHCI_CTRL_IR |OHCI_SCHED_ENABLES )) { - need_reinit = true; - }else { -switch (ohci->hc_control &OHCI_CTRL_HCFS ) { -case OHCI_USB_OPER : -case OHCI_USB_RESET : - need_reinit = true; - } - } - -/* If needed, reinitialize and suspend the root hub */ -if (need_reinit) { -spin_lock_irq (&ohci->lock); -ohci_rh_resume (ohci); -ohci_rh_suspend (ohci,0 ); -spin_unlock_irq (&ohci->lock); - } - -/* Normally just turn on port power and enable interrupts */ -else { -ohci_dbg (ohci,"powerup ports\n" ); -for (port =0 ; port < ohci->num_ports; port++) -ohci_writel (ohci,RH_PS_PPS , - &ohci->regs->roothub.portstatus[port]); - -ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrenable); -ohci_readl (ohci, &ohci->regs->intrenable); -msleep (20 ); - } - -usb_hcd_resume_root_hub (hcd); -} -/* Carry out polling-, autostop-, and autoresume-related state changes */ static int ohci_root_hub_state_changes (struct ohci_hcd *ohci,int changed,int any_connected,int rhsc_status)drivers/usb/host/ohci-omap.c +1
-1@@ -530,7 +530,7 @@ static int ohci_omap_resume(struct platform_device *dev) ohci->next_statechange = jiffies;omap_ohci_clock_power (1 ); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-platform.c +1
-1@@ -203,7 +203,7 @@ static int ohci_platform_resume(struct device *dev)return err; } -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-pxa27x.c +1
-1@@ -591,7 +591,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct device *dev)/* Select Power Management Mode */ pxa27x_ohci_select_pmm (ohci, inf->port_mode); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-s3c2410.c +1
-2@@ -524,8 +524,7 @@ static int ohci_hcd_s3c2410_drv_resume(struct device *dev)s3c2410_start_hc (pdev, hcd); -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-spear.c +1
-1@@ -231,7 +231,7 @@ static int spear_ohci_hcd_drv_resume(struct platform_device *dev) ohci->next_statechange = jiffies;spear_start_ohci (ohci_p); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif drivers/usb/host/ohci-tmio.c +1
-2@@ -352,7 +352,7 @@ static int ohci_hcd_tmio_drv_resume(struct platform_device *dev)spin_unlock_irqrestore (&tmio->lock, flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; } --1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 14/24] USB: ohci: merge ohci_finish_controller_resume with ohci_resume
In reply to Florian FainelliOn 10/04/2012 05:17 PM, Florian Fainelli :
Quoted 9 lines
Merge
ohci_finish_controller_resumewithohci_resumeas suggested by Alan Stern. Sinceohci_finish_controller_resumeno longer exists, update the various OHCI drivers to callohci_resume()instead. Some drivers used to set themselves the bitHCD_FLAG_HW_ACCESSIBLE, which is now handled byohci_resume().Signed-off-by Florian Fainelli <[email protected]>--- drivers/usb/host/ohci-at91.c | 2 +-
Seems ok for AT91, so
Thanks Florian, bye,
Quoted 244 lines
drivers/usb/host/ohci-ep93xx.c | 2 +- drivers/usb/host/ohci-exynos.c | 5 +---- drivers/usb/host/ohci-hcd.c | 41 +++++++++++++++++++++++++++++++++++-- drivers/usb/host/ohci-hub.c | 42 -------------------------------------- drivers/usb/host/ohci-omap.c | 2 +- drivers/usb/host/ohci-platform.c | 2 +- drivers/usb/host/ohci-pxa27x.c | 2 +- drivers/usb/host/ohci-s3c2410.c | 3 +-- drivers/usb/host/ohci-spear.c | 2 +- drivers/usb/host/ohci-tmio.c | 2 +- 11 files changed, 48 insertions(+), 57 deletions(-)drivers/usb/host/ohci-at91.c +1
-1@@ -705,7 +705,7 @@ static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)if (!clocked)at91_start_clock (); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#else drivers/usb/host/ohci-ep93xx.c +1
-1@@ -194,7 +194,7 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)ep93xx_start_hc (&pdev->dev); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif drivers/usb/host/ohci-exynos.c +1
-4@@ -252,10 +252,7 @@ static int exynos_ohci_resume(struct device *dev)if (pdata && pdata->phy_init) pdata->phy_init (pdev,S5P_USB_PHY_HOST ); -/* Mark hardware accessible again as we are out of D3 state by now */ -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); - -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-hcd.c +39
-2@@ -1003,13 +1003,50 @@ static int __maybe_unused ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)static int __maybe_unused ohci_resume (struct usb_hcd *hcd,bool hibernated) { +struct ohci_hcd *ohci =hcd_to_ohci (hcd); +int port; +bool need_reinit = false; +set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags);/* Make sure resume from hibernation re-enumerates everything */ if (hibernated) -ohci_usb_reset (hcd_to_ohci (hcd)); +ohci_usb_reset (ohci); + +/* See if the controller is already running or has been reset */ + ohci->hc_control =ohci_readl (ohci, &ohci->regs->control); +if (ohci->hc_control & (OHCI_CTRL_IR |OHCI_SCHED_ENABLES )) { + need_reinit = true; + }else { +switch (ohci->hc_control &OHCI_CTRL_HCFS ) { +case OHCI_USB_OPER : +case OHCI_USB_RESET : + need_reinit = true; + } + } + +/* If needed, reinitialize and suspend the root hub */ +if (need_reinit) { +spin_lock_irq (&ohci->lock); +ohci_rh_resume (ohci); +ohci_rh_suspend (ohci,0 ); +spin_unlock_irq (&ohci->lock); + } + +/* Normally just turn on port power and enable interrupts */ +else { +ohci_dbg (ohci,"powerup ports\n" ); +for (port =0 ; port < ohci->num_ports; port++) +ohci_writel (ohci,RH_PS_PPS , + &ohci->regs->roothub.portstatus[port]); + +ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrenable); +ohci_readl (ohci, &ohci->regs->intrenable); +msleep (20 ); + } + +usb_hcd_resume_root_hub (hcd); -ohci_finish_controller_resume (hcd);return 0 ; }drivers/usb/host/ohci-hub.c +0
-42@@ -316,48 +316,6 @@ static int ohci_bus_resume (struct usb_hcd *hcd)return rc; } -/* Carry out the final steps of resuming the controller device */ -static void __maybe_unused ohci_finish_controller_resume (struct usb_hcd *hcd) -{ -struct ohci_hcd *ohci =hcd_to_ohci (hcd); -int port; -bool need_reinit = false; - -/* See if the controller is already running or has been reset */ - ohci->hc_control =ohci_readl (ohci, &ohci->regs->control); -if (ohci->hc_control & (OHCI_CTRL_IR |OHCI_SCHED_ENABLES )) { - need_reinit = true; - }else { -switch (ohci->hc_control &OHCI_CTRL_HCFS ) { -case OHCI_USB_OPER : -case OHCI_USB_RESET : - need_reinit = true; - } - } - -/* If needed, reinitialize and suspend the root hub */ -if (need_reinit) { -spin_lock_irq (&ohci->lock); -ohci_rh_resume (ohci); -ohci_rh_suspend (ohci,0 ); -spin_unlock_irq (&ohci->lock); - } - -/* Normally just turn on port power and enable interrupts */ -else { -ohci_dbg (ohci,"powerup ports\n" ); -for (port =0 ; port < ohci->num_ports; port++) -ohci_writel (ohci,RH_PS_PPS , - &ohci->regs->roothub.portstatus[port]); - -ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrenable); -ohci_readl (ohci, &ohci->regs->intrenable); -msleep (20 ); - } - -usb_hcd_resume_root_hub (hcd); -} -/* Carry out polling-, autostop-, and autoresume-related state changes */ static int ohci_root_hub_state_changes (struct ohci_hcd *ohci,int changed,int any_connected,int rhsc_status)drivers/usb/host/ohci-omap.c +1
-1@@ -530,7 +530,7 @@ static int ohci_omap_resume(struct platform_device *dev) ohci->next_statechange = jiffies;omap_ohci_clock_power (1 ); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-platform.c +1
-1@@ -203,7 +203,7 @@ static int ohci_platform_resume(struct device *dev)return err; } -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-pxa27x.c +1
-1@@ -591,7 +591,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct device *dev)/* Select Power Management Mode */ pxa27x_ohci_select_pmm (ohci, inf->port_mode); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-s3c2410.c +1
-2@@ -524,8 +524,7 @@ static int ohci_hcd_s3c2410_drv_resume(struct device *dev)s3c2410_start_hc (pdev, hcd); -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }drivers/usb/host/ohci-spear.c +1
-1@@ -231,7 +231,7 @@ static int spear_ohci_hcd_drv_resume(struct platform_device *dev) ohci->next_statechange = jiffies;spear_start_ohci (ohci_p); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false); return 0; }#endif drivers/usb/host/ohci-tmio.c +1
-1@@ -352,7 +352,7 @@ static int ohci_hcd_tmio_drv_resume(struct platform_device *dev)spin_unlock_irqrestore (&tmio->lock, flags); -ohci_finish_controller_resume (hcd); +ohci_resume (hcd, false);return 0 ; }
Signature · 1 line
Nicolas Ferre
PATCH v2 23/24 MIPS: Alchemy: use the OHCI platform driver
In reply to a message not in the archiveConvert the Alchemy platform to register the ohci-platform driver, now that the ohci-platform driver properly handles the specific ohci-au1xxx resume from suspend case.
This also greatly simplifies the power_{on,off} callbacks and make them work on platform device id instead of checking the OHCI controller base address like what was done in ohci-au1xxx.c.
Impacted defconfigs are also updated accordingly to select the OHCI platform driver.
---
Changes since v1:
- updated defconfigs accordingly
- really instantiate "ohci-platform" instead of "ohci-au1xxx"
- rebased on top of the latest OHCI HCD changes
arch/mips/alchemy/common/platform.c | 35 +++++++++++++++++++++++++++++++++-- arch/mips/configs/db1000_defconfig | 1 + arch/mips/configs/db1200_defconfig | 1 + arch/mips/configs/db1300_defconfig | 1 + arch/mips/configs/db1550_defconfig | 1 + arch/mips/configs/gpr_defconfig | 1 + arch/mips/configs/mtx1_defconfig | 1 + arch/mips/configs/pb1100_defconfig | 1 + arch/mips/configs/pb1500_defconfig | 1 + arch/mips/configs/pb1550_defconfig | 1 + 10 files changed, 42 insertions(+), 2 deletions(-)
arch/mips/alchemy/common/platform.c +33 -2
@@ -18,6 +18,7 @@#include <linux/serial_8250.h> #include <linux/slab.h> #include <linux/usb/ehci_pdriver.h> +#include <linux/usb/ohci_pdriver.h> #include <asm/mach-au1x00/au1000.h> #include <asm/mach-au1x00/au1xxx_dbdma.h>
@@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = { .power_suspend = alchemy_ehci_power_off, }; +/* Power on callback for the ohci platform driver */ +static int alchemy_ohci_power_on (struct platform_device *pdev) +{ +int unit; + + unit = (pdev->id ==1 ) ? +ALCHEMY_USB_OHCI1 :ALCHEMY_USB_OHCI0 ; + +return alchemy_usb_control (unit,1 ); +} + +/* Power off/suspend callback for the ohci platform driver */ +static void alchemy_ohci_power_off (struct platform_device *pdev) +{ +int unit; + + unit = (pdev->id ==1 ) ? +ALCHEMY_USB_OHCI1 :ALCHEMY_USB_OHCI0 ; + +alchemy_usb_control (unit,0 ); +} + +static struct usb_ohci_pdata alchemy_ohci_pdata = { + .power_on = alchemy_ohci_power_on, + .power_off = alchemy_ohci_power_off, + .power_suspend = alchemy_ohci_power_off, +}; +static unsigned long alchemy_ohci_data[][2 ]__initdata = { [ALCHEMY_CPU_AU1000 ] = {AU1000_USB_OHCI_PHYS_ADDR ,AU1000_USB_HOST_INT }, [ALCHEMY_CPU_AU1500 ] = {AU1000_USB_OHCI_PHYS_ADDR ,AU1500_USB_HOST_INT },
@@ -189,9 +218,10 @@ static void __init alchemy_setup_usb(int ctype) res[1 ].start = alchemy_ohci_data[ctype][1 ]; res[1 ].end = res[1 ].start; res[1 ].flags =IORESOURCE_IRQ ; - pdev->name ="au1xxx-ohci" ; + pdev->name ="ohci-platform" ; pdev->id =0 ; pdev->dev.dma_mask = &alchemy_ohci_dmamask; + pdev->dev.platform_data = &alchemy_ohci_pdata;if (platform_device_register (pdev))printk (KERN_INFO "Alchemy USB: cannot add OHCI0\n" );
@@ -228,9 +258,10 @@ static void __init alchemy_setup_usb(int ctype) res[1 ].start =AU1300_USB_INT ; res[1 ].end = res[1 ].start; res[1 ].flags =IORESOURCE_IRQ ; - pdev->name ="au1xxx-ohci" ; + pdev->name ="ohci-platform" ; pdev->id =1 ; pdev->dev.dma_mask = &alchemy_ohci_dmamask; + pdev->dev.platform_data = &alchemy_ohci_pdata;if (platform_device_register (pdev))printk (KERN_INFO "Alchemy USB: cannot add OHCI1\n" );
arch/mips/configs/db1000_defconfig +1 -0
@@ -233,6 +233,7 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_STORAGE=y CONFIG_NEW_LEDS=y
arch/mips/configs/db1200_defconfig +1 -0
@@ -120,6 +120,7 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_MMC=y # CONFIG_MMC_BLOCK_BOUNCE is not set CONFIG_MMC_AU1X=y
arch/mips/configs/db1300_defconfig +1 -0
@@ -292,6 +292,7 @@ CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y
arch/mips/configs/db1550_defconfig +1 -0
@@ -187,6 +187,7 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=y CONFIG_USB_STORAGE=y
arch/mips/configs/gpr_defconfig +1 -0
@@ -291,6 +291,7 @@ CONFIG_USB_MON=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_STORAGE=m CONFIG_USB_LIBUSUAL=y CONFIG_USB_SERIAL=y
arch/mips/configs/mtx1_defconfig +1 -0
@@ -581,6 +581,7 @@ CONFIG_USB_MON=m CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=m +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_USB_UHCI_HCD=m CONFIG_USB_U132_HCD=m CONFIG_USB_SL811_HCD=m
arch/mips/configs/pb1100_defconfig +1 -0
@@ -97,6 +97,7 @@ CONFIG_USB=y CONFIG_USB_DYNAMIC_MINORS=y CONFIG_USB_SUSPEND=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AU1XXX=y CONFIG_EXT2_FS=y
arch/mips/configs/pb1500_defconfig +1 -0
@@ -104,6 +104,7 @@ CONFIG_USB=y CONFIG_USB_DYNAMIC_MINORS=y CONFIG_USB_OTG_WHITELIST=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AU1XXX=y CONFIG_EXT2_FS=y
arch/mips/configs/pb1550_defconfig +1 -0
@@ -108,6 +108,7 @@ CONFIG_USB_SUSPEND=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AU1XXX=y CONFIG_EXT2_FS=y
Signature · 1 line
1.7.9.5
PATCH v2 24/24 USB: OHCI: remove Alchemy OHCI platform driver.
In reply to a message not in the archiveAll users have been converted to use the OHCI platform driver instead, thus making ohci-au1xxx obsolete, remove it.
---
Changes since v1:
- rebased on top of the latest OHCI HCD changes
drivers/usb/host/ohci-au1xxx.c | 234 ---------------------------------------- drivers/usb/host/ohci-hcd.c | 5 - 2 files changed, 239 deletions(-) delete mode 100644 drivers/usb/host/ohci-au1xxx.c
drivers/usb/host/ohci-au1xxx.c deleted +0 -234
@@ -1,234 +0,0 @@ -/* -* OHCI HCD (Host Controller Driver) for USB. -* -* (C) Copyright 1999 Roman Weissgaerber <[email protected]> -* (C) Copyright 2000-2002 David Brownell <[email protected]> -* (C) Copyright 2002 Hewlett-Packard Company -* -* Bus Glue for AMD Alchemy Au1xxx -* -* Written by Christopher Hoover <[email protected]> -* Based on fragments of previous driver by Russell King et al. -* -* Modified for LH7A404 from ohci-sa1111.c -* by Durgesh Pattamatta <[email protected]> -* Modified for AMD Alchemy Au1xxx -* by Matt Porter <[email protected]> -* -* This file is licenced under the GPL. -*/ - -#include <linux/platform_device.h> -#include <linux/signal.h> - -#include <asm/mach-au1x00/au1000.h> - - -extern int usb_disabled (void ); - -static int __devinit ohci_au1xxx_start (struct usb_hcd *hcd) -{ -struct ohci_hcd *ohci =hcd_to_ohci (hcd); -int ret; - -ohci_dbg (ohci,"ohci_au1xxx_start, ohci:%p" , ohci); - -if ((ret =ohci_init (ohci)) <0 ) -return ret; - -if ((ret =ohci_run (ohci)) <0 ) { -dev_err (hcd->self.controller,"can't start %s" , - hcd->self.bus_name); -ohci_stop (hcd); -return ret; - } - -return 0 ; -} - -static const struct hc_driver ohci_au1xxx_hc_driver = { - .description = hcd_name, - .product_desc ="Au1xxx OHCI" , - .hcd_priv_size =sizeof (struct ohci_hcd ), - -/* -* generic hardware linkage -*/ - .irq = ohci_irq, - .flags =HCD_USB11 |HCD_MEMORY , - -/* -* basic lifecycle operations -*/ - .start = ohci_au1xxx_start, - .stop = ohci_stop, - .shutdown = ohci_shutdown, - -/* -* managing i/o requests and associated device resources -*/ - .urb_enqueue = ohci_urb_enqueue, - .urb_dequeue = ohci_urb_dequeue, - .endpoint_disable = ohci_endpoint_disable, - -/* -* scheduling support -*/ - .get_frame_number = ohci_get_frame, - -/* -* root hub support -*/ - .hub_status_data = ohci_hub_status_data, - .hub_control = ohci_hub_control, -#ifdef CONFIG_PM - .bus_suspend = ohci_bus_suspend, - .bus_resume = ohci_bus_resume, -#endif - .start_port_reset = ohci_start_port_reset, -}; - -static int ohci_hcd_au1xxx_drv_probe (struct platform_device *pdev) -{ -int ret, unit; -struct usb_hcd *hcd; - -if (usb_disabled ()) -return -ENODEV ; - -if (pdev->resource[1 ].flags !=IORESOURCE_IRQ ) { -pr_debug ("resource[1] is not IORESOURCE_IRQ\n" ); -return -ENOMEM ; - } - - hcd =usb_create_hcd (&ohci_au1xxx_hc_driver, &pdev->dev,"au1xxx" ); -if (!hcd) -return -ENOMEM ; - - hcd->rsrc_start = pdev->resource[0 ].start; - hcd->rsrc_len = pdev->resource[0 ].end - pdev->resource[0 ].start +1 ; - -if (!request_mem_region (hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { -pr_debug ("request_mem_region failed\n" ); - ret = -EBUSY ; - goto err1; - } - - hcd->regs =ioremap (hcd->rsrc_start, hcd->rsrc_len); -if (!hcd->regs) { -pr_debug ("ioremap failed\n" ); - ret = -ENOMEM ; - goto err2; - } - - unit = (hcd->rsrc_start ==AU1300_USB_OHCI1_PHYS_ADDR ) ? -ALCHEMY_USB_OHCI1 :ALCHEMY_USB_OHCI0 ; -if (alchemy_usb_control (unit,1 )) { -printk (KERN_INFO "%s: controller init failed!\n" , pdev->name); - ret = -ENODEV ; - goto err3; - } - -ohci_hcd_init (hcd_to_ohci (hcd)); - - ret =usb_add_hcd (hcd, pdev->resource[1 ].start, -IRQF_SHARED ); -if (ret ==0 ) { -platform_set_drvdata (pdev, hcd); -return ret; - } - -alchemy_usb_control (unit,0 ); -err3: -iounmap (hcd->regs); -err2: -release_mem_region (hcd->rsrc_start, hcd->rsrc_len); -err1: -usb_put_hcd (hcd); -return ret; -} - -static int ohci_hcd_au1xxx_drv_remove (struct platform_device *pdev) -{ -struct usb_hcd *hcd =platform_get_drvdata (pdev); -int unit; - - unit = (hcd->rsrc_start ==AU1300_USB_OHCI1_PHYS_ADDR ) ? -ALCHEMY_USB_OHCI1 :ALCHEMY_USB_OHCI0 ; -usb_remove_hcd (hcd); -alchemy_usb_control (unit,0 ); -iounmap (hcd->regs); -release_mem_region (hcd->rsrc_start, hcd->rsrc_len); -usb_put_hcd (hcd); -platform_set_drvdata (pdev,NULL ); - -return 0 ; -} - -#ifdef CONFIG_PM -static int ohci_hcd_au1xxx_drv_suspend (struct device *dev) -{ -struct usb_hcd *hcd =dev_get_drvdata (dev); -struct ohci_hcd *ohci =hcd_to_ohci (hcd); -unsigned long flags; -int rc; - - rc =0 ; - -/* Root hub was already suspended. Disable irq emission and -* mark HW unaccessible, bail out if RH has been resumed. Use -* the spinlock to properly synchronize with possible pending -* RH suspend or resume activity. -*/ -spin_lock_irqsave (&ohci->lock, flags); -if (ohci->rh_state !=OHCI_RH_SUSPENDED ) { - rc = -EINVAL ; - goto bail; - } -ohci_writel (ohci,OHCI_INTR_MIE , &ohci->regs->intrdisable); - (void )ohci_readl (ohci, &ohci->regs->intrdisable); - -clear_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); - -alchemy_usb_control (ALCHEMY_USB_OHCI0 ,0 ); -bail: -spin_unlock_irqrestore (&ohci->lock, flags); - -return rc; -} - -static int ohci_hcd_au1xxx_drv_resume (struct device *dev) -{ -struct usb_hcd *hcd =dev_get_drvdata (dev); - -alchemy_usb_control (ALCHEMY_USB_OHCI0 ,1 ); - -set_bit (HCD_FLAG_HW_ACCESSIBLE , &hcd->flags); -ohci_finish_controller_resume (hcd); - -return 0 ; -} - -static const struct dev_pm_ops au1xxx_ohci_pmops = { - .suspend = ohci_hcd_au1xxx_drv_suspend, - .resume = ohci_hcd_au1xxx_drv_resume, -}; - -#define AU1XXX_OHCI_PMOPS &au1xxx_ohci_pmops - -#else -#define AU1XXX_OHCI_PMOPS NULL -#endif - -static struct platform_driver ohci_hcd_au1xxx_driver = { - .probe = ohci_hcd_au1xxx_drv_probe, - .remove = ohci_hcd_au1xxx_drv_remove, - .shutdown = usb_hcd_platform_shutdown, - .driver = { - .name ="au1xxx-ohci" , - .owner =THIS_MODULE , - .pm =AU1XXX_OHCI_PMOPS , - }, -}; - -MODULE_ALIAS ("platform:au1xxx-ohci" );
drivers/usb/host/ohci-hcd.c +0 -5
@@ -1098,11 +1098,6 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ohci_hcd_ep93xx_driver#endif -#ifdef CONFIG_MIPS_ALCHEMY -#include "ohci-au1xxx.c" -#define PLATFORM_DRIVER ohci_hcd_au1xxx_driver -#endif -#ifdef CONFIG_USB_OHCI_HCD_PPC_SOC #include "ohci-ppc-soc.c" #define PLATFORM_DRIVER ohci_hcd_ppc_soc_driver
Signature · 1 line
1.7.9.5