Lines Matching full:phy
18 #include <linux/phy/phy.h>
24 struct phy *phy; member
30 static int ipq4019_ss_phy_power_off(struct phy *_phy) in ipq4019_ss_phy_power_off()
32 struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); in ipq4019_ss_phy_power_off() local
34 reset_control_assert(phy->por_rst); in ipq4019_ss_phy_power_off()
40 static int ipq4019_ss_phy_power_on(struct phy *_phy) in ipq4019_ss_phy_power_on()
42 struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); in ipq4019_ss_phy_power_on() local
46 reset_control_deassert(phy->por_rst); in ipq4019_ss_phy_power_on()
56 static int ipq4019_hs_phy_power_off(struct phy *_phy) in ipq4019_hs_phy_power_off()
58 struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); in ipq4019_hs_phy_power_off() local
60 reset_control_assert(phy->por_rst); in ipq4019_hs_phy_power_off()
63 reset_control_assert(phy->srif_rst); in ipq4019_hs_phy_power_off()
69 static int ipq4019_hs_phy_power_on(struct phy *_phy) in ipq4019_hs_phy_power_on()
71 struct ipq4019_usb_phy *phy = phy_get_drvdata(_phy); in ipq4019_hs_phy_power_on() local
75 reset_control_deassert(phy->srif_rst); in ipq4019_hs_phy_power_on()
78 reset_control_deassert(phy->por_rst); in ipq4019_hs_phy_power_on()
89 { .compatible = "qcom,usb-hs-ipq4019-phy", .data = &ipq4019_usb_hs_phy_ops},
90 { .compatible = "qcom,usb-ss-ipq4019-phy", .data = &ipq4019_usb_ss_phy_ops},
100 struct ipq4019_usb_phy *phy; in ipq4019_usb_phy_probe() local
102 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in ipq4019_usb_phy_probe()
103 if (!phy) in ipq4019_usb_phy_probe()
106 phy->dev = &pdev->dev; in ipq4019_usb_phy_probe()
108 phy->base = devm_ioremap_resource(&pdev->dev, res); in ipq4019_usb_phy_probe()
109 if (IS_ERR(phy->base)) { in ipq4019_usb_phy_probe()
111 return PTR_ERR(phy->base); in ipq4019_usb_phy_probe()
114 phy->por_rst = devm_reset_control_get(phy->dev, "por_rst"); in ipq4019_usb_phy_probe()
115 if (IS_ERR(phy->por_rst)) { in ipq4019_usb_phy_probe()
116 if (PTR_ERR(phy->por_rst) != -EPROBE_DEFER) in ipq4019_usb_phy_probe()
118 return PTR_ERR(phy->por_rst); in ipq4019_usb_phy_probe()
121 phy->srif_rst = devm_reset_control_get_optional(phy->dev, "srif_rst"); in ipq4019_usb_phy_probe()
122 if (IS_ERR(phy->srif_rst)) in ipq4019_usb_phy_probe()
123 return PTR_ERR(phy->srif_rst); in ipq4019_usb_phy_probe()
125 phy->phy = devm_phy_create(dev, NULL, of_device_get_match_data(dev)); in ipq4019_usb_phy_probe()
126 if (IS_ERR(phy->phy)) { in ipq4019_usb_phy_probe()
127 dev_err(dev, "failed to create PHY\n"); in ipq4019_usb_phy_probe()
128 return PTR_ERR(phy->phy); in ipq4019_usb_phy_probe()
130 phy_set_drvdata(phy->phy, phy); in ipq4019_usb_phy_probe()
141 .name = "ipq4019-usb-phy",
146 MODULE_DESCRIPTION("QCOM/IPQ4019 USB phy driver");