diff options
author | Olivier DANET <odanet@caramail.com> | 2006-08-08 14:48:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 10:53:41 -0400 |
commit | a16bf5d5603184dc1db88f37051881b2eeacfd17 (patch) | |
tree | dbb50cc4d2e8ec9d7e57853e391181735b2ae809 /drivers/media/dvb/dvb-usb | |
parent | 47922e9c3f583adf05a23842ff98f3b0bf7eec6d (diff) |
V4L/DVB: Adding support for MT2060 and thus for some DVB-USB-devices based on it
- MT2060 tuner driver
- Added support for some USB DVB-T devices based on Dib3000P
Signed-off-by: Olivier DANET <odanet@caramail.com>
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/dibusb-common.c | 68 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mb.c | 7 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-mc.c | 27 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb.h | 9 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 15 |
5 files changed, 105 insertions, 21 deletions
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index abd75b4a350d..4d3d0d3dab95 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -168,15 +168,63 @@ int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val) | |||
168 | } | 168 | } |
169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); | 169 | EXPORT_SYMBOL(dibusb_read_eeprom_byte); |
170 | 170 | ||
171 | static struct mt2060_config default_mt2060_config = { | ||
172 | .i2c_address = 0x60, | ||
173 | }; | ||
174 | |||
175 | static int dibusb_tuner_init(struct dvb_frontend *fe) | ||
176 | { | ||
177 | int ret; | ||
178 | struct dvb_usb_device *d = fe->dvb->priv; | ||
179 | struct dibusb_state *st = d->priv; | ||
180 | |||
181 | if (d->tuner_pass_ctrl) { | ||
182 | if ((int)d->fe->misc_priv==DIBUSB_TUNER_MT2060) { // Microtune MT2060 | ||
183 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); | ||
184 | ret=mt2060_init(&st->mt2060); | ||
185 | } | ||
186 | else { // Panasonic whatever | ||
187 | d->tuner_pass_ctrl(d->fe,1,d->pll_addr); | ||
188 | ret=dvb_usb_pll_init_i2c(fe); | ||
189 | } | ||
190 | d->tuner_pass_ctrl(d->fe,0,0); | ||
191 | return ret; | ||
192 | } | ||
193 | return -ENODEV; | ||
194 | } | ||
195 | |||
196 | static int dibusb_tuner_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) | ||
197 | { | ||
198 | int ret; | ||
199 | struct dvb_usb_device *d = fe->dvb->priv; | ||
200 | struct dibusb_state *st = d->priv; | ||
201 | |||
202 | if (d->tuner_pass_ctrl) { | ||
203 | if ((int)d->fe->misc_priv==DIBUSB_TUNER_MT2060) { | ||
204 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); | ||
205 | ret=mt2060_set(&st->mt2060,fep); | ||
206 | } | ||
207 | else { | ||
208 | d->tuner_pass_ctrl(d->fe,1,d->pll_addr); | ||
209 | ret=dvb_usb_pll_set_i2c(fe,fep); | ||
210 | } | ||
211 | d->tuner_pass_ctrl(d->fe,0,0); | ||
212 | return ret; | ||
213 | } | ||
214 | return -ENODEV; | ||
215 | } | ||
216 | |||
171 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) | 217 | int dibusb_dib3000mc_frontend_attach(struct dvb_usb_device *d) |
172 | { | 218 | { |
173 | struct dib3000_config demod_cfg; | 219 | struct dib3000_config demod_cfg; |
174 | struct dibusb_state *st = d->priv; | 220 | struct dibusb_state *st = d->priv; |
175 | 221 | ||
222 | demod_cfg.pll_set = dibusb_tuner_set; | ||
223 | demod_cfg.pll_init = dibusb_tuner_init; | ||
224 | |||
176 | for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) | 225 | for (demod_cfg.demod_address = 0x8; demod_cfg.demod_address < 0xd; demod_cfg.demod_address++) |
177 | if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { | 226 | if ((d->fe = dib3000mc_attach(&demod_cfg,&d->i2c_adap,&st->ops)) != NULL) { |
178 | d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; | 227 | d->fe->misc_priv=(void *)DIBUSB_TUNER_DEFAULT; |
179 | d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; | ||
180 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; | 228 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; |
181 | return 0; | 229 | return 0; |
182 | } | 230 | } |
@@ -187,13 +235,19 @@ EXPORT_SYMBOL(dibusb_dib3000mc_frontend_attach); | |||
187 | 235 | ||
188 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) | 236 | int dibusb_dib3000mc_tuner_attach (struct dvb_usb_device *d) |
189 | { | 237 | { |
238 | int ret; | ||
190 | d->pll_addr = 0x60; | 239 | d->pll_addr = 0x60; |
191 | d->pll_desc = &dvb_pll_env57h1xd5; | 240 | d->pll_desc = &dvb_pll_env57h1xd5; |
192 | 241 | if (d->tuner_pass_ctrl) { | |
193 | d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; | 242 | struct dibusb_state *st = d->priv; |
194 | d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; | 243 | d->tuner_pass_ctrl(d->fe,1,default_mt2060_config.i2c_address); |
195 | 244 | if ((ret = mt2060_attach(&st->mt2060,&default_mt2060_config, &d->i2c_adap)) == 0) { | |
196 | return 0; | 245 | d->fe->misc_priv=(void *)DIBUSB_TUNER_MT2060; |
246 | } | ||
247 | d->tuner_pass_ctrl(d->fe,0,0); | ||
248 | return 0; | ||
249 | } | ||
250 | return -ENODEV; | ||
197 | } | 251 | } |
198 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); | 252 | EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); |
199 | 253 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index f4c45f386ebc..dd5a13195886 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c | |||
@@ -20,12 +20,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d) | |||
20 | struct dibusb_state *st = d->priv; | 20 | struct dibusb_state *st = d->priv; |
21 | 21 | ||
22 | demod_cfg.demod_address = 0x8; | 22 | demod_cfg.demod_address = 0x8; |
23 | demod_cfg.pll_set = dvb_usb_pll_set_i2c; | ||
24 | demod_cfg.pll_init = dvb_usb_pll_init_i2c; | ||
23 | 25 | ||
24 | if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) { | 26 | if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) |
25 | d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c; | ||
26 | d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c; | ||
27 | return -ENODEV; | 27 | return -ENODEV; |
28 | } | ||
29 | 28 | ||
30 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; | 29 | d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl; |
31 | 30 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index 55802fba3c29..2ef3d739abba 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -28,6 +28,13 @@ static struct usb_device_id dibusb_dib3000mc_table [] = { | |||
28 | /* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) }, | 28 | /* 00 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) }, |
29 | /* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) }, | 29 | /* 01 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) }, |
30 | /* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, | 30 | /* 02 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, |
31 | /* 03 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_WARM) }, // ( ? ) | ||
32 | /* 04 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_COLD) }, | ||
33 | /* 05 */ { USB_DEVICE(USB_VID_LITEON, USB_PID_LITEON_DVB_T_WARM) }, | ||
34 | /* 06 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_COLD) }, | ||
35 | /* 07 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_DIGIVOX_MINI_SL_WARM) }, | ||
36 | /* 08 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_COLD) }, | ||
37 | /* 09 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB2_WARM) }, | ||
31 | { } /* Terminating entry */ | 38 | { } /* Terminating entry */ |
32 | }; | 39 | }; |
33 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); | 40 | MODULE_DEVICE_TABLE (usb, dibusb_dib3000mc_table); |
@@ -68,16 +75,30 @@ static struct dvb_usb_properties dibusb_mc_properties = { | |||
68 | } | 75 | } |
69 | }, | 76 | }, |
70 | 77 | ||
71 | .num_device_descs = 2, | 78 | .num_device_descs = 5, |
72 | .devices = { | 79 | .devices = { |
73 | { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", | 80 | { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", |
74 | { &dibusb_dib3000mc_table[0], NULL }, | 81 | { &dibusb_dib3000mc_table[0], NULL }, |
75 | { &dibusb_dib3000mc_table[1], NULL }, | 82 | { &dibusb_dib3000mc_table[1], NULL }, |
76 | }, | 83 | }, |
77 | { "Artec T1 USB2.0 TVBOX (please report the warm ID)", | 84 | { "Artec T1 USB2.0 TVBOX (please check the warm ID)", |
78 | { &dibusb_dib3000mc_table[2], NULL }, | 85 | { &dibusb_dib3000mc_table[2], NULL }, |
79 | { NULL }, | 86 | { &dibusb_dib3000mc_table[3], NULL }, |
80 | }, | 87 | }, |
88 | { "LITE-ON USB2.0 DVB-T Tuner", | ||
89 | /* Also rebranded as Intuix S800, Toshiba */ | ||
90 | { &dibusb_dib3000mc_table[4], NULL }, | ||
91 | { &dibusb_dib3000mc_table[5], NULL }, | ||
92 | }, | ||
93 | { "MSI Digivox Mini SL", | ||
94 | { &dibusb_dib3000mc_table[6], NULL }, | ||
95 | { &dibusb_dib3000mc_table[7], NULL }, | ||
96 | }, | ||
97 | { "GRAND - USB2.0 DVB-T adapter", | ||
98 | { &dibusb_dib3000mc_table[8], NULL }, | ||
99 | { &dibusb_dib3000mc_table[9], NULL }, | ||
100 | }, | ||
101 | { NULL }, | ||
81 | } | 102 | } |
82 | }; | 103 | }; |
83 | 104 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index 2d99d05c7eab..f3e3ea8c8dbb 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "dvb-usb.h" | 17 | #include "dvb-usb.h" |
18 | 18 | ||
19 | #include "dib3000.h" | 19 | #include "dib3000.h" |
20 | #include "mt2060.h" | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * protocol of all dibusb related devices | 23 | * protocol of all dibusb related devices |
@@ -94,8 +95,16 @@ | |||
94 | #define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 | 95 | #define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 |
95 | #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 | 96 | #define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 |
96 | 97 | ||
98 | /* Tuner types. | ||
99 | These constants shall correspond to the proper AGC values in the array | ||
100 | dib3000mc_agc_tuner[][12] in dib3000mc_priv.h */ | ||
101 | #define DIBUSB_TUNER_DEFAULT 1 // a.k.a Panasonic | ||
102 | #define DIBUSB_TUNER_MT2060 4 | ||
103 | |||
104 | |||
97 | struct dibusb_state { | 105 | struct dibusb_state { |
98 | struct dib_fe_xfer_ops ops; | 106 | struct dib_fe_xfer_ops ops; |
107 | struct mt2060_state mt2060; | ||
99 | 108 | ||
100 | /* for RC5 remote control */ | 109 | /* for RC5 remote control */ |
101 | int old_toggle; | 110 | int old_toggle; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index f10f49ad9b20..6039e67425ac 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #define USB_VID_VISIONPLUS 0x13d3 | 31 | #define USB_VID_VISIONPLUS 0x13d3 |
32 | #define USB_VID_TWINHAN 0x1822 | 32 | #define USB_VID_TWINHAN 0x1822 |
33 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 | 33 | #define USB_VID_ULTIMA_ELECTRONIC 0x05d8 |
34 | #define USB_VID_GENPIX 0x09c0 | 34 | #define USB_VID_LITEON 0x04ca |
35 | 35 | ||
36 | /* Product IDs */ | 36 | /* Product IDs */ |
37 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 | 37 | #define USB_PID_ADSTECH_USB2_COLD 0xa333 |
@@ -84,10 +84,6 @@ | |||
84 | #define USB_PID_DTT200U_WARM 0x0301 | 84 | #define USB_PID_DTT200U_WARM 0x0301 |
85 | #define USB_PID_WT220U_COLD 0x0222 | 85 | #define USB_PID_WT220U_COLD 0x0222 |
86 | #define USB_PID_WT220U_WARM 0x0221 | 86 | #define USB_PID_WT220U_WARM 0x0221 |
87 | #define USB_PID_WT220U_FC_COLD 0x0225 | ||
88 | #define USB_PID_WT220U_FC_WARM 0x0226 | ||
89 | #define USB_PID_WT220U_ZL0353_COLD 0x022a | ||
90 | #define USB_PID_WT220U_ZL0353_WARM 0x022b | ||
91 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 | 87 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 |
92 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 88 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
93 | #define USB_PID_NEBULA_DIGITV 0x0201 | 89 | #define USB_PID_NEBULA_DIGITV 0x0201 |
@@ -107,6 +103,11 @@ | |||
107 | #define USB_PID_KYE_DVB_T_WARM 0x701f | 103 | #define USB_PID_KYE_DVB_T_WARM 0x701f |
108 | #define USB_PID_PCTV_200E 0x020e | 104 | #define USB_PID_PCTV_200E 0x020e |
109 | #define USB_PID_PCTV_400E 0x020f | 105 | #define USB_PID_PCTV_400E 0x020f |
110 | #define USB_PID_GENPIX_8PSK_COLD 0x0200 | 106 | #define USB_PID_LITEON_DVB_T_COLD 0xf000 |
111 | #define USB_PID_GENPIX_8PSK_WARM 0x0201 | 107 | #define USB_PID_LITEON_DVB_T_WARM 0xf001 |
108 | #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 | ||
109 | #define USB_PID_DIGIVOX_MINI_SL_WARM 0xe361 | ||
110 | #define USB_PID_GRANDTEC_DVBT_USB2_COLD 0x0bc6 | ||
111 | #define USB_PID_GRANDTEC_DVBT_USB2_WARM 0x0bc7 | ||
112 | |||
112 | #endif | 113 | #endif |