• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/usb/otg/

Lines Matching refs:otg

29 #include <linux/usb/otg.h>
40 static int ulpi_set_otg_flags(struct otg_transceiver *otg)
45 if (otg->flags & ULPI_OTG_ID_PULLUP)
52 if (otg->flags & ULPI_OTG_DP_PULLDOWN_DIS)
55 if (otg->flags & ULPI_OTG_DM_PULLDOWN_DIS)
58 if (otg->flags & ULPI_OTG_EXTVBUSIND)
61 return otg_io_write(otg, flags, ULPI_OTG_CTRL);
64 static int ulpi_set_fc_flags(struct otg_transceiver *otg)
72 if (otg->flags & ULPI_FC_HS)
74 else if (otg->flags & ULPI_FC_LS)
76 else if (otg->flags & ULPI_FC_FS4LS)
81 if (otg->flags & ULPI_FC_TERMSEL)
88 if (otg->flags & ULPI_FC_OP_NODRV)
90 else if (otg->flags & ULPI_FC_OP_DIS_NRZI)
92 else if (otg->flags & ULPI_FC_OP_NSYNC_NEOP)
103 return otg_io_write(otg, flags, ULPI_FUNC_CTRL);
106 static int ulpi_set_ic_flags(struct otg_transceiver *otg)
110 if (otg->flags & ULPI_IC_AUTORESUME)
113 if (otg->flags & ULPI_IC_EXTVBUS_INDINV)
116 if (otg->flags & ULPI_IC_IND_PASSTHRU)
119 if (otg->flags & ULPI_IC_PROTECT_DIS)
122 return otg_io_write(otg, flags, ULPI_IFC_CTRL);
125 static int ulpi_set_flags(struct otg_transceiver *otg)
129 ret = ulpi_set_otg_flags(otg);
133 ret = ulpi_set_ic_flags(otg);
137 return ulpi_set_fc_flags(otg);
140 static int ulpi_init(struct otg_transceiver *otg)
146 ret = otg_io_read(otg, ULPI_PRODUCT_ID_HIGH - i);
158 return ulpi_set_flags(otg);
164 static int ulpi_set_host(struct otg_transceiver *otg, struct usb_bus *host)
166 unsigned int flags = otg_io_read(otg, ULPI_IFC_CTRL);
169 otg->host = NULL;
173 otg->host = host;
179 if (otg->flags & ULPI_IC_6PIN_SERIAL)
181 else if (otg->flags & ULPI_IC_3PIN_SERIAL)
183 else if (otg->flags & ULPI_IC_CARKIT)
186 return otg_io_write(otg, flags, ULPI_IFC_CTRL);
189 static int ulpi_set_vbus(struct otg_transceiver *otg, bool on)
191 unsigned int flags = otg_io_read(otg, ULPI_OTG_CTRL);
196 if (otg->flags & ULPI_OTG_DRVVBUS)
199 if (otg->flags & ULPI_OTG_DRVVBUS_EXT)
203 return otg_io_write(otg, flags, ULPI_OTG_CTRL);
210 struct otg_transceiver *otg;
212 otg = kzalloc(sizeof(*otg), GFP_KERNEL);
213 if (!otg)
216 otg->label = "ULPI";
217 otg->flags = flags;
218 otg->io_ops = ops;
219 otg->init = ulpi_init;
220 otg->set_host = ulpi_set_host;
221 otg->set_vbus = ulpi_set_vbus;
223 return otg;