Lines Matching full: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()
95 tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index) in tegra_xusb_pad_find_phy_node() argument
99 lanes = of_get_child_by_name(pad->dev.of_node, "lanes"); in tegra_xusb_pad_find_phy_node()
103 np = of_get_child_by_name(lanes, pad->soc->lanes[index].name); in tegra_xusb_pad_find_phy_node()
112 struct device *dev = &lane->pad->dev; in tegra_xusb_lane_parse_dt()
137 lane->pad->ops->remove(lane); in tegra_xusb_lane_destroy()
144 struct tegra_xusb_pad *pad = to_tegra_xusb_pad(dev); in tegra_xusb_pad_release() local
146 pad->soc->ops->remove(pad); in tegra_xusb_pad_release()
153 int tegra_xusb_pad_init(struct tegra_xusb_pad *pad, in tegra_xusb_pad_init() argument
159 device_initialize(&pad->dev); in tegra_xusb_pad_init()
160 INIT_LIST_HEAD(&pad->list); in tegra_xusb_pad_init()
161 pad->dev.parent = padctl->dev; in tegra_xusb_pad_init()
162 pad->dev.type = &tegra_xusb_pad_type; in tegra_xusb_pad_init()
163 pad->dev.of_node = np; in tegra_xusb_pad_init()
164 pad->padctl = padctl; in tegra_xusb_pad_init()
166 err = dev_set_name(&pad->dev, "%s", pad->soc->name); in tegra_xusb_pad_init()
170 err = device_add(&pad->dev); in tegra_xusb_pad_init()
177 device_unregister(&pad->dev); in tegra_xusb_pad_init()
181 int tegra_xusb_pad_register(struct tegra_xusb_pad *pad, in tegra_xusb_pad_register() argument
189 children = of_get_child_by_name(pad->dev.of_node, "lanes"); in tegra_xusb_pad_register()
193 pad->lanes = devm_kcalloc(&pad->dev, pad->soc->num_lanes, sizeof(lane), in tegra_xusb_pad_register()
195 if (!pad->lanes) { in tegra_xusb_pad_register()
200 for (i = 0; i < pad->soc->num_lanes; i++) { in tegra_xusb_pad_register()
201 struct device_node *np = tegra_xusb_pad_find_phy_node(pad, i); in tegra_xusb_pad_register()
210 pad->lanes[i] = phy_create(&pad->dev, np, ops); in tegra_xusb_pad_register()
211 if (IS_ERR(pad->lanes[i])) { in tegra_xusb_pad_register()
212 err = PTR_ERR(pad->lanes[i]); in tegra_xusb_pad_register()
217 lane = pad->ops->probe(pad, np, i); in tegra_xusb_pad_register()
219 phy_destroy(pad->lanes[i]); in tegra_xusb_pad_register()
224 list_add_tail(&lane->list, &pad->padctl->lanes); in tegra_xusb_pad_register()
225 phy_set_drvdata(pad->lanes[i], lane); in tegra_xusb_pad_register()
228 pad->provider = of_phy_provider_register_full(&pad->dev, children, in tegra_xusb_pad_register()
230 if (IS_ERR(pad->provider)) { in tegra_xusb_pad_register()
231 err = PTR_ERR(pad->provider); in tegra_xusb_pad_register()
239 tegra_xusb_lane_destroy(pad->lanes[i]); in tegra_xusb_pad_register()
246 void tegra_xusb_pad_unregister(struct tegra_xusb_pad *pad) in tegra_xusb_pad_unregister() argument
248 unsigned int i = pad->soc->num_lanes; in tegra_xusb_pad_unregister()
250 of_phy_provider_unregister(pad->provider); in tegra_xusb_pad_unregister()
253 tegra_xusb_lane_destroy(pad->lanes[i]); in tegra_xusb_pad_unregister()
255 device_unregister(&pad->dev); in tegra_xusb_pad_unregister()
262 struct tegra_xusb_pad *pad; in tegra_xusb_pad_create() local
270 pad = soc->ops->probe(padctl, soc, np); in tegra_xusb_pad_create()
271 if (IS_ERR(pad)) { in tegra_xusb_pad_create()
272 err = PTR_ERR(pad); in tegra_xusb_pad_create()
273 dev_err(padctl->dev, "failed to create pad %s: %d\n", in tegra_xusb_pad_create()
280 padctl->pcie = pad; in tegra_xusb_pad_create()
283 padctl->sata = pad; in tegra_xusb_pad_create()
286 padctl->usb2 = pad; in tegra_xusb_pad_create()
289 padctl->ulpi = pad; in tegra_xusb_pad_create()
292 padctl->hsic = pad; in tegra_xusb_pad_create()
294 return pad; in tegra_xusb_pad_create()
299 struct tegra_xusb_pad *pad, *tmp; in __tegra_xusb_remove_pads() local
301 list_for_each_entry_safe_reverse(pad, tmp, &padctl->pads, list) { in __tegra_xusb_remove_pads()
302 list_del(&pad->list); in __tegra_xusb_remove_pads()
303 tegra_xusb_pad_unregister(pad); in __tegra_xusb_remove_pads()
316 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra_xusb_lane_program()
331 static void tegra_xusb_pad_program(struct tegra_xusb_pad *pad) in tegra_xusb_pad_program() argument
335 for (i = 0; i < pad->soc->num_lanes; i++) { in tegra_xusb_pad_program()
338 if (pad->lanes[i]) { in tegra_xusb_pad_program()
339 lane = phy_get_drvdata(pad->lanes[i]); in tegra_xusb_pad_program()
347 struct tegra_xusb_pad *pad; in tegra_xusb_setup_pads() local
356 pad = tegra_xusb_pad_create(padctl, soc); in tegra_xusb_setup_pads()
357 if (IS_ERR(pad)) { in tegra_xusb_setup_pads()
358 err = PTR_ERR(pad); in tegra_xusb_setup_pads()
359 dev_err(padctl->dev, "failed to create pad %s: %d\n", in tegra_xusb_setup_pads()
366 if (!pad) in tegra_xusb_setup_pads()
369 list_add_tail(&pad->list, &padctl->pads); in tegra_xusb_setup_pads()
372 list_for_each_entry(pad, &padctl->pads, list) in tegra_xusb_setup_pads()
373 tegra_xusb_pad_program(pad); in tegra_xusb_setup_pads()
690 port->usb_phy.dev = &lane->pad->lanes[port->index]->dev; in tegra_xusb_setup_usb_role_switch()
1294 * registry of pad controllers, but since there will almost certainly in tegra_xusb_padctl_get()
1366 struct tegra_xusb_padctl *padctl = lane->pad->padctl; in tegra_phy_xusb_utmi_port_reset()
1397 MODULE_DESCRIPTION("Tegra XUSB Pad Controller driver");