aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
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/cx25840
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/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c9
-rw-r--r--drivers/media/video/cx25840/cx25840-core.h3
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 774d2536555b..1757a588970f 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -35,6 +35,7 @@
35#include <linux/videodev2.h> 35#include <linux/videodev2.h>
36#include <linux/i2c.h> 36#include <linux/i2c.h>
37#include <media/v4l2-common.h> 37#include <media/v4l2-common.h>
38#include <media/v4l2-chip-ident.h>
38#include <media/cx25840.h> 39#include <media/cx25840.h>
39 40
40#include "cx25840-core.h" 41#include "cx25840-core.h"
@@ -827,9 +828,8 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
827 cx25840_initialize(client, 0); 828 cx25840_initialize(client, 0);
828 break; 829 break;
829 830
830 case VIDIOC_INT_G_CHIP_IDENT: 831 case VIDIOC_G_CHIP_IDENT:
831 *(enum v4l2_chip_ident *)arg = state->id; 832 return v4l2_chip_ident_i2c_client(client, arg, state->id, state->rev);
832 break;
833 833
834 default: 834 default:
835 return -EINVAL; 835 return -EINVAL;
@@ -847,7 +847,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
847{ 847{
848 struct i2c_client *client; 848 struct i2c_client *client;
849 struct cx25840_state *state; 849 struct cx25840_state *state;
850 enum v4l2_chip_ident id; 850 u32 id;
851 u16 device_id; 851 u16 device_id;
852 852
853 /* Check if the adapter supports the needed features 853 /* Check if the adapter supports the needed features
@@ -902,6 +902,7 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
902 state->audmode = V4L2_TUNER_MODE_LANG1; 902 state->audmode = V4L2_TUNER_MODE_LANG1;
903 state->vbi_line_offset = 8; 903 state->vbi_line_offset = 8;
904 state->id = id; 904 state->id = id;
905 state->rev = device_id;
905 906
906 i2c_attach_client(client); 907 i2c_attach_client(client);
907 908
diff --git a/drivers/media/video/cx25840/cx25840-core.h b/drivers/media/video/cx25840/cx25840-core.h
index 28049064dd7d..f4b56d2fd6b6 100644
--- a/drivers/media/video/cx25840/cx25840-core.h
+++ b/drivers/media/video/cx25840/cx25840-core.h
@@ -43,7 +43,8 @@ struct cx25840_state {
43 u32 audclk_freq; 43 u32 audclk_freq;
44 int audmode; 44 int audmode;
45 int vbi_line_offset; 45 int vbi_line_offset;
46 enum v4l2_chip_ident id; 46 u32 id;
47 u32 rev;
47 int is_cx25836; 48 int is_cx25836;
48}; 49};
49 50