aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dtt200u.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dtt200u.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u.c160
1 files changed, 88 insertions, 72 deletions
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c
index 27af4e436479..b834db74e77c 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -28,19 +28,19 @@ static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff)
28 return 0; 28 return 0;
29} 29}
30 30
31static int dtt200u_streaming_ctrl(struct dvb_usb_device *d, int onoff) 31static int dtt200u_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
32{ 32{
33 u8 b_streaming[2] = { SET_STREAMING, onoff }; 33 u8 b_streaming[2] = { SET_STREAMING, onoff };
34 u8 b_rst_pid = RESET_PID_FILTER; 34 u8 b_rst_pid = RESET_PID_FILTER;
35 35
36 dvb_usb_generic_write(d,b_streaming,2); 36 dvb_usb_generic_write(adap->dev, b_streaming, 2);
37 37
38 if (onoff == 0) 38 if (onoff == 0)
39 dvb_usb_generic_write(d,&b_rst_pid,1); 39 dvb_usb_generic_write(adap->dev, &b_rst_pid, 1);
40 return 0; 40 return 0;
41} 41}
42 42
43static int dtt200u_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) 43static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
44{ 44{
45 u8 b_pid[4]; 45 u8 b_pid[4];
46 pid = onoff ? pid : 0; 46 pid = onoff ? pid : 0;
@@ -50,7 +50,7 @@ static int dtt200u_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int
50 b_pid[2] = pid & 0xff; 50 b_pid[2] = pid & 0xff;
51 b_pid[3] = (pid >> 8) & 0x1f; 51 b_pid[3] = (pid >> 8) & 0x1f;
52 52
53 return dvb_usb_generic_write(d,b_pid,4); 53 return dvb_usb_generic_write(adap->dev, b_pid, 4);
54} 54}
55 55
56/* remote control */ 56/* remote control */
@@ -86,16 +86,16 @@ static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
86 return 0; 86 return 0;
87} 87}
88 88
89static int dtt200u_frontend_attach(struct dvb_usb_device *d) 89static int dtt200u_frontend_attach(struct dvb_usb_adapter *adap)
90{ 90{
91 d->fe = dtt200u_fe_attach(d); 91 adap->fe = dtt200u_fe_attach(adap);
92 return 0; 92 return 0;
93} 93}
94 94
95static struct dvb_usb_properties dtt200u_properties; 95static struct dvb_usb_device_properties dtt200u_properties;
96static struct dvb_usb_properties wt220u_fc_properties; 96static struct dvb_usb_device_properties wt220u_fc_properties;
97static struct dvb_usb_properties wt220u_properties; 97static struct dvb_usb_device_properties wt220u_properties;
98static struct dvb_usb_properties wt220u_zl0353_properties; 98static struct dvb_usb_device_properties wt220u_zl0353_properties;
99 99
100static int dtt200u_usb_probe(struct usb_interface *intf, 100static int dtt200u_usb_probe(struct usb_interface *intf,
101 const struct usb_device_id *id) 101 const struct usb_device_id *id)
@@ -123,28 +123,22 @@ static struct usb_device_id dtt200u_usb_table [] = {
123}; 123};
124MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); 124MODULE_DEVICE_TABLE(usb, dtt200u_usb_table);
125 125
126static struct dvb_usb_properties dtt200u_properties = { 126static struct dvb_usb_device_properties dtt200u_properties = {
127 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
128 .pid_filter_count = 15,
129
130 .usb_ctrl = CYPRESS_FX2, 127 .usb_ctrl = CYPRESS_FX2,
131 .firmware = "dvb-usb-dtt200u-01.fw", 128 .firmware = "dvb-usb-dtt200u-01.fw",
132 129
133 .power_ctrl = dtt200u_power_ctrl, 130 .num_adapters = 1,
131 .adapter = {
132 {
133 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
134 .pid_filter_count = 15,
135
134 .streaming_ctrl = dtt200u_streaming_ctrl, 136 .streaming_ctrl = dtt200u_streaming_ctrl,
135 .pid_filter = dtt200u_pid_filter, 137 .pid_filter = dtt200u_pid_filter,
136 .frontend_attach = dtt200u_frontend_attach, 138 .frontend_attach = dtt200u_frontend_attach,
137
138 .rc_interval = 300,
139 .rc_key_map = dtt200u_rc_keys,
140 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
141 .rc_query = dtt200u_rc_query,
142
143 .generic_bulk_ctrl_endpoint = 0x01,
144
145 /* parameter for the MPEG2-data transfer */ 139 /* parameter for the MPEG2-data transfer */
146 .urb = { 140 .stream = {
147 .type = DVB_USB_BULK, 141 .type = USB_BULK,
148 .count = 7, 142 .count = 7,
149 .endpoint = 0x02, 143 .endpoint = 0x02,
150 .u = { 144 .u = {
@@ -153,6 +147,16 @@ static struct dvb_usb_properties dtt200u_properties = {
153 } 147 }
154 } 148 }
155 }, 149 },
150 }
151 },
152 .power_ctrl = dtt200u_power_ctrl,
153
154 .rc_interval = 300,
155 .rc_key_map = dtt200u_rc_keys,
156 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
157 .rc_query = dtt200u_rc_query,
158
159 .generic_bulk_ctrl_endpoint = 0x01,
156 160
157 .num_device_descs = 1, 161 .num_device_descs = 1,
158 .devices = { 162 .devices = {
@@ -164,28 +168,22 @@ static struct dvb_usb_properties dtt200u_properties = {
164 } 168 }
165}; 169};
166 170
167static struct dvb_usb_properties wt220u_properties = { 171static struct dvb_usb_device_properties wt220u_properties = {
168 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
169 .pid_filter_count = 15,
170
171 .usb_ctrl = CYPRESS_FX2, 172 .usb_ctrl = CYPRESS_FX2,
172 .firmware = "dvb-usb-wt220u-02.fw", 173 .firmware = "dvb-usb-wt220u-02.fw",
173 174
174 .power_ctrl = dtt200u_power_ctrl, 175 .num_adapters = 1,
176 .adapter = {
177 {
178 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
179 .pid_filter_count = 15,
180
175 .streaming_ctrl = dtt200u_streaming_ctrl, 181 .streaming_ctrl = dtt200u_streaming_ctrl,
176 .pid_filter = dtt200u_pid_filter, 182 .pid_filter = dtt200u_pid_filter,
177 .frontend_attach = dtt200u_frontend_attach, 183 .frontend_attach = dtt200u_frontend_attach,
178
179 .rc_interval = 300,
180 .rc_key_map = dtt200u_rc_keys,
181 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
182 .rc_query = dtt200u_rc_query,
183
184 .generic_bulk_ctrl_endpoint = 0x01,
185
186 /* parameter for the MPEG2-data transfer */ 184 /* parameter for the MPEG2-data transfer */
187 .urb = { 185 .stream = {
188 .type = DVB_USB_BULK, 186 .type = USB_BULK,
189 .count = 7, 187 .count = 7,
190 .endpoint = 0x02, 188 .endpoint = 0x02,
191 .u = { 189 .u = {
@@ -194,6 +192,16 @@ static struct dvb_usb_properties wt220u_properties = {
194 } 192 }
195 } 193 }
196 }, 194 },
195 }
196 },
197 .power_ctrl = dtt200u_power_ctrl,
198
199 .rc_interval = 300,
200 .rc_key_map = dtt200u_rc_keys,
201 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
202 .rc_query = dtt200u_rc_query,
203
204 .generic_bulk_ctrl_endpoint = 0x01,
197 205
198 .num_device_descs = 1, 206 .num_device_descs = 1,
199 .devices = { 207 .devices = {
@@ -205,36 +213,40 @@ static struct dvb_usb_properties wt220u_properties = {
205 } 213 }
206}; 214};
207 215
208static struct dvb_usb_properties wt220u_fc_properties = { 216static struct dvb_usb_device_properties wt220u_fc_properties = {
209 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
210 .pid_filter_count = 15,
211
212 .usb_ctrl = CYPRESS_FX2, 217 .usb_ctrl = CYPRESS_FX2,
213 .firmware = "dvb-usb-wt220u-fc03.fw", 218 .firmware = "dvb-usb-wt220u-fc03.fw",
214 219
215 .power_ctrl = dtt200u_power_ctrl, 220 .num_adapters = 1,
221 .adapter = {
222 {
223 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
224 .pid_filter_count = 15,
225
216 .streaming_ctrl = dtt200u_streaming_ctrl, 226 .streaming_ctrl = dtt200u_streaming_ctrl,
217 .pid_filter = dtt200u_pid_filter, 227 .pid_filter = dtt200u_pid_filter,
218 .frontend_attach = dtt200u_frontend_attach, 228 .frontend_attach = dtt200u_frontend_attach,
219
220 .rc_interval = 300,
221 .rc_key_map = dtt200u_rc_keys,
222 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
223 .rc_query = dtt200u_rc_query,
224
225 .generic_bulk_ctrl_endpoint = 0x01,
226
227 /* parameter for the MPEG2-data transfer */ 229 /* parameter for the MPEG2-data transfer */
228 .urb = { 230 .stream = {
229 .type = DVB_USB_BULK, 231 .type = USB_BULK,
230 .count = 7, 232 .count = 7,
231 .endpoint = 0x86, 233 .endpoint = 0x06,
232 .u = { 234 .u = {
233 .bulk = { 235 .bulk = {
234 .buffersize = 4096, 236 .buffersize = 4096,
235 } 237 }
236 } 238 }
237 }, 239 },
240 }
241 },
242 .power_ctrl = dtt200u_power_ctrl,
243
244 .rc_interval = 300,
245 .rc_key_map = dtt200u_rc_keys,
246 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
247 .rc_query = dtt200u_rc_query,
248
249 .generic_bulk_ctrl_endpoint = 0x01,
238 250
239 .num_device_descs = 1, 251 .num_device_descs = 1,
240 .devices = { 252 .devices = {
@@ -246,28 +258,22 @@ static struct dvb_usb_properties wt220u_fc_properties = {
246 } 258 }
247}; 259};
248 260
249static struct dvb_usb_properties wt220u_zl0353_properties = { 261static struct dvb_usb_device_properties wt220u_zl0353_properties = {
250 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
251 .pid_filter_count = 15,
252
253 .usb_ctrl = CYPRESS_FX2, 262 .usb_ctrl = CYPRESS_FX2,
254 .firmware = "dvb-usb-wt220u-zl0353-01.fw", 263 .firmware = "dvb-usb-wt220u-zl0353-01.fw",
255 264
256 .power_ctrl = dtt200u_power_ctrl, 265 .num_adapters = 1,
266 .adapter = {
267 {
268 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
269 .pid_filter_count = 15,
270
257 .streaming_ctrl = dtt200u_streaming_ctrl, 271 .streaming_ctrl = dtt200u_streaming_ctrl,
258 .pid_filter = dtt200u_pid_filter, 272 .pid_filter = dtt200u_pid_filter,
259 .frontend_attach = dtt200u_frontend_attach, 273 .frontend_attach = dtt200u_frontend_attach,
260
261 .rc_interval = 300,
262 .rc_key_map = dtt200u_rc_keys,
263 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
264 .rc_query = dtt200u_rc_query,
265
266 .generic_bulk_ctrl_endpoint = 0x01,
267
268 /* parameter for the MPEG2-data transfer */ 274 /* parameter for the MPEG2-data transfer */
269 .urb = { 275 .stream = {
270 .type = DVB_USB_BULK, 276 .type = USB_BULK,
271 .count = 7, 277 .count = 7,
272 .endpoint = 0x02, 278 .endpoint = 0x02,
273 .u = { 279 .u = {
@@ -276,6 +282,16 @@ static struct dvb_usb_properties wt220u_zl0353_properties = {
276 } 282 }
277 } 283 }
278 }, 284 },
285 }
286 },
287 .power_ctrl = dtt200u_power_ctrl,
288
289 .rc_interval = 300,
290 .rc_key_map = dtt200u_rc_keys,
291 .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
292 .rc_query = dtt200u_rc_query,
293
294 .generic_bulk_ctrl_endpoint = 0x01,
279 295
280 .num_device_descs = 1, 296 .num_device_descs = 1,
281 .devices = { 297 .devices = {