[media] V4L: mt9m001, mt9v022: add a clarifying comment
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Wed, 27 Jul 2011 19:03:33 +0000 (16:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 3 Nov 2011 20:27:47 +0000 (18:27 -0200)
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/mt9m001.c
drivers/media/video/mt9v022.c

index 7618b3c2fce0384cbd1a51039071128a52475f2c..750ce60abac84cae8b55262e3c19e84e19acf73a 100644 (file)
@@ -734,6 +734,12 @@ static int mt9m001_s_mbus_config(struct v4l2_subdev *sd,
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        struct soc_camera_device *icd = client->dev.platform_data;
        struct soc_camera_link *icl = to_soc_camera_link(icd);
+       /*
+        * Cannot use icd->current_fmt->host_fmt->bits_per_sample, because that
+        * is the number of bits, that the host has to sample, not the number of
+        * bits, that we have to send. See mx3_camera.c for an example of 10-bit
+        * formats being truncated to 8 bits by the host.
+        */
        unsigned int bps = soc_mbus_get_fmtdesc(icd->current_fmt->code)->bits_per_sample;
 
        if (icl->set_bus_param)
index 2fc6ca22f31c7b0c80310c35756a696e663585d4..ddc11d0a6254a73e27c7a930778351ac2da5dd33 100644 (file)
@@ -875,6 +875,12 @@ static int mt9v022_s_mbus_config(struct v4l2_subdev *sd,
        struct soc_camera_link *icl = to_soc_camera_link(icd);
        struct mt9v022 *mt9v022 = to_mt9v022(client);
        unsigned long flags = soc_camera_apply_board_flags(icl, cfg);
+       /*
+        * Cannot use icd->current_fmt->host_fmt->bits_per_sample, because that
+        * is the number of bits, that the host has to sample, not the number of
+        * bits, that we have to send. See mx3_camera.c for an example of 10-bit
+        * formats being truncated to 8 bits by the host.
+        */
        unsigned int bps = soc_mbus_get_fmtdesc(icd->current_fmt->code)->bits_per_sample;
        int ret;
        u16 pixclk = 0;