aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-02-18 10:35:33 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:54 -0400
commit17bdd9ddd14dc4d15277aacb277272f7a6c4eb2a (patch)
treec8e526126905feb52cf7e2f5600ef537a79780d7 /drivers/media/video/saa7115.c
parent9040320a899f41cc1978bdd4b6867b172da9b021 (diff)
V4L/DVB (10702): saa7115: add querystd and g_input_status support for zoran.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index b1c5f63bb77a..591f7f98aa33 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1373,6 +1373,47 @@ static int saa711x_g_vbi_data(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_dat
1373 } 1373 }
1374} 1374}
1375 1375
1376static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
1377{
1378 struct saa711x_state *state = to_state(sd);
1379 int reg1e;
1380
1381 *std = V4L2_STD_ALL;
1382 if (state->ident != V4L2_IDENT_SAA7115)
1383 return 0;
1384 reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC);
1385
1386 switch (reg1e & 0x03) {
1387 case 1:
1388 *std = V4L2_STD_NTSC;
1389 break;
1390 case 2:
1391 *std = V4L2_STD_PAL;
1392 break;
1393 case 3:
1394 *std = V4L2_STD_SECAM;
1395 break;
1396 default:
1397 break;
1398 }
1399 return 0;
1400}
1401
1402static int saa711x_g_input_status(struct v4l2_subdev *sd, u32 *status)
1403{
1404 struct saa711x_state *state = to_state(sd);
1405 int reg1e = 0x80;
1406 int reg1f;
1407
1408 *status = V4L2_IN_ST_NO_SIGNAL;
1409 if (state->ident == V4L2_IDENT_SAA7115)
1410 reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC);
1411 reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC);
1412 if ((reg1f & 0xc1) == 0x81 && (reg1e & 0xc0) == 0x80)
1413 *status = 0;
1414 return 0;
1415}
1416
1376#ifdef CONFIG_VIDEO_ADV_DEBUG 1417#ifdef CONFIG_VIDEO_ADV_DEBUG
1377static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) 1418static int saa711x_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg)
1378{ 1419{
@@ -1496,6 +1537,8 @@ static const struct v4l2_subdev_video_ops saa711x_video_ops = {
1496 .g_vbi_data = saa711x_g_vbi_data, 1537 .g_vbi_data = saa711x_g_vbi_data,
1497 .decode_vbi_line = saa711x_decode_vbi_line, 1538 .decode_vbi_line = saa711x_decode_vbi_line,
1498 .s_stream = saa711x_s_stream, 1539 .s_stream = saa711x_s_stream,
1540 .querystd = saa711x_querystd,
1541 .g_input_status = saa711x_g_input_status,
1499}; 1542};
1500 1543
1501static const struct v4l2_subdev_ops saa711x_ops = { 1544static const struct v4l2_subdev_ops saa711x_ops = {