Lines Matching +full:sub +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0
5 * The DP AUX bus is used for devices that are connected over a DisplayPort
6 * AUX bus. The device on the far side of the bus is referred to as an
9 * There is only one device connected to the DP AUX bus: an eDP panel.
11 * platform devices, putting them under the DP AUX bus allows the panel driver
12 * to perform transactions on that bus.
31 * dp_aux_ep_match() - The match function for the dp_aux_bus.
41 return !!of_match_device(drv->of_match_table, dev); in dp_aux_ep_match()
45 * dp_aux_ep_probe() - The probe function for the dp_aux_bus.
54 struct dp_aux_ep_driver *aux_ep_drv = to_dp_aux_ep_drv(dev->driver); in dp_aux_ep_probe()
64 ret = aux_ep_drv->probe(aux_ep); in dp_aux_ep_probe()
68 if (aux_ep_with_data->done_probing) { in dp_aux_ep_probe()
69 ret = aux_ep_with_data->done_probing(aux_ep->aux); in dp_aux_ep_probe()
73 * -EPROBE_DEFER to us. If it does, we treat it as an in dp_aux_ep_probe()
74 * error. Passing it on as-is would cause the _panel_ in dp_aux_ep_probe()
77 if (ret == -EPROBE_DEFER) { in dp_aux_ep_probe()
80 ret = -EINVAL; in dp_aux_ep_probe()
88 if (aux_ep_drv->remove) in dp_aux_ep_probe()
89 aux_ep_drv->remove(aux_ep); in dp_aux_ep_probe()
97 * dp_aux_ep_remove() - The remove function for the dp_aux_bus.
104 struct dp_aux_ep_driver *aux_ep_drv = to_dp_aux_ep_drv(dev->driver); in dp_aux_ep_remove()
107 if (aux_ep_drv->remove) in dp_aux_ep_remove()
108 aux_ep_drv->remove(aux_ep); in dp_aux_ep_remove()
113 * dp_aux_ep_shutdown() - The shutdown function for the dp_aux_bus.
122 if (!dev->driver) in dp_aux_ep_shutdown()
125 aux_ep_drv = to_dp_aux_ep_drv(dev->driver); in dp_aux_ep_shutdown()
126 if (aux_ep_drv->shutdown) in dp_aux_ep_shutdown()
127 aux_ep_drv->shutdown(to_dp_aux_ep_dev(dev)); in dp_aux_ep_shutdown()
131 .name = "dp-aux",
152 * dp_aux_ep_dev_release() - Free memory for the dp_aux_ep device
176 * of_dp_aux_ep_destroy() - Destroy an DP AUX endpoint device
181 * is called for _all_ of the child devices of the device providing the AUX bus.
193 struct device_node *np = dev->of_node; in of_dp_aux_ep_destroy()
195 if (dev->bus != &dp_aux_bus_type) in of_dp_aux_ep_destroy()
210 * of_dp_aux_depopulate_bus() - Undo of_dp_aux_populate_bus
218 device_for_each_child_reverse(aux->dev, NULL, of_dp_aux_ep_destroy); in of_dp_aux_depopulate_bus()
223 * of_dp_aux_populate_bus() - Populate the endpoint device on the DP AUX
228 * function will return -ENODEV.
231 * "aux-bus" node of the device providing the AUX channel (AKA aux->dev).
234 * our sub-device will have finished probing. It should be noted that if our
235 * sub-device returns -EPROBE_DEFER or is probing asynchronously for some
237 * sub-device will _not_ have actually probed successfully yet.
240 * when our sub device finishes probing. Our sub device is expected to be an
244 * will be called when our sub-device finishes probing.
250 * Return: 0 if no error or negative error code; returns -ENODEV if there are
257 struct device_node *bus = NULL, *np = NULL; in of_dp_aux_populate_bus() local
263 WARN_ON_ONCE(!aux->ddc.algo); in of_dp_aux_populate_bus()
265 if (!aux->dev->of_node) in of_dp_aux_populate_bus()
266 return -ENODEV; in of_dp_aux_populate_bus()
267 bus = of_get_child_by_name(aux->dev->of_node, "aux-bus"); in of_dp_aux_populate_bus()
268 if (!bus) in of_dp_aux_populate_bus()
269 return -ENODEV; in of_dp_aux_populate_bus()
271 np = of_get_next_available_child(bus, NULL); in of_dp_aux_populate_bus()
272 of_node_put(bus); in of_dp_aux_populate_bus()
274 return -ENODEV; in of_dp_aux_populate_bus()
277 dev_err(aux->dev, "DP AUX EP device already populated\n"); in of_dp_aux_populate_bus()
278 ret = -EINVAL; in of_dp_aux_populate_bus()
284 ret = -ENOMEM; in of_dp_aux_populate_bus()
288 aux_ep_with_data->done_probing = done_probing; in of_dp_aux_populate_bus()
290 aux_ep = &aux_ep_with_data->aux_ep; in of_dp_aux_populate_bus()
291 aux_ep->aux = aux; in of_dp_aux_populate_bus()
292 aux_ep->dev.parent = aux->dev; in of_dp_aux_populate_bus()
293 aux_ep->dev.bus = &dp_aux_bus_type; in of_dp_aux_populate_bus()
294 aux_ep->dev.type = &dp_aux_device_type_type; in of_dp_aux_populate_bus()
295 aux_ep->dev.of_node = of_node_get(np); in of_dp_aux_populate_bus()
296 dev_set_name(&aux_ep->dev, "aux-%s", dev_name(aux->dev)); in of_dp_aux_populate_bus()
298 ret = device_register(&aux_ep->dev); in of_dp_aux_populate_bus()
300 dev_err(aux->dev, "Failed to create AUX EP for %pOF: %d\n", np, ret); in of_dp_aux_populate_bus()
306 put_device(&aux_ep->dev); in of_dp_aux_populate_bus()
329 * devm_of_dp_aux_populate_bus() - devm wrapper for of_dp_aux_populate_bus()
333 * function will return -ENODEV.
335 * Handles freeing w/ devm on the device "aux->dev".
337 * Return: 0 if no error or negative error code; returns -ENODEV if there are
350 return devm_add_action_or_reset(aux->dev, in devm_of_dp_aux_populate_bus()
357 drv->driver.owner = owner; in __dp_aux_dp_driver_register()
358 drv->driver.bus = &dp_aux_bus_type; in __dp_aux_dp_driver_register()
360 return driver_register(&drv->driver); in __dp_aux_dp_driver_register()
366 driver_unregister(&drv->driver); in dp_aux_dp_driver_unregister()
390 MODULE_DESCRIPTION("DRM DisplayPort AUX bus");