aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
commitcf2fa66055d718ae13e62451bb546505f63906a2 (patch)
treee206d3f04e74a34e9aa88d21af6c26eea21d4121 /drivers/media/video/saa7115.c
parent4501a466f28788485604ee42641d7a5fe7258d16 (diff)
parent57f51dbc45f65f7ee1e8c8f77200bb8000e3e271 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (313 commits) V4L/DVB (9186): Added support for Prof 7300 DVB-S/S2 cards V4L/DVB (9185): S2API: Ensure we have a reasonable ROLLOFF default V4L/DVB (9184): cx24116: Change the default SNR units back to percentage by default. V4L/DVB (9183): S2API: Return error of the caller provides 0 commands. V4L/DVB (9182): S2API: Added support for DTV_HIERARCHY V4L/DVB (9181): S2API: Add support fot DTV_GUARD_INTERVAL and DTV_TRANSMISSION_MODE V4L/DVB (9180): S2API: Added support for DTV_CODE_RATE_HP/LP V4L/DVB (9179): S2API: frontend.h cleanup V4L/DVB (9178): cx24116: Add module parameter to return SNR as ESNO. V4L/DVB (9177): S2API: Change _8PSK / _16APSK to PSK_8 and APSK_16 V4L/DVB (9176): Add support for DvbWorld USB cards with STV0288 demodulator. V4L/DVB (9175): Remove NULL pointer in stb6000 driver. V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator. V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation V4L/DVB (9172): S2API: Bugfix related to DVB-S / DVB-S2 tuning for the legacy API. V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API. V4L/DVB (9170): cx24116: Sanity checking to data input via S2API to the cx24116 demod. V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams. V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote V4L/DVB: v4l2-dev: remove duplicated #include ...
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index ad733caec720..c8e9cb3db30a 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1057,7 +1057,7 @@ static void saa711x_set_lcr(struct i2c_client *client, struct v4l2_sliced_vbi_fo
1057 for (i = 0; i <= 23; i++) 1057 for (i = 0; i <= 23; i++)
1058 lcr[i] = 0xff; 1058 lcr[i] = 0xff;
1059 1059
1060 if (fmt->service_set == 0) { 1060 if (fmt == NULL) {
1061 /* raw VBI */ 1061 /* raw VBI */
1062 if (is_50hz) 1062 if (is_50hz)
1063 for (i = 6; i <= 23; i++) 1063 for (i = 6; i <= 23; i++)
@@ -1113,7 +1113,7 @@ static void saa711x_set_lcr(struct i2c_client *client, struct v4l2_sliced_vbi_fo
1113 } 1113 }
1114 1114
1115 /* enable/disable raw VBI capturing */ 1115 /* enable/disable raw VBI capturing */
1116 saa711x_writeregs(client, fmt->service_set == 0 ? 1116 saa711x_writeregs(client, fmt == NULL ?
1117 saa7115_cfg_vbi_on : 1117 saa7115_cfg_vbi_on :
1118 saa7115_cfg_vbi_off); 1118 saa7115_cfg_vbi_off);
1119} 1119}
@@ -1153,6 +1153,10 @@ static int saa711x_set_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt
1153 saa711x_set_lcr(client, &fmt->fmt.sliced); 1153 saa711x_set_lcr(client, &fmt->fmt.sliced);
1154 return 0; 1154 return 0;
1155 } 1155 }
1156 if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
1157 saa711x_set_lcr(client, NULL);
1158 return 0;
1159 }
1156 if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 1160 if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
1157 return -EINVAL; 1161 return -EINVAL;
1158 1162
@@ -1309,10 +1313,13 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1309 case VIDIOC_INT_S_VIDEO_ROUTING: 1313 case VIDIOC_INT_S_VIDEO_ROUTING:
1310 { 1314 {
1311 struct v4l2_routing *route = arg; 1315 struct v4l2_routing *route = arg;
1316 u32 input = route->input;
1317 u8 mask = (state->ident == V4L2_IDENT_SAA7111) ? 0xf8 : 0xf0;
1312 1318
1313 v4l_dbg(1, debug, client, "decoder set input %d output %d\n", route->input, route->output); 1319 v4l_dbg(1, debug, client, "decoder set input %d output %d\n", route->input, route->output);
1314 /* saa7113 does not have these inputs */ 1320 /* saa7111/3 does not have these inputs */
1315 if (state->ident == V4L2_IDENT_SAA7113 && 1321 if ((state->ident == V4L2_IDENT_SAA7113 ||
1322 state->ident == V4L2_IDENT_SAA7111) &&
1316 (route->input == SAA7115_COMPOSITE4 || 1323 (route->input == SAA7115_COMPOSITE4 ||
1317 route->input == SAA7115_COMPOSITE5)) { 1324 route->input == SAA7115_COMPOSITE5)) {
1318 return -EINVAL; 1325 return -EINVAL;
@@ -1327,10 +1334,23 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1327 (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", (route->output == SAA7115_IPORT_ON) ? "iport on" : "iport off"); 1334 (route->input >= SAA7115_SVIDEO0) ? "S-Video" : "Composite", (route->output == SAA7115_IPORT_ON) ? "iport on" : "iport off");
1328 state->input = route->input; 1335 state->input = route->input;
1329 1336
1337 /* saa7111 has slightly different input numbering */
1338 if (state->ident == V4L2_IDENT_SAA7111) {
1339 if (input >= SAA7115_COMPOSITE4)
1340 input -= 2;
1341 /* saa7111 specific */
1342 saa711x_write(client, R_10_CHROMA_CNTL_2,
1343 (saa711x_read(client, R_10_CHROMA_CNTL_2) & 0x3f) |
1344 ((route->output & 0xc0) ^ 0x40));
1345 saa711x_write(client, R_13_RT_X_PORT_OUT_CNTL,
1346 (saa711x_read(client, R_13_RT_X_PORT_OUT_CNTL) & 0xf0) |
1347 ((route->output & 2) ? 0x0a : 0));
1348 }
1349
1330 /* select mode */ 1350 /* select mode */
1331 saa711x_write(client, R_02_INPUT_CNTL_1, 1351 saa711x_write(client, R_02_INPUT_CNTL_1,
1332 (saa711x_read(client, R_02_INPUT_CNTL_1) & 0xf0) | 1352 (saa711x_read(client, R_02_INPUT_CNTL_1) & mask) |
1333 state->input); 1353 input);
1334 1354
1335 /* bypass chrominance trap for S-Video modes */ 1355 /* bypass chrominance trap for S-Video modes */
1336 saa711x_write(client, R_09_LUMA_CNTL, 1356 saa711x_write(client, R_09_LUMA_CNTL,
@@ -1384,6 +1404,13 @@ static int saa7115_command(struct i2c_client *client, unsigned int cmd, void *ar
1384 saa711x_writeregs(client, saa7115_cfg_reset_scaler); 1404 saa711x_writeregs(client, saa7115_cfg_reset_scaler);
1385 break; 1405 break;
1386 1406
1407 case VIDIOC_INT_S_GPIO:
1408 if (state->ident != V4L2_IDENT_SAA7111)
1409 return -EINVAL;
1410 saa711x_write(client, 0x11, (saa711x_read(client, 0x11) & 0x7f) |
1411 (*(u32 *)arg ? 0x80 : 0));
1412 break;
1413
1387 case VIDIOC_INT_G_VBI_DATA: 1414 case VIDIOC_INT_G_VBI_DATA:
1388 { 1415 {
1389 struct v4l2_sliced_vbi_data *data = arg; 1416 struct v4l2_sliced_vbi_data *data = arg;
@@ -1539,7 +1566,8 @@ static int saa7115_probe(struct i2c_client *client,
1539 state->crystal_freq = SAA7115_FREQ_32_11_MHZ; 1566 state->crystal_freq = SAA7115_FREQ_32_11_MHZ;
1540 saa711x_writeregs(client, saa7115_init_auto_input); 1567 saa711x_writeregs(client, saa7115_init_auto_input);
1541 } 1568 }
1542 saa711x_writeregs(client, saa7115_init_misc); 1569 if (state->ident != V4L2_IDENT_SAA7111)
1570 saa711x_writeregs(client, saa7115_init_misc);
1543 saa711x_set_v4lstd(client, V4L2_STD_NTSC); 1571 saa711x_set_v4lstd(client, V4L2_STD_NTSC);
1544 1572
1545 v4l_dbg(1, debug, client, "status: (1E) 0x%02x, (1F) 0x%02x\n", 1573 v4l_dbg(1, debug, client, "status: (1E) 0x%02x, (1F) 0x%02x\n",