diff options
author | Richard Zhao <richard.zhao@freescale.com> | 2012-06-29 05:48:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-06 14:03:32 -0400 |
commit | 77c4400f2f0fd8384ab5cbe41d81ccc664896b2d (patch) | |
tree | c9c7b4016a4857ea819aab764de3d1d3778b473d | |
parent | 6bf83594e3fa1b1147ed1baff356d4fd30846b84 (diff) |
USB: Chipidea: rename struct ci13xxx_udc_driver to struct ci13xxx_platform_data
This patch rename struct ci13xxx_udc_driver and var with the type.
ci13xxx_platform_data reflect it's passed from platfrom driver.
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/chipidea/ci.h | 4 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci13xxx_msm.c | 6 | ||||
-rw-r--r-- | drivers/usb/chipidea/ci13xxx_pci.c | 20 | ||||
-rw-r--r-- | drivers/usb/chipidea/core.c | 12 | ||||
-rw-r--r-- | drivers/usb/chipidea/host.c | 2 | ||||
-rw-r--r-- | drivers/usb/chipidea/udc.c | 24 | ||||
-rw-r--r-- | include/linux/usb/chipidea.h | 2 |
7 files changed, 35 insertions, 35 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 50911f8490d4..0b093308548d 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h | |||
@@ -125,7 +125,7 @@ struct hw_bank { | |||
125 | * @remote_wakeup: host-enabled remote wakeup | 125 | * @remote_wakeup: host-enabled remote wakeup |
126 | * @suspended: suspended by host | 126 | * @suspended: suspended by host |
127 | * @test_mode: the selected test mode | 127 | * @test_mode: the selected test mode |
128 | * @udc_driver: platform specific information supplied by parent device | 128 | * @platdata: platform specific information supplied by parent device |
129 | * @vbus_active: is VBUS active | 129 | * @vbus_active: is VBUS active |
130 | * @transceiver: pointer to USB PHY, if any | 130 | * @transceiver: pointer to USB PHY, if any |
131 | * @hcd: pointer to usb_hcd for ehci host driver | 131 | * @hcd: pointer to usb_hcd for ehci host driver |
@@ -158,7 +158,7 @@ struct ci13xxx { | |||
158 | u8 suspended; | 158 | u8 suspended; |
159 | u8 test_mode; | 159 | u8 test_mode; |
160 | 160 | ||
161 | struct ci13xxx_udc_driver *udc_driver; | 161 | struct ci13xxx_platform_data *platdata; |
162 | int vbus_active; | 162 | int vbus_active; |
163 | struct usb_phy *transceiver; | 163 | struct usb_phy *transceiver; |
164 | struct usb_hcd *hcd; | 164 | struct usb_hcd *hcd; |
diff --git a/drivers/usb/chipidea/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c index 11a7befdc4ef..12c0dd6a300c 100644 --- a/drivers/usb/chipidea/ci13xxx_msm.c +++ b/drivers/usb/chipidea/ci13xxx_msm.c | |||
@@ -45,7 +45,7 @@ static void ci13xxx_msm_notify_event(struct ci13xxx *udc, unsigned event) | |||
45 | } | 45 | } |
46 | } | 46 | } |
47 | 47 | ||
48 | static struct ci13xxx_udc_driver ci13xxx_msm_udc_driver = { | 48 | static struct ci13xxx_platform_data ci13xxx_msm_platdata = { |
49 | .name = "ci13xxx_msm", | 49 | .name = "ci13xxx_msm", |
50 | .flags = CI13XXX_REGS_SHARED | | 50 | .flags = CI13XXX_REGS_SHARED | |
51 | CI13XXX_REQUIRE_TRANSCEIVER | | 51 | CI13XXX_REQUIRE_TRANSCEIVER | |
@@ -75,8 +75,8 @@ static int __devinit ci13xxx_msm_probe(struct platform_device *pdev) | |||
75 | goto put_platform; | 75 | goto put_platform; |
76 | } | 76 | } |
77 | 77 | ||
78 | ret = platform_device_add_data(plat_ci, &ci13xxx_msm_udc_driver, | 78 | ret = platform_device_add_data(plat_ci, &ci13xxx_msm_platdata, |
79 | sizeof(ci13xxx_msm_udc_driver)); | 79 | sizeof(ci13xxx_msm_platdata)); |
80 | if (ret) | 80 | if (ret) |
81 | goto put_platform; | 81 | goto put_platform; |
82 | 82 | ||
diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c index e3dab27f5c75..cdcac3a0e94d 100644 --- a/drivers/usb/chipidea/ci13xxx_pci.c +++ b/drivers/usb/chipidea/ci13xxx_pci.c | |||
@@ -23,17 +23,17 @@ | |||
23 | /****************************************************************************** | 23 | /****************************************************************************** |
24 | * PCI block | 24 | * PCI block |
25 | *****************************************************************************/ | 25 | *****************************************************************************/ |
26 | struct ci13xxx_udc_driver pci_driver = { | 26 | struct ci13xxx_platform_data pci_platdata = { |
27 | .name = UDC_DRIVER_NAME, | 27 | .name = UDC_DRIVER_NAME, |
28 | .capoffset = DEF_CAPOFFSET, | 28 | .capoffset = DEF_CAPOFFSET, |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct ci13xxx_udc_driver langwell_pci_driver = { | 31 | struct ci13xxx_platform_data langwell_pci_platdata = { |
32 | .name = UDC_DRIVER_NAME, | 32 | .name = UDC_DRIVER_NAME, |
33 | .capoffset = 0, | 33 | .capoffset = 0, |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct ci13xxx_udc_driver penwell_pci_driver = { | 36 | struct ci13xxx_platform_data penwell_pci_platdata = { |
37 | .name = UDC_DRIVER_NAME, | 37 | .name = UDC_DRIVER_NAME, |
38 | .capoffset = 0, | 38 | .capoffset = 0, |
39 | .power_budget = 200, | 39 | .power_budget = 200, |
@@ -51,12 +51,12 @@ struct ci13xxx_udc_driver penwell_pci_driver = { | |||
51 | static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, | 51 | static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, |
52 | const struct pci_device_id *id) | 52 | const struct pci_device_id *id) |
53 | { | 53 | { |
54 | struct ci13xxx_udc_driver *driver = (void *)id->driver_data; | 54 | struct ci13xxx_platform_data *platdata = (void *)id->driver_data; |
55 | struct platform_device *plat_ci; | 55 | struct platform_device *plat_ci; |
56 | struct resource res[3]; | 56 | struct resource res[3]; |
57 | int retval = 0, nres = 2; | 57 | int retval = 0, nres = 2; |
58 | 58 | ||
59 | if (!driver) { | 59 | if (!platdata) { |
60 | dev_err(&pdev->dev, "device doesn't provide driver data\n"); | 60 | dev_err(&pdev->dev, "device doesn't provide driver data\n"); |
61 | return -ENODEV; | 61 | return -ENODEV; |
62 | } | 62 | } |
@@ -95,7 +95,7 @@ static int __devinit ci13xxx_pci_probe(struct pci_dev *pdev, | |||
95 | goto put_platform; | 95 | goto put_platform; |
96 | } | 96 | } |
97 | 97 | ||
98 | retval = platform_device_add_data(plat_ci, driver, sizeof(*driver)); | 98 | retval = platform_device_add_data(plat_ci, platdata, sizeof(*platdata)); |
99 | if (retval) | 99 | if (retval) |
100 | goto put_platform; | 100 | goto put_platform; |
101 | 101 | ||
@@ -147,19 +147,19 @@ static void __devexit ci13xxx_pci_remove(struct pci_dev *pdev) | |||
147 | static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = { | 147 | static DEFINE_PCI_DEVICE_TABLE(ci13xxx_pci_id_table) = { |
148 | { | 148 | { |
149 | PCI_DEVICE(0x153F, 0x1004), | 149 | PCI_DEVICE(0x153F, 0x1004), |
150 | .driver_data = (kernel_ulong_t)&pci_driver, | 150 | .driver_data = (kernel_ulong_t)&pci_platdata, |
151 | }, | 151 | }, |
152 | { | 152 | { |
153 | PCI_DEVICE(0x153F, 0x1006), | 153 | PCI_DEVICE(0x153F, 0x1006), |
154 | .driver_data = (kernel_ulong_t)&pci_driver, | 154 | .driver_data = (kernel_ulong_t)&pci_platdata, |
155 | }, | 155 | }, |
156 | { | 156 | { |
157 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0811), | 157 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0811), |
158 | .driver_data = (kernel_ulong_t)&langwell_pci_driver, | 158 | .driver_data = (kernel_ulong_t)&langwell_pci_platdata, |
159 | }, | 159 | }, |
160 | { | 160 | { |
161 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829), | 161 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0829), |
162 | .driver_data = (kernel_ulong_t)&penwell_pci_driver, | 162 | .driver_data = (kernel_ulong_t)&penwell_pci_platdata, |
163 | }, | 163 | }, |
164 | { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ } | 164 | { 0, 0, 0, 0, 0, 0, 0 /* end: all zeroes */ } |
165 | }; | 165 | }; |
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 15e03b308f8a..9a883bd5e113 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -179,7 +179,7 @@ static int hw_device_init(struct ci13xxx *ci, void __iomem *base) | |||
179 | ci->hw_bank.abs = base; | 179 | ci->hw_bank.abs = base; |
180 | 180 | ||
181 | ci->hw_bank.cap = ci->hw_bank.abs; | 181 | ci->hw_bank.cap = ci->hw_bank.abs; |
182 | ci->hw_bank.cap += ci->udc_driver->capoffset; | 182 | ci->hw_bank.cap += ci->platdata->capoffset; |
183 | ci->hw_bank.op = ci->hw_bank.cap + ioread8(ci->hw_bank.cap); | 183 | ci->hw_bank.op = ci->hw_bank.cap + ioread8(ci->hw_bank.cap); |
184 | 184 | ||
185 | hw_alloc_regmap(ci, false); | 185 | hw_alloc_regmap(ci, false); |
@@ -227,11 +227,11 @@ int hw_device_reset(struct ci13xxx *ci, u32 mode) | |||
227 | udelay(10); /* not RTOS friendly */ | 227 | udelay(10); /* not RTOS friendly */ |
228 | 228 | ||
229 | 229 | ||
230 | if (ci->udc_driver->notify_event) | 230 | if (ci->platdata->notify_event) |
231 | ci->udc_driver->notify_event(ci, | 231 | ci->platdata->notify_event(ci, |
232 | CI13XXX_CONTROLLER_RESET_EVENT); | 232 | CI13XXX_CONTROLLER_RESET_EVENT); |
233 | 233 | ||
234 | if (ci->udc_driver->flags & CI13XXX_DISABLE_STREAMING) | 234 | if (ci->platdata->flags & CI13XXX_DISABLE_STREAMING) |
235 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); | 235 | hw_write(ci, OP_USBMODE, USBMODE_CI_SDIS, USBMODE_CI_SDIS); |
236 | 236 | ||
237 | /* USBMODE should be configured step by step */ | 237 | /* USBMODE should be configured step by step */ |
@@ -364,7 +364,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) | |||
364 | } | 364 | } |
365 | 365 | ||
366 | ci->dev = dev; | 366 | ci->dev = dev; |
367 | ci->udc_driver = dev->platform_data; | 367 | ci->platdata = dev->platform_data; |
368 | 368 | ||
369 | ret = hw_device_init(ci, base); | 369 | ret = hw_device_init(ci, base); |
370 | if (ret < 0) { | 370 | if (ret < 0) { |
@@ -419,7 +419,7 @@ static int __devinit ci_hdrc_probe(struct platform_device *pdev) | |||
419 | } | 419 | } |
420 | 420 | ||
421 | platform_set_drvdata(pdev, ci); | 421 | platform_set_drvdata(pdev, ci); |
422 | ret = request_irq(ci->irq, ci_irq, IRQF_SHARED, ci->udc_driver->name, | 422 | ret = request_irq(ci->irq, ci_irq, IRQF_SHARED, ci->platdata->name, |
423 | ci); | 423 | ci); |
424 | if (ret) | 424 | if (ret) |
425 | goto stop; | 425 | goto stop; |
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c index 9eacd21c0cd9..4a4fdb8c65f8 100644 --- a/drivers/usb/chipidea/host.c +++ b/drivers/usb/chipidea/host.c | |||
@@ -116,7 +116,7 @@ static int host_start(struct ci13xxx *ci) | |||
116 | hcd->regs = ci->hw_bank.abs; | 116 | hcd->regs = ci->hw_bank.abs; |
117 | hcd->has_tt = 1; | 117 | hcd->has_tt = 1; |
118 | 118 | ||
119 | hcd->power_budget = ci->udc_driver->power_budget; | 119 | hcd->power_budget = ci->platdata->power_budget; |
120 | 120 | ||
121 | ehci = hcd_to_ehci(hcd); | 121 | ehci = hcd_to_ehci(hcd); |
122 | ehci->caps = ci->hw_bank.cap; | 122 | ehci->caps = ci->hw_bank.cap; |
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 80e71021f186..3094c85dc0b5 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -1363,7 +1363,7 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
1363 | unsigned long flags; | 1363 | unsigned long flags; |
1364 | int gadget_ready = 0; | 1364 | int gadget_ready = 0; |
1365 | 1365 | ||
1366 | if (!(udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS)) | 1366 | if (!(udc->platdata->flags & CI13XXX_PULLUP_ON_VBUS)) |
1367 | return -EOPNOTSUPP; | 1367 | return -EOPNOTSUPP; |
1368 | 1368 | ||
1369 | spin_lock_irqsave(&udc->lock, flags); | 1369 | spin_lock_irqsave(&udc->lock, flags); |
@@ -1379,8 +1379,8 @@ static int ci13xxx_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
1379 | hw_device_state(udc, udc->ep0out->qh.dma); | 1379 | hw_device_state(udc, udc->ep0out->qh.dma); |
1380 | } else { | 1380 | } else { |
1381 | hw_device_state(udc, 0); | 1381 | hw_device_state(udc, 0); |
1382 | if (udc->udc_driver->notify_event) | 1382 | if (udc->platdata->notify_event) |
1383 | udc->udc_driver->notify_event(udc, | 1383 | udc->platdata->notify_event(udc, |
1384 | CI13XXX_CONTROLLER_STOPPED_EVENT); | 1384 | CI13XXX_CONTROLLER_STOPPED_EVENT); |
1385 | _gadget_stop_activity(&udc->gadget); | 1385 | _gadget_stop_activity(&udc->gadget); |
1386 | pm_runtime_put_sync(&_gadget->dev); | 1386 | pm_runtime_put_sync(&_gadget->dev); |
@@ -1515,9 +1515,9 @@ static int ci13xxx_start(struct usb_gadget *gadget, | |||
1515 | 1515 | ||
1516 | udc->driver = driver; | 1516 | udc->driver = driver; |
1517 | pm_runtime_get_sync(&udc->gadget.dev); | 1517 | pm_runtime_get_sync(&udc->gadget.dev); |
1518 | if (udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) { | 1518 | if (udc->platdata->flags & CI13XXX_PULLUP_ON_VBUS) { |
1519 | if (udc->vbus_active) { | 1519 | if (udc->vbus_active) { |
1520 | if (udc->udc_driver->flags & CI13XXX_REGS_SHARED) | 1520 | if (udc->platdata->flags & CI13XXX_REGS_SHARED) |
1521 | hw_device_reset(udc, USBMODE_CM_DC); | 1521 | hw_device_reset(udc, USBMODE_CM_DC); |
1522 | } else { | 1522 | } else { |
1523 | pm_runtime_put_sync(&udc->gadget.dev); | 1523 | pm_runtime_put_sync(&udc->gadget.dev); |
@@ -1545,11 +1545,11 @@ static int ci13xxx_stop(struct usb_gadget *gadget, | |||
1545 | 1545 | ||
1546 | spin_lock_irqsave(&udc->lock, flags); | 1546 | spin_lock_irqsave(&udc->lock, flags); |
1547 | 1547 | ||
1548 | if (!(udc->udc_driver->flags & CI13XXX_PULLUP_ON_VBUS) || | 1548 | if (!(udc->platdata->flags & CI13XXX_PULLUP_ON_VBUS) || |
1549 | udc->vbus_active) { | 1549 | udc->vbus_active) { |
1550 | hw_device_state(udc, 0); | 1550 | hw_device_state(udc, 0); |
1551 | if (udc->udc_driver->notify_event) | 1551 | if (udc->platdata->notify_event) |
1552 | udc->udc_driver->notify_event(udc, | 1552 | udc->platdata->notify_event(udc, |
1553 | CI13XXX_CONTROLLER_STOPPED_EVENT); | 1553 | CI13XXX_CONTROLLER_STOPPED_EVENT); |
1554 | udc->driver = NULL; | 1554 | udc->driver = NULL; |
1555 | spin_unlock_irqrestore(&udc->lock, flags); | 1555 | spin_unlock_irqrestore(&udc->lock, flags); |
@@ -1582,7 +1582,7 @@ static irqreturn_t udc_irq(struct ci13xxx *udc) | |||
1582 | 1582 | ||
1583 | spin_lock(&udc->lock); | 1583 | spin_lock(&udc->lock); |
1584 | 1584 | ||
1585 | if (udc->udc_driver->flags & CI13XXX_REGS_SHARED) { | 1585 | if (udc->platdata->flags & CI13XXX_REGS_SHARED) { |
1586 | if (hw_read(udc, OP_USBMODE, USBMODE_CM) != | 1586 | if (hw_read(udc, OP_USBMODE, USBMODE_CM) != |
1587 | USBMODE_CM_DC) { | 1587 | USBMODE_CM_DC) { |
1588 | spin_unlock(&udc->lock); | 1588 | spin_unlock(&udc->lock); |
@@ -1654,7 +1654,7 @@ static int udc_start(struct ci13xxx *udc) | |||
1654 | udc->gadget.speed = USB_SPEED_UNKNOWN; | 1654 | udc->gadget.speed = USB_SPEED_UNKNOWN; |
1655 | udc->gadget.max_speed = USB_SPEED_HIGH; | 1655 | udc->gadget.max_speed = USB_SPEED_HIGH; |
1656 | udc->gadget.is_otg = 0; | 1656 | udc->gadget.is_otg = 0; |
1657 | udc->gadget.name = udc->udc_driver->name; | 1657 | udc->gadget.name = udc->platdata->name; |
1658 | 1658 | ||
1659 | INIT_LIST_HEAD(&udc->gadget.ep_list); | 1659 | INIT_LIST_HEAD(&udc->gadget.ep_list); |
1660 | 1660 | ||
@@ -1687,14 +1687,14 @@ static int udc_start(struct ci13xxx *udc) | |||
1687 | 1687 | ||
1688 | udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); | 1688 | udc->transceiver = usb_get_phy(USB_PHY_TYPE_USB2); |
1689 | 1689 | ||
1690 | if (udc->udc_driver->flags & CI13XXX_REQUIRE_TRANSCEIVER) { | 1690 | if (udc->platdata->flags & CI13XXX_REQUIRE_TRANSCEIVER) { |
1691 | if (udc->transceiver == NULL) { | 1691 | if (udc->transceiver == NULL) { |
1692 | retval = -ENODEV; | 1692 | retval = -ENODEV; |
1693 | goto free_pools; | 1693 | goto free_pools; |
1694 | } | 1694 | } |
1695 | } | 1695 | } |
1696 | 1696 | ||
1697 | if (!(udc->udc_driver->flags & CI13XXX_REGS_SHARED)) { | 1697 | if (!(udc->platdata->flags & CI13XXX_REGS_SHARED)) { |
1698 | retval = hw_device_reset(udc, USBMODE_CM_DC); | 1698 | retval = hw_device_reset(udc, USBMODE_CM_DC); |
1699 | if (retval) | 1699 | if (retval) |
1700 | goto put_transceiver; | 1700 | goto put_transceiver; |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index edb90d6cfd12..d4cf970656fb 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #define __LINUX_USB_CHIPIDEA_H | 6 | #define __LINUX_USB_CHIPIDEA_H |
7 | 7 | ||
8 | struct ci13xxx; | 8 | struct ci13xxx; |
9 | struct ci13xxx_udc_driver { | 9 | struct ci13xxx_platform_data { |
10 | const char *name; | 10 | const char *name; |
11 | /* offset of the capability registers */ | 11 | /* offset of the capability registers */ |
12 | uintptr_t capoffset; | 12 | uintptr_t capoffset; |