Lines Matching +full:device +full:- +full:unique
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Media device
19 #include <media/media-devnode.h>
20 #include <media/media-entity.h>
26 * struct media_entity_notify - Media Entity Notify
33 * registered with the media device. This handler is intended for creating
44 * struct media_device_ops - Media device operations
76 * struct media_device - Media device
77 * @dev: Parent device
78 * @devnode: Media device node
79 * @driver_name: Optional device driver name. If not set, calls to
80 * %MEDIA_IOC_DEVICE_INFO will return ``dev->driver->name``.
83 * @model: Device model name
84 * @serial: Device serial number (optional)
85 * @bus_info: Unique and stable device location identifier
86 * @hw_revision: Hardware device revision
89 * @id: Unique ID used on the last registered graph object
90 * @entity_internal_idx: Unique internal entity ID used by the graph traversal
109 * @request_id: Used to generate unique request IDs
111 * This structure represents an abstract high-level media device. It allows easy
112 * access to entities and provides basic media device-level support. The
115 * The parent @dev is a physical device. It must be set before registering the
116 * media device.
119 * be unique.
130 * Use-case: find tuner entity connected to the decoder
146 /* dev->driver_data points to this struct. */
147 struct device *dev;
195 * media_device_init() - Initializes a media device element
199 * This function initializes the media device prior to its registration.
200 * The media device initialization and registration is split in two functions
201 * to avoid race conditions and make the media device available to user-space
204 * So drivers need to first initialize the media device, register any entity
205 * within the media device, create pad to pad links and then finally register
206 * the media device by calling media_device_register() as a final step.
208 * The caller is responsible for initializing the media device before
211 * - dev must point to the parent device
212 * - model must be filled with the device model name
220 * media_device_cleanup() - Cleanups a media device element
230 * __media_device_register() - Registers a media device element
240 * - &media_device.model must be filled with the device model name as a
241 * NUL-terminated UTF-8 string. The device/model revision must not be
246 * - &media_device.serial is a unique serial number stored as a
247 * NUL-terminated ASCII string. The field is big enough to store a GUID
248 * in text form. If the hardware doesn't provide a unique serial number
251 * - &media_device.bus_info represents the location of the device in the
252 * system as a NUL-terminated ASCII string. For PCI/PCIe devices
258 * - &media_device.hw_revision is the hardware device revision in a
259 * driver-specific format. When possible the revision should be formatted
264 …* #) Upon successful registration a character device named media[0-9]+ is created. The device m…
266 * #) Unregistering a media device that hasn't been registered is **NOT** safe.
275 * media_device_register() - Registers a media device element
285 * media_device_unregister() - Unregisters a media device element
290 * media device.
295 * media_device_register_entity() - registers a media entity inside a
296 * previously registered media device.
301 * Entities are identified by a unique positive integer ID. The media
309 * calling media_device_register_entity(). Entities embedded in higher-level
310 * standard structures can have some of those fields set by the higher-level
313 * If the device has pads, media_entity_pads_init() should be called before
334 * media_device_unregister_entity() - unregisters a media entity.
344 * When a media device is unregistered, all its entities are unregistered
355 * media_device_register_entity_notify() - Registers a media entity_notify
358 * @mdev: The media device
371 * media_device_unregister_entity_notify() - Unregister a media entity notify
374 * @mdev: The media device
383 list_for_each_entry(entity, &(mdev)->entities, graph_obj.list)
387 list_for_each_entry(intf, &(mdev)->interfaces, graph_obj.list)
391 list_for_each_entry(pad, &(mdev)->pads, graph_obj.list)
395 list_for_each_entry(link, &(mdev)->links, graph_obj.list)
398 * media_device_pci_init() - create and initialize a
399 * struct &media_device from a PCI device.
403 * @name: media device name. If %NULL, the routine will use the default
404 * name for the pci device, given by pci_name() macro.
410 * __media_device_usb_init() - create and initialize a
411 * struct &media_device from a PCI device.
415 * @board_name: media device name. If %NULL, the routine will use the usb
418 * given by ``udev->dev->driver->name``, with is usually the wrong
480 * media_device_usb_init() - create and initialize a
481 * struct &media_device from a PCI device.
485 * @name: media device name. If %NULL, the routine will use the usb
496 * media_set_bus_info() - Set bus_info field
500 * @dev: Related struct device
503 * platform devices. dev is required to be non-NULL for this to happen.
508 media_set_bus_info(char *bus_info, size_t bus_info_size, struct device *dev) in media_set_bus_info()