[media] saa7164: Implement resolution control firmware command
authorSteven Toth <stoth@kernellabs.com>
Sat, 31 Jul 2010 18:28:18 +0000 (15:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 09:54:57 +0000 (07:54 -0200)
.. also fix a minor line 80 wrapping coding style issue.

Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7164/saa7164-api.c
drivers/media/video/saa7164/saa7164-core.c
drivers/media/video/saa7164/saa7164-reg.h

index 5630a5d408966c318cda5e0736189a3ed029e98f..9fd39326b85ab528f5909b35e8e8692f47151dfb 100644 (file)
@@ -63,6 +63,12 @@ int saa7164_api_set_encoder(struct saa7164_port *port)
        if (ret != SAA_OK)
                printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
 
+       /* Resolution */
+       ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR,
+               EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile);
+       if (ret != SAA_OK)
+               printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
+
        /* Establish video bitrates */
        if (port->encoder_params.bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)
                vb.ucVideoBitRateMode = EU_VIDEO_BIT_RATE_MODE_CONSTANT;
@@ -110,6 +116,11 @@ int saa7164_api_get_encoder(struct saa7164_port *port)
        if (ret != SAA_OK)
                printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
 
+       ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR,
+               EU_VIDEO_RESOLUTION_CONTROL, sizeof(u8), &port->video_resolution);
+       if (ret != SAA_OK)
+               printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
+
        ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR,
                EU_VIDEO_FORMAT_CONTROL, sizeof(u8), &port->video_format);
        if (ret != SAA_OK)
index fd15bf388e3b451b73c284c5613118d143430041..ad619b325e96c763966dafa04271e55d691c946b 100644 (file)
@@ -339,7 +339,8 @@ static void saa7164_work_enchandler(struct work_struct *w)
 
                                if (buf->actual_size <= ubuf->actual_size) {
 
-                                       memcpy_fromio(ubuf->data, buf->cpu, ubuf->actual_size);
+                                       memcpy_fromio(ubuf->data, port->shadow_buf[rp],
+                                               ubuf->actual_size);
 
                                        /* Throw a new checksum on the read buffer */
                                        ubuf->crc = crc32(0, ubuf->data, ubuf->actual_size);
index ad60534463e957a49db21ac20b5333b5f29745bf..33da55c21c91abe826fec95a91aae3b9b8635270 100644 (file)
 #define EU_PROFILE_CONTROL             0x00
 #define EU_VIDEO_FORMAT_CONTROL                0x01
 #define EU_VIDEO_BIT_RATE_CONTROL      0x02
+#define EU_VIDEO_RESOLUTION_CONTROL    0x03
 #define EU_VIDEO_GOP_STRUCTURE_CONTROL 0x04
 #define EU_VIDEO_INPUT_ASPECT_CONTROL  0x0A
 #define EU_AUDIO_FORMAT_CONTROL                0x0C