Lines Matching refs:phy
120 static struct usb3_dpll_params *ti_usb3_get_dpll_params(struct ti_usb_phy *phy) in ti_usb3_get_dpll_params() argument
123 struct usb3_dpll_map *dpll_map = phy->dpll_map; in ti_usb3_get_dpll_params()
137 static int ti_usb3_dpll_wait_lock(struct ti_usb_phy *phy) in ti_usb3_dpll_wait_lock() argument
141 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_STATUS); in ti_usb3_dpll_wait_lock()
149 static int ti_usb3_dpll_program(struct ti_usb_phy *phy) in ti_usb3_dpll_program() argument
154 if (!phy->pll_ctrl_base) in ti_usb3_dpll_program()
157 dpll_params = ti_usb3_get_dpll_params(phy); in ti_usb3_dpll_program()
161 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1); in ti_usb3_dpll_program()
164 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val); in ti_usb3_dpll_program()
166 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION2); in ti_usb3_dpll_program()
169 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION2, val); in ti_usb3_dpll_program()
171 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION1); in ti_usb3_dpll_program()
174 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION1, val); in ti_usb3_dpll_program()
176 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION4); in ti_usb3_dpll_program()
179 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION4, val); in ti_usb3_dpll_program()
181 val = ti_usb3_readl(phy->pll_ctrl_base, PLL_CONFIGURATION3); in ti_usb3_dpll_program()
184 ti_usb3_writel(phy->pll_ctrl_base, PLL_CONFIGURATION3, val); in ti_usb3_dpll_program()
186 ti_usb3_writel(phy->pll_ctrl_base, PLL_GO, SET_PLL_GO); in ti_usb3_dpll_program()
188 return ti_usb3_dpll_wait_lock(phy); in ti_usb3_dpll_program()
192 void ti_usb2_phy_power(struct ti_usb_phy *phy, int on) in ti_usb2_phy_power() argument
196 val = readl(phy->usb2_phy_power); in ti_usb2_phy_power()
200 if (phy->index == 1) in ti_usb2_phy_power()
212 if (phy->index == 1) in ti_usb2_phy_power()
224 writel(val, phy->usb2_phy_power); in ti_usb2_phy_power()
228 void ti_usb3_phy_power(struct ti_usb_phy *phy, int on) in ti_usb3_phy_power() argument
235 if (!phy->usb3_phy_power) in ti_usb3_phy_power()
238 val = readl(phy->usb3_phy_power); in ti_usb3_phy_power()
251 writel(val, phy->usb3_phy_power); in ti_usb3_phy_power()
268 struct ti_usb_phy *phy; in ti_usb_phy_uboot_init() local
270 phy = devm_kzalloc(NULL, sizeof(*phy), GFP_KERNEL); in ti_usb_phy_uboot_init()
271 if (!phy) { in ti_usb_phy_uboot_init()
276 phy->dpll_map = dpll_map_usb; in ti_usb_phy_uboot_init()
277 phy->index = dev->index; in ti_usb_phy_uboot_init()
278 phy->pll_ctrl_base = dev->pll_ctrl_base; in ti_usb_phy_uboot_init()
279 phy->usb2_phy_power = dev->usb2_phy_power; in ti_usb_phy_uboot_init()
280 phy->usb3_phy_power = dev->usb3_phy_power; in ti_usb_phy_uboot_init()
283 ti_usb3_dpll_program(phy); in ti_usb_phy_uboot_init()
284 ti_usb3_phy_power(phy, 1); in ti_usb_phy_uboot_init()
286 ti_usb2_phy_power(phy, 1); in ti_usb_phy_uboot_init()
288 list_add_tail(&phy->list, &ti_usb_phy_list); in ti_usb_phy_uboot_init()
305 struct ti_usb_phy *phy = NULL; in ti_usb_phy_uboot_exit() local
307 list_for_each_entry(phy, &ti_usb_phy_list, list) { in ti_usb_phy_uboot_exit()
308 if (phy->index != index) in ti_usb_phy_uboot_exit()
311 ti_usb2_phy_power(phy, 0); in ti_usb_phy_uboot_exit()
313 ti_usb3_phy_power(phy, 0); in ti_usb_phy_uboot_exit()
315 list_del(&phy->list); in ti_usb_phy_uboot_exit()
316 kfree(phy); in ti_usb_phy_uboot_exit()