Lines Matching refs:rk_phy
95 struct rockchip_emmc_phy *rk_phy = phy_get_drvdata(phy); in rockchip_emmc_phy_power() local
106 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power()
107 rk_phy->reg_offset + GRF_EMMCPHY_CON6, in rockchip_emmc_phy_power()
111 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power()
112 rk_phy->reg_offset + GRF_EMMCPHY_CON6, in rockchip_emmc_phy_power()
121 rate = clk_get_rate(rk_phy->emmcclk); in rockchip_emmc_phy_power()
164 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power()
165 rk_phy->reg_offset + GRF_EMMCPHY_CON6, in rockchip_emmc_phy_power()
177 ret = regmap_read_poll_timeout(rk_phy->reg_base, in rockchip_emmc_phy_power()
178 rk_phy->reg_offset + GRF_EMMCPHY_STATUS, in rockchip_emmc_phy_power()
187 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power()
188 rk_phy->reg_offset + GRF_EMMCPHY_CON0, in rockchip_emmc_phy_power()
193 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power()
194 rk_phy->reg_offset + GRF_EMMCPHY_CON6, in rockchip_emmc_phy_power()
225 ret = regmap_read_poll_timeout(rk_phy->reg_base, in rockchip_emmc_phy_power()
226 rk_phy->reg_offset + GRF_EMMCPHY_STATUS, in rockchip_emmc_phy_power()
239 struct rockchip_emmc_phy *rk_phy = phy_get_drvdata(phy); in rockchip_emmc_phy_init() local
258 rk_phy->emmcclk = clk_get_optional(&phy->dev, "emmcclk"); in rockchip_emmc_phy_init()
259 if (IS_ERR(rk_phy->emmcclk)) { in rockchip_emmc_phy_init()
260 ret = PTR_ERR(rk_phy->emmcclk); in rockchip_emmc_phy_init()
262 rk_phy->emmcclk = NULL; in rockchip_emmc_phy_init()
270 struct rockchip_emmc_phy *rk_phy = phy_get_drvdata(phy); in rockchip_emmc_phy_exit() local
272 clk_put(rk_phy->emmcclk); in rockchip_emmc_phy_exit()
285 struct rockchip_emmc_phy *rk_phy = phy_get_drvdata(phy); in rockchip_emmc_phy_power_on() local
288 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power_on()
289 rk_phy->reg_offset + GRF_EMMCPHY_CON6, in rockchip_emmc_phy_power_on()
290 HIWORD_UPDATE(rk_phy->drive_impedance, in rockchip_emmc_phy_power_on()
295 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power_on()
296 rk_phy->reg_offset + GRF_EMMCPHY_CON0, in rockchip_emmc_phy_power_on()
302 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power_on()
303 rk_phy->reg_offset + GRF_EMMCPHY_CON0, in rockchip_emmc_phy_power_on()
304 HIWORD_UPDATE(rk_phy->output_tapdelay_select, in rockchip_emmc_phy_power_on()
309 regmap_write(rk_phy->reg_base, in rockchip_emmc_phy_power_on()
310 rk_phy->reg_offset + GRF_EMMCPHY_CON2, in rockchip_emmc_phy_power_on()
311 HIWORD_UPDATE(rk_phy->enable_strobe_pulldown, in rockchip_emmc_phy_power_on()
350 struct rockchip_emmc_phy *rk_phy; in rockchip_emmc_phy_probe() local
366 rk_phy = devm_kzalloc(dev, sizeof(*rk_phy), GFP_KERNEL); in rockchip_emmc_phy_probe()
367 if (!rk_phy) in rockchip_emmc_phy_probe()
376 rk_phy->reg_offset = reg_offset; in rockchip_emmc_phy_probe()
377 rk_phy->reg_base = grf; in rockchip_emmc_phy_probe()
378 rk_phy->drive_impedance = PHYCTRL_DR_50OHM; in rockchip_emmc_phy_probe()
379 rk_phy->enable_strobe_pulldown = PHYCTRL_REN_STRB_DISABLE; in rockchip_emmc_phy_probe()
380 rk_phy->output_tapdelay_select = PHYCTRL_OTAPDLYSEL_DEFAULT; in rockchip_emmc_phy_probe()
383 rk_phy->drive_impedance = convert_drive_impedance_ohm(pdev, val); in rockchip_emmc_phy_probe()
386 rk_phy->enable_strobe_pulldown = PHYCTRL_REN_STRB_ENABLE; in rockchip_emmc_phy_probe()
390 rk_phy->output_tapdelay_select = val; in rockchip_emmc_phy_probe()
401 phy_set_drvdata(generic_phy, rk_phy); in rockchip_emmc_phy_probe()