aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-async.c
AgeCommit message (Collapse)AuthorFilesLines
2015-06-15v4l: async: Add a pointer to of_node to struct v4l2_subdev, match itSakari Ailus1-12/+27
V4L2 async sub-devices are currently matched (OF case) based on the struct device_node pointer in struct device. LED devices may have more than one LED, and in that case the OF node to match is not directly the device's node, but a LED's node. Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Bryan Wu <[email protected]>
2013-11-08[media] v4l2-async: Don't use dynamic static allocationMauro Carvalho Chehab1-3/+27
Dynamic static allocation is evil, as Kernel stack is too low, and compilation complains about it on some archs: drivers/media/v4l2-core/v4l2-async.c:238:1: warning: 'v4l2_async_notifier_unregister' uses dynamic stack allocation [enabled by default] Instead, let's enforce a limit for the buffer. In this specific case, there's a hard limit imposed by V4L2_MAX_SUBDEVS, with is currently 128. That means that the buffer size can be up to 128x8 = 1024 bytes (on a 64bits kernel), with is too big for stack. Worse than that, someone could increase it and cause real troubles. So, let's use dynamically allocated data, instead. Signed-off-by: Mauro Carvalho Chehab <[email protected]> Reviewed-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-08-18[media] v4l2-async: Use proper list head for iteration over registered subdevsSylwester Nawrocki1-1/+1
This fixes regression introduced in commit b426b3a660c85faf6e1ca1c92c6d [media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-08-18[media] v4l: async: Make it safe to unregister unregistered notifierLaurent Pinchart1-0/+6
Calling v4l2_async_notifier_unregister() on a notifier that hasn't been registered leads to a crash. To simplify drivers, make it safe to unregister a notifier that has not been registered. Signed-off-by: Laurent Pinchart <[email protected]> Tested-by: Sylwester Nawrocki <[email protected]> Acked-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-07-30[media] V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdevSylwester Nawrocki1-38/+29
By integrating the v4l2-async API internals a bit more with the core overall the v4l2-async code becomes a bit simpler and easier to follow. Acked-and-tested-by: Lad, Prabhakar <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-07-30[media] V4L: Rename subdev field of struct v4l2_async_notifierSylwester Nawrocki1-1/+1
This is a purely cosmetic change. Since the 'subdev' member points to an array of subdevs make it more explicit by renaming to the plural form. Acked-and-tested-by: Lad, Prabhakar <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-07-30[media] V4L: Add V4L2_ASYNC_MATCH_OF subdev matching typeSylwester Nawrocki1-0/+9
Add support for matching by device_node pointer. This allows the notifier user to simply pass a list of device_node pointers corresponding to sub-devices. Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Lad, Prabhakar <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-07-30[media] V4L: Rename v4l2_async_bus_* to v4l2_async_match_*Sylwester Nawrocki1-13/+13
enum v4l2_async_bus_type also selects a method subdevs are matched in the notification handlers, rename it to v4l2_async_match_type so V4L2_ASYNC_MATCH_OF entry can be further added for matching by device tree node pointer. Acked-and-tested-by: Lad, Prabhakar <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-07-30[media] V4L: Drop bus_type check in v4l2-async match functionsSylwester Nawrocki1-3/+1
These match_* functions are internal callbacks and are always invoked only after checking asd->bus_type. So drop redundant checks in match_i2c() and match_platform() functions. Acked-and-tested-by: Lad, Prabhakar <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-06-28[media] V4L2: fix compilation if CONFIG_I2C is undefinedGuennadi Liakhovetski1-0/+4
i2c_verify_client() is only available, if I2C is enabled. Fix v4l2-async.c compilation if I2C is disabled. Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2013-06-21[media] V4L2: support asynchronous subdevice registrationGuennadi Liakhovetski1-0/+280
Currently bridge device drivers register devices for all subdevices synchronously, typically, during their probing. E.g. if an I2C CMOS sensor is attached to a video bridge device, the bridge driver will create an I2C device and wait for the respective I2C driver to probe. This makes linking of devices straight forward, but this approach cannot be used with intrinsically asynchronous and unordered device registration systems like the Flattened Device Tree. To support such systems this patch adds an asynchronous subdevice registration framework to V4L2. To use it respective (e.g. I2C) subdevice drivers must register themselves with the framework. A bridge driver on the other hand must register notification callbacks, that will be called upon various related events. Signed-off-by: Guennadi Liakhovetski <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Laurent Pinchart <[email protected]> Tested-by: Lad, Prabhakar <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>