Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271782
b: refs/heads/master
c: d09a7dc
h: refs/heads/master
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Sep 6, 2011
1 parent fe82f19 commit 46b0da0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 131b6c619758ed8fd16d26b06a423801a497b867
refs/heads/master: d09a7dc887275564ea226b3b089b51c2c8b07bee
32 changes: 32 additions & 0 deletions trunk/drivers/media/video/s5p-fimc/fimc-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,37 @@ static const struct v4l2_ioctl_ops fimc_capture_ioctl_ops = {
.vidioc_g_input = fimc_cap_g_input,
};

/* Media operations */
static int fimc_link_setup(struct media_entity *entity,
const struct media_pad *local,
const struct media_pad *remote, u32 flags)
{
struct video_device *vd = media_entity_to_video_device(entity);
struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(remote->entity);
struct fimc_dev *fimc = video_get_drvdata(vd);

if (WARN_ON(fimc == NULL))
return 0;

dbg("%s --> %s, flags: 0x%x. input: 0x%x",
local->entity->name, remote->entity->name, flags,
fimc->vid_cap.input);

if (flags & MEDIA_LNK_FL_ENABLED) {
if (fimc->vid_cap.input != 0)
return -EBUSY;
fimc->vid_cap.input = sd->grp_id;
return 0;
}

fimc->vid_cap.input = 0;
return 0;
}

static const struct media_entity_operations fimc_media_ops = {
.link_setup = fimc_link_setup,
};

/* fimc->lock must be already initialized */
int fimc_register_capture_device(struct fimc_dev *fimc,
struct v4l2_device *v4l2_dev)
Expand Down Expand Up @@ -743,6 +774,7 @@ int fimc_register_capture_device(struct fimc_dev *fimc,
if (ret)
goto err_ent;

vfd->entity.ops = &fimc_media_ops;
vfd->ctrl_handler = &ctx->ctrl_handler;
return 0;

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/media/video/s5p-fimc/fimc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ struct fimc_m2m_device {
* @reqbufs_count: the number of buffers requested in REQBUFS ioctl
* @input_index: input (camera sensor) index
* @refcnt: driver's private reference counter
* @input: capture input type, grp_id of the attached subdev
* @user_subdev_api: true if subdevs are not configured by the host driver
*/
struct fimc_vid_cap {
Expand All @@ -323,6 +324,7 @@ struct fimc_vid_cap {
unsigned int reqbufs_count;
int input_index;
int refcnt;
u32 input;
bool user_subdev_api;
};

Expand Down

0 comments on commit 46b0da0

Please sign in to comment.