Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Alchemy: use the OHCI platform driver

Convert 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.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Florian Fainelli and committed by
Greg Kroah-Hartman
e223a4cc 231a72e0

+36 -2
+33 -2
arch/mips/alchemy/common/platform.c
··· 18 18 #include <linux/serial_8250.h> 19 19 #include <linux/slab.h> 20 20 #include <linux/usb/ehci_pdriver.h> 21 + #include <linux/usb/ohci_pdriver.h> 21 22 22 23 #include <asm/mach-au1x00/au1000.h> 23 24 #include <asm/mach-au1x00/au1xxx_dbdma.h> ··· 143 142 .power_suspend = alchemy_ehci_power_off, 144 143 }; 145 144 145 + /* Power on callback for the ohci platform driver */ 146 + static int alchemy_ohci_power_on(struct platform_device *pdev) 147 + { 148 + int unit; 149 + 150 + unit = (pdev->id == 1) ? 151 + ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0; 152 + 153 + return alchemy_usb_control(unit, 1); 154 + } 155 + 156 + /* Power off/suspend callback for the ohci platform driver */ 157 + static void alchemy_ohci_power_off(struct platform_device *pdev) 158 + { 159 + int unit; 160 + 161 + unit = (pdev->id == 1) ? 162 + ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0; 163 + 164 + alchemy_usb_control(unit, 0); 165 + } 166 + 167 + static struct usb_ohci_pdata alchemy_ohci_pdata = { 168 + .power_on = alchemy_ohci_power_on, 169 + .power_off = alchemy_ohci_power_off, 170 + .power_suspend = alchemy_ohci_power_off, 171 + }; 172 + 146 173 static unsigned long alchemy_ohci_data[][2] __initdata = { 147 174 [ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT }, 148 175 [ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT }, ··· 218 189 res[1].start = alchemy_ohci_data[ctype][1]; 219 190 res[1].end = res[1].start; 220 191 res[1].flags = IORESOURCE_IRQ; 221 - pdev->name = "au1xxx-ohci"; 192 + pdev->name = "ohci-platform"; 222 193 pdev->id = 0; 223 194 pdev->dev.dma_mask = &alchemy_ohci_dmamask; 195 + pdev->dev.platform_data = &alchemy_ohci_pdata; 224 196 225 197 if (platform_device_register(pdev)) 226 198 printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n"); ··· 258 228 res[1].start = AU1300_USB_INT; 259 229 res[1].end = res[1].start; 260 230 res[1].flags = IORESOURCE_IRQ; 261 - pdev->name = "au1xxx-ohci"; 231 + pdev->name = "ohci-platform"; 262 232 pdev->id = 1; 263 233 pdev->dev.dma_mask = &alchemy_ohci_dmamask; 234 + pdev->dev.platform_data = &alchemy_ohci_pdata; 264 235 265 236 if (platform_device_register(pdev)) 266 237 printk(KERN_INFO "Alchemy USB: cannot add OHCI1\n");
+1
arch/mips/configs/db1000_defconfig
··· 233 233 CONFIG_USB_EHCI_ROOT_HUB_TT=y 234 234 CONFIG_USB_EHCI_TT_NEWSCHED=y 235 235 CONFIG_USB_OHCI_HCD=y 236 + CONFIG_USB_OHCI_HCD_PLATFORM=y 236 237 CONFIG_USB_UHCI_HCD=y 237 238 CONFIG_USB_STORAGE=y 238 239 CONFIG_NEW_LEDS=y
+1
arch/mips/configs/gpr_defconfig
··· 291 291 CONFIG_USB_EHCI_HCD=y 292 292 CONFIG_USB_EHCI_ROOT_HUB_TT=y 293 293 CONFIG_USB_OHCI_HCD=y 294 + CONFIG_USB_OHCI_HCD_PLATFORM=y 294 295 CONFIG_USB_STORAGE=m 295 296 CONFIG_USB_LIBUSUAL=y 296 297 CONFIG_USB_SERIAL=y
+1
arch/mips/configs/mtx1_defconfig
··· 581 581 CONFIG_USB_EHCI_HCD=m 582 582 CONFIG_USB_EHCI_ROOT_HUB_TT=y 583 583 CONFIG_USB_OHCI_HCD=m 584 + CONFIG_USB_OHCI_HCD_PLATFORM=y 584 585 CONFIG_USB_UHCI_HCD=m 585 586 CONFIG_USB_U132_HCD=m 586 587 CONFIG_USB_SL811_HCD=m