OSDN Git Service

media: subdev: add active state to struct v4l2_subdev
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tue, 12 Apr 2022 09:42:43 +0000 (10:42 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:17:24 +0000 (08:17 +0100)
commitf69952a4dc1ef13b69497408fedbd12c7ceb294d
tree88ec3dbd63f2e26353c655a917d26f7ad561507c
parent40aaab9d773b07e9b106eac4256bb50fb1ba8cff
media: subdev: add active state to struct v4l2_subdev

Add a new 'active_state' field to struct v4l2_subdev to which we can
store the active state of a subdev. This will place the subdev
configuration into a known place, allowing us to use the state directly
from the v4l2 framework, thus simplifying the drivers.

Also add functions v4l2_subdev_init_finalize() and
v4l2_subdev_cleanup(), which will allocate and free the active state.
The functions are named in a generic way so that they can be also used
for other subdev initialization work.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h