Lines Matching refs:usb_phy
140 struct sun4i_usb_phy_plat *usb_phy; member
148 struct sun4i_usb_phy_plat *usb_phy = &phy_data->usb_phy[phy->id]; in sun4i_usb_phy_write() local
149 u32 temp, usbc_bit = BIT(usb_phy->id * 2); in sun4i_usb_phy_write()
193 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_passby() local
196 if (!usb_phy->pmu) in sun4i_usb_phy_passby()
203 if (data->cfg->type == sun8i_a83t_phy && usb_phy->id == 2) in sun4i_usb_phy_passby()
207 reg_value = readl(usb_phy->pmu); in sun4i_usb_phy_passby()
214 writel(reg_value, usb_phy->pmu); in sun4i_usb_phy_passby()
220 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_power_on() local
227 usb_phy->power_on_count++; in sun4i_usb_phy_power_on()
228 if (usb_phy->power_on_count != 1) in sun4i_usb_phy_power_on()
231 if (usb_phy->gpio_vbus >= 0) in sun4i_usb_phy_power_on()
232 gpio_set_value(usb_phy->gpio_vbus, SUNXI_GPIO_PULL_UP); in sun4i_usb_phy_power_on()
240 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_power_off() local
242 usb_phy->power_on_count--; in sun4i_usb_phy_power_off()
243 if (usb_phy->power_on_count != 0) in sun4i_usb_phy_power_off()
246 if (usb_phy->gpio_vbus >= 0) in sun4i_usb_phy_power_off()
247 gpio_set_value(usb_phy->gpio_vbus, SUNXI_GPIO_PULL_DISABLE); in sun4i_usb_phy_power_off()
270 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_init() local
273 setbits_le32(&data->ccm->usb_clk_cfg, usb_phy->rst_mask); in sun4i_usb_phy_init()
283 if (usb_phy->pmu && data->cfg->enable_pmu_unk1) { in sun4i_usb_phy_init()
284 val = readl(usb_phy->pmu + REG_PMU_UNK1); in sun4i_usb_phy_init()
285 writel(val & ~2, usb_phy->pmu + REG_PMU_UNK1); in sun4i_usb_phy_init()
288 if (usb_phy->id == 0) in sun4i_usb_phy_init()
303 if (usb_phy->id != 0) in sun4i_usb_phy_init()
314 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_exit() local
327 clrbits_le32(&data->ccm->usb_clk_cfg, usb_phy->rst_mask); in sun4i_usb_phy_exit()
352 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_vbus_detect() local
355 debug("%s: id_det = %d\n", __func__, usb_phy->gpio_id_det); in sun4i_usb_phy_vbus_detect()
357 if (usb_phy->gpio_vbus_det < 0) in sun4i_usb_phy_vbus_detect()
358 return usb_phy->gpio_vbus_det; in sun4i_usb_phy_vbus_detect()
360 err = gpio_get_value(usb_phy->gpio_vbus_det); in sun4i_usb_phy_vbus_detect()
368 err = gpio_get_value(usb_phy->gpio_vbus_det); in sun4i_usb_phy_vbus_detect()
377 struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; in sun4i_usb_phy_id_detect() local
379 debug("%s: id_det = %d\n", __func__, usb_phy->gpio_id_det); in sun4i_usb_phy_id_detect()
381 if (usb_phy->gpio_id_det < 0) in sun4i_usb_phy_id_detect()
382 return usb_phy->gpio_id_det; in sun4i_usb_phy_id_detect()
384 return gpio_get_value(usb_phy->gpio_id_det); in sun4i_usb_phy_id_detect()
418 data->usb_phy = plat; in sun4i_usb_phy_probe()