git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
usb
/
host
/
ohci-s3c2410.c
diff --git
a/drivers/usb/host/ohci-s3c2410.c
b/drivers/usb/host/ohci-s3c2410.c
index
372527a
..
b350d45
100644
(file)
--- a/
drivers/usb/host/ohci-s3c2410.c
+++ b/
drivers/usb/host/ohci-s3c2410.c
@@
-30,6
+30,7
@@
/* clock device associated with the hcd */
static struct clk *clk;
/* clock device associated with the hcd */
static struct clk *clk;
+static struct clk *usb_clk;
/* forward definitions */
/* forward definitions */
@@
-37,7
+38,7
@@
static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);
/* conversion functions */
/* conversion functions */
-struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
+st
atic st
ruct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
{
return hcd->self.controller->platform_data;
}
{
return hcd->self.controller->platform_data;
}
@@
-47,6
+48,10
@@
static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
struct s3c2410_hcd_info *info = dev->dev.platform_data;
dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
struct s3c2410_hcd_info *info = dev->dev.platform_data;
dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
+
+ clk_enable(usb_clk);
+ mdelay(2); /* let the bus clock stabilise */
+
clk_enable(clk);
if (info != NULL) {
clk_enable(clk);
if (info != NULL) {
@@
-75,6
+80,7
@@
static void s3c2410_stop_hc(struct platform_device *dev)
}
clk_disable(clk);
}
clk_disable(clk);
+ clk_disable(usb_clk);
}
/* ohci_s3c2410_hub_status_data
}
/* ohci_s3c2410_hub_status_data
@@
-158,7
+164,7
@@
static int ohci_s3c2410_hub_control (
"s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n",
hcd, typeReq, wValue, wIndex, buf, wLength);
"s3c2410_hub_control(%p,0x%04x,0x%04x,0x%04x,%p,%04x)\n",
hcd, typeReq, wValue, wIndex, buf, wLength);
- /* if we are only an humble host without any special capabilites
+ /* if we are only an humble host without any special capabilit
i
es
* process the request straight away and exit */
if (info == NULL) {
* process the request straight away and exit */
if (info == NULL) {
@@
-316,7
+322,8
@@
static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc)
*
*/
*
*/
-void usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev)
+static void
+usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev)
{
usb_remove_hcd(hcd);
s3c2410_stop_hc(dev);
{
usb_remove_hcd(hcd);
s3c2410_stop_hc(dev);
@@
-334,8
+341,8
@@
void usb_hcd_s3c2410_remove (struct usb_hcd *hcd, struct platform_device *dev)
* through the hotplug entry's driver_data.
*
*/
* through the hotplug entry's driver_data.
*
*/
-int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
- struct platform_device *dev)
+
static
int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
+
struct platform_device *dev)
{
struct usb_hcd *hcd = NULL;
int retval;
{
struct usb_hcd *hcd = NULL;
int retval;
@@
-353,14
+360,21
@@
int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
dev_err(&dev->dev, "request_mem_region failed");
retval = -EBUSY;
if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
dev_err(&dev->dev, "request_mem_region failed");
retval = -EBUSY;
- goto err
0
;
+ goto err
_put
;
}
}
- clk = clk_get(
NULL
, "usb-host");
+ clk = clk_get(
&dev->dev
, "usb-host");
if (IS_ERR(clk)) {
dev_err(&dev->dev, "cannot get usb-host clock\n");
retval = -ENOENT;
if (IS_ERR(clk)) {
dev_err(&dev->dev, "cannot get usb-host clock\n");
retval = -ENOENT;
- goto err1;
+ goto err_mem;
+ }
+
+ usb_clk = clk_get(&dev->dev, "usb-bus-host");
+ if (IS_ERR(usb_clk)) {
+ dev_err(&dev->dev, "cannot get usb-host clock\n");
+ retval = -ENOENT;
+ goto err_clk;
}
s3c2410_start_hc(dev, hcd);
}
s3c2410_start_hc(dev, hcd);
@@
-369,26
+383,29
@@
int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
if (!hcd->regs) {
dev_err(&dev->dev, "ioremap failed\n");
retval = -ENOMEM;
if (!hcd->regs) {
dev_err(&dev->dev, "ioremap failed\n");
retval = -ENOMEM;
- goto err
2
;
+ goto err
_ioremap
;
}
ohci_hcd_init(hcd_to_ohci(hcd));
}
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)
if (retval != 0)
- goto err
2
;
+ goto err
_ioremap
;
return 0;
return 0;
- err
2
:
+ err
_ioremap
:
s3c2410_stop_hc(dev);
iounmap(hcd->regs);
s3c2410_stop_hc(dev);
iounmap(hcd->regs);
+ clk_put(usb_clk);
+
+ err_clk:
clk_put(clk);
clk_put(clk);
- err
1
:
+ err
_mem
:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
- err
0
:
+ err
_put
:
usb_put_hcd(hcd);
return retval;
}
usb_put_hcd(hcd);
return retval;
}
@@
-430,6
+447,7
@@
static const struct hc_driver ohci_s3c2410_hc_driver = {
*/
.start = ohci_s3c2410_start,
.stop = ohci_stop,
*/
.start = ohci_s3c2410_start,
.stop = ohci_stop,
+ .shutdown = ohci_shutdown,
/*
* managing i/o requests and associated device resources
/*
* managing i/o requests and associated device resources
@@
-448,6
+466,7
@@
static const struct hc_driver ohci_s3c2410_hc_driver = {
*/
.hub_status_data = ohci_s3c2410_hub_status_data,
.hub_control = ohci_s3c2410_hub_control,
*/
.hub_status_data = ohci_s3c2410_hub_status_data,
.hub_control = ohci_s3c2410_hub_control,
+ .hub_irq_enable = ohci_rhsc_enable,
#ifdef CONFIG_PM
.bus_suspend = ohci_bus_suspend,
.bus_resume = ohci_bus_resume,
#ifdef CONFIG_PM
.bus_suspend = ohci_bus_suspend,
.bus_resume = ohci_bus_resume,
@@
-473,6
+492,7
@@
static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev)
static struct platform_driver ohci_hcd_s3c2410_driver = {
.probe = ohci_hcd_s3c2410_drv_probe,
.remove = ohci_hcd_s3c2410_drv_remove,
static struct platform_driver ohci_hcd_s3c2410_driver = {
.probe = ohci_hcd_s3c2410_drv_probe,
.remove = ohci_hcd_s3c2410_drv_remove,
+ .shutdown = usb_hcd_platform_shutdown,
/*.suspend = ohci_hcd_s3c2410_drv_suspend, */
/*.resume = ohci_hcd_s3c2410_drv_resume, */
.driver = {
/*.suspend = ohci_hcd_s3c2410_drv_suspend, */
/*.resume = ohci_hcd_s3c2410_drv_resume, */
.driver = {