Lines Matching refs:dphy

84 int sun6i_dphy_init(struct sun6i_dphy *dphy, unsigned int lanes)  in sun6i_dphy_init()  argument
86 reset_control_deassert(dphy->reset); in sun6i_dphy_init()
87 clk_prepare_enable(dphy->mod_clk); in sun6i_dphy_init()
88 clk_set_rate_exclusive(dphy->mod_clk, 150000000); in sun6i_dphy_init()
90 regmap_write(dphy->regs, SUN6I_DPHY_TX_CTL_REG, in sun6i_dphy_init()
93 regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME0_REG, in sun6i_dphy_init()
98 regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME1_REG, in sun6i_dphy_init()
104 regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME2_REG, in sun6i_dphy_init()
107 regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME3_REG, 0); in sun6i_dphy_init()
109 regmap_write(dphy->regs, SUN6I_DPHY_TX_TIME4_REG, in sun6i_dphy_init()
113 regmap_write(dphy->regs, SUN6I_DPHY_GCTL_REG, in sun6i_dphy_init()
120 int sun6i_dphy_power_on(struct sun6i_dphy *dphy, unsigned int lanes) in sun6i_dphy_power_on() argument
124 regmap_write(dphy->regs, SUN6I_DPHY_ANA0_REG, in sun6i_dphy_power_on()
131 regmap_write(dphy->regs, SUN6I_DPHY_ANA1_REG, in sun6i_dphy_power_on()
135 regmap_write(dphy->regs, SUN6I_DPHY_ANA4_REG, in sun6i_dphy_power_on()
146 regmap_write(dphy->regs, SUN6I_DPHY_ANA2_REG, in sun6i_dphy_power_on()
150 regmap_write(dphy->regs, SUN6I_DPHY_ANA3_REG, in sun6i_dphy_power_on()
156 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA3_REG, in sun6i_dphy_power_on()
163 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA3_REG, in sun6i_dphy_power_on()
168 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA2_REG, in sun6i_dphy_power_on()
173 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA1_REG, in sun6i_dphy_power_on()
177 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA2_REG, in sun6i_dphy_power_on()
184 int sun6i_dphy_power_off(struct sun6i_dphy *dphy) in sun6i_dphy_power_off() argument
186 regmap_update_bits(dphy->regs, SUN6I_DPHY_ANA1_REG, in sun6i_dphy_power_off()
192 int sun6i_dphy_exit(struct sun6i_dphy *dphy) in sun6i_dphy_exit() argument
194 clk_rate_exclusive_put(dphy->mod_clk); in sun6i_dphy_exit()
195 clk_disable_unprepare(dphy->mod_clk); in sun6i_dphy_exit()
196 reset_control_assert(dphy->reset); in sun6i_dphy_exit()
216 struct sun6i_dphy *dphy; in sun6i_dphy_probe() local
226 dphy = devm_kzalloc(dsi->dev, sizeof(*dphy), GFP_KERNEL); in sun6i_dphy_probe()
227 if (!dphy) in sun6i_dphy_probe()
242 dphy->regs = devm_regmap_init_mmio(dsi->dev, regs, in sun6i_dphy_probe()
244 if (IS_ERR(dphy->regs)) { in sun6i_dphy_probe()
246 return PTR_ERR(dphy->regs); in sun6i_dphy_probe()
249 dphy->reset = of_reset_control_get_shared(node, NULL); in sun6i_dphy_probe()
250 if (IS_ERR(dphy->reset)) { in sun6i_dphy_probe()
252 return PTR_ERR(dphy->reset); in sun6i_dphy_probe()
255 dphy->bus_clk = of_clk_get_by_name(node, "bus"); in sun6i_dphy_probe()
256 if (IS_ERR(dphy->bus_clk)) { in sun6i_dphy_probe()
258 ret = PTR_ERR(dphy->bus_clk); in sun6i_dphy_probe()
261 regmap_mmio_attach_clk(dphy->regs, dphy->bus_clk); in sun6i_dphy_probe()
263 dphy->mod_clk = of_clk_get_by_name(node, "mod"); in sun6i_dphy_probe()
264 if (IS_ERR(dphy->mod_clk)) { in sun6i_dphy_probe()
266 ret = PTR_ERR(dphy->mod_clk); in sun6i_dphy_probe()
270 dsi->dphy = dphy; in sun6i_dphy_probe()
275 regmap_mmio_detach_clk(dphy->regs); in sun6i_dphy_probe()
276 clk_put(dphy->bus_clk); in sun6i_dphy_probe()
278 reset_control_put(dphy->reset); in sun6i_dphy_probe()
284 struct sun6i_dphy *dphy = dsi->dphy; in sun6i_dphy_remove() local
286 regmap_mmio_detach_clk(dphy->regs); in sun6i_dphy_remove()
287 clk_put(dphy->mod_clk); in sun6i_dphy_remove()
288 clk_put(dphy->bus_clk); in sun6i_dphy_remove()
289 reset_control_put(dphy->reset); in sun6i_dphy_remove()