[media] s5p-fimc: Add support for sensors with multiple pads
authorAndrzej Hajda <a.hajda@samsung.com>
Thu, 22 Nov 2012 15:13:27 +0000 (12:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Dec 2012 14:26:55 +0000 (12:26 -0200)
Some sensors can have more than one pad (case of S5C73M3).
In such cases FIMC assumes the last pad of the sensor is
the source pad.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/s5p-fimc/fimc-capture.c
drivers/media/platform/s5p-fimc/fimc-mdevice.c

index 52d8d885d2879a5940cafc54842bd25b0b20086a..50c0da9c788b881cf58afa42d51a4d398f2e495f 100644 (file)
@@ -884,14 +884,16 @@ static int fimc_get_sensor_frame_desc(struct v4l2_subdev *sensor,
 {
        struct v4l2_mbus_frame_desc fd;
        int i, ret;
+       int pad;
 
        for (i = 0; i < num_planes; i++)
                fd.entry[i].length = plane_fmt[i].sizeimage;
 
+       pad = sensor->entity.num_pads - 1;
        if (try)
-               ret = v4l2_subdev_call(sensor, pad, set_frame_desc, 0, &fd);
+               ret = v4l2_subdev_call(sensor, pad, set_frame_desc, pad, &fd);
        else
-               ret = v4l2_subdev_call(sensor, pad, get_frame_desc, 0, &fd);
+               ret = v4l2_subdev_call(sensor, pad, get_frame_desc, pad, &fd);
 
        if (ret < 0)
                return ret;
index d0028740640a5dce6a22a9b9aa7fa1e8dc52cc33..8b43f982c12d512c8fa409d3f9c7ae3dc6eba835 100644 (file)
@@ -659,7 +659,8 @@ static int fimc_md_create_links(struct fimc_md *fmd)
                                 "but s5p-csis module is not loaded!\n"))
                                return -EINVAL;
 
-                       ret = media_entity_create_link(&sensor->entity, 0,
+                       pad = sensor->entity.num_pads - 1;
+                       ret = media_entity_create_link(&sensor->entity, pad,
                                              &csis->entity, CSIS_PAD_SINK,
                                              MEDIA_LNK_FL_IMMUTABLE |
                                              MEDIA_LNK_FL_ENABLED);