Lines Matching defs:phy

16 #include <linux/usb/phy.h>
37 static const char *const PHY_RESETS[] = { "phy31", "phy", };
44 struct usb_phy phy;
56 ret = extcon_get_property(ta->phy.edev, EXTCON_USB_HOST,
59 dev_err(ta->phy.dev, "no polarity property from extcon\n");
68 static int phy_init(struct usb_phy *phy)
70 struct tca_apb *ta = container_of(phy, struct tca_apb, phy);
71 void __iomem *ctrl1 = phy->io_priv + CTRL1_OFFSET;
82 dev_err(ta->phy.dev, "SRAM init failed, 0x%x\n", val);
89 if (!ta->phy.edev) {
90 writel(TCPC_CONN, ta->phy.io_priv + TCPC_OFFSET);
91 return phy->set_vbus(phy, true);
99 static void phy_shutdown(struct usb_phy *phy)
101 struct tca_apb *ta = container_of(phy, struct tca_apb, phy);
109 ta->phy.set_vbus(&ta->phy, false);
112 writel(TCPC_DISCONN, ta->phy.io_priv + TCPC_OFFSET);
118 static int phy_set_vbus(struct usb_phy *phy, int on)
120 struct tca_apb *ta = container_of(phy, struct tca_apb, phy);
134 dev_dbg(ta->phy.dev, "set vbus: %d\n", on);
150 connected = extcon_get_state(ta->phy.edev, EXTCON_USB_HOST);
159 dev_dbg(ta->phy.dev, "connected%s\n", flipped ? " flipped" : "");
162 dev_dbg(ta->phy.dev, "disconnected\n");
165 writel(val, ta->phy.io_priv + TCPC_OFFSET);
167 ret = ta->phy.set_vbus(&ta->phy, connected);
169 dev_err(ta->phy.dev, "failed to set VBUS\n");
174 struct tca_apb *ta = container_of(nb, struct tca_apb, phy.id_nb);
191 struct usb_phy *phy;
202 phy = &ta->phy;
203 phy->dev = dev;
204 phy->label = dev_name(dev);
205 phy->type = USB_PHY_TYPE_USB3;
206 phy->init = phy_init;
207 phy->shutdown = phy_shutdown;
208 phy->set_vbus = phy_set_vbus;
209 phy->id_nb.notifier_call = id_notifier;
210 phy->vbus_nb.notifier_call = vbus_notifier;
212 phy->io_priv = devm_platform_ioremap_resource(pdev, 0);
213 if (IS_ERR(phy->io_priv))
214 return PTR_ERR(phy->io_priv);
252 return usb_add_phy_dev(phy);
259 usb_remove_phy(&ta->phy);
265 { .compatible = "intel,lgm-usb-phy" },
272 .name = "lgm-usb-phy",