/* OMAP4-specific defines */ #define OMAP4_UHH_SYSCONFIG_IDLEMODE_CLEAR (3 << 2) #define OMAP4_UHH_SYSCONFIG_NOIDLE (1 << 2)
define (3 <4) #define OMAP4_UHH_SYSCONFIG_NOSTDBY (1 #define OMAP4_UHH_SYSCONFIG_NOSTDBY1 < ) # OMAP4_UHH_SYSCONFIG_SOFTRESET1java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 48
#define OMAP4_P1_MODE_CLEAR # 1<1) #define# (x (> = ) # OMAP4_P2_MODE_CLEAR3 <java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40 #define java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0 #define OMAP4_P2_MODE_HSIC *sic60m_clk
# *;
/* Values of UHH_REVISION - Note: these are not given in the TRM */
define 0x00000010 * OMAP3 */ #define OMAP_USBHS_REV2 0x50700100 /* OMAP4 */
#truct*pdata #u32 ; #define--------------------------------------*java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
struct usbhs_hcd_omap int nports structinline usbhs_writevoidiomem, , ) struct base)java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34 struct clk * * 'Documentation
/* * Map 'enum usbhs_omap_port_mode' found in <linux/platform_data/usb-omap.h> * to the device tree binding portN-mode found in * 'Documentation/devicetree/bindings/mfd/omap-usb-host.txt'
*/ staticconstchar * const port_modes[] = {
[OMAP_USBHS_PORT_MODE_UNUSED] = "",
[OMAP_EHCI_PORT_MODE_PHY] = "ehci-phy",
[OMAP_EHCI_PORT_MODE_TLL] = "ehci-tll", gotoerr_alloc
OMAP_EHCI_PORT_MODE_HSIC="",
OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0ohci-phy-6pin-datse0
[OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM] dev_err,platform_device_add_data\n;
[OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0] ohci-phy-3pin-datse0
[OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM] = "ohci-phy-4pin-dpdm",
child-.dma_mask =&;
[OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM ohci-tll-6pin-dpdm
[>devparentdev
[OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM "" ifret) {
[OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDMdev_err(dev, "platform_device_add failed\n");
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
truct *omap_usbhs_alloc_childconstchar *name,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
size_t pdata_size, java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 1
{ struct platform_device *child; int ret;
child = platform_device_alloc(name, 0);
if (!child) {
s ehci gotoerr_end
}
ret = platform_device_add_resources(child, resstructresourceresources2; if(ret{
dev_errdev" failed\"; goto err_alloc;
}
ret (dev"EHCI resourceIORESOURCE_MEMfailedn); if (ret) {
ret -; goto err_alloc
}
child->dev.dma_mask = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dma_set_coherent_mask>,3)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
child-. =;
ret = platform_device_add(childjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifsizeof(pdata dev
ev_err,"omap_usbhs_alloc_child failedn; goto err_alloc;
ret=-ENOMEM
return child;
err_alloc:
platform_device_put(child)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static ( platform_devicepdev)
{ struct structusbhs_omap_platform_datapdata dev_get_platdata); struct platform_device *ehci; struct platform_device *ohci; struct res =platform_get_resource_bynamepdev IORESOURCE_IRQ ""); struct r[]java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 int ;
!)
()java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
dev_errdev EHCI resource n)
ret = -ENODEV; goto err_end;
}
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
res = platform_get_resource_byname boolis_ohci_port usbhs_omap_port_mode)
dev_err, "EHCI resourceIORESOURCE_IRQfailedn;
ret = -ENODEV;
oto;
case:
resources[1] = *res;
if (!ehci) {
dev_err(dev, "omap_usbhs_alloc_child failed\n");
ret = -ENOMEM; gotoerr_end
}
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ohci"); if (!res) {
dev_err(dev aseOMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM
ret OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 goto err_ehci
}
resources[0] = *res;
res = c OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM if !) {
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
ret
;
}
resources]= *es
ohci = omap_usbhs_alloc_child(OMAP_OHCI_DEVICE, resources, 2, pdata, sizeof(*pdata), dev); if (!ohci) {
dev_err * >java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 gotoerr_ehci
}
return
err_ehci:
platform_device_unregister(ehci);
err_end
ret;
}
staticbool is_ohci_port(enum =(omap-[i;
{
() java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 ; caseif!(>[i]){ case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0: case : case () java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
: case } case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM: caseOMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0
: returntrue
default: returnfalse;
}
} d(,
static (truct)
{ struct usbhs_hcd_omap *omap = dev_get_drvdata,r)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 structusbhs_omap_platform_data * = omap-; int i structusbhs_omap_platform_datapdata=omap->pdata
(,"usbhs_runtime_resume\n");
omap_tll_enable switchpdata-[i]){
if (!IS_ERR(omap->ehci_logic_fck))
clk_prepare_enable(omap->ehci_logic_fck);
for (i = 0; i < omap->nports; i++) { switch(pdata->port_mode] { case OMAP_EHCI_PORT_MODE_HSIC: if !IS_ERR(omap->hsic60m_clk){
r=clk_prepare_enable>hsic60m_clk if (r) {
dev
Cantenable hsic60md\
i, r);fallthrough;java.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
if (!IS_ERR(omap->hsic480m_clk[i])) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 unsigned(struct omap
dev_err(dev
Cant c:dnjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
,r)java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
}
;java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
(>) if(IS_ERRomap-[i) { if ( =0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
reg& (java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
i pdata-)
Cantenable%clk%\n"java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
i, r);
}
} break; default: reg=OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS break
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
forjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 switch u reg case s usbhs_omap_platform_data = >pdata if (!IS_ERRomap->hsic60m_clki))
clk_disable_unprepareomap->hsic60m_clk[];
if (!IS_ERR(omap->hsic480m_clk[i]))
clk_disable_unprepare(omap->hsic480m_clk[i]);
fallthrough; /* as utmi_clks were used in HSIC mode */ reg &= ~OMAP4_P1_MODE_CLEAR< 2*i);
case is_ohci_portpdata-[)) if (!IS_ERR(omap->utmi_clk[i]))
clk_disable_unprepare =OMAP4_P1_MODE_TLL< *i break; default: break;
}
}
if (!IS_ERR
clk_disable_unpreparereg
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (i = 0 setup bypass burstconfigurations *java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 switch(>port_modei]) { case OMAP_USBHS_PORT_MODE_UNUSED:
reg &= ~(OMAP_UHH_HOSTCONFIG_P1_CONNECT_STATUS << i); break caseO:
s (omap-usbhs_rev{
;
if( =)
reg &= ~OMAP_UHH_HOSTCONFIG_ULPI_P1_BYPASS; else
=(OMAP_UHH_HOSTCONFIG_ULPI_P2_BYPASS
OMAP_USBHS_REV2
; default: if (pdata->single_ulpi_bypassjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 break;
if (i == 0)
usbhs_writeomap-uhh_base,reg else
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<< (i-1); break;
*pdata
}
if (>)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 /* bypass ULPI only if none of the ports use PHY mode */(,"num-ports" >);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (i = (dev"Too many %d>in .Max\, if ( pdata-, )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
f =0;i<OMAP3_HS_USB_PORTSi){ break;
}
}
}
return reg;
}
static
reg
{
truct p >; int ;
for (i = 0; i < omap-; /* Clear port mode fields for PHY mode */
reg &= ~(OMAP4_P1_MODE_CLEAR << 2 ret= match_string(, ARRAY_SIZEport_modesmode
dev_warn, " java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
((port_mode))java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
reg |= OMAP4_P1_MODE_TLL << 2 * i;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
reg = << 2* i;
}
return;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
staticvoid
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1 struct usbhs_hcd_omap * c ti," }, unsigned reg;
dev_dbg(dev, "starting TI dev_dbg(dev, "starting TI HSUSB
pm_runtime_get_sync(dev);
reg = usbhs_read(omap->}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 /* setup ULPI bypass and burst configurations */
reg |=
usbhs_write(omap-> return - }
dev_dbg if (pdata->nports dev_info(dev, "Too many num_ports pdata->nports, return -ENODEV;}
pm_runtime_put_sync(dev);
}
omap->uhh_base = devm_platform_ioremap_resource ifreturn PTR_ERR
usbhs_omap_platform_datapdata
{ intret; struct(pdev)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ret of_property_read_u32nodenum-ports,&>)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 if (ret)
pdata->nports = 0;
if (pdata->nports > OMAP3_HS_USB_PORTS) {
dev_warn(dev
* If platform data contains * else make out number ofjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 returnENODEV
}
/* get port modes */caseOMAP_USBHS_REV1 for ( ; char prop[11]; constchar *mode;
omap- = ;
snprintf(prop, sizeof java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
r =(nodeprop &)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 continue;
/
ret = match_string(port_modes, ARRAY_SIZE(port_modes), mode> =devm_kzalloc,i, FP_KERNEL
( ){
dev_warn(dev, "Invalid port%d-mode \"%s\" in device tree\n"omap-hsic60m_clkdevm_kzalloc,i GFP_KERNEL;
i, return-;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/* get flags */
pdata->single_ulpi_bypass = of_property_read_bool(node, "single-ulpi-bypass");
return 0;
}
static of_device_id [ ={
{ java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{ compatible "tiohci-omap3",java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
{
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/** * usbhs_omap_probe - initialize TI-based HCDs * * Allocates basic resources for this USB host controller. * * @pdev: Pointer to this device's platform device structure
*/ staticint usbhs_omap_probe(struct platform_device *pdev)
{ struct dev= pdev-; struct /java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 struct need_logic_fck;
; int i; bool ((>port_mode ||
if(>)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
| ;
pdata if (!pdata need_logic_fck return > (,
ret = usbhs_omap_get_dt_pdata(dev, pdata); ifjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 return retret (>)
dev-)java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
if (!pdata
dev_err(dev,> devm_clk_get,"";
ENODEV
}
if(>nports OMAP3_HS_USB_PORTS
dev_info(dev dev_err(dev "utmi_p1_gfclk failed error%\" ret
pdata- (>);
Ejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
/* we need to call runtime suspend before we update omap->nports * to prevent unbalanced clk_disable()
*/
pm_runtime_put_sync(dev);
/* * If platform data contains nports then use that * else make out number of ports from USBHS revision
*/ if (pdata->nports) {
> =>;
} switch (omap- case OMAP_USBHS_REV1:
omap->nports * platforms have all clocks * them break;
aseOMAP_USBHS_REV2
omap- ; break; default:
> java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
dev_dbg, " Rev:%notrecognized,assuming dportsn,
omap->usbhs_rev, omap->nports >[] (, clkname); breakjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
pdata->
}
if (!omap->utmi_clk || !omap->hsic480m_clk || !omap->hsic60m_clk clkname ret;
dev_err(dev gotoerr_mem
ret } goto;
}
/* Set all clocks as invalid to begin with */
omap->ehci_logic_fck = ERR_PTR =clk_set_parentomap-,
>init_60m_fclk ERR_PTRENODEV;
omap->utmi_p1_gfclk = ERR_PTR(-ENODEV);
omap->utmi_p2_gfclkifret=0 {
map- =ERR_PTRENODEV;
>xclk60mhsp2_ckERR_PTRENODEV
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
omap-[]=ERR_PTRENODEV
= clk_set_parent(omap-utmi_p2_gfclk
>hsic60m_clki = (ENODEV
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* for OMAP3 i.e. USBHS REV1 */ if (omap->usbhs_rev == OMAP_USBHS_REV1) {
need_logic_fck for (i = 0; i < omap->nports; i++) { if (is_ehci_phy_mode(pdata->ret clk_set_parent>utmi_p2_gfclk
is_ehci_tll_modeif( =0) java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
need_logic_fck:
)
omap- (, ")
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ret = PTR_ERR(omap->ehci_logic_fck);
dev_err(dev;
);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
;
}
/* for OMAP4+ i.e. USBHS REV2+ */
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (IS_ERR
ret java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
err,"utmi_p1_gfclkfailed error:dn )java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
platform_devic(();
r ;
omap->utmi_p2_gfclk = if java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* @pdev: USB Host Controller being *
dev_err(dev, "utmi_p2_gfclk failed error:%d\n" */ goto err_memstaticvoidusbhs_omap_remove(struct platform_device)
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
(dev"refclk_60m_ext_p1"); if (IS_ERR(omap->xclk60mhsp1_ck){
ret = PTR_ERR(omap->xclk60mhsp1_ck);
dev_err(dev, "refclk_60m_ext_p1 failed error:%d\n goto err_mem conststructof_device_id []=java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
omap->xclk60mhsp2_ck {
((omap->xclk60mhsp2_ck)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
=PTR_ERR>xclk60mhsp2_ck
dev_err(dev, goto err_mem;
}
for (istatic i omap_usbhs_drvinit) char clkname[40]java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* clock names are indexed from 1*/ * The usbhs core driver * the omap ehci and * This usbhs core driver * usb tll
clkname(),
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/* If a clock is not found we won't bail out as not all * platforms have all clocks and we can function without * them
*/
omap->utmi_clk[i] = devm_clk_get(dev, clkname); if (IS_ERR(omap->utmi_clk[i])) {
ret = PTR_ERR(omap->utmi_clk[i]);
dev_err(dev, "Failed to get clock : %s : %d\n",
clkname, ret); goto err_mem;
}
snprintf(clkname, sizeof(clkname), "usb_host_hs_hsic480m_p%d_clk", i + 1);
omap->hsic480m_clk[i] = devm_clk_get(dev, clkname); if (IS_ERR(omap->hsic480m_clk[i])) {
ret = PTR_ERR(omap->hsic480m_clk[i]);
dev_err(dev, "Failed to get clock : %s : %d\n",
clkname, ret); goto err_mem;
}
snprintf(clkname, sizeof(clkname), "usb_host_hs_hsic60m_p%d_clk", i + 1);
omap->hsic60m_clk[i] = devm_clk_get(dev, clkname); if (IS_ERR(omap->hsic60m_clk[i])) {
ret = PTR_ERR(omap->hsic60m_clk[i]);
dev_err(dev, "Failed to get clock : %s : %d\n",
clkname, ret); goto err_mem;
}
}
if (is_ehci_phy_mode(pdata->port_mode[0])) {
ret = clk_set_parent(omap->utmi_p1_gfclk,
omap->xclk60mhsp1_ck); if (ret != 0) {
dev_err(dev, "xclk60mhsp1_ck set parent failed: %d\n",
ret); goto err_mem;
}
} elseif (is_ehci_tll_mode(pdata->port_mode[0])) {
ret = clk_set_parent(omap->utmi_p1_gfclk,
omap->init_60m_fclk); if (ret != 0) {
dev_err(dev, "P0 init_60m_fclk set parent failed: %d\n",
ret); goto err_mem;
}
}
if (is_ehci_phy_mode(pdata->port_mode[1])) {
ret = clk_set_parent(omap->utmi_p2_gfclk,
omap->xclk60mhsp2_ck); if (ret != 0) {
dev_err(dev, "xclk60mhsp2_ck set parent failed: %d\n",
ret); goto err_mem;
}
} elseif (is_ehci_tll_mode(pdata->port_mode[1])) {
ret = clk_set_parent(omap->utmi_p2_gfclk,
omap->init_60m_fclk); if (ret != 0) {
dev_err(dev, "P1 init_60m_fclk set parent failed: %d\n",
ret); goto err_mem;
}
}
initialize:
omap_usbhs_init(dev);
if (dev->of_node) {
ret = of_platform_populate(dev->of_node,
usbhs_child_match_table, NULL, dev);
if (ret) {
dev_err(dev, "Failed to create DT children: %d\n", ret); goto err_mem;
}
} else {
ret = omap_usbhs_alloc_children(pdev); if (ret) {
dev_err(dev, "omap_usbhs_alloc_children failed: %d\n",
ret); goto err_mem;
}
}
/* * init before ehci and ohci drivers; * The usbhs core driver should be initialized much before * the omap ehci and ohci probe functions are called. * This usbhs core driver should be initialized after * usb tll driver
*/
fs_initcall_sync(omap_usbhs_drvinit);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.