Lines Matching +full:num +full:- +full:channels

1 // SPDX-License-Identifier: GPL-2.0-only
3 * omap-usb-tll.c - The USB TLL driver for OMAP EHCI & OHCI
5 * Copyright (C) 2012-2013 Texas Instruments Incorporated - https://www.ti.com
19 #include <linux/platform_data/usb-omap.h>
22 #include "omap-usb.h"
48 #define OMAP_TLL_CHANNEL_CONF(num) (0x040 + 0x004 * num) argument
71 #define OMAP_TLL_ULPI_FUNCTION_CTRL(num) (0x804 + 0x100 * num) argument
72 #define OMAP_TLL_ULPI_INTERFACE_CTRL(num) (0x807 + 0x100 * num) argument
73 #define OMAP_TLL_ULPI_OTG_CTRL(num) (0x80A + 0x100 * num) argument
74 #define OMAP_TLL_ULPI_INT_EN_RISE(num) (0x80D + 0x100 * num) argument
75 #define OMAP_TLL_ULPI_INT_EN_FALL(num) (0x810 + 0x100 * num) argument
76 #define OMAP_TLL_ULPI_INT_STATUS(num) (0x813 + 0x100 * num) argument
77 #define OMAP_TLL_ULPI_INT_LATCH(num) (0x814 + 0x100 * num) argument
78 #define OMAP_TLL_ULPI_DEBUG(num) (0x815 + 0x100 * num) argument
79 #define OMAP_TLL_ULPI_SCRATCH_REGISTER(num) (0x816 + 0x100 * num) argument
87 /* Values of USBTLL_REVISION - Note: these are not given in the TRM */
101 int nch; /* num. of channels */
105 /*-------------------------------------------------------------------------*/
111 /*-------------------------------------------------------------------------*/
128 /*-------------------------------------------------------------------------*/
151 * convert the port-mode enum to a value we can use in the FSLSMODE
194 * usbtll_omap_probe - initialize TI-based HCDs
202 struct device *dev = &pdev->dev; in usbtll_omap_probe()
228 dev_dbg(dev, "rev 0x%x not recognized, assuming %d channels\n", in usbtll_omap_probe()
237 return -ENOMEM; in usbtll_omap_probe()
240 tll->base = base; in usbtll_omap_probe()
241 tll->nch = nch; in usbtll_omap_probe()
249 tll->ch_clk[i] = clk_get(dev, clkname); in usbtll_omap_probe()
251 if (IS_ERR(tll->ch_clk[i])) in usbtll_omap_probe()
254 clk_prepare(tll->ch_clk[i]); in usbtll_omap_probe()
267 * usbtll_omap_remove - shutdown processing for UHH & TLL HCDs
281 for (i = 0; i < tll->nch; i++) { in usbtll_omap_remove()
282 if (!IS_ERR(tll->ch_clk[i])) { in usbtll_omap_remove()
283 clk_unprepare(tll->ch_clk[i]); in usbtll_omap_remove()
284 clk_put(tll->ch_clk[i]); in usbtll_omap_remove()
288 pm_runtime_disable(&pdev->dev); in usbtll_omap_remove()
293 { .compatible = "ti,usbhs-tll" },
316 return -ENODEV; in omap_tll_init()
323 for (i = 0; i < tll->nch; i++) in omap_tll_init()
324 needs_tll |= omap_usb_mode_needs_tll(pdata->port_mode[i]); in omap_tll_init()
327 void __iomem *base = tll->base; in omap_tll_init()
338 /* Enable channels now */ in omap_tll_init()
339 for (i = 0; i < tll->nch; i++) { in omap_tll_init()
342 if (is_ohci_port(pdata->port_mode[i])) { in omap_tll_init()
343 reg |= ohci_omap3_fslsmode(pdata->port_mode[i]) in omap_tll_init()
346 } else if (pdata->port_mode[i] == in omap_tll_init()
356 } else if (pdata->port_mode[i] == in omap_tll_init()
390 return -ENODEV; in omap_tll_enable()
397 for (i = 0; i < tll->nch; i++) { in omap_tll_enable()
398 if (omap_usb_mode_needs_tll(pdata->port_mode[i])) { in omap_tll_enable()
401 if (IS_ERR(tll->ch_clk[i])) in omap_tll_enable()
404 r = clk_enable(tll->ch_clk[i]); in omap_tll_enable()
424 return -ENODEV; in omap_tll_disable()
429 for (i = 0; i < tll->nch; i++) { in omap_tll_disable()
430 if (omap_usb_mode_needs_tll(pdata->port_mode[i])) { in omap_tll_disable()
431 if (!IS_ERR(tll->ch_clk[i])) in omap_tll_disable()
432 clk_disable(tll->ch_clk[i]); in omap_tll_disable()