Lines Matching +full:ulpi +full:- +full:0

1 // SPDX-License-Identifier: GPL-2.0-only
6 #include <linux/ulpi/driver.h>
7 #include <linux/ulpi/regs.h>
10 #include <linux/pinctrl/pinctrl-state.h>
14 #define ULPI_HSIC_CFG 0x30
15 #define ULPI_HSIC_IO_CAL 0x33
18 struct ulpi *ulpi; member
29 struct ulpi *ulpi = uphy->ulpi; in qcom_usb_hsic_phy_power_on() local
33 ret = clk_prepare_enable(uphy->phy_clk); in qcom_usb_hsic_phy_power_on()
37 ret = clk_prepare_enable(uphy->cal_clk); in qcom_usb_hsic_phy_power_on()
41 ret = clk_prepare_enable(uphy->cal_sleep_clk); in qcom_usb_hsic_phy_power_on()
46 ret = ulpi_write(ulpi, ULPI_HSIC_IO_CAL, 0xff); in qcom_usb_hsic_phy_power_on()
51 ret = ulpi_write(ulpi, ULPI_HSIC_CFG, 0xa8); in qcom_usb_hsic_phy_power_on()
56 pins_default = pinctrl_lookup_state(uphy->pctl, PINCTRL_STATE_DEFAULT); in qcom_usb_hsic_phy_power_on()
62 ret = pinctrl_select_state(uphy->pctl, pins_default); in qcom_usb_hsic_phy_power_on()
67 ret = ulpi_write(ulpi, ULPI_SET(ULPI_HSIC_CFG), 0x01); in qcom_usb_hsic_phy_power_on()
71 /* Disable auto-resume */ in qcom_usb_hsic_phy_power_on()
72 ret = ulpi_write(ulpi, ULPI_CLR(ULPI_IFC_CTRL), in qcom_usb_hsic_phy_power_on()
79 clk_disable_unprepare(uphy->cal_sleep_clk); in qcom_usb_hsic_phy_power_on()
81 clk_disable_unprepare(uphy->cal_clk); in qcom_usb_hsic_phy_power_on()
83 clk_disable_unprepare(uphy->phy_clk); in qcom_usb_hsic_phy_power_on()
91 clk_disable_unprepare(uphy->cal_sleep_clk); in qcom_usb_hsic_phy_power_off()
92 clk_disable_unprepare(uphy->cal_clk); in qcom_usb_hsic_phy_power_off()
93 clk_disable_unprepare(uphy->phy_clk); in qcom_usb_hsic_phy_power_off()
95 return 0; in qcom_usb_hsic_phy_power_off()
104 static int qcom_usb_hsic_phy_probe(struct ulpi *ulpi) in qcom_usb_hsic_phy_probe() argument
110 uphy = devm_kzalloc(&ulpi->dev, sizeof(*uphy), GFP_KERNEL); in qcom_usb_hsic_phy_probe()
112 return -ENOMEM; in qcom_usb_hsic_phy_probe()
113 ulpi_set_drvdata(ulpi, uphy); in qcom_usb_hsic_phy_probe()
115 uphy->ulpi = ulpi; in qcom_usb_hsic_phy_probe()
116 uphy->pctl = devm_pinctrl_get(&ulpi->dev); in qcom_usb_hsic_phy_probe()
117 if (IS_ERR(uphy->pctl)) in qcom_usb_hsic_phy_probe()
118 return PTR_ERR(uphy->pctl); in qcom_usb_hsic_phy_probe()
120 uphy->phy_clk = clk = devm_clk_get(&ulpi->dev, "phy"); in qcom_usb_hsic_phy_probe()
124 uphy->cal_clk = clk = devm_clk_get(&ulpi->dev, "cal"); in qcom_usb_hsic_phy_probe()
128 uphy->cal_sleep_clk = clk = devm_clk_get(&ulpi->dev, "cal_sleep"); in qcom_usb_hsic_phy_probe()
132 uphy->phy = devm_phy_create(&ulpi->dev, ulpi->dev.of_node, in qcom_usb_hsic_phy_probe()
134 if (IS_ERR(uphy->phy)) in qcom_usb_hsic_phy_probe()
135 return PTR_ERR(uphy->phy); in qcom_usb_hsic_phy_probe()
136 phy_set_drvdata(uphy->phy, uphy); in qcom_usb_hsic_phy_probe()
138 p = devm_of_phy_provider_register(&ulpi->dev, of_phy_simple_xlate); in qcom_usb_hsic_phy_probe()
143 { .compatible = "qcom,usb-hsic-phy", },