Lines Matching +full:stih407 +full:- +full:usb2 +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0-only
5 * STMicroelectronics Generic PHY driver for STiH407 USB2.
19 #include <linux/phy/phy.h>
33 struct phy *phy; member
44 reset_control_deassert(phy_dev->rstc); in stih407_usb2_pico_ctrl()
46 return regmap_update_bits(phy_dev->regmap, phy_dev->ctrl, in stih407_usb2_pico_ctrl()
51 static int stih407_usb2_init_port(struct phy *phy) in stih407_usb2_init_port() argument
54 struct stih407_usb2_picophy *phy_dev = phy_get_drvdata(phy); in stih407_usb2_init_port()
58 ret = regmap_update_bits(phy_dev->regmap, in stih407_usb2_init_port()
59 phy_dev->param, in stih407_usb2_init_port()
65 return reset_control_deassert(phy_dev->rstport); in stih407_usb2_init_port()
68 static int stih407_usb2_exit_port(struct phy *phy) in stih407_usb2_exit_port() argument
70 struct stih407_usb2_picophy *phy_dev = phy_get_drvdata(phy); in stih407_usb2_exit_port()
73 * Only port reset is asserted, phy global reset is kept untouched in stih407_usb2_exit_port()
75 * state, assumption is made that power will be cut off on the phy, in in stih407_usb2_exit_port()
79 return reset_control_assert(phy_dev->rstport); in stih407_usb2_exit_port()
91 struct device *dev = &pdev->dev; in stih407_usb2_picophy_probe()
92 struct device_node *np = dev->of_node; in stih407_usb2_picophy_probe()
94 struct phy *phy; in stih407_usb2_picophy_probe() local
99 return -ENOMEM; in stih407_usb2_picophy_probe()
101 phy_dev->dev = dev; in stih407_usb2_picophy_probe()
104 phy_dev->rstc = devm_reset_control_get_shared(dev, "global"); in stih407_usb2_picophy_probe()
105 if (IS_ERR(phy_dev->rstc)) { in stih407_usb2_picophy_probe()
107 return PTR_ERR(phy_dev->rstc); in stih407_usb2_picophy_probe()
110 phy_dev->rstport = devm_reset_control_get_exclusive(dev, "port"); in stih407_usb2_picophy_probe()
111 if (IS_ERR(phy_dev->rstport)) { in stih407_usb2_picophy_probe()
113 return PTR_ERR(phy_dev->rstport); in stih407_usb2_picophy_probe()
116 /* Reset port by default: only deassert it in phy init */ in stih407_usb2_picophy_probe()
117 reset_control_assert(phy_dev->rstport); in stih407_usb2_picophy_probe()
119 phy_dev->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); in stih407_usb2_picophy_probe()
120 if (IS_ERR(phy_dev->regmap)) { in stih407_usb2_picophy_probe()
122 return PTR_ERR(phy_dev->regmap); in stih407_usb2_picophy_probe()
126 &phy_dev->param); in stih407_usb2_picophy_probe()
133 &phy_dev->ctrl); in stih407_usb2_picophy_probe()
139 phy = devm_phy_create(dev, NULL, &stih407_usb2_picophy_data); in stih407_usb2_picophy_probe()
140 if (IS_ERR(phy)) { in stih407_usb2_picophy_probe()
141 dev_err(dev, "failed to create Display Port PHY\n"); in stih407_usb2_picophy_probe()
142 return PTR_ERR(phy); in stih407_usb2_picophy_probe()
145 phy_dev->phy = phy; in stih407_usb2_picophy_probe()
146 phy_set_drvdata(phy, phy_dev); in stih407_usb2_picophy_probe()
152 dev_info(dev, "STiH407 USB Generic picoPHY driver probed!"); in stih407_usb2_picophy_probe()
158 { .compatible = "st,stih407-usb2-phy" },
167 .name = "stih407-usb-genphy",
175 MODULE_DESCRIPTION("STMicroelectronics Generic picoPHY driver for STiH407");