diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-04-27 11:31:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:43:50 -0400 |
commit | 74cab31c413c8615efe818d44ff4ac83e2a138be (patch) | |
tree | 036e32f1b1a928901f6f2ab4b9921c39aa8de82c /drivers | |
parent | 1a0adaf37c30e89e44d1470ef604a930999a5826 (diff) |
V4L/DVB (5355): Add VIDIOC_G_CHIP_IDENT to various i2c modules
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cs53l32a.c | 4 | ||||
-rw-r--r-- | drivers/media/video/msp3400-driver.c | 5 | ||||
-rw-r--r-- | drivers/media/video/msp3400-driver.h | 1 | ||||
-rw-r--r-- | drivers/media/video/tvaudio.c | 4 | ||||
-rw-r--r-- | drivers/media/video/upd64031a.c | 4 | ||||
-rw-r--r-- | drivers/media/video/upd64083.c | 5 | ||||
-rw-r--r-- | drivers/media/video/wm8739.c | 4 | ||||
-rw-r--r-- | drivers/media/video/wm8775.c | 4 |
8 files changed, 31 insertions, 0 deletions
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index de87247c74ee..a73e285af730 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/i2c-id.h> | 28 | #include <linux/i2c-id.h> |
29 | #include <linux/videodev.h> | 29 | #include <linux/videodev.h> |
30 | #include <media/v4l2-common.h> | 30 | #include <media/v4l2-common.h> |
31 | #include <media/v4l2-chip-ident.h> | ||
31 | 32 | ||
32 | MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); | 33 | MODULE_DESCRIPTION("i2c device driver for cs53l32a Audio ADC"); |
33 | MODULE_AUTHOR("Martin Vaughan"); | 34 | MODULE_AUTHOR("Martin Vaughan"); |
@@ -103,6 +104,9 @@ static int cs53l32a_command(struct i2c_client *client, unsigned int cmd, | |||
103 | cs53l32a_write(client, 0x05, (u8) ctrl->value); | 104 | cs53l32a_write(client, 0x05, (u8) ctrl->value); |
104 | break; | 105 | break; |
105 | 106 | ||
107 | case VIDIOC_G_CHIP_IDENT: | ||
108 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_CS53l32A, 0); | ||
109 | |||
106 | case VIDIOC_LOG_STATUS: | 110 | case VIDIOC_LOG_STATUS: |
107 | { | 111 | { |
108 | u8 v = cs53l32a_read(client, 0x01); | 112 | u8 v = cs53l32a_read(client, 0x01); |
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c index ba1af3c8525e..3bb7d6634862 100644 --- a/drivers/media/video/msp3400-driver.c +++ b/drivers/media/video/msp3400-driver.c | |||
@@ -773,6 +773,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
773 | break; | 773 | break; |
774 | } | 774 | } |
775 | 775 | ||
776 | case VIDIOC_G_CHIP_IDENT: | ||
777 | return v4l2_chip_ident_i2c_client(client, arg, state->ident, (state->rev1 << 16) | state->rev2); | ||
778 | |||
776 | default: | 779 | default: |
777 | /* unknown */ | 780 | /* unknown */ |
778 | return -EINVAL; | 781 | return -EINVAL; |
@@ -872,6 +875,8 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind) | |||
872 | snprintf(client->name, sizeof(client->name), "MSP%d4%02d%c-%c%d", | 875 | snprintf(client->name, sizeof(client->name), "MSP%d4%02d%c-%c%d", |
873 | msp_family, msp_product, | 876 | msp_family, msp_product, |
874 | msp_revision, msp_hard, msp_rom); | 877 | msp_revision, msp_hard, msp_rom); |
878 | /* Rev B=2, C=3, D=4, G=7 */ | ||
879 | state->ident = msp_family * 10000 + 4000 + msp_product * 10 + msp_revision - '@'; | ||
875 | 880 | ||
876 | /* Has NICAM support: all mspx41x and mspx45x products have NICAM */ | 881 | /* Has NICAM support: all mspx41x and mspx45x products have NICAM */ |
877 | state->has_nicam = msp_prod_hi == 1 || msp_prod_hi == 5; | 882 | state->has_nicam = msp_prod_hi == 1 || msp_prod_hi == 5; |
diff --git a/drivers/media/video/msp3400-driver.h b/drivers/media/video/msp3400-driver.h index 7531efa1615e..ab69a290e5dc 100644 --- a/drivers/media/video/msp3400-driver.h +++ b/drivers/media/video/msp3400-driver.h | |||
@@ -50,6 +50,7 @@ extern int msp_stereo_thresh; | |||
50 | 50 | ||
51 | struct msp_state { | 51 | struct msp_state { |
52 | int rev1, rev2; | 52 | int rev1, rev2; |
53 | int ident; | ||
53 | u8 has_nicam; | 54 | u8 has_nicam; |
54 | u8 has_radio; | 55 | u8 has_radio; |
55 | u8 has_headphones; | 56 | u8 has_headphones; |
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index d506dfaa45a9..426083c08986 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include <media/tvaudio.h> | 34 | #include <media/tvaudio.h> |
35 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
36 | 37 | ||
37 | #include <media/i2c-addr.h> | 38 | #include <media/i2c-addr.h> |
38 | 39 | ||
@@ -1775,6 +1776,9 @@ static int chip_command(struct i2c_client *client, | |||
1775 | /* the thread will call checkmode() later */ | 1776 | /* the thread will call checkmode() later */ |
1776 | } | 1777 | } |
1777 | break; | 1778 | break; |
1779 | |||
1780 | case VIDIOC_G_CHIP_IDENT: | ||
1781 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_TVAUDIO, 0); | ||
1778 | } | 1782 | } |
1779 | return 0; | 1783 | return 0; |
1780 | } | 1784 | } |
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c index 28d1133a3b7a..0b2a961efd22 100644 --- a/drivers/media/video/upd64031a.c +++ b/drivers/media/video/upd64031a.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | #include <media/v4l2-common.h> | 29 | #include <media/v4l2-common.h> |
30 | #include <media/v4l2-chip-ident.h> | ||
30 | #include <media/upd64031a.h> | 31 | #include <media/upd64031a.h> |
31 | 32 | ||
32 | // --------------------- read registers functions define ----------------------- | 33 | // --------------------- read registers functions define ----------------------- |
@@ -179,6 +180,9 @@ static int upd64031a_command(struct i2c_client *client, unsigned int cmd, void * | |||
179 | } | 180 | } |
180 | #endif | 181 | #endif |
181 | 182 | ||
183 | case VIDIOC_G_CHIP_IDENT: | ||
184 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_UPD64031A, 0); | ||
185 | |||
182 | default: | 186 | default: |
183 | break; | 187 | break; |
184 | } | 188 | } |
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c index fe38224150d8..401bd21f46eb 100644 --- a/drivers/media/video/upd64083.c +++ b/drivers/media/video/upd64083.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/videodev2.h> | 27 | #include <linux/videodev2.h> |
28 | #include <media/v4l2-common.h> | 28 | #include <media/v4l2-common.h> |
29 | #include <media/v4l2-chip-ident.h> | ||
29 | #include <media/upd64083.h> | 30 | #include <media/upd64083.h> |
30 | 31 | ||
31 | MODULE_DESCRIPTION("uPD64083 driver"); | 32 | MODULE_DESCRIPTION("uPD64083 driver"); |
@@ -155,6 +156,10 @@ static int upd64083_command(struct i2c_client *client, unsigned int cmd, void *a | |||
155 | break; | 156 | break; |
156 | } | 157 | } |
157 | #endif | 158 | #endif |
159 | |||
160 | case VIDIOC_G_CHIP_IDENT: | ||
161 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_UPD64083, 0); | ||
162 | |||
158 | default: | 163 | default: |
159 | break; | 164 | break; |
160 | } | 165 | } |
diff --git a/drivers/media/video/wm8739.c b/drivers/media/video/wm8739.c index a9b59c35cd67..8f6741a28a47 100644 --- a/drivers/media/video/wm8739.c +++ b/drivers/media/video/wm8739.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/i2c-id.h> | 29 | #include <linux/i2c-id.h> |
30 | #include <linux/videodev.h> | 30 | #include <linux/videodev.h> |
31 | #include <media/v4l2-common.h> | 31 | #include <media/v4l2-common.h> |
32 | #include <media/v4l2-chip-ident.h> | ||
32 | 33 | ||
33 | MODULE_DESCRIPTION("wm8739 driver"); | 34 | MODULE_DESCRIPTION("wm8739 driver"); |
34 | MODULE_AUTHOR("T. Adachi, Hans Verkuil"); | 35 | MODULE_AUTHOR("T. Adachi, Hans Verkuil"); |
@@ -236,6 +237,9 @@ static int wm8739_command(struct i2c_client *client, unsigned int cmd, void *arg | |||
236 | return -EINVAL; | 237 | return -EINVAL; |
237 | } | 238 | } |
238 | 239 | ||
240 | case VIDIOC_G_CHIP_IDENT: | ||
241 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_WM8739, 0); | ||
242 | |||
239 | case VIDIOC_LOG_STATUS: | 243 | case VIDIOC_LOG_STATUS: |
240 | v4l_info(client, "Frequency: %u Hz\n", state->clock_freq); | 244 | v4l_info(client, "Frequency: %u Hz\n", state->clock_freq); |
241 | v4l_info(client, "Volume L: %02x%s\n", state->vol_l & 0x1f, | 245 | v4l_info(client, "Volume L: %02x%s\n", state->vol_l & 0x1f, |
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index d81a88bbe43d..4df5d30d4d09 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/i2c-id.h> | 33 | #include <linux/i2c-id.h> |
34 | #include <linux/videodev.h> | 34 | #include <linux/videodev.h> |
35 | #include <media/v4l2-common.h> | 35 | #include <media/v4l2-common.h> |
36 | #include <media/v4l2-chip-ident.h> | ||
36 | 37 | ||
37 | MODULE_DESCRIPTION("wm8775 driver"); | 38 | MODULE_DESCRIPTION("wm8775 driver"); |
38 | MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); | 39 | MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); |
@@ -124,6 +125,9 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd, | |||
124 | wm8775_write(client, R21, 0x100 + state->input); | 125 | wm8775_write(client, R21, 0x100 + state->input); |
125 | break; | 126 | break; |
126 | 127 | ||
128 | case VIDIOC_G_CHIP_IDENT: | ||
129 | return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_WM8775, 0); | ||
130 | |||
127 | case VIDIOC_LOG_STATUS: | 131 | case VIDIOC_LOG_STATUS: |
128 | v4l_info(client, "Input: %d%s\n", state->input, | 132 | v4l_info(client, "Input: %d%s\n", state->input, |
129 | state->muted ? " (muted)" : ""); | 133 | state->muted ? " (muted)" : ""); |