diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:35:11 -0400 |
commit | 0851668fdd97e526b2a41f794b785c204dd3d3e0 (patch) | |
tree | 4ef7c20a8be8393006c6fe9627eb29dd30877d61 /drivers/media/video/ivtv | |
parent | 00ebb6382b8d9c7c15b5f8ad230670d8161d38dd (diff) | |
parent | 7655e594945289b418af39f6669fea4666a7b520 (diff) |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits)
[media] af9015: Fix max I2C message size when used with tda18271
[media] IR: initialize ir_raw_event in few more drivers
[media] Guard a divide in v4l1 compat layer
[media] imon: fix nomouse modprobe option
[media] imon: remove redundant change_protocol call
[media] imon: fix my egregious brown paper bag w/rdev/idev split
[media] cafe_ccic: Configure ov7670 correctly
[media] ov7670: allow configuration of image size, clock speed, and I/O method
[media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016]
[media] af9015: map DigitalNow TinyTwin v2 remote
[media] DigitalNow TinyTwin remote controller
[media] af9015: RC fixes and improvements
videodev2.h.xml: Update to reflect the latest changes at videodev2.h
[media] v4l: document new Bayer and monochrome pixel formats
[media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028
[media] firedtv: add parameter to fake ca_system_ids in CA_INFO
[media] tm6000: fix a macro coding style issue
tm6000: Remove some ugly debug code
[media] Nova-S-Plus audio line input
[media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers
...
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.h | 14 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-i2c.c | 42 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 1 |
3 files changed, 19 insertions, 38 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h index 75803141481e..04bacdbd10bb 100644 --- a/drivers/media/video/ivtv/ivtv-driver.h +++ b/drivers/media/video/ivtv/ivtv-driver.h | |||
@@ -811,15 +811,23 @@ static inline int ivtv_raw_vbi(const struct ivtv *itv) | |||
811 | /* Call the specified callback for all subdevs matching hw (if 0, then | 811 | /* Call the specified callback for all subdevs matching hw (if 0, then |
812 | match them all). Ignore any errors. */ | 812 | match them all). Ignore any errors. */ |
813 | #define ivtv_call_hw(itv, hw, o, f, args...) \ | 813 | #define ivtv_call_hw(itv, hw, o, f, args...) \ |
814 | __v4l2_device_call_subdevs(&(itv)->v4l2_dev, !(hw) || (sd->grp_id & (hw)), o, f , ##args) | 814 | do { \ |
815 | struct v4l2_subdev *__sd; \ | ||
816 | __v4l2_device_call_subdevs_p(&(itv)->v4l2_dev, __sd, \ | ||
817 | !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \ | ||
818 | } while (0) | ||
815 | 819 | ||
816 | #define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) | 820 | #define ivtv_call_all(itv, o, f, args...) ivtv_call_hw(itv, 0, o, f , ##args) |
817 | 821 | ||
818 | /* Call the specified callback for all subdevs matching hw (if 0, then | 822 | /* Call the specified callback for all subdevs matching hw (if 0, then |
819 | match them all). If the callback returns an error other than 0 or | 823 | match them all). If the callback returns an error other than 0 or |
820 | -ENOIOCTLCMD, then return with that error code. */ | 824 | -ENOIOCTLCMD, then return with that error code. */ |
821 | #define ivtv_call_hw_err(itv, hw, o, f, args...) \ | 825 | #define ivtv_call_hw_err(itv, hw, o, f, args...) \ |
822 | __v4l2_device_call_subdevs_until_err(&(itv)->v4l2_dev, !(hw) || (sd->grp_id & (hw)), o, f , ##args) | 826 | ({ \ |
827 | struct v4l2_subdev *__sd; \ | ||
828 | __v4l2_device_call_subdevs_until_err_p(&(itv)->v4l2_dev, __sd, \ | ||
829 | !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \ | ||
830 | }) | ||
823 | 831 | ||
824 | #define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args) | 832 | #define ivtv_call_all_err(itv, o, f, args...) ivtv_call_hw_err(itv, 0, o, f , ##args) |
825 | 833 | ||
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c index a74fa099c565..9e8039ac909e 100644 --- a/drivers/media/video/ivtv/ivtv-i2c.c +++ b/drivers/media/video/ivtv/ivtv-i2c.c | |||
@@ -121,31 +121,6 @@ static const u8 hw_addrs[] = { | |||
121 | }; | 121 | }; |
122 | 122 | ||
123 | /* This array should match the IVTV_HW_ defines */ | 123 | /* This array should match the IVTV_HW_ defines */ |
124 | static const char *hw_modules[] = { | ||
125 | "cx25840", | ||
126 | "saa7115", | ||
127 | "saa7127", | ||
128 | "msp3400", | ||
129 | "tuner", | ||
130 | "wm8775", | ||
131 | "cs53l32a", | ||
132 | NULL, | ||
133 | "saa7115", | ||
134 | "upd64031a", | ||
135 | "upd64083", | ||
136 | "saa717x", | ||
137 | "wm8739", | ||
138 | "vp27smpx", | ||
139 | "m52790", | ||
140 | NULL, | ||
141 | NULL, /* IVTV_HW_I2C_IR_RX_AVER */ | ||
142 | NULL, /* IVTV_HW_I2C_IR_RX_HAUP_EXT */ | ||
143 | NULL, /* IVTV_HW_I2C_IR_RX_HAUP_INT */ | ||
144 | NULL, /* IVTV_HW_Z8F0811_IR_TX_HAUP */ | ||
145 | NULL, /* IVTV_HW_Z8F0811_IR_RX_HAUP */ | ||
146 | }; | ||
147 | |||
148 | /* This array should match the IVTV_HW_ defines */ | ||
149 | static const char * const hw_devicenames[] = { | 124 | static const char * const hw_devicenames[] = { |
150 | "cx25840", | 125 | "cx25840", |
151 | "saa7115", | 126 | "saa7115", |
@@ -257,7 +232,6 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
257 | { | 232 | { |
258 | struct v4l2_subdev *sd; | 233 | struct v4l2_subdev *sd; |
259 | struct i2c_adapter *adap = &itv->i2c_adap; | 234 | struct i2c_adapter *adap = &itv->i2c_adap; |
260 | const char *mod = hw_modules[idx]; | ||
261 | const char *type = hw_devicenames[idx]; | 235 | const char *type = hw_devicenames[idx]; |
262 | u32 hw = 1 << idx; | 236 | u32 hw = 1 << idx; |
263 | 237 | ||
@@ -266,17 +240,17 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
266 | if (hw == IVTV_HW_TUNER) { | 240 | if (hw == IVTV_HW_TUNER) { |
267 | /* special tuner handling */ | 241 | /* special tuner handling */ |
268 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 242 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
269 | adap, mod, type, | 243 | adap, NULL, type, |
270 | 0, itv->card_i2c->radio); | 244 | 0, itv->card_i2c->radio); |
271 | if (sd) | 245 | if (sd) |
272 | sd->grp_id = 1 << idx; | 246 | sd->grp_id = 1 << idx; |
273 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 247 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
274 | adap, mod, type, | 248 | adap, NULL, type, |
275 | 0, itv->card_i2c->demod); | 249 | 0, itv->card_i2c->demod); |
276 | if (sd) | 250 | if (sd) |
277 | sd->grp_id = 1 << idx; | 251 | sd->grp_id = 1 << idx; |
278 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 252 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
279 | adap, mod, type, | 253 | adap, NULL, type, |
280 | 0, itv->card_i2c->tv); | 254 | 0, itv->card_i2c->tv); |
281 | if (sd) | 255 | if (sd) |
282 | sd->grp_id = 1 << idx; | 256 | sd->grp_id = 1 << idx; |
@@ -293,16 +267,17 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
293 | /* It's an I2C device other than an analog tuner or IR chip */ | 267 | /* It's an I2C device other than an analog tuner or IR chip */ |
294 | if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { | 268 | if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { |
295 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 269 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
296 | adap, mod, type, 0, I2C_ADDRS(hw_addrs[idx])); | 270 | adap, NULL, type, 0, I2C_ADDRS(hw_addrs[idx])); |
297 | } else if (hw == IVTV_HW_CX25840) { | 271 | } else if (hw == IVTV_HW_CX25840) { |
298 | struct cx25840_platform_data pdata; | 272 | struct cx25840_platform_data pdata; |
299 | 273 | ||
300 | pdata.pvr150_workaround = itv->pvr150_workaround; | 274 | pdata.pvr150_workaround = itv->pvr150_workaround; |
301 | sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, | 275 | sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, |
302 | adap, mod, type, 0, &pdata, hw_addrs[idx], NULL); | 276 | adap, NULL, type, 0, &pdata, hw_addrs[idx], |
277 | NULL); | ||
303 | } else { | 278 | } else { |
304 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 279 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
305 | adap, mod, type, hw_addrs[idx], NULL); | 280 | adap, NULL, type, hw_addrs[idx], NULL); |
306 | } | 281 | } |
307 | if (sd) | 282 | if (sd) |
308 | sd->grp_id = 1 << idx; | 283 | sd->grp_id = 1 << idx; |
@@ -706,8 +681,7 @@ int init_ivtv_i2c(struct ivtv *itv) | |||
706 | /* Sanity checks for the I2C hardware arrays. They must be the | 681 | /* Sanity checks for the I2C hardware arrays. They must be the |
707 | * same size. | 682 | * same size. |
708 | */ | 683 | */ |
709 | if (ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) || | 684 | if (ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs)) { |
710 | ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_modules)) { | ||
711 | IVTV_ERR("Mismatched I2C hardware arrays\n"); | 685 | IVTV_ERR("Mismatched I2C hardware arrays\n"); |
712 | return -ENODEV; | 686 | return -ENODEV; |
713 | } | 687 | } |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 4eed9123683e..b686da5e4326 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <media/v4l2-chip-ident.h> | 37 | #include <media/v4l2-chip-ident.h> |
38 | #include <media/v4l2-event.h> | 38 | #include <media/v4l2-event.h> |
39 | #include <linux/dvb/audio.h> | 39 | #include <linux/dvb/audio.h> |
40 | #include <linux/i2c-id.h> | ||
41 | 40 | ||
42 | u16 ivtv_service2vbi(int type) | 41 | u16 ivtv_service2vbi(int type) |
43 | { | 42 | { |