Lines Matching refs:pad

27 	struct tegra_xusb_pad *pad = dev_get_drvdata(dev);  in tegra_xusb_pad_of_xlate()  local
34 for (i = 0; i < pad->soc->num_lanes; i++) { in tegra_xusb_pad_of_xlate()
35 if (!pad->lanes[i]) in tegra_xusb_pad_of_xlate()
38 if (pad->lanes[i]->dev.of_node == args->np) { in tegra_xusb_pad_of_xlate()
39 phy = pad->lanes[i]; in tegra_xusb_pad_of_xlate()
101 tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index) in tegra_xusb_pad_find_phy_node() argument
105 lanes = of_get_child_by_name(pad->dev.of_node, "lanes"); in tegra_xusb_pad_find_phy_node()
109 np = of_get_child_by_name(lanes, pad->soc->lanes[index].name); in tegra_xusb_pad_find_phy_node()
118 struct device *dev = &lane->pad->dev; in tegra_xusb_lane_parse_dt()
143 lane->pad->ops->remove(lane); in tegra_xusb_lane_destroy()
150 struct tegra_xusb_pad *pad = to_tegra_xusb_pad(dev); in tegra_xusb_pad_release() local
152 pad->soc->ops->remove(pad); in tegra_xusb_pad_release()
159 int tegra_xusb_pad_init(struct tegra_xusb_pad *pad, in tegra_xusb_pad_init() argument
165 device_initialize(&pad->dev); in tegra_xusb_pad_init()
166 INIT_LIST_HEAD(&pad->list); in tegra_xusb_pad_init()
167 pad->dev.parent = padctl->dev; in tegra_xusb_pad_init()
168 pad->dev.type = &tegra_xusb_pad_type; in tegra_xusb_pad_init()
169 pad->dev.of_node = np; in tegra_xusb_pad_init()
170 pad->padctl = padctl; in tegra_xusb_pad_init()
172 err = dev_set_name(&pad->dev, "%s", pad->soc->name); in tegra_xusb_pad_init()
176 err = device_add(&pad->dev); in tegra_xusb_pad_init()
183 device_unregister(&pad->dev); in tegra_xusb_pad_init()
187 int tegra_xusb_pad_register(struct tegra_xusb_pad *pad, in tegra_xusb_pad_register() argument
195 children = of_get_child_by_name(pad->dev.of_node, "lanes"); in tegra_xusb_pad_register()
199 pad->lanes = devm_kcalloc(&pad->dev, pad->soc->num_lanes, sizeof(lane), in tegra_xusb_pad_register()
201 if (!pad->lanes) { in tegra_xusb_pad_register()
206 for (i = 0; i < pad->soc->num_lanes; i++) { in tegra_xusb_pad_register()
207 struct device_node *np = tegra_xusb_pad_find_phy_node(pad, i); in tegra_xusb_pad_register()
216 pad->lanes[i] = phy_create(&pad->dev, np, ops); in tegra_xusb_pad_register()
217 if (IS_ERR(pad->lanes[i])) { in tegra_xusb_pad_register()
218 err = PTR_ERR(pad->lanes[i]); in tegra_xusb_pad_register()
223 lane = pad->ops->probe(pad, np, i); in tegra_xusb_pad_register()
225 phy_destroy(pad->lanes[i]); in tegra_xusb_pad_register()
230 list_add_tail(&lane->list, &pad->padctl->lanes); in tegra_xusb_pad_register()
231 phy_set_drvdata(pad->lanes[i], lane); in tegra_xusb_pad_register()
234 pad->provider = of_phy_provider_register_full(&pad->dev, children, in tegra_xusb_pad_register()
236 if (IS_ERR(pad->provider)) { in tegra_xusb_pad_register()
237 err = PTR_ERR(pad->provider); in tegra_xusb_pad_register()
245 tegra_xusb_lane_destroy(pad->lanes[i]); in tegra_xusb_pad_register()
252 void tegra_xusb_pad_unregister(struct tegra_xusb_pad *pad) in tegra_xusb_pad_unregister() argument
254 unsigned int i = pad->soc->num_lanes; in tegra_xusb_pad_unregister()
256 of_phy_provider_unregister(pad->provider); in tegra_xusb_pad_unregister()
259 tegra_xusb_lane_destroy(pad->lanes[i]); in tegra_xusb_pad_unregister()
261 device_unregister(&pad->dev); in tegra_xusb_pad_unregister()
268 struct tegra_xusb_pad *pad; in tegra_xusb_pad_create() local
276 pad = soc->ops->probe(padctl, soc, np); in tegra_xusb_pad_create()
277 if (IS_ERR(pad)) { in tegra_xusb_pad_create()
278 err = PTR_ERR(pad); in tegra_xusb_pad_create()
286 padctl->pcie = pad; in tegra_xusb_pad_create()
289 padctl->sata = pad; in tegra_xusb_pad_create()
292 padctl->usb2 = pad; in tegra_xusb_pad_create()
295 padctl->ulpi = pad; in tegra_xusb_pad_create()
298 padctl->hsic = pad; in tegra_xusb_pad_create()
300 return pad; in tegra_xusb_pad_create()
305 struct tegra_xusb_pad *pad, *tmp; in __tegra_xusb_remove_pads() local
307 list_for_each_entry_safe_reverse(pad, tmp, &padctl->pads, list) { in __tegra_xusb_remove_pads()
308 list_del(&pad->list); in __tegra_xusb_remove_pads()
309 tegra_xusb_pad_unregister(pad); in __tegra_xusb_remove_pads()
322 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra_xusb_lane_program()
330 if (lane->pad->ops->iddq_enable) in tegra_xusb_lane_program()
331 lane->pad->ops->iddq_enable(lane); in tegra_xusb_lane_program()
339 if (lane->pad->ops->iddq_disable) in tegra_xusb_lane_program()
340 lane->pad->ops->iddq_disable(lane); in tegra_xusb_lane_program()
343 static void tegra_xusb_pad_program(struct tegra_xusb_pad *pad) in tegra_xusb_pad_program() argument
347 for (i = 0; i < pad->soc->num_lanes; i++) { in tegra_xusb_pad_program()
350 if (pad->lanes[i]) { in tegra_xusb_pad_program()
351 lane = phy_get_drvdata(pad->lanes[i]); in tegra_xusb_pad_program()
359 struct tegra_xusb_pad *pad; in tegra_xusb_setup_pads() local
368 pad = tegra_xusb_pad_create(padctl, soc); in tegra_xusb_setup_pads()
369 if (IS_ERR(pad)) { in tegra_xusb_setup_pads()
370 err = PTR_ERR(pad); in tegra_xusb_setup_pads()
378 if (!pad) in tegra_xusb_setup_pads()
381 list_add_tail(&pad->list, &padctl->pads); in tegra_xusb_setup_pads()
384 list_for_each_entry(pad, &padctl->pads, list) in tegra_xusb_setup_pads()
385 tegra_xusb_pad_program(pad); in tegra_xusb_setup_pads()
703 port->usb_phy.dev = &lane->pad->lanes[port->index]->dev; in tegra_xusb_setup_usb_role_switch()
1393 if (lane->pad->ops->enable_phy_sleepwalk) in tegra_xusb_padctl_enable_phy_sleepwalk()
1394 return lane->pad->ops->enable_phy_sleepwalk(lane, speed); in tegra_xusb_padctl_enable_phy_sleepwalk()
1404 if (lane->pad->ops->disable_phy_sleepwalk) in tegra_xusb_padctl_disable_phy_sleepwalk()
1405 return lane->pad->ops->disable_phy_sleepwalk(lane); in tegra_xusb_padctl_disable_phy_sleepwalk()
1415 if (lane->pad->ops->enable_phy_wake) in tegra_xusb_padctl_enable_phy_wake()
1416 return lane->pad->ops->enable_phy_wake(lane); in tegra_xusb_padctl_enable_phy_wake()
1426 if (lane->pad->ops->disable_phy_wake) in tegra_xusb_padctl_disable_phy_wake()
1427 return lane->pad->ops->disable_phy_wake(lane); in tegra_xusb_padctl_disable_phy_wake()
1437 if (lane->pad->ops->remote_wake_detected) in tegra_xusb_padctl_remote_wake_detected()
1438 return lane->pad->ops->remote_wake_detected(lane); in tegra_xusb_padctl_remote_wake_detected()
1468 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra_phy_xusb_utmi_port_reset()
1486 padctl = lane->pad->padctl; in tegra_phy_xusb_utmi_pad_power_on()
1502 padctl = lane->pad->padctl; in tegra_phy_xusb_utmi_pad_power_down()