Lines Matching defs:pad
27 struct tegra_xusb_pad *pad = dev_get_drvdata(dev);
34 for (i = 0; i < pad->soc->num_lanes; i++) {
35 if (!pad->lanes[i])
38 if (pad->lanes[i]->dev.of_node == args->np) {
39 phy = pad->lanes[i];
113 tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index)
117 lanes = of_get_child_by_name(pad->dev.of_node, "lanes");
121 np = of_get_child_by_name(lanes, pad->soc->lanes[index].name);
130 struct device *dev = &lane->pad->dev;
155 lane->pad->ops->remove(lane);
162 struct tegra_xusb_pad *pad = to_tegra_xusb_pad(dev);
164 pad->soc->ops->remove(pad);
171 int tegra_xusb_pad_init(struct tegra_xusb_pad *pad,
177 device_initialize(&pad->dev);
178 INIT_LIST_HEAD(&pad->list);
179 pad->dev.parent = padctl->dev;
180 pad->dev.type = &tegra_xusb_pad_type;
181 pad->dev.of_node = np;
182 pad->padctl = padctl;
184 err = dev_set_name(&pad->dev, "%s", pad->soc->name);
188 err = device_add(&pad->dev);
195 device_unregister(&pad->dev);
199 int tegra_xusb_pad_register(struct tegra_xusb_pad *pad,
207 children = of_get_child_by_name(pad->dev.of_node, "lanes");
211 pad->lanes = devm_kzalloc_objs(&pad->dev, lane, pad->soc->num_lanes);
212 if (!pad->lanes) {
217 for (i = 0; i < pad->soc->num_lanes; i++) {
218 struct device_node *np = tegra_xusb_pad_find_phy_node(pad, i);
227 pad->lanes[i] = phy_create(&pad->dev, np, ops);
228 if (IS_ERR(pad->lanes[i])) {
229 err = PTR_ERR(pad->lanes[i]);
234 lane = pad->ops->probe(pad, np, i);
236 phy_destroy(pad->lanes[i]);
241 list_add_tail(&lane->list, &pad->padctl->lanes);
242 phy_set_drvdata(pad->lanes[i], lane);
245 pad->provider = of_phy_provider_register_full(&pad->dev, children,
247 if (IS_ERR(pad->provider)) {
248 err = PTR_ERR(pad->provider);
256 tegra_xusb_lane_destroy(pad->lanes[i]);
263 void tegra_xusb_pad_unregister(struct tegra_xusb_pad *pad)
265 unsigned int i = pad->soc->num_lanes;
267 of_phy_provider_unregister(pad->provider);
270 tegra_xusb_lane_destroy(pad->lanes[i]);
272 device_unregister(&pad->dev);
279 struct tegra_xusb_pad *pad;
287 pad = soc->ops->probe(padctl, soc, np);
288 if (IS_ERR(pad)) {
289 err = PTR_ERR(pad);
290 dev_err(padctl->dev, "failed to create pad %s: %d\n",
297 padctl->pcie = pad;
300 padctl->sata = pad;
303 padctl->usb2 = pad;
306 padctl->ulpi = pad;
309 padctl->hsic = pad;
311 return pad;
316 struct tegra_xusb_pad *pad, *tmp;
318 list_for_each_entry_safe_reverse(pad, tmp, &padctl->pads, list) {
319 list_del(&pad->list);
320 tegra_xusb_pad_unregister(pad);
333 struct tegra_xusb_padctl *padctl = lane->pad->padctl;
341 if (lane->pad->ops->iddq_enable)
342 lane->pad->ops->iddq_enable(lane);
350 if (lane->pad->ops->iddq_disable)
351 lane->pad->ops->iddq_disable(lane);
354 static void tegra_xusb_pad_program(struct tegra_xusb_pad *pad)
358 for (i = 0; i < pad->soc->num_lanes; i++) {
361 if (pad->lanes[i]) {
362 lane = phy_get_drvdata(pad->lanes[i]);
370 struct tegra_xusb_pad *pad;
379 pad = tegra_xusb_pad_create(padctl, soc);
380 if (IS_ERR(pad)) {
381 err = PTR_ERR(pad);
382 dev_err(padctl->dev, "failed to create pad %s: %d\n",
389 if (!pad)
392 list_add_tail(&pad->list, &padctl->pads);
395 list_for_each_entry(pad, &padctl->pads, list)
396 tegra_xusb_pad_program(pad);
717 port->usb_phy.dev = &lane->pad->lanes[port->index]->dev;
1348 * registry of pad controllers, but since there will almost certainly
1401 if (lane->pad->ops->enable_phy_sleepwalk)
1402 return lane->pad->ops->enable_phy_sleepwalk(lane, speed);
1412 if (lane->pad->ops->disable_phy_sleepwalk)
1413 return lane->pad->ops->disable_phy_sleepwalk(lane);
1423 if (lane->pad->ops->enable_phy_wake)
1424 return lane->pad->ops->enable_phy_wake(lane);
1434 if (lane->pad->ops->disable_phy_wake)
1435 return lane->pad->ops->disable_phy_wake(lane);
1445 if (lane->pad->ops->remote_wake_detected)
1446 return lane->pad->ops->remote_wake_detected(lane);
1476 struct tegra_xusb_padctl *padctl = lane->pad->padctl;
1494 padctl = lane->pad->padctl;
1510 padctl = lane->pad->padctl;