diff options
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 19 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-i2c.c | 23 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-ioctl.c | 1 |
3 files changed, 18 insertions, 25 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 9bc51a99376b..77be58c1096b 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -674,18 +674,25 @@ static inline int cx18_raw_vbi(const struct cx18 *cx) | |||
674 | 674 | ||
675 | /* Call the specified callback for all subdevs with a grp_id bit matching the | 675 | /* Call the specified callback for all subdevs with a grp_id bit matching the |
676 | * mask in hw (if 0, then match them all). Ignore any errors. */ | 676 | * mask in hw (if 0, then match them all). Ignore any errors. */ |
677 | #define cx18_call_hw(cx, hw, o, f, args...) \ | 677 | #define cx18_call_hw(cx, hw, o, f, args...) \ |
678 | __v4l2_device_call_subdevs(&(cx)->v4l2_dev, \ | 678 | do { \ |
679 | !(hw) || (sd->grp_id & (hw)), o, f , ##args) | 679 | struct v4l2_subdev *__sd; \ |
680 | __v4l2_device_call_subdevs_p(&(cx)->v4l2_dev, __sd, \ | ||
681 | !(hw) || (__sd->grp_id & (hw)), o, f , ##args); \ | ||
682 | } while (0) | ||
680 | 683 | ||
681 | #define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args) | 684 | #define cx18_call_all(cx, o, f, args...) cx18_call_hw(cx, 0, o, f , ##args) |
682 | 685 | ||
683 | /* Call the specified callback for all subdevs with a grp_id bit matching the | 686 | /* Call the specified callback for all subdevs with a grp_id bit matching the |
684 | * mask in hw (if 0, then match them all). If the callback returns an error | 687 | * mask in hw (if 0, then match them all). If the callback returns an error |
685 | * other than 0 or -ENOIOCTLCMD, then return with that error code. */ | 688 | * other than 0 or -ENOIOCTLCMD, then return with that error code. */ |
686 | #define cx18_call_hw_err(cx, hw, o, f, args...) \ | 689 | #define cx18_call_hw_err(cx, hw, o, f, args...) \ |
687 | __v4l2_device_call_subdevs_until_err( \ | 690 | ({ \ |
688 | &(cx)->v4l2_dev, !(hw) || (sd->grp_id & (hw)), o, f , ##args) | 691 | struct v4l2_subdev *__sd; \ |
692 | __v4l2_device_call_subdevs_until_err_p(&(cx)->v4l2_dev, \ | ||
693 | __sd, !(hw) || (__sd->grp_id & (hw)), o, f, \ | ||
694 | ##args); \ | ||
695 | }) | ||
689 | 696 | ||
690 | #define cx18_call_all_err(cx, o, f, args...) \ | 697 | #define cx18_call_all_err(cx, o, f, args...) \ |
691 | cx18_call_hw_err(cx, 0, o, f , ##args) | 698 | cx18_call_hw_err(cx, 0, o, f , ##args) |
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c index 73ce90c2f577..a09caf883170 100644 --- a/drivers/media/video/cx18/cx18-i2c.c +++ b/drivers/media/video/cx18/cx18-i2c.c | |||
@@ -71,19 +71,6 @@ static const u8 hw_bus[] = { | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* This array should match the CX18_HW_ defines */ | 73 | /* This array should match the CX18_HW_ defines */ |
74 | static const char * const hw_modules[] = { | ||
75 | "tuner", /* CX18_HW_TUNER */ | ||
76 | NULL, /* CX18_HW_TVEEPROM */ | ||
77 | "cs5345", /* CX18_HW_CS5345 */ | ||
78 | NULL, /* CX18_HW_DVB */ | ||
79 | NULL, /* CX18_HW_418_AV */ | ||
80 | NULL, /* CX18_HW_GPIO_MUX */ | ||
81 | NULL, /* CX18_HW_GPIO_RESET_CTRL */ | ||
82 | NULL, /* CX18_HW_Z8F0811_IR_TX_HAUP */ | ||
83 | NULL, /* CX18_HW_Z8F0811_IR_RX_HAUP */ | ||
84 | }; | ||
85 | |||
86 | /* This array should match the CX18_HW_ defines */ | ||
87 | static const char * const hw_devicenames[] = { | 74 | static const char * const hw_devicenames[] = { |
88 | "tuner", | 75 | "tuner", |
89 | "tveeprom", | 76 | "tveeprom", |
@@ -126,7 +113,6 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx) | |||
126 | struct v4l2_subdev *sd; | 113 | struct v4l2_subdev *sd; |
127 | int bus = hw_bus[idx]; | 114 | int bus = hw_bus[idx]; |
128 | struct i2c_adapter *adap = &cx->i2c_adap[bus]; | 115 | struct i2c_adapter *adap = &cx->i2c_adap[bus]; |
129 | const char *mod = hw_modules[idx]; | ||
130 | const char *type = hw_devicenames[idx]; | 116 | const char *type = hw_devicenames[idx]; |
131 | u32 hw = 1 << idx; | 117 | u32 hw = 1 << idx; |
132 | 118 | ||
@@ -136,15 +122,15 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx) | |||
136 | if (hw == CX18_HW_TUNER) { | 122 | if (hw == CX18_HW_TUNER) { |
137 | /* special tuner group handling */ | 123 | /* special tuner group handling */ |
138 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 124 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
139 | adap, mod, type, 0, cx->card_i2c->radio); | 125 | adap, NULL, type, 0, cx->card_i2c->radio); |
140 | if (sd != NULL) | 126 | if (sd != NULL) |
141 | sd->grp_id = hw; | 127 | sd->grp_id = hw; |
142 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 128 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
143 | adap, mod, type, 0, cx->card_i2c->demod); | 129 | adap, NULL, type, 0, cx->card_i2c->demod); |
144 | if (sd != NULL) | 130 | if (sd != NULL) |
145 | sd->grp_id = hw; | 131 | sd->grp_id = hw; |
146 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 132 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
147 | adap, mod, type, 0, cx->card_i2c->tv); | 133 | adap, NULL, type, 0, cx->card_i2c->tv); |
148 | if (sd != NULL) | 134 | if (sd != NULL) |
149 | sd->grp_id = hw; | 135 | sd->grp_id = hw; |
150 | return sd != NULL ? 0 : -1; | 136 | return sd != NULL ? 0 : -1; |
@@ -158,7 +144,8 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx) | |||
158 | return -1; | 144 | return -1; |
159 | 145 | ||
160 | /* It's an I2C device other than an analog tuner or IR chip */ | 146 | /* It's an I2C device other than an analog tuner or IR chip */ |
161 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, mod, type, hw_addrs[idx], NULL); | 147 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, NULL, type, hw_addrs[idx], |
148 | NULL); | ||
162 | if (sd != NULL) | 149 | if (sd != NULL) |
163 | sd->grp_id = hw; | 150 | sd->grp_id = hw; |
164 | return sd != NULL ? 0 : -1; | 151 | return sd != NULL ? 0 : -1; |
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index d6792405f8d3..7150195740dc 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include "cx18-av-core.h" | 40 | #include "cx18-av-core.h" |
41 | #include <media/tveeprom.h> | 41 | #include <media/tveeprom.h> |
42 | #include <media/v4l2-chip-ident.h> | 42 | #include <media/v4l2-chip-ident.h> |
43 | #include <linux/i2c-id.h> | ||
44 | 43 | ||
45 | u16 cx18_service2vbi(int type) | 44 | u16 cx18_service2vbi(int type) |
46 | { | 45 | { |