aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-07-31 14:28:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:54:57 -0400
commitf6eeece8ec2a323f004265527282f443e083d25a (patch)
treea9a4cfef78be1c2bdd725164db7b6acdda505f8c
parenta97781ac918073117bb8e63619c77e0380bbcc8d (diff)
[media] saa7164: Implement resolution control firmware command
.. 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>
-rw-r--r--drivers/media/video/saa7164/saa7164-api.c11
-rw-r--r--drivers/media/video/saa7164/saa7164-core.c3
-rw-r--r--drivers/media/video/saa7164/saa7164-reg.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c
index 5630a5d40896..9fd39326b85a 100644
--- a/drivers/media/video/saa7164/saa7164-api.c
+++ b/drivers/media/video/saa7164/saa7164-api.c
@@ -63,6 +63,12 @@ int saa7164_api_set_encoder(struct saa7164_port *port)
63 if (ret != SAA_OK) 63 if (ret != SAA_OK)
64 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 64 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
65 65
66 /* Resolution */
67 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR,
68 EU_PROFILE_CONTROL, sizeof(u8), &port->encoder_profile);
69 if (ret != SAA_OK)
70 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
71
66 /* Establish video bitrates */ 72 /* Establish video bitrates */
67 if (port->encoder_params.bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) 73 if (port->encoder_params.bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)
68 vb.ucVideoBitRateMode = EU_VIDEO_BIT_RATE_MODE_CONSTANT; 74 vb.ucVideoBitRateMode = EU_VIDEO_BIT_RATE_MODE_CONSTANT;
@@ -111,6 +117,11 @@ int saa7164_api_get_encoder(struct saa7164_port *port)
111 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 117 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
112 118
113 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR, 119 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR,
120 EU_VIDEO_RESOLUTION_CONTROL, sizeof(u8), &port->video_resolution);
121 if (ret != SAA_OK)
122 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
123
124 ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, GET_CUR,
114 EU_VIDEO_FORMAT_CONTROL, sizeof(u8), &port->video_format); 125 EU_VIDEO_FORMAT_CONTROL, sizeof(u8), &port->video_format);
115 if (ret != SAA_OK) 126 if (ret != SAA_OK)
116 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret); 127 printk(KERN_ERR "%s() error, ret = 0x%x\n", __func__, ret);
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c
index fd15bf388e3b..ad619b325e96 100644
--- a/drivers/media/video/saa7164/saa7164-core.c
+++ b/drivers/media/video/saa7164/saa7164-core.c
@@ -339,7 +339,8 @@ static void saa7164_work_enchandler(struct work_struct *w)
339 339
340 if (buf->actual_size <= ubuf->actual_size) { 340 if (buf->actual_size <= ubuf->actual_size) {
341 341
342 memcpy_fromio(ubuf->data, buf->cpu, ubuf->actual_size); 342 memcpy_fromio(ubuf->data, port->shadow_buf[rp],
343 ubuf->actual_size);
343 344
344 /* Throw a new checksum on the read buffer */ 345 /* Throw a new checksum on the read buffer */
345 ubuf->crc = crc32(0, ubuf->data, ubuf->actual_size); 346 ubuf->crc = crc32(0, ubuf->data, ubuf->actual_size);
diff --git a/drivers/media/video/saa7164/saa7164-reg.h b/drivers/media/video/saa7164/saa7164-reg.h
index ad60534463e9..33da55c21c91 100644
--- a/drivers/media/video/saa7164/saa7164-reg.h
+++ b/drivers/media/video/saa7164/saa7164-reg.h
@@ -205,6 +205,7 @@
205#define EU_PROFILE_CONTROL 0x00 205#define EU_PROFILE_CONTROL 0x00
206#define EU_VIDEO_FORMAT_CONTROL 0x01 206#define EU_VIDEO_FORMAT_CONTROL 0x01
207#define EU_VIDEO_BIT_RATE_CONTROL 0x02 207#define EU_VIDEO_BIT_RATE_CONTROL 0x02
208#define EU_VIDEO_RESOLUTION_CONTROL 0x03
208#define EU_VIDEO_GOP_STRUCTURE_CONTROL 0x04 209#define EU_VIDEO_GOP_STRUCTURE_CONTROL 0x04
209#define EU_VIDEO_INPUT_ASPECT_CONTROL 0x0A 210#define EU_VIDEO_INPUT_ASPECT_CONTROL 0x0A
210#define EU_AUDIO_FORMAT_CONTROL 0x0C 211#define EU_AUDIO_FORMAT_CONTROL 0x0C