From 1305b42c68587e5e96b662bc8694a3f821e51e0d Mon Sep 17 00:00:00 2001 From: Todor Tomov Date: Tue, 25 Jan 2011 17:46:44 +0200 Subject: Add v4l2_subdev_open() and v4l2_subdev_close() to subdev.h Add v4l2_subdev_close() function and declare both in subdev.h. Signed-off-by: Laurent Pinchart Signed-off-by: Todor Tomov --- subdev.c | 7 ++++++- subdev.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/subdev.c b/subdev.c index b324d4e..3a8e82a 100644 --- a/subdev.c +++ b/subdev.c @@ -33,7 +33,7 @@ #include "subdev.h" #include "tools.h" -static int v4l2_subdev_open(struct media_entity *entity) +int v4l2_subdev_open(struct media_entity *entity) { if (entity->fd != -1) return 0; @@ -48,6 +48,11 @@ static int v4l2_subdev_open(struct media_entity *entity) return 0; } +void v4l2_subdev_close(struct media_entity *entity) +{ + close(entity->fd); +} + int v4l2_subdev_get_format(struct media_entity *entity, struct v4l2_mbus_framefmt *format, unsigned int pad, enum v4l2_subdev_format_whence which) diff --git a/subdev.h b/subdev.h index 7c1733d..976d066 100644 --- a/subdev.h +++ b/subdev.h @@ -24,6 +24,9 @@ struct media_entity; +int v4l2_subdev_open(struct media_entity *entity); + +void v4l2_subdev_close(struct media_entity *entity); int v4l2_subdev_get_format(struct media_entity *entity, struct v4l2_mbus_framefmt *format, unsigned int pad, -- cgit v1.2.3