X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fusb%2Fhost%2Fohci-lh7a404.c;h=de42283149c7154608c30c9b1ceeec29e14b07ba;hb=8af6096caf8b3fb7ee33e636c44a29f373d27df5;hp=859aca7be753bf6dfbc209e0bf19497834262e7a;hpb=fc611a1a50caa04bae82ed3c1fc6505132f8343f;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 859aca7b..de42283 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c @@ -8,7 +8,7 @@ * Bus Glue for Sharp LH7A404 * * Written by Christopher Hoover - * Based on fragments of previous driver by Rusell King et al. + * Based on fragments of previous driver by Russell King et al. * * Modified for LH7A404 from ohci-sa1111.c * by Durgesh Pattamatta @@ -16,7 +16,10 @@ * This file is licenced under the GPL. */ -#include +#include +#include + +#include extern int usb_disabled(void); @@ -35,7 +38,7 @@ static void lh7a404_start_hc(struct platform_device *dev) CSC_PWRCNT |= CSC_PWRCNT_USBH_EN; /* Enable clock */ udelay(1000); USBH_CMDSTATUS = OHCI_HCR; - + printk(KERN_DEBUG __FILE__ ": Clock to USB host has been enabled \n"); } @@ -86,7 +89,7 @@ int usb_hcd_lh7a404_probe (const struct hc_driver *driver, retval = -EBUSY; goto err1; } - + hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); if (!hcd->regs) { pr_debug("ioremap failed"); @@ -97,7 +100,7 @@ int usb_hcd_lh7a404_probe (const struct hc_driver *driver, lh7a404_start_hc(dev); ohci_hcd_init(hcd_to_ohci(hcd)); - retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); + retval = usb_add_hcd(hcd, dev->resource[1].start, IRQF_DISABLED); if (retval == 0) return retval; @@ -170,11 +173,8 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { * basic lifecycle operations */ .start = ohci_lh7a404_start, -#ifdef CONFIG_PM - /* suspend: ohci_lh7a404_suspend, -- tbd */ - /* resume: ohci_lh7a404_resume, -- tbd */ -#endif /*CONFIG_PM*/ .stop = ohci_stop, + .shutdown = ohci_shutdown, /* * managing i/o requests and associated device resources @@ -193,13 +193,17 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { */ .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_lh7a404_drv_probe(struct device *dev) +static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(dev); int ret; pr_debug ("In ohci_hcd_lh7a404_drv_probe"); @@ -211,54 +215,39 @@ static int ohci_hcd_lh7a404_drv_probe(struct device *dev) return ret; } -static int ohci_hcd_lh7a404_drv_remove(struct device *dev) +static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev) { - struct platform_device *pdev = to_platform_device(dev); - struct usb_hcd *hcd = dev_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(pdev); usb_hcd_lh7a404_remove(hcd, pdev); return 0; } /*TBD*/ -/*static int ohci_hcd_lh7a404_drv_suspend(struct device *dev) +/*static int ohci_hcd_lh7a404_drv_suspend(struct platform_device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct usb_hcd *hcd = dev_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(dev); return 0; } -static int ohci_hcd_lh7a404_drv_resume(struct device *dev) +static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct usb_hcd *hcd = dev_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(dev); return 0; } */ -static struct device_driver ohci_hcd_lh7a404_driver = { - .name = "lh7a404-ohci", - .bus = &platform_bus_type, +static struct platform_driver ohci_hcd_lh7a404_driver = { .probe = ohci_hcd_lh7a404_drv_probe, .remove = ohci_hcd_lh7a404_drv_remove, + .shutdown = usb_hcd_platform_shutdown, /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ /*.resume = ohci_hcd_lh7a404_drv_resume, */ + .driver = { + .name = "lh7a404-ohci", + .owner = THIS_MODULE, + }, }; -static int __init ohci_hcd_lh7a404_init (void) -{ - pr_debug (DRIVER_INFO " (LH7A404)"); - pr_debug ("block sizes: ed %d td %d\n", - sizeof (struct ed), sizeof (struct td)); - - return driver_register(&ohci_hcd_lh7a404_driver); -} - -static void __exit ohci_hcd_lh7a404_cleanup (void) -{ - driver_unregister(&ohci_hcd_lh7a404_driver); -} - -module_init (ohci_hcd_lh7a404_init); -module_exit (ohci_hcd_lh7a404_cleanup); +MODULE_ALIAS("platform:lh7a404-ohci");