aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-09-19 11:51:33 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-03 14:12:27 -0400
commit136cafbf4a024b52ba0a10627217f03cea9ff9f8 (patch)
treecf827cb4d792a82a9c7b30bccc0db71547607472 /drivers/media/dvb/dvb-usb
parent6870ab576c86a496869fbd5bb339da7e442ee7f5 (diff)
V4L/DVB (4646): Misc. changes, DiB3000MC, MT2060
Changed the attach-function of the dib3000mc-driver to return only one frontend. In case of multiple dib3000-chips on one board, one has to call the i2c-enumeration manually before. Added a field to Microtune 2060 config to output the clock to other tuners/device on a board. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/Makefile1
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-common.c11
-rw-r--r--drivers/media/dvb/dvb-usb/dibusb-mc.c1
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-firmware.c6
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-ids.h6
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h41
-rw-r--r--drivers/media/dvb/dvb-usb/usb-urb.c2
7 files changed, 34 insertions, 34 deletions
diff --git a/drivers/media/dvb/dvb-usb/Makefile b/drivers/media/dvb/dvb-usb/Makefile
index 275cbc2925c..e239107998e 100644
--- a/drivers/media/dvb/dvb-usb/Makefile
+++ b/drivers/media/dvb/dvb-usb/Makefile
@@ -37,5 +37,6 @@ dvb-usb-cxusb-objs = cxusb.o
37obj-$(CONFIG_DVB_USB_CXUSB) += dvb-usb-cxusb.o 37obj-$(CONFIG_DVB_USB_CXUSB) += dvb-usb-cxusb.o
38 38
39dvb-usb-dib0700-objs = dib0700_core.o dib0700_devices.o 39dvb-usb-dib0700-objs = dib0700_core.o dib0700_devices.o
40obj-$(CONFIG_DVB_USB_DIB0700) += dvb-usb-dib0700.o
40 41
41EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ 42EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c
index 5f8afec96a3..b4d6e539ff5 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-common.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-common.c
@@ -230,8 +230,8 @@ static struct dib3000mc_config mod3000p_dib3000p_config = {
230 230
231int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap) 231int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *adap)
232{ 232{
233 if (dib3000mc_attach(&adap->dev->i2c_adap, 1, DEFAULT_DIB3000P_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &adap->fe) == 0 || 233 if ((adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000P_I2C_ADDRESS, &mod3000p_dib3000p_config)) == NULL ||
234 dib3000mc_attach(&adap->dev->i2c_adap, 1, DEFAULT_DIB3000MC_I2C_ADDRESS, 0, &mod3000p_dib3000p_config, &adap->fe) == 0) { 234 (adap->fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, DEFAULT_DIB3000MC_I2C_ADDRESS, &mod3000p_dib3000p_config)) == NULL) {
235 if (adap->priv != NULL) { 235 if (adap->priv != NULL) {
236 struct dibusb_state *st = adap->priv; 236 struct dibusb_state *st = adap->priv;
237 st->ops.pid_parse = dib3000mc_pid_parse; 237 st->ops.pid_parse = dib3000mc_pid_parse;
@@ -247,10 +247,9 @@ static struct mt2060_config stk3000p_mt2060_config = {
247 0x60 247 0x60
248}; 248};
249 249
250int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *adap) 250int dibusb_dib3000mc_tuner_attach(struct dvb_usb_adapter *adap)
251{ 251{
252 struct dibusb_state *st = adap->priv; 252 struct dibusb_state *st = adap->priv;
253 int ret;
254 u8 a,b; 253 u8 a,b;
255 u16 if1 = 1220; 254 u16 if1 = 1220;
256 struct i2c_adapter *tun_i2c; 255 struct i2c_adapter *tun_i2c;
@@ -287,9 +286,9 @@ int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *adap)
287 } 286 }
288 287
289 tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1); 288 tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe, 1);
290 if ((ret = mt2060_attach(adap->fe, tun_i2c, &stk3000p_mt2060_config, if1)) != 0) { 289 if (dvb_attach(mt2060_attach, adap->fe, tun_i2c, &stk3000p_mt2060_config, if1) != NULL) {
291 /* not found - use panasonic pll parameters */ 290 /* not found - use panasonic pll parameters */
292 if (dvb_pll_attach(adap->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL) 291 if (dvb_attach(dvb_pll_attach, adap->fe, 0x60, tun_i2c, &dvb_pll_env57h1xd5) == NULL)
293 return -ENOMEM; 292 return -ENOMEM;
294 } else { 293 } else {
295 st->mt2060_present = 1; 294 st->mt2060_present = 1;
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c
index d823e7d5b26..a0fd37efc04 100644
--- a/drivers/media/dvb/dvb-usb/dibusb-mc.c
+++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c
@@ -49,7 +49,6 @@ static struct dvb_usb_device_properties dibusb_mc_properties = {
49 .usb_ctrl = CYPRESS_FX2, 49 .usb_ctrl = CYPRESS_FX2,
50 .firmware = "dvb-usb-dibusb-6.0.0.8.fw", 50 .firmware = "dvb-usb-dibusb-6.0.0.8.fw",
51 51
52
53 .num_adapters = 1, 52 .num_adapters = 1,
54 .adapter = { 53 .adapter = {
55 { 54 {
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
index 122ff8157d1..e1112e39fb6 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
@@ -24,9 +24,6 @@ static struct usb_cypress_controller cypress[] = {
24 { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 }, 24 { .id = CYPRESS_FX2, .name = "Cypress FX2", .cpu_cs_register = 0xe600 },
25}; 25};
26 26
27static int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
28 int *pos);
29
30/* 27/*
31 * load a firmware packet to the device 28 * load a firmware packet to the device
32 */ 29 */
@@ -115,7 +112,7 @@ int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_device_pro
115 return ret; 112 return ret;
116} 113}
117 114
118static int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, 115int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
119 int *pos) 116 int *pos)
120{ 117{
121 u8 *b = (u8 *) &fw->data[*pos]; 118 u8 *b = (u8 *) &fw->data[*pos];
@@ -146,3 +143,4 @@ static int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx,
146 143
147 return *pos; 144 return *pos;
148} 145}
146EXPORT_SYMBOL(dvb_usb_get_hexline);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
index 57a10de1d3d..feb098727dc 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
@@ -52,8 +52,7 @@
52#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 52#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9
53#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 53#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6
54#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 54#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7
55#define USB_PID_DIBCOM_STK7700 0x1e14 55#define USB_PID_DIBCOM_STK7700P 0x1e14
56#define USB_PID_DIBCOM_STK7700_REENUM 0x1e15
57#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 56#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131
58#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 57#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0
59#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 58#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1
@@ -95,6 +94,9 @@
95#define USB_PID_WT220U_ZL0353_WARM 0x022b 94#define USB_PID_WT220U_ZL0353_WARM 0x022b
96#define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 95#define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300
97#define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 96#define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301
97#define USB_PID_HAUPPAUGE_NOVA_T_500 0x1234
98#define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x1234
99#define USB_PID_AVERMEDIA_VOLAR 0x1234
98#define USB_PID_NEBULA_DIGITV 0x0201 100#define USB_PID_NEBULA_DIGITV 0x0201
99#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 101#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820
100#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 102#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 5546554d387..44b49db4992 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -90,8 +90,8 @@ struct dvb_usb_adapter;
90struct usb_data_stream; 90struct usb_data_stream;
91 91
92/** 92/**
93 * Properties of USB streaming - TODO this structure does not belong here actually 93 * Properties of USB streaming - TODO this structure should be somewhere else
94 * describes the kind of USB transfer used for MPEG2-TS-streaming. 94 * describes the kind of USB transfer used for data-streaming.
95 * (BULK or ISOC) 95 * (BULK or ISOC)
96 */ 96 */
97struct usb_data_stream_properties { 97struct usb_data_stream_properties {
@@ -193,10 +193,10 @@ struct dvb_usb_device_properties {
193#define CYPRESS_AN2135 1 193#define CYPRESS_AN2135 1
194#define CYPRESS_AN2235 2 194#define CYPRESS_AN2235 2
195#define CYPRESS_FX2 3 195#define CYPRESS_FX2 3
196 int usb_ctrl; 196 int usb_ctrl;
197 int (*download_firmware) (struct usb_device *, const struct firmware *);
197 const char firmware[FIRMWARE_NAME_MAX]; 198 const char firmware[FIRMWARE_NAME_MAX];
198 int (*download_firmware) (struct usb_device *, const struct firmware *); 199 int no_reconnect;
199 int no_reconnect;
200 200
201 int size_of_priv; 201 int size_of_priv;
202 202
@@ -212,7 +212,7 @@ struct dvb_usb_device_properties {
212#define REMOTE_NO_KEY_PRESSED 0x00 212#define REMOTE_NO_KEY_PRESSED 0x00
213#define REMOTE_KEY_PRESSED 0x01 213#define REMOTE_KEY_PRESSED 0x01
214#define REMOTE_KEY_REPEAT 0x02 214#define REMOTE_KEY_REPEAT 0x02
215 struct dvb_usb_rc_key *rc_key_map; 215 struct dvb_usb_rc_key *rc_key_map;
216 int rc_key_map_size; 216 int rc_key_map_size;
217 int (*rc_query) (struct dvb_usb_device *, u32 *, int *); 217 int (*rc_query) (struct dvb_usb_device *, u32 *, int *);
218 int rc_interval; 218 int rc_interval;
@@ -234,13 +234,11 @@ struct dvb_usb_device_properties {
234 * 234 *
235 * @urbs_initialized: number of URBs initialized. 235 * @urbs_initialized: number of URBs initialized.
236 * @urbs_submitted: number of URBs submitted. 236 * @urbs_submitted: number of URBs submitted.
237 *
238 * TODO put this in the correct place.
239 */ 237 */
240#define MAX_NO_URBS_FOR_DATA_STREAM 10 238#define MAX_NO_URBS_FOR_DATA_STREAM 10
241struct usb_data_stream { 239struct usb_data_stream {
242 struct usb_device *udev; 240 struct usb_device *udev;
243 struct usb_data_stream_properties props; 241 struct usb_data_stream_properties props;
244 242
245#define USB_STATE_INIT 0x00 243#define USB_STATE_INIT 0x00
246#define USB_STATE_URB_BUF 0x01 244#define USB_STATE_URB_BUF 0x01
@@ -248,12 +246,11 @@ struct usb_data_stream {
248 246
249 void (*complete) (struct usb_data_stream *, u8 *, size_t); 247 void (*complete) (struct usb_data_stream *, u8 *, size_t);
250 248
251 struct urb *urb_list[MAX_NO_URBS_FOR_DATA_STREAM]; 249 struct urb *urb_list[MAX_NO_URBS_FOR_DATA_STREAM];
252 250 int buf_num;
253 int buf_num; 251 unsigned long buf_size;
254 unsigned long buf_size; 252 u8 *buf_list[MAX_NO_URBS_FOR_DATA_STREAM];
255 u8 *buf_list[MAX_NO_URBS_FOR_DATA_STREAM]; 253 dma_addr_t dma_addr[MAX_NO_URBS_FOR_DATA_STREAM];
256 dma_addr_t dma_addr[MAX_NO_URBS_FOR_DATA_STREAM];
257 254
258 int urbs_initialized; 255 int urbs_initialized;
259 int urbs_submitted; 256 int urbs_submitted;
@@ -271,8 +268,8 @@ struct usb_data_stream {
271 * @pll_addr: I2C address of the tuner for programming 268 * @pll_addr: I2C address of the tuner for programming
272 * @pll_init: array containing the initialization buffer 269 * @pll_init: array containing the initialization buffer
273 * @pll_desc: pointer to the appropriate struct dvb_pll_desc 270 * @pll_desc: pointer to the appropriate struct dvb_pll_desc
274 *
275 * @tuner_pass_ctrl: called to (de)activate tuner passthru of the demod or the board 271 * @tuner_pass_ctrl: called to (de)activate tuner passthru of the demod or the board
272 *
276 * @dvb_adap: device's dvb_adapter. 273 * @dvb_adap: device's dvb_adapter.
277 * @dmxdev: device's dmxdev. 274 * @dmxdev: device's dmxdev.
278 * @demux: device's software demuxer. 275 * @demux: device's software demuxer.
@@ -280,8 +277,10 @@ struct usb_data_stream {
280 * @dvb_frontend: device's frontend. 277 * @dvb_frontend: device's frontend.
281 * @max_feed_count: how many feeds can be handled simultaneously by this 278 * @max_feed_count: how many feeds can be handled simultaneously by this
282 * device 279 * device
280 *
281 * @fe_init: rerouted frontend-init (wakeup) function.
283 * @fe_sleep: rerouted frontend-sleep function. 282 * @fe_sleep: rerouted frontend-sleep function.
284 * @fe_init: rerouted frontend-init (wakeup) function. 283 *
285 * @stream: the usb data stream. 284 * @stream: the usb data stream.
286 */ 285 */
287struct dvb_usb_adapter { 286struct dvb_usb_adapter {
@@ -292,7 +291,7 @@ struct dvb_usb_adapter {
292#define DVB_USB_ADAP_STATE_DVB 0x001 291#define DVB_USB_ADAP_STATE_DVB 0x001
293 int state; 292 int state;
294 293
295 int id; 294 u8 id;
296 295
297 int feedcount; 296 int feedcount;
298 int pid_filtering; 297 int pid_filtering;
@@ -311,8 +310,8 @@ struct dvb_usb_adapter {
311 struct dvb_frontend *fe; 310 struct dvb_frontend *fe;
312 int max_feed_count; 311 int max_feed_count;
313 312
314 int (*fe_sleep) (struct dvb_frontend *);
315 int (*fe_init) (struct dvb_frontend *); 313 int (*fe_init) (struct dvb_frontend *);
314 int (*fe_sleep) (struct dvb_frontend *);
316 315
317 struct usb_data_stream stream; 316 struct usb_data_stream stream;
318 317
@@ -400,5 +399,7 @@ struct hexline {
400 u8 chk; 399 u8 chk;
401}; 400};
402extern int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type); 401extern int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type);
402extern int dvb_usb_get_hexline(const struct firmware *fw, struct hexline *hx, int *pos);
403
403 404
404#endif 405#endif
diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c
index f2f3bb6044a..8728cf347a7 100644
--- a/drivers/media/dvb/dvb-usb/usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/usb-urb.c
@@ -122,7 +122,7 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
122 usb_free_stream_buffers(stream); 122 usb_free_stream_buffers(stream);
123 return -ENOMEM; 123 return -ENOMEM;
124 } 124 }
125 deb_mem("buffer %d: %p (dma: %ld)\n", 125 deb_mem("buffer %d: %p (dma: %u)\n",
126 stream->buf_num, stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]); 126 stream->buf_num, stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
127 memset(stream->buf_list[stream->buf_num],0,size); 127 memset(stream->buf_list[stream->buf_num],0,size);
128 stream->state |= USB_STATE_URB_BUF; 128 stream->state |= USB_STATE_URB_BUF;