diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-04-20 18:57:25 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-20 09:17:11 -0300 |
commit | 693f5c40825e91632478624bf0366e6ebf862a25 (patch) | |
tree | 3c948517fbdbffdde66c2b076a187aa31ca07100 /drivers/media/video/s5p-fimc/fimc-m2m.c | |
parent | [media] s5p-fimc: Move m2m node driver into separate file (diff) | |
download | linux-dev-693f5c40825e91632478624bf0366e6ebf862a25.tar.xz linux-dev-693f5c40825e91632478624bf0366e6ebf862a25.zip |
[media] s5p-fimc: Use v4l2_subdev internal ops to register video nodes
In order to be able to select only FIMC-LITE support, which is added
with subsequent patches, the regular FIMC support is now contained
only in fimc-core.c, fimc-m2m.c and fimc-capture.c files. The graph
and pipeline management is now solely handled in fimc-mdevice.[ch].
This means the FIMC driver can now be excluded with Kconfig option,
leaving only FIMC-LITE and allowing this driver to be reused in SoCs
that have only FIMC-LITE and no regular FIMC IP.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-m2m.c')
-rw-r--r-- | drivers/media/video/s5p-fimc/fimc-m2m.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-m2m.c b/drivers/media/video/s5p-fimc/fimc-m2m.c index 9935cc4bd0cb..92b6059b25bf 100644 --- a/drivers/media/video/s5p-fimc/fimc-m2m.c +++ b/drivers/media/video/s5p-fimc/fimc-m2m.c @@ -776,7 +776,7 @@ int fimc_register_m2m_device(struct fimc_dev *fimc, This driver needs auditing so that this flag can be removed. */ set_bit(V4L2_FL_LOCK_ALL_FOPS, &vfd->flags); - snprintf(vfd->name, sizeof(vfd->name), "%s.m2m", dev_name(&pdev->dev)); + snprintf(vfd->name, sizeof(vfd->name), "fimc.%d.m2m", fimc->id); video_set_drvdata(vfd, fimc); fimc->m2m.vfd = vfd; @@ -788,9 +788,20 @@ int fimc_register_m2m_device(struct fimc_dev *fimc, } ret = media_entity_init(&vfd->entity, 0, NULL, 0); - if (!ret) - return 0; + if (ret) + goto err_me; + + ret = video_register_device(vfd, VFL_TYPE_GRABBER, -1); + if (ret) + goto err_vd; + + v4l2_info(v4l2_dev, "Registered %s as /dev/%s\n", + vfd->name, video_device_node_name(vfd)); + return 0; +err_vd: + media_entity_cleanup(&vfd->entity); +err_me: v4l2_m2m_release(fimc->m2m.m2m_dev); err_init: video_device_release(fimc->m2m.vfd); |