Lines Matching refs:phy

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