diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2005-07-07 20:58:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:24:03 -0400 |
commit | d590f9c20e15620ba708e5bd71d345bf1b7b0d73 (patch) | |
tree | 938e37de3c945d3fb035f487a802ae574aa599a8 /drivers/media | |
parent | 4b2bd30eb79c292a83b1dfd3cca6d435c02fd5c0 (diff) |
[PATCH] dvb: usb: add supprt for WideView WT-220U
Add support and rewrote some parts with the help of vendor information
(Thanks to Steve Chang from WideView, Inc.):
o added support for the WT-220U (Pensize DVB-T receiver)
o corrected byte order for unc,ber and the pid filter
o corrected number of pids that can be fetched at the same time.
o added some comments in Kconfig-file
o added USB IDs for the WT-220U
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u-fe.c | 72 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u.c | 86 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dtt200u.h | 38 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 3 |
5 files changed, 130 insertions, 73 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 91e88b2ed5d0..612e5b087b1c 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -109,9 +109,11 @@ config DVB_USB_NOVA_T_USB2 | |||
109 | Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver. | 109 | Say Y here to support the Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 receiver. |
110 | 110 | ||
111 | config DVB_USB_DTT200U | 111 | config DVB_USB_DTT200U |
112 | tristate "WideView/Yakumo/Hama/Typhoon/Yuan DVB-T USB2.0 support" | 112 | tristate "WideView WT-200U and WT-220U (pen) DVB-T USB2.0 support (Yakumo/Hama/Typhoon/Yuan)" |
113 | depends on DVB_USB | 113 | depends on DVB_USB |
114 | help | 114 | help |
115 | Say Y here to support the WideView/Yakumo/Hama/Typhoon/Yuan DVB-T USB2.0 receiver. | 115 | Say Y here to support the WideView/Yakumo/Hama/Typhoon/Yuan DVB-T USB2.0 receiver. |
116 | 116 | ||
117 | The receivers are also known as DTT200U (Yakumo) and UB300 (Yuan). | 117 | The receivers are also known as DTT200U (Yakumo) and UB300 (Yuan). |
118 | |||
119 | The WT-220U and its clones are pen-sized. | ||
diff --git a/drivers/media/dvb/dvb-usb/dtt200u-fe.c b/drivers/media/dvb/dvb-usb/dtt200u-fe.c index 7807f33573b8..b032523b07bc 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u-fe.c +++ b/drivers/media/dvb/dvb-usb/dtt200u-fe.c | |||
@@ -14,61 +14,58 @@ | |||
14 | struct dtt200u_fe_state { | 14 | struct dtt200u_fe_state { |
15 | struct dvb_usb_device *d; | 15 | struct dvb_usb_device *d; |
16 | 16 | ||
17 | fe_status_t stat; | ||
18 | |||
17 | struct dvb_frontend_parameters fep; | 19 | struct dvb_frontend_parameters fep; |
18 | struct dvb_frontend frontend; | 20 | struct dvb_frontend frontend; |
19 | }; | 21 | }; |
20 | 22 | ||
21 | #define moan(which,what) info("unexpected value in '%s' for cmd '%02x' - please report to linux-dvb@linuxtv.org",which,what) | ||
22 | |||
23 | static int dtt200u_fe_read_status(struct dvb_frontend* fe, fe_status_t *stat) | 23 | static int dtt200u_fe_read_status(struct dvb_frontend* fe, fe_status_t *stat) |
24 | { | 24 | { |
25 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 25 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
26 | u8 bw = GET_TUNE_STAT; | 26 | u8 st = GET_TUNE_STATUS, b[3]; |
27 | u8 br[3] = { 0 }; | 27 | |
28 | // u8 bdeb[5] = { 0 }; | 28 | dvb_usb_generic_rw(state->d,&st,1,b,3,0); |
29 | 29 | ||
30 | dvb_usb_generic_rw(state->d,&bw,1,br,3,0); | 30 | switch (b[0]) { |
31 | switch (br[0]) { | ||
32 | case 0x01: | 31 | case 0x01: |
33 | *stat = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; | 32 | *stat = FE_HAS_SIGNAL | FE_HAS_CARRIER | |
33 | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; | ||
34 | break; | 34 | break; |
35 | case 0x00: | 35 | case 0x00: /* pending */ |
36 | *stat = 0; | 36 | *stat = FE_TIMEDOUT; /* during set_frontend */ |
37 | break; | 37 | break; |
38 | default: | 38 | default: |
39 | moan("br[0]",GET_TUNE_STAT); | 39 | case 0x02: /* failed */ |
40 | *stat = 0; | ||
40 | break; | 41 | break; |
41 | } | 42 | } |
42 | |||
43 | // bw[0] = 0x88; | ||
44 | // dvb_usb_generic_rw(state->d,bw,1,bdeb,5,0); | ||
45 | |||
46 | // deb_info("%02x: %02x %02x %02x %02x %02x\n",bw[0],bdeb[0],bdeb[1],bdeb[2],bdeb[3],bdeb[4]); | ||
47 | |||
48 | return 0; | 43 | return 0; |
49 | } | 44 | } |
45 | |||
50 | static int dtt200u_fe_read_ber(struct dvb_frontend* fe, u32 *ber) | 46 | static int dtt200u_fe_read_ber(struct dvb_frontend* fe, u32 *ber) |
51 | { | 47 | { |
52 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 48 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
53 | u8 bw = GET_BER; | 49 | u8 bw = GET_VIT_ERR_CNT,b[3]; |
54 | *ber = 0; | 50 | dvb_usb_generic_rw(state->d,&bw,1,b,3,0); |
55 | dvb_usb_generic_rw(state->d,&bw,1,(u8*) ber,3,0); | 51 | *ber = (b[0] << 16) | (b[1] << 8) | b[2]; |
56 | return 0; | 52 | return 0; |
57 | } | 53 | } |
58 | 54 | ||
59 | static int dtt200u_fe_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) | 55 | static int dtt200u_fe_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) |
60 | { | 56 | { |
61 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 57 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
62 | u8 bw = GET_UNK; | 58 | u8 bw = GET_RS_UNCOR_BLK_CNT,b[2]; |
63 | *unc = 0; | 59 | |
64 | dvb_usb_generic_rw(state->d,&bw,1,(u8*) unc,3,0); | 60 | dvb_usb_generic_rw(state->d,&bw,1,b,2,0); |
61 | *unc = (b[0] << 8) | b[1]; | ||
65 | return 0; | 62 | return 0; |
66 | } | 63 | } |
67 | 64 | ||
68 | static int dtt200u_fe_read_signal_strength(struct dvb_frontend* fe, u16 *strength) | 65 | static int dtt200u_fe_read_signal_strength(struct dvb_frontend* fe, u16 *strength) |
69 | { | 66 | { |
70 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 67 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
71 | u8 bw = GET_SIG_STRENGTH, b; | 68 | u8 bw = GET_AGC, b; |
72 | dvb_usb_generic_rw(state->d,&bw,1,&b,1,0); | 69 | dvb_usb_generic_rw(state->d,&bw,1,&b,1,0); |
73 | *strength = (b << 8) | b; | 70 | *strength = (b << 8) | b; |
74 | return 0; | 71 | return 0; |
@@ -86,7 +83,7 @@ static int dtt200u_fe_read_snr(struct dvb_frontend* fe, u16 *snr) | |||
86 | static int dtt200u_fe_init(struct dvb_frontend* fe) | 83 | static int dtt200u_fe_init(struct dvb_frontend* fe) |
87 | { | 84 | { |
88 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 85 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
89 | u8 b = RESET_DEMOD; | 86 | u8 b = SET_INIT; |
90 | return dvb_usb_generic_write(state->d,&b,1); | 87 | return dvb_usb_generic_write(state->d,&b,1); |
91 | } | 88 | } |
92 | 89 | ||
@@ -98,8 +95,8 @@ static int dtt200u_fe_sleep(struct dvb_frontend* fe) | |||
98 | static int dtt200u_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) | 95 | static int dtt200u_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) |
99 | { | 96 | { |
100 | tune->min_delay_ms = 1500; | 97 | tune->min_delay_ms = 1500; |
101 | tune->step_size = 166667; | 98 | tune->step_size = 0; |
102 | tune->max_drift = 166667 * 2; | 99 | tune->max_drift = 0; |
103 | return 0; | 100 | return 0; |
104 | } | 101 | } |
105 | 102 | ||
@@ -107,27 +104,32 @@ static int dtt200u_fe_set_frontend(struct dvb_frontend* fe, | |||
107 | struct dvb_frontend_parameters *fep) | 104 | struct dvb_frontend_parameters *fep) |
108 | { | 105 | { |
109 | struct dtt200u_fe_state *state = fe->demodulator_priv; | 106 | struct dtt200u_fe_state *state = fe->demodulator_priv; |
107 | int i; | ||
108 | fe_status_t st; | ||
110 | u16 freq = fep->frequency / 250000; | 109 | u16 freq = fep->frequency / 250000; |
111 | u8 bw,bwbuf[2] = { SET_BANDWIDTH, 0 }, freqbuf[3] = { SET_FREQUENCY, 0, 0 }; | 110 | u8 bwbuf[2] = { SET_BANDWIDTH, 0 },freqbuf[3] = { SET_RF_FREQ, 0, 0 }; |
112 | 111 | ||
113 | switch (fep->u.ofdm.bandwidth) { | 112 | switch (fep->u.ofdm.bandwidth) { |
114 | case BANDWIDTH_8_MHZ: bw = 8; break; | 113 | case BANDWIDTH_8_MHZ: bwbuf[1] = 8; break; |
115 | case BANDWIDTH_7_MHZ: bw = 7; break; | 114 | case BANDWIDTH_7_MHZ: bwbuf[1] = 7; break; |
116 | case BANDWIDTH_6_MHZ: bw = 6; break; | 115 | case BANDWIDTH_6_MHZ: bwbuf[1] = 6; break; |
117 | case BANDWIDTH_AUTO: return -EOPNOTSUPP; | 116 | case BANDWIDTH_AUTO: return -EOPNOTSUPP; |
118 | default: | 117 | default: |
119 | return -EINVAL; | 118 | return -EINVAL; |
120 | } | 119 | } |
121 | deb_info("set_frontend\n"); | ||
122 | 120 | ||
123 | bwbuf[1] = bw; | ||
124 | dvb_usb_generic_write(state->d,bwbuf,2); | 121 | dvb_usb_generic_write(state->d,bwbuf,2); |
125 | 122 | ||
126 | freqbuf[1] = freq & 0xff; | 123 | freqbuf[1] = freq & 0xff; |
127 | freqbuf[2] = (freq >> 8) & 0xff; | 124 | freqbuf[2] = (freq >> 8) & 0xff; |
128 | dvb_usb_generic_write(state->d,freqbuf,3); | 125 | dvb_usb_generic_write(state->d,freqbuf,3); |
129 | 126 | ||
130 | memcpy(&state->fep,fep,sizeof(struct dvb_frontend_parameters)); | 127 | for (i = 0; i < 30; i++) { |
128 | msleep(20); | ||
129 | dtt200u_fe_read_status(fe, &st); | ||
130 | if (st & FE_TIMEDOUT) | ||
131 | continue; | ||
132 | } | ||
131 | 133 | ||
132 | return 0; | 134 | return 0; |
133 | } | 135 | } |
@@ -174,7 +176,7 @@ success: | |||
174 | 176 | ||
175 | static struct dvb_frontend_ops dtt200u_fe_ops = { | 177 | static struct dvb_frontend_ops dtt200u_fe_ops = { |
176 | .info = { | 178 | .info = { |
177 | .name = "DTT200U (Yakumo/Typhoon/Hama) DVB-T", | 179 | .name = "WideView USB DVB-T", |
178 | .type = FE_OFDM, | 180 | .type = FE_OFDM, |
179 | .frequency_min = 44250000, | 181 | .frequency_min = 44250000, |
180 | .frequency_max = 867250000, | 182 | .frequency_max = 867250000, |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index 1ebd3eff96d1..47dba6e45968 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c | |||
@@ -3,6 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) | 4 | * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) |
5 | * | 5 | * |
6 | * Thanks to Steve Chang from WideView for providing support for the WT-220U. | ||
7 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of the GNU General Public License as published by the Free | 9 | * under the terms of the GNU General Public License as published by the Free |
8 | * Software Foundation, version 2. | 10 | * Software Foundation, version 2. |
@@ -16,14 +18,24 @@ int dvb_usb_dtt200u_debug; | |||
16 | module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644); | 18 | module_param_named(debug,dvb_usb_dtt200u_debug, int, 0644); |
17 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS); | 19 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2 (or-able))." DVB_USB_DEBUG_STATUS); |
18 | 20 | ||
21 | static int dtt200u_power_ctrl(struct dvb_usb_device *d, int onoff) | ||
22 | { | ||
23 | u8 b = SET_INIT; | ||
24 | |||
25 | if (onoff) | ||
26 | dvb_usb_generic_write(d,&b,2); | ||
27 | |||
28 | return 0; | ||
29 | } | ||
30 | |||
19 | static int dtt200u_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 31 | static int dtt200u_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
20 | { | 32 | { |
21 | u8 b_streaming[2] = { SET_TS_CTRL, onoff }; | 33 | u8 b_streaming[2] = { SET_STREAMING, onoff }; |
22 | u8 b_rst_pid = RESET_PID_FILTER; | 34 | u8 b_rst_pid = RESET_PID_FILTER; |
23 | 35 | ||
24 | dvb_usb_generic_write(d,b_streaming,2); | 36 | dvb_usb_generic_write(d,b_streaming,2); |
25 | 37 | ||
26 | if (!onoff) | 38 | if (onoff == 0) |
27 | dvb_usb_generic_write(d,&b_rst_pid,1); | 39 | dvb_usb_generic_write(d,&b_rst_pid,1); |
28 | return 0; | 40 | return 0; |
29 | } | 41 | } |
@@ -36,7 +48,7 @@ static int dtt200u_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int | |||
36 | b_pid[0] = SET_PID_FILTER; | 48 | b_pid[0] = SET_PID_FILTER; |
37 | b_pid[1] = index; | 49 | b_pid[1] = index; |
38 | b_pid[2] = pid & 0xff; | 50 | b_pid[2] = pid & 0xff; |
39 | b_pid[3] = (pid >> 8) & 0xff; | 51 | b_pid[3] = (pid >> 8) & 0x1f; |
40 | 52 | ||
41 | return dvb_usb_generic_write(d,b_pid,4); | 53 | return dvb_usb_generic_write(d,b_pid,4); |
42 | } | 54 | } |
@@ -54,9 +66,9 @@ static struct dvb_usb_rc_key dtt200u_rc_keys[] = { | |||
54 | { 0x80, 0x08, KEY_5 }, | 66 | { 0x80, 0x08, KEY_5 }, |
55 | { 0x80, 0x09, KEY_6 }, | 67 | { 0x80, 0x09, KEY_6 }, |
56 | { 0x80, 0x0a, KEY_7 }, | 68 | { 0x80, 0x0a, KEY_7 }, |
57 | { 0x00, 0x0c, KEY_ZOOM }, | 69 | { 0x80, 0x0c, KEY_ZOOM }, |
58 | { 0x80, 0x0d, KEY_0 }, | 70 | { 0x80, 0x0d, KEY_0 }, |
59 | { 0x00, 0x0e, KEY_SELECT }, | 71 | { 0x80, 0x0e, KEY_SELECT }, |
60 | { 0x80, 0x12, KEY_POWER }, | 72 | { 0x80, 0x12, KEY_POWER }, |
61 | { 0x80, 0x1a, KEY_CHANNELUP }, | 73 | { 0x80, 0x1a, KEY_CHANNELUP }, |
62 | { 0x80, 0x1b, KEY_8 }, | 74 | { 0x80, 0x1b, KEY_8 }, |
@@ -66,7 +78,7 @@ static struct dvb_usb_rc_key dtt200u_rc_keys[] = { | |||
66 | 78 | ||
67 | static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 79 | static int dtt200u_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
68 | { | 80 | { |
69 | u8 key[5],cmd = GET_RC_KEY; | 81 | u8 key[5],cmd = GET_RC_CODE; |
70 | dvb_usb_generic_rw(d,&cmd,1,key,5,0); | 82 | dvb_usb_generic_rw(d,&cmd,1,key,5,0); |
71 | dvb_usb_nec_rc_key_to_event(d,key,event,state); | 83 | dvb_usb_nec_rc_key_to_event(d,key,event,state); |
72 | if (key[0] != 0) | 84 | if (key[0] != 0) |
@@ -81,32 +93,41 @@ static int dtt200u_frontend_attach(struct dvb_usb_device *d) | |||
81 | } | 93 | } |
82 | 94 | ||
83 | static struct dvb_usb_properties dtt200u_properties; | 95 | static struct dvb_usb_properties dtt200u_properties; |
96 | static struct dvb_usb_properties wt220u_properties; | ||
84 | 97 | ||
85 | static int dtt200u_usb_probe(struct usb_interface *intf, | 98 | static int dtt200u_usb_probe(struct usb_interface *intf, |
86 | const struct usb_device_id *id) | 99 | const struct usb_device_id *id) |
87 | { | 100 | { |
88 | return dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE); | 101 | if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE) == 0 || |
102 | dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE) == 0) | ||
103 | return 0; | ||
104 | |||
105 | return -ENODEV; | ||
89 | } | 106 | } |
90 | 107 | ||
91 | static struct usb_device_id dtt200u_usb_table [] = { | 108 | static struct usb_device_id dtt200u_usb_table [] = { |
109 | // { USB_DEVICE(0x04b4,0x8613) }, | ||
92 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_COLD) }, | 110 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_COLD) }, |
93 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_WARM) }, | 111 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_WARM) }, |
112 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_COLD) }, | ||
113 | { USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) }, | ||
94 | { 0 }, | 114 | { 0 }, |
95 | }; | 115 | }; |
96 | MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); | 116 | MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); |
97 | 117 | ||
98 | static struct dvb_usb_properties dtt200u_properties = { | 118 | static struct dvb_usb_properties dtt200u_properties = { |
99 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING, | 119 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING, |
100 | .pid_filter_count = 255, /* It is a guess, but there are at least 10 */ | 120 | .pid_filter_count = 15, |
101 | 121 | ||
102 | .usb_ctrl = CYPRESS_FX2, | 122 | .usb_ctrl = CYPRESS_FX2, |
103 | .firmware = "dvb-usb-dtt200u-01.fw", | 123 | .firmware = "dvb-usb-dtt200u-01.fw", |
104 | 124 | ||
125 | .power_ctrl = dtt200u_power_ctrl, | ||
105 | .streaming_ctrl = dtt200u_streaming_ctrl, | 126 | .streaming_ctrl = dtt200u_streaming_ctrl, |
106 | .pid_filter = dtt200u_pid_filter, | 127 | .pid_filter = dtt200u_pid_filter, |
107 | .frontend_attach = dtt200u_frontend_attach, | 128 | .frontend_attach = dtt200u_frontend_attach, |
108 | 129 | ||
109 | .rc_interval = 200, | 130 | .rc_interval = 300, |
110 | .rc_key_map = dtt200u_rc_keys, | 131 | .rc_key_map = dtt200u_rc_keys, |
111 | .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), | 132 | .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), |
112 | .rc_query = dtt200u_rc_query, | 133 | .rc_query = dtt200u_rc_query, |
@@ -127,7 +148,7 @@ static struct dvb_usb_properties dtt200u_properties = { | |||
127 | 148 | ||
128 | .num_device_descs = 1, | 149 | .num_device_descs = 1, |
129 | .devices = { | 150 | .devices = { |
130 | { .name = "WideView/Yakumo/Hama/Typhoon DVB-T USB2.0)", | 151 | { .name = "WideView/Yuan/Yakumo/Hama/Typhoon DVB-T USB2.0 (WT-200U)", |
131 | .cold_ids = { &dtt200u_usb_table[0], NULL }, | 152 | .cold_ids = { &dtt200u_usb_table[0], NULL }, |
132 | .warm_ids = { &dtt200u_usb_table[1], NULL }, | 153 | .warm_ids = { &dtt200u_usb_table[1], NULL }, |
133 | }, | 154 | }, |
@@ -135,10 +156,51 @@ static struct dvb_usb_properties dtt200u_properties = { | |||
135 | } | 156 | } |
136 | }; | 157 | }; |
137 | 158 | ||
159 | static struct dvb_usb_properties wt220u_properties = { | ||
160 | .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING, | ||
161 | .pid_filter_count = 15, | ||
162 | |||
163 | .usb_ctrl = CYPRESS_FX2, | ||
164 | .firmware = "dvb-usb-wt220u-01.fw", | ||
165 | |||
166 | .power_ctrl = dtt200u_power_ctrl, | ||
167 | .streaming_ctrl = dtt200u_streaming_ctrl, | ||
168 | .pid_filter = dtt200u_pid_filter, | ||
169 | .frontend_attach = dtt200u_frontend_attach, | ||
170 | |||
171 | .rc_interval = 300, | ||
172 | .rc_key_map = dtt200u_rc_keys, | ||
173 | .rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys), | ||
174 | .rc_query = dtt200u_rc_query, | ||
175 | |||
176 | .generic_bulk_ctrl_endpoint = 0x01, | ||
177 | |||
178 | /* parameter for the MPEG2-data transfer */ | ||
179 | .urb = { | ||
180 | .type = DVB_USB_BULK, | ||
181 | .count = 7, | ||
182 | .endpoint = 0x02, | ||
183 | .u = { | ||
184 | .bulk = { | ||
185 | .buffersize = 4096, | ||
186 | } | ||
187 | } | ||
188 | }, | ||
189 | |||
190 | .num_device_descs = 1, | ||
191 | .devices = { | ||
192 | { .name = "WideView WT-220U PenType Receiver (and clones)", | ||
193 | .cold_ids = { &dtt200u_usb_table[2], NULL }, | ||
194 | .warm_ids = { &dtt200u_usb_table[3], NULL }, | ||
195 | }, | ||
196 | { 0 }, | ||
197 | } | ||
198 | }; | ||
199 | |||
138 | /* usb specific object needed to register this driver with the usb subsystem */ | 200 | /* usb specific object needed to register this driver with the usb subsystem */ |
139 | static struct usb_driver dtt200u_usb_driver = { | 201 | static struct usb_driver dtt200u_usb_driver = { |
140 | .owner = THIS_MODULE, | 202 | .owner = THIS_MODULE, |
141 | .name = "dtt200u", | 203 | .name = "dvb_usb_dtt200u", |
142 | .probe = dtt200u_usb_probe, | 204 | .probe = dtt200u_usb_probe, |
143 | .disconnect = dvb_usb_device_exit, | 205 | .disconnect = dvb_usb_device_exit, |
144 | .id_table = dtt200u_usb_table, | 206 | .id_table = dtt200u_usb_table, |
@@ -166,6 +228,6 @@ module_init(dtt200u_usb_module_init); | |||
166 | module_exit(dtt200u_usb_module_exit); | 228 | module_exit(dtt200u_usb_module_exit); |
167 | 229 | ||
168 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 230 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
169 | MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon DVB-T USB2.0 device"); | 231 | MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon DVB-T USB2.0 devices"); |
170 | MODULE_VERSION("1.0"); | 232 | MODULE_VERSION("1.0"); |
171 | MODULE_LICENSE("GPL"); | 233 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.h b/drivers/media/dvb/dvb-usb/dtt200u.h index 9ab081a55b84..6f1f3042e21a 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.h +++ b/drivers/media/dvb/dvb-usb/dtt200u.h | |||
@@ -22,44 +22,34 @@ extern int dvb_usb_dtt200u_debug; | |||
22 | /* guessed protocol description (reverse engineered): | 22 | /* guessed protocol description (reverse engineered): |
23 | * read | 23 | * read |
24 | * 00 - USB type 0x02 for usb2.0, 0x01 for usb1.1 | 24 | * 00 - USB type 0x02 for usb2.0, 0x01 for usb1.1 |
25 | * 81 - <TS_LOCK> <current frequency divided by 250000> | ||
26 | * 82 - crash - do not touch | ||
27 | * 83 - crash - do not touch | ||
28 | * 84 - remote control | ||
29 | * 85 - crash - do not touch (OK, stop testing here) | ||
30 | * 88 - locking 2 bytes (0x80 0x40 == no signal, 0x89 0x20 == nice signal) | 25 | * 88 - locking 2 bytes (0x80 0x40 == no signal, 0x89 0x20 == nice signal) |
31 | * 89 - noise-to-signal | ||
32 | * 8a - unkown 1 byte - signal_strength | ||
33 | * 8c - ber ??? | ||
34 | * 8d - ber | ||
35 | * 8e - unc | ||
36 | */ | 26 | */ |
37 | 27 | ||
38 | #define GET_SPEED 0x00 | 28 | #define GET_SPEED 0x00 |
39 | #define GET_TUNE_STAT 0x81 | 29 | #define GET_TUNE_STATUS 0x81 |
40 | #define GET_RC_KEY 0x84 | 30 | #define GET_RC_CODE 0x84 |
41 | #define GET_STATUS 0x88 | 31 | #define GET_CONFIGURATION 0x88 |
42 | #define GET_SNR 0x89 | 32 | #define GET_AGC 0x89 |
43 | #define GET_SIG_STRENGTH 0x8a | 33 | #define GET_SNR 0x8a |
44 | #define GET_UNK 0x8c | 34 | #define GET_VIT_ERR_CNT 0x8c |
45 | #define GET_BER 0x8d | 35 | #define GET_RS_ERR_CNT 0x8d |
46 | #define GET_UNC 0x8e | 36 | #define GET_RS_UNCOR_BLK_CNT 0x8e |
47 | 37 | ||
48 | /* write | 38 | /* write |
49 | * 01 - reset the demod | 39 | * 01 - init |
50 | * 02 - frequency (divided by 250000) | 40 | * 02 - frequency (divided by 250000) |
51 | * 03 - bandwidth | 41 | * 03 - bandwidth |
52 | * 04 - pid table (index pid(7:0) pid(12:8)) | 42 | * 04 - pid table (index pid(7:0) pid(12:8)) |
53 | * 05 - reset the pid table | 43 | * 05 - reset the pid table |
54 | * 08 - demod transfer enabled or not (FX2 transfer is enabled by default) | 44 | * 08 - transfer switch |
55 | */ | 45 | */ |
56 | 46 | ||
57 | #define RESET_DEMOD 0x01 | 47 | #define SET_INIT 0x01 |
58 | #define SET_FREQUENCY 0x02 | 48 | #define SET_RF_FREQ 0x02 |
59 | #define SET_BANDWIDTH 0x03 | 49 | #define SET_BANDWIDTH 0x03 |
60 | #define SET_PID_FILTER 0x04 | 50 | #define SET_PID_FILTER 0x04 |
61 | #define RESET_PID_FILTER 0x05 | 51 | #define RESET_PID_FILTER 0x05 |
62 | #define SET_TS_CTRL 0x08 | 52 | #define SET_STREAMING 0x08 |
63 | 53 | ||
64 | extern struct dvb_frontend * dtt200u_fe_attach(struct dvb_usb_device *d); | 54 | extern struct dvb_frontend * dtt200u_fe_attach(struct dvb_usb_device *d); |
65 | 55 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 75f4cb18a635..794d513a8480 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -72,6 +72,8 @@ | |||
72 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 | 72 | #define USB_PID_HANFTEK_UMT_010_WARM 0x0015 |
73 | #define USB_PID_DTT200U_COLD 0x0201 | 73 | #define USB_PID_DTT200U_COLD 0x0201 |
74 | #define USB_PID_DTT200U_WARM 0x0301 | 74 | #define USB_PID_DTT200U_WARM 0x0301 |
75 | #define USB_PID_WT220U_COLD 0x0222 | ||
76 | #define USB_PID_WT220U_WARM 0x0221 | ||
75 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 | 77 | #define USB_PID_WINTV_NOVA_T_USB2_COLD 0x9300 |
76 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 78 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
77 | #define USB_PID_NEBULA_DIGITV 0x0201 | 79 | #define USB_PID_NEBULA_DIGITV 0x0201 |
@@ -84,5 +86,4 @@ | |||
84 | #define USB_PID_KYE_DVB_T_COLD 0x701e | 86 | #define USB_PID_KYE_DVB_T_COLD 0x701e |
85 | #define USB_PID_KYE_DVB_T_WARM 0x701f | 87 | #define USB_PID_KYE_DVB_T_WARM 0x701f |
86 | 88 | ||
87 | |||
88 | #endif | 89 | #endif |