aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-04-27 11:31:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:43:27 -0400
commit3434eb7e14d9587ee56f3462bcfa5726b62dadb9 (patch)
tree49afb0915dac8e7864f89582ddbb7a6453982e2c /drivers/media/video/saa7115.c
parentced80c67cd1ed503c6fb72f02ac7342ab4ebf67a (diff)
V4L/DVB (5306): Add support for VIDIOC_G_CHIP_IDENT
VIDIOC_G_CHIP_IDENT improves debugging of card problems: it can be used to detect which chips are on the board and based on that information selected register dumps can be made, making it easy to debug complicated media chips containing tens or hundreds of registers. This ioctl replaces the internal VIDIOC_INT_G_CHIP_IDENT ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 4d5bbd859de1..26c9b64c748c 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -45,6 +45,7 @@
45#include <linux/i2c.h> 45#include <linux/i2c.h>
46#include <linux/videodev2.h> 46#include <linux/videodev2.h>
47#include <media/v4l2-common.h> 47#include <media/v4l2-common.h>
48#include <media/v4l2-chip-ident.h>
48#include <media/saa7115.h> 49#include <media/saa7115.h>
49#include <asm/div64.h> 50#include <asm/div64.h>
50 51
@@ -80,7 +81,7 @@ struct saa711x_state {
80 int sat; 81 int sat;
81 int width; 82 int width;
82 int height; 83 int height;
83 enum v4l2_chip_ident ident; 84 u32 ident;
84 u32 audclk_freq; 85 u32 audclk_freq;
85 u32 crystal_freq; 86 u32 crystal_freq;
86 u8 ucgc; 87 u8 ucgc;
@@ -1232,7 +1233,6 @@ static void saa711x_decode_vbi_line(struct i2c_client *client,
1232static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *arg) 1233static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *arg)
1233{ 1234{
1234 struct saa711x_state *state = i2c_get_clientdata(client); 1235 struct saa711x_state *state = i2c_get_clientdata(client);
1235 int *iarg = arg;
1236 1236
1237 /* ioctls to allow direct access to the saa7115 registers for testing */ 1237 /* ioctls to allow direct access to the saa7115 registers for testing */
1238 switch (cmd) { 1238 switch (cmd) {
@@ -1437,9 +1437,8 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar
1437 } 1437 }
1438#endif 1438#endif
1439 1439
1440 case VIDIOC_INT_G_CHIP_IDENT: 1440 case VIDIOC_G_CHIP_IDENT:
1441 *iarg = state->ident; 1441 return v4l2_chip_ident_i2c_client(client, arg, state->ident, 0);
1442 break;
1443 1442
1444 default: 1443 default:
1445 return -EINVAL; 1444 return -EINVAL;