1 From fa5622c2fadae573dd6b0f5bffe436b230b411f6 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Tue, 16 Jun 2015 12:52:07 +0200
4 Subject: [PATCH v3 4/6] usb: bcma: use separated function for USB 2.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This will allow adding USB 3.0 (XHCI) support cleanly.
12 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
13 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 drivers/usb/host/bcma-hcd.c | 51 +++++++++++++++++++++++++++++++--------------
16 1 file changed, 35 insertions(+), 16 deletions(-)
18 --- a/drivers/usb/host/bcma-hcd.c
19 +++ b/drivers/usb/host/bcma-hcd.c
20 @@ -34,6 +34,7 @@ MODULE_DESCRIPTION("Common USB driver fo
21 MODULE_LICENSE("GPL");
23 struct bcma_hcd_device {
24 + struct bcma_device *core;
25 struct platform_device *ehci_dev;
26 struct platform_device *ohci_dev;
28 @@ -293,27 +294,16 @@ err_alloc:
32 -static int bcma_hcd_probe(struct bcma_device *dev)
33 +static int bcma_hcd_usb20_init(struct bcma_hcd_device *usb_dev)
36 + struct bcma_device *dev = usb_dev->core;
37 + struct bcma_chipinfo *chipinfo = &dev->bus->chipinfo;
39 - struct bcma_hcd_device *usb_dev;
40 - struct bcma_chipinfo *chipinfo;
42 - chipinfo = &dev->bus->chipinfo;
44 - /* TODO: Probably need checks here; is the core connected? */
47 if (dma_set_mask_and_coherent(dev->dma_dev, DMA_BIT_MASK(32)))
50 - usb_dev = devm_kzalloc(&dev->dev, sizeof(struct bcma_hcd_device),
55 - bcma_hci_platform_power_gpio(dev, true);
58 case BCMA_CORE_NS_USB20:
59 bcma_hcd_init_chip_arm(dev);
60 @@ -346,7 +336,6 @@ static int bcma_hcd_probe(struct bcma_de
61 goto err_unregister_ohci_dev;
64 - bcma_set_drvdata(dev, usb_dev);
67 err_unregister_ohci_dev:
68 @@ -354,6 +343,36 @@ err_unregister_ohci_dev:
72 +static int bcma_hcd_probe(struct bcma_device *dev)
75 + struct bcma_hcd_device *usb_dev;
77 + /* TODO: Probably need checks here; is the core connected? */
79 + usb_dev = devm_kzalloc(&dev->dev, sizeof(struct bcma_hcd_device),
83 + usb_dev->core = dev;
85 + bcma_hci_platform_power_gpio(dev, true);
87 + switch (dev->id.id) {
88 + case BCMA_CORE_USB20_HOST:
89 + case BCMA_CORE_NS_USB20:
90 + err = bcma_hcd_usb20_init(usb_dev);
98 + bcma_set_drvdata(dev, usb_dev);
102 static void bcma_hcd_remove(struct bcma_device *dev)
104 struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);