Lines Matching refs:phy

55 static int ulpi_set_otg_flags(struct usb_phy *phy)
60 if (phy->flags & ULPI_OTG_ID_PULLUP)
67 if (phy->flags & ULPI_OTG_DP_PULLDOWN_DIS)
70 if (phy->flags & ULPI_OTG_DM_PULLDOWN_DIS)
73 if (phy->flags & ULPI_OTG_EXTVBUSIND)
76 return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
79 static int ulpi_set_fc_flags(struct usb_phy *phy)
87 if (phy->flags & ULPI_FC_HS)
89 else if (phy->flags & ULPI_FC_LS)
91 else if (phy->flags & ULPI_FC_FS4LS)
96 if (phy->flags & ULPI_FC_TERMSEL)
103 if (phy->flags & ULPI_FC_OP_NODRV)
105 else if (phy->flags & ULPI_FC_OP_DIS_NRZI)
107 else if (phy->flags & ULPI_FC_OP_NSYNC_NEOP)
118 return usb_phy_io_write(phy, flags, ULPI_FUNC_CTRL);
121 static int ulpi_set_ic_flags(struct usb_phy *phy)
125 if (phy->flags & ULPI_IC_AUTORESUME)
128 if (phy->flags & ULPI_IC_EXTVBUS_INDINV)
131 if (phy->flags & ULPI_IC_IND_PASSTHRU)
134 if (phy->flags & ULPI_IC_PROTECT_DIS)
137 return usb_phy_io_write(phy, flags, ULPI_IFC_CTRL);
140 static int ulpi_set_flags(struct usb_phy *phy)
144 ret = ulpi_set_otg_flags(phy);
148 ret = ulpi_set_ic_flags(phy);
152 return ulpi_set_fc_flags(phy);
155 static int ulpi_check_integrity(struct usb_phy *phy)
161 ret = usb_phy_io_write(phy, val, ULPI_SCRATCH);
165 ret = usb_phy_io_read(phy, ULPI_SCRATCH);
181 static int ulpi_init(struct usb_phy *phy)
187 ret = usb_phy_io_read(phy, ULPI_PRODUCT_ID_HIGH - i);
205 ret = ulpi_check_integrity(phy);
209 return ulpi_set_flags(phy);
214 struct usb_phy *phy = otg->phy;
215 unsigned int flags = usb_phy_io_read(phy, ULPI_IFC_CTRL);
228 if (phy->flags & ULPI_IC_6PIN_SERIAL)
230 else if (phy->flags & ULPI_IC_3PIN_SERIAL)
232 else if (phy->flags & ULPI_IC_CARKIT)
235 return usb_phy_io_write(phy, flags, ULPI_IFC_CTRL);
240 struct usb_phy *phy = otg->phy;
241 unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);
246 if (phy->flags & ULPI_OTG_DRVVBUS)
249 if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
253 return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
260 struct usb_phy *phy;
263 phy = kzalloc(sizeof(*phy), GFP_KERNEL);
264 if (!phy)
269 kfree(phy);
273 phy->label = "ULPI";
274 phy->flags = flags;
275 phy->io_ops = ops;
276 phy->otg = otg;
277 phy->init = ulpi_init;
279 otg->phy = phy;
283 return phy;