media: v4l: fwnode: Add convenience function for parsing common external refs

Add v4l2_fwnode_parse_reference_sensor_common for parsing common
sensor properties that refer to adjacent devices such as flash or lens
driver chips.

As this is an association only, there's little a regular driver needs to
know about these devices as such.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Sakari Ailus
2017-09-06 08:35:42 -04:00
committed by Mauro Carvalho Chehab
parent a1699a4e52
commit 7a9ec808ad
3 changed files with 58 additions and 1 deletions

View File

@@ -319,4 +319,25 @@ int v4l2_async_notifier_parse_fwnode_endpoints_by_port(
struct v4l2_fwnode_endpoint *vep,
struct v4l2_async_subdev *asd));
/**
* v4l2_fwnode_reference_parse_sensor_common - parse common references on
* sensors for async sub-devices
* @dev: the device node the properties of which are parsed for references
* @notifier: the async notifier where the async subdevs will be added
*
* Parse common sensor properties for remote devices related to the
* sensor and set up async sub-devices for them.
*
* Any notifier populated using this function must be released with a call to
* v4l2_async_notifier_release() after it has been unregistered and the async
* sub-devices are no longer in use, even in the case the function returned an
* error.
*
* Return: 0 on success
* -ENOMEM if memory allocation failed
* -EINVAL if property parsing failed
*/
int v4l2_async_notifier_parse_fwnode_sensor_common(
struct device *dev, struct v4l2_async_notifier *notifier);
#endif /* _V4L2_FWNODE_H */