aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-07-30 16:24:55 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:04:52 -0400
commit692d5522646fdf432329efbe5092dc9c5ca83e85 (patch)
treeb68da8aa39f3acd1098ed6c7129e6ccebcf44cb0 /include
parentc4ce6d14b92aa1772c9d84d068d1b45114fe73cc (diff)
V4L/DVB: v4l: Add a v4l2_subdev host private data field
The existing priv field stores subdev private data owned by the subdev driver. Host (bridge) drivers might need to store per-subdev host-specific data, such as a pointer to platform data. Add a v4l2_subdev host_priv field to store host-specific data, and rename the existing priv field to dev_priv. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-subdev.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 905879d7742f..b0316a7cf08d 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -438,17 +438,28 @@ struct v4l2_subdev {
438 /* can be used to group similar subdevs, value is driver-specific */ 438 /* can be used to group similar subdevs, value is driver-specific */
439 u32 grp_id; 439 u32 grp_id;
440 /* pointer to private data */ 440 /* pointer to private data */
441 void *priv; 441 void *dev_priv;
442 void *host_priv;
442}; 443};
443 444
444static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) 445static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p)
445{ 446{
446 sd->priv = p; 447 sd->dev_priv = p;
447} 448}
448 449
449static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) 450static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd)
450{ 451{
451 return sd->priv; 452 return sd->dev_priv;
453}
454
455static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p)
456{
457 sd->host_priv = p;
458}
459
460static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd)
461{
462 return sd->host_priv;
452} 463}
453 464
454static inline void v4l2_subdev_init(struct v4l2_subdev *sd, 465static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
@@ -462,7 +473,8 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
462 sd->flags = 0; 473 sd->flags = 0;
463 sd->name[0] = '\0'; 474 sd->name[0] = '\0';
464 sd->grp_id = 0; 475 sd->grp_id = 0;
465 sd->priv = NULL; 476 sd->dev_priv = NULL;
477 sd->host_priv = NULL;
466} 478}
467 479
468/* Call an ops of a v4l2_subdev, doing the right checks against 480/* Call an ops of a v4l2_subdev, doing the right checks against