Commit 588c87be authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] s5p-fimc: Add sensor group ids for fimc-is

Add subdev group id definition for FIMC-IS ISP and sensor subdev.
While at it rename all group id definitions to start with GRP_ID.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a2fea0df
...@@ -62,16 +62,17 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p, ...@@ -62,16 +62,17 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
switch (sd->grp_id) { switch (sd->grp_id) {
case SENSOR_GROUP_ID: case GRP_ID_FIMC_IS_SENSOR:
case GRP_ID_SENSOR:
p->subdevs[IDX_SENSOR] = sd; p->subdevs[IDX_SENSOR] = sd;
break; break;
case CSIS_GROUP_ID: case GRP_ID_CSIS:
p->subdevs[IDX_CSIS] = sd; p->subdevs[IDX_CSIS] = sd;
break; break;
case FLITE_GROUP_ID: case GRP_ID_FLITE:
p->subdevs[IDX_FLITE] = sd; p->subdevs[IDX_FLITE] = sd;
break; break;
case FIMC_GROUP_ID: case GRP_ID_FIMC:
/* No need to control FIMC subdev through subdev ops */ /* No need to control FIMC subdev through subdev ops */
break; break;
default: default:
...@@ -269,7 +270,7 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd, ...@@ -269,7 +270,7 @@ static struct v4l2_subdev *fimc_md_register_sensor(struct fimc_md *fmd,
return ERR_PTR(-EPROBE_DEFER); return ERR_PTR(-EPROBE_DEFER);
} }
v4l2_set_subdev_hostdata(sd, s_info); v4l2_set_subdev_hostdata(sd, s_info);
sd->grp_id = SENSOR_GROUP_ID; sd->grp_id = GRP_ID_SENSOR;
v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice %s\n", v4l2_info(&fmd->v4l2_dev, "Registered sensor subdevice %s\n",
s_info->pdata.board_info->type); s_info->pdata.board_info->type);
...@@ -351,7 +352,7 @@ static int fimc_register_callback(struct device *dev, void *p) ...@@ -351,7 +352,7 @@ static int fimc_register_callback(struct device *dev, void *p)
return 0; return 0;
sd = &fimc->vid_cap.subdev; sd = &fimc->vid_cap.subdev;
sd->grp_id = FIMC_GROUP_ID; sd->grp_id = GRP_ID_FIMC;
v4l2_set_subdev_hostdata(sd, (void *)&fimc_pipeline_ops); v4l2_set_subdev_hostdata(sd, (void *)&fimc_pipeline_ops);
ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
...@@ -374,7 +375,7 @@ static int fimc_lite_register_callback(struct device *dev, void *p) ...@@ -374,7 +375,7 @@ static int fimc_lite_register_callback(struct device *dev, void *p)
if (fimc == NULL || fimc->index >= FIMC_LITE_MAX_DEVS) if (fimc == NULL || fimc->index >= FIMC_LITE_MAX_DEVS)
return 0; return 0;
fimc->subdev.grp_id = FLITE_GROUP_ID; fimc->subdev.grp_id = GRP_ID_FLITE;
v4l2_set_subdev_hostdata(&fimc->subdev, (void *)&fimc_pipeline_ops); v4l2_set_subdev_hostdata(&fimc->subdev, (void *)&fimc_pipeline_ops);
ret = v4l2_device_register_subdev(&fmd->v4l2_dev, &fimc->subdev); ret = v4l2_device_register_subdev(&fmd->v4l2_dev, &fimc->subdev);
...@@ -404,7 +405,7 @@ static int csis_register_callback(struct device *dev, void *p) ...@@ -404,7 +405,7 @@ static int csis_register_callback(struct device *dev, void *p)
v4l2_info(sd, "csis%d sd: %s\n", pdev->id, sd->name); v4l2_info(sd, "csis%d sd: %s\n", pdev->id, sd->name);
id = pdev->id < 0 ? 0 : pdev->id; id = pdev->id < 0 ? 0 : pdev->id;
sd->grp_id = CSIS_GROUP_ID; sd->grp_id = GRP_ID_CSIS;
ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd); ret = v4l2_device_register_subdev(&fmd->v4l2_dev, sd);
if (!ret) if (!ret)
...@@ -828,11 +829,11 @@ static int fimc_md_link_notify(struct media_pad *source, ...@@ -828,11 +829,11 @@ static int fimc_md_link_notify(struct media_pad *source,
sd = media_entity_to_v4l2_subdev(sink->entity); sd = media_entity_to_v4l2_subdev(sink->entity);
switch (sd->grp_id) { switch (sd->grp_id) {
case FLITE_GROUP_ID: case GRP_ID_FLITE:
fimc_lite = v4l2_get_subdevdata(sd); fimc_lite = v4l2_get_subdevdata(sd);
pipeline = &fimc_lite->pipeline; pipeline = &fimc_lite->pipeline;
break; break;
case FIMC_GROUP_ID: case GRP_ID_FIMC:
fimc = v4l2_get_subdevdata(sd); fimc = v4l2_get_subdevdata(sd);
pipeline = &fimc->pipeline; pipeline = &fimc->pipeline;
break; break;
......
...@@ -22,11 +22,13 @@ ...@@ -22,11 +22,13 @@
#include "mipi-csis.h" #include "mipi-csis.h"
/* Group IDs of sensor, MIPI-CSIS, FIMC-LITE and the writeback subdevs. */ /* Group IDs of sensor, MIPI-CSIS, FIMC-LITE and the writeback subdevs. */
#define SENSOR_GROUP_ID (1 << 8) #define GRP_ID_SENSOR (1 << 8)
#define CSIS_GROUP_ID (1 << 9) #define GRP_ID_FIMC_IS_SENSOR (1 << 9)
#define WRITEBACK_GROUP_ID (1 << 10) #define GRP_ID_WRITEBACK (1 << 10)
#define FIMC_GROUP_ID (1 << 11) #define GRP_ID_CSIS (1 << 11)
#define FLITE_GROUP_ID (1 << 12) #define GRP_ID_FIMC (1 << 12)
#define GRP_ID_FLITE (1 << 13)
#define GRP_ID_FIMC_IS (1 << 14)
#define FIMC_MAX_SENSORS 8 #define FIMC_MAX_SENSORS 8
#define FIMC_MAX_CAMCLKS 2 #define FIMC_MAX_CAMCLKS 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment