diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-03-21 13:49:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-04 19:17:27 -0400 |
commit | e781bbe3fecf05ab8f3c05fd0b693bebb5e489d5 (patch) | |
tree | 5a1736f544f0f0b140c486de12795b23151f5f83 /drivers/media/platform/exynos4-is/media-dev.c | |
parent | 0580abc2b5d04fca31578c7a9cc4adc0ed3677ac (diff) |
[media] exynos4-is: Add fimc-is subdevs registration
This patch adds support for registration of the FIMC-IS device
represented by the FIMC-IS-ISP subdev to the top level media device
driver. The FIMC-IS subsystem is available on Exynos4x12 SoCs which
support only device tree based booting.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@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/platform/exynos4-is/media-dev.c')
-rw-r--r-- | drivers/media/platform/exynos4-is/media-dev.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index a0fd8cce18df..597648e2bd76 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c | |||
@@ -32,6 +32,7 @@ | |||
32 | 32 | ||
33 | #include "media-dev.h" | 33 | #include "media-dev.h" |
34 | #include "fimc-core.h" | 34 | #include "fimc-core.h" |
35 | #include "fimc-is.h" | ||
35 | #include "fimc-lite.h" | 36 | #include "fimc-lite.h" |
36 | #include "mipi-csis.h" | 37 | #include "mipi-csis.h" |
37 | 38 | ||
@@ -85,9 +86,11 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p, | |||
85 | case GRP_ID_FIMC: | 86 | case GRP_ID_FIMC: |
86 | /* No need to control FIMC subdev through subdev ops */ | 87 | /* No need to control FIMC subdev through subdev ops */ |
87 | break; | 88 | break; |
89 | case GRP_ID_FIMC_IS: | ||
90 | p->subdevs[IDX_IS_ISP] = sd; | ||
91 | break; | ||
88 | default: | 92 | default: |
89 | pr_warn("%s: Unknown subdev grp_id: %#x\n", | 93 | break; |
90 | __func__, sd->grp_id); | ||
91 | } | 94 | } |
92 | me = &sd->entity; | 95 | me = &sd->entity; |
93 | if (me->num_pads == 1) | 96 | if (me->num_pads == 1) |
@@ -322,6 +325,7 @@ static void fimc_md_unregister_sensor(struct v4l2_subdev *sd) | |||
322 | 325 | ||
323 | if (!client) | 326 | if (!client) |
324 | return; | 327 | return; |
328 | |||
325 | v4l2_device_unregister_subdev(sd); | 329 | v4l2_device_unregister_subdev(sd); |
326 | 330 | ||
327 | if (!client->dev.of_node) { | 331 | if (!client->dev.of_node) { |
@@ -372,7 +376,11 @@ static int fimc_md_of_add_sensor(struct fimc_md *fmd, | |||
372 | goto mod_put; | 376 | goto mod_put; |
373 | 377 | ||
374 | v4l2_set_subdev_hostdata(sd, si); | 378 | v4l2_set_subdev_hostdata(sd, si); |
375 | sd->grp_id = GRP_ID_SENSOR; | 379 | if (si->pdata.fimc_bus_type == FIMC_BUS_TYPE_ISP_WRITEBACK) |
380 | sd->grp_id = GRP_ID_FIMC_IS_SENSOR; | ||
381 | else | ||
382 | sd->grp_id = GRP_ID_SENSOR; | ||
383 | |||
376 | si->subdev = sd; | 384 | si->subdev = sd; |
377 | v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice: %s (%d)\n", | 385 | v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice: %s (%d)\n", |
378 | sd->name, fmd->num_sensors); | 386 | sd->name, fmd->num_sensors); |
@@ -652,6 +660,22 @@ static int register_csis_entity(struct fimc_md *fmd, | |||
652 | return ret; | 660 | return ret; |
653 | } | 661 | } |
654 | 662 | ||
663 | static int register_fimc_is_entity(struct fimc_md *fmd, struct fimc_is *is) | ||
664 | { | ||
665 | struct v4l2_subdev *sd = &is->isp.subdev; | ||
666 | int ret; | ||
667 | |||
668 | ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); | ||
669 | if (ret) { | ||
670 | v4l2_err(&fmd->v4l2_dev, | ||
671 | "Failed to register FIMC-ISP (%d)\n", ret); | ||
672 | return ret; | ||
673 | } | ||
674 | |||
675 | fmd->fimc_is = is; | ||
676 | return 0; | ||
677 | } | ||
678 | |||
655 | static int fimc_md_register_platform_entity(struct fimc_md *fmd, | 679 | static int fimc_md_register_platform_entity(struct fimc_md *fmd, |
656 | struct platform_device *pdev, | 680 | struct platform_device *pdev, |
657 | int plat_entity) | 681 | int plat_entity) |
@@ -679,6 +703,9 @@ static int fimc_md_register_platform_entity(struct fimc_md *fmd, | |||
679 | case IDX_CSIS: | 703 | case IDX_CSIS: |
680 | ret = register_csis_entity(fmd, pdev, drvdata); | 704 | ret = register_csis_entity(fmd, pdev, drvdata); |
681 | break; | 705 | break; |
706 | case IDX_IS_ISP: | ||
707 | ret = register_fimc_is_entity(fmd, drvdata); | ||
708 | break; | ||
682 | default: | 709 | default: |
683 | ret = -ENODEV; | 710 | ret = -ENODEV; |
684 | } | 711 | } |
@@ -742,6 +769,8 @@ static int fimc_md_register_of_platform_entities(struct fimc_md *fmd, | |||
742 | /* If driver of any entity isn't ready try all again later. */ | 769 | /* If driver of any entity isn't ready try all again later. */ |
743 | if (!strcmp(node->name, CSIS_OF_NODE_NAME)) | 770 | if (!strcmp(node->name, CSIS_OF_NODE_NAME)) |
744 | plat_entity = IDX_CSIS; | 771 | plat_entity = IDX_CSIS; |
772 | else if (!strcmp(node->name, FIMC_IS_OF_NODE_NAME)) | ||
773 | plat_entity = IDX_IS_ISP; | ||
745 | else if (!strcmp(node->name, FIMC_LITE_OF_NODE_NAME)) | 774 | else if (!strcmp(node->name, FIMC_LITE_OF_NODE_NAME)) |
746 | plat_entity = IDX_FLITE; | 775 | plat_entity = IDX_FLITE; |
747 | else if (!strcmp(node->name, FIMC_OF_NODE_NAME) && | 776 | else if (!strcmp(node->name, FIMC_OF_NODE_NAME) && |
@@ -1308,6 +1337,8 @@ static int fimc_md_probe(struct platform_device *pdev) | |||
1308 | v4l2_dev->notify = fimc_sensor_notify; | 1337 | v4l2_dev->notify = fimc_sensor_notify; |
1309 | strlcpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name)); | 1338 | strlcpy(v4l2_dev->name, "s5p-fimc-md", sizeof(v4l2_dev->name)); |
1310 | 1339 | ||
1340 | fmd->use_isp = fimc_md_is_isp_available(dev->of_node); | ||
1341 | |||
1311 | ret = v4l2_device_register(dev, &fmd->v4l2_dev); | 1342 | ret = v4l2_device_register(dev, &fmd->v4l2_dev); |
1312 | if (ret < 0) { | 1343 | if (ret < 0) { |
1313 | v4l2_err(v4l2_dev, "Failed to register v4l2_device: %d\n", ret); | 1344 | v4l2_err(v4l2_dev, "Failed to register v4l2_device: %d\n", ret); |