kernel: bump 4.14 to 4.4.142
[openwrt/openwrt.git] / target / linux / gemini / patches-4.14 / 0028-usb-host-fotg2-add-device-tree-probing.patch
1 From 5662c553e89ac4179ec2a7a94a342ba3e5d78cf7 Mon Sep 17 00:00:00 2001
2 From: Hans Ulli Kroll <ulli.kroll@googlemail.com>
3 Date: Thu, 9 Feb 2017 15:20:49 +0100
4 Subject: [PATCH 28/31] usb: host: fotg2: add device tree probing
5
6 Add device tree probing to the fotg2 driver.
7
8 Signed-off-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
9 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
10 ---
11 ChangeLog v2->v3:
12 - Change compatible to "faraday,fotg210" simply.
13 ---
14 drivers/usb/host/fotg210-hcd.c | 19 +++++++++++++++++++
15 1 file changed, 19 insertions(+)
16
17 --- a/drivers/usb/host/fotg210-hcd.c
18 +++ b/drivers/usb/host/fotg210-hcd.c
19 @@ -23,6 +23,7 @@
20 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22 #include <linux/module.h>
23 +#include <linux/of.h>
24 #include <linux/device.h>
25 #include <linux/dmapool.h>
26 #include <linux/kernel.h>
27 @@ -5604,6 +5605,15 @@ static int fotg210_hcd_probe(struct plat
28 if (usb_disabled())
29 return -ENODEV;
30
31 + /* Right now device-tree probed devices don't get dma_mask set.
32 + * Since shared usb code relies on it, set it here for now.
33 + * Once we have dma capability bindings this can go away.
34 + */
35 +
36 + retval = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
37 + if (retval)
38 + goto fail_create_hcd;
39 +
40 pdev->dev.power.power_state = PMSG_ON;
41
42 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
43 @@ -5680,9 +5690,18 @@ static int fotg210_hcd_remove(struct pla
44 return 0;
45 }
46
47 +#ifdef CONFIG_OF
48 +static const struct of_device_id fotg210_of_match[] = {
49 + { .compatible = "faraday,fotg210" },
50 + {},
51 +};
52 +MODULE_DEVICE_TABLE(of, fotg210_of_match);
53 +#endif
54 +
55 static struct platform_driver fotg210_hcd_driver = {
56 .driver = {
57 .name = "fotg210-hcd",
58 + .of_match_table = of_match_ptr(fotg210_of_match),
59 },
60 .probe = fotg210_hcd_probe,
61 .remove = fotg210_hcd_remove,