Lines Matching +full:mini +full:- +full:usb

1 // SPDX-License-Identifier: GPL-2.0+
16 #include <linux/usb.h>
17 #include <linux/usb/otg.h>
23 #define FOTG210_RR_ID BIT(21) /* 1 = B-device, 0 = A-device */
27 * Gemini-specific initialization function, only executed on the
30 * The gemini USB blocks are connected to either Mini-A (host mode) or
31 * Mini-B (peripheral mode) plugs. There is no role switch support on the
32 * Gemini SoC, just either-or.
45 struct device *dev = fotg->dev; in fotg210_gemini_init()
46 struct device_node *np = dev->of_node; in fotg210_gemini_init()
55 fotg->map = map; in fotg210_gemini_init()
56 wakeup = of_property_read_bool(np, "wakeup-source"); in fotg210_gemini_init()
63 if (res->start == 0x69000000) { in fotg210_gemini_init()
64 fotg->port = GEMINI_PORT_1; in fotg210_gemini_init()
74 fotg->port = GEMINI_PORT_0; in fotg210_gemini_init()
97 * fotg210_vbus() - Called by gadget driver to enable/disable VBUS
107 switch (fotg->port) { in fotg210_vbus()
119 ret = regmap_update_bits(fotg->map, GEMINI_GLOBAL_MISC_CTRL, mask, val); in fotg210_vbus()
121 dev_err(fotg->dev, "failed to %s VBUS\n", in fotg210_vbus()
123 dev_info(fotg->dev, "%s: %s VBUS\n", __func__, enable ? "enable" : "disable"); in fotg210_vbus()
128 struct device *dev = &pdev->dev; in fotg210_probe()
136 return -ENOMEM; in fotg210_probe()
137 fotg->dev = dev; in fotg210_probe()
139 fotg->base = devm_platform_get_and_ioremap_resource(pdev, 0, &fotg->res); in fotg210_probe()
140 if (IS_ERR(fotg->base)) in fotg210_probe()
141 return PTR_ERR(fotg->base); in fotg210_probe()
143 fotg->pclk = devm_clk_get_optional_enabled(dev, "PCLK"); in fotg210_probe()
144 if (IS_ERR(fotg->pclk)) in fotg210_probe()
145 return PTR_ERR(fotg->pclk); in fotg210_probe()
149 if (of_device_is_compatible(dev->of_node, "cortina,gemini-usb")) { in fotg210_probe()
150 ret = fotg210_gemini_init(fotg, fotg->res, mode); in fotg210_probe()
155 val = readl(fotg->base + FOTG210_RR); in fotg210_probe()
171 struct device *dev = &pdev->dev; in fotg210_remove()
217 MODULE_AUTHOR("Yuan-Hsin Chen, Feng-Hsin Chiang");