diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-09-19 11:51:43 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-03 14:12:40 -0400 |
commit | 0540c4961fcc6d69b8a3314c330c376890715eee (patch) | |
tree | 8babf9a7a6d10f4ebc5990009ad64328daf044a5 /drivers | |
parent | 6958effedb0dc709966c22e7fd0e8210b5401b84 (diff) |
V4L/DVB (4649): Merged VP702x support to dvb-usb multi input
The fixed support for the VP70x (supports only StarBox2) is now in sync with
latest changes in the dvb-usb framework.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-urb.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x-fe.c | 35 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x.c | 173 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/vp702x.h | 2 |
5 files changed, 149 insertions, 72 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c index 0aed7fd60623..5cef12a07f72 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c | |||
@@ -71,9 +71,19 @@ static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buffer, si | |||
71 | dvb_dmx_swfilter(&adap->demux, buffer, length); | 71 | dvb_dmx_swfilter(&adap->demux, buffer, length); |
72 | } | 72 | } |
73 | 73 | ||
74 | static void dvb_usb_data_complete_204(struct usb_data_stream *stream, u8 *buffer, size_t length) | ||
75 | { | ||
76 | struct dvb_usb_adapter *adap = stream->user_priv; | ||
77 | if (adap->feedcount > 0 && adap->state & DVB_USB_ADAP_STATE_DVB) | ||
78 | dvb_dmx_swfilter_204(&adap->demux, buffer, length); | ||
79 | } | ||
80 | |||
74 | int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap) | 81 | int dvb_usb_adapter_stream_init(struct dvb_usb_adapter *adap) |
75 | { | 82 | { |
76 | adap->stream.udev = adap->dev->udev; | 83 | adap->stream.udev = adap->dev->udev; |
84 | if (adap->props.caps & DVB_USB_ADAP_RECEIVES_204_BYTE_TS) | ||
85 | adap->stream.complete = dvb_usb_data_complete_204; | ||
86 | else | ||
77 | adap->stream.complete = dvb_usb_data_complete; | 87 | adap->stream.complete = dvb_usb_data_complete; |
78 | adap->stream.user_priv = adap; | 88 | adap->stream.user_priv = adap; |
79 | return usb_urb_init(&adap->stream, &adap->props.stream); | 89 | return usb_urb_init(&adap->stream, &adap->props.stream); |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 44b49db4992e..2ec7c777fcef 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -133,6 +133,7 @@ struct dvb_usb_adapter_properties { | |||
133 | #define DVB_USB_ADAP_HAS_PID_FILTER 0x01 | 133 | #define DVB_USB_ADAP_HAS_PID_FILTER 0x01 |
134 | #define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02 | 134 | #define DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF 0x02 |
135 | #define DVB_USB_ADAP_NEED_PID_FILTERING 0x04 | 135 | #define DVB_USB_ADAP_NEED_PID_FILTERING 0x04 |
136 | #define DVB_USB_ADAP_RECEIVES_204_BYTE_TS 0x08 | ||
136 | int caps; | 137 | int caps; |
137 | int pid_filter_count; | 138 | int pid_filter_count; |
138 | 139 | ||
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c index d4da494132ec..41f733b47e70 100644 --- a/drivers/media/dvb/dvb-usb/vp702x-fe.c +++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c | |||
@@ -24,6 +24,8 @@ struct vp702x_fe_state { | |||
24 | struct dvb_frontend fe; | 24 | struct dvb_frontend fe; |
25 | struct dvb_usb_device *d; | 25 | struct dvb_usb_device *d; |
26 | 26 | ||
27 | struct dvb_frontend_ops ops; | ||
28 | |||
27 | fe_sec_voltage_t voltage; | 29 | fe_sec_voltage_t voltage; |
28 | fe_sec_tone_mode_t tone_mode; | 30 | fe_sec_tone_mode_t tone_mode; |
29 | 31 | ||
@@ -72,9 +74,6 @@ static int vp702x_fe_read_status(struct dvb_frontend* fe, fe_status_t *status) | |||
72 | else | 74 | else |
73 | *status = 0; | 75 | *status = 0; |
74 | 76 | ||
75 | deb_fe("real state: %x\n",*status); | ||
76 | *status = 0x1f; | ||
77 | |||
78 | if (*status & FE_HAS_LOCK) | 77 | if (*status & FE_HAS_LOCK) |
79 | st->status_check_interval = 1000; | 78 | st->status_check_interval = 1000; |
80 | else | 79 | else |
@@ -171,8 +170,6 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe, | |||
171 | st->status_check_interval = 250; | 170 | st->status_check_interval = 250; |
172 | st->next_status_check = jiffies; | 171 | st->next_status_check = jiffies; |
173 | 172 | ||
174 | vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0); | ||
175 | msleep(30); | ||
176 | vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100); | 173 | vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100); |
177 | 174 | ||
178 | if (ibuf[2] == 0 && ibuf[3] == 0) | 175 | if (ibuf[2] == 0 && ibuf[3] == 0) |
@@ -183,6 +180,20 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe, | |||
183 | return 0; | 180 | return 0; |
184 | } | 181 | } |
185 | 182 | ||
183 | static int vp702x_fe_init(struct dvb_frontend *fe) | ||
184 | { | ||
185 | struct vp702x_fe_state *st = fe->demodulator_priv; | ||
186 | deb_fe("%s\n",__FUNCTION__); | ||
187 | vp702x_usb_in_op(st->d, RESET_TUNER, 0, 0, NULL, 0); | ||
188 | return 0; | ||
189 | } | ||
190 | |||
191 | static int vp702x_fe_sleep(struct dvb_frontend *fe) | ||
192 | { | ||
193 | deb_fe("%s\n",__FUNCTION__); | ||
194 | return 0; | ||
195 | } | ||
196 | |||
186 | static int vp702x_fe_get_frontend(struct dvb_frontend* fe, | 197 | static int vp702x_fe_get_frontend(struct dvb_frontend* fe, |
187 | struct dvb_frontend_parameters *fep) | 198 | struct dvb_frontend_parameters *fep) |
188 | { | 199 | { |
@@ -207,12 +218,12 @@ static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe, | |||
207 | memcpy(&cmd[3], m->msg, m->msg_len); | 218 | memcpy(&cmd[3], m->msg, m->msg_len); |
208 | cmd[7] = vp702x_chksum(cmd,0,7); | 219 | cmd[7] = vp702x_chksum(cmd,0,7); |
209 | 220 | ||
210 | vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100); | 221 | // vp702x_usb_inout_op(st->d,cmd,8,ibuf,10,100); |
211 | 222 | ||
212 | if (ibuf[2] == 0 && ibuf[3] == 0) | 223 | // if (ibuf[2] == 0 && ibuf[3] == 0) |
213 | deb_fe("diseqc cmd failed.\n"); | 224 | // deb_fe("diseqc cmd failed.\n"); |
214 | else | 225 | // else |
215 | deb_fe("diseqc cmd succeeded.\n"); | 226 | // deb_fe("diseqc cmd succeeded.\n"); |
216 | 227 | ||
217 | return 0; | 228 | return 0; |
218 | } | 229 | } |
@@ -318,8 +329,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = { | |||
318 | }, | 329 | }, |
319 | .release = vp702x_fe_release, | 330 | .release = vp702x_fe_release, |
320 | 331 | ||
321 | .init = NULL, | 332 | .init = vp702x_fe_init, |
322 | .sleep = NULL, | 333 | .sleep = vp702x_fe_sleep, |
323 | 334 | ||
324 | .set_frontend = vp702x_fe_set_frontend, | 335 | .set_frontend = vp702x_fe_set_frontend, |
325 | .get_frontend = vp702x_fe_get_frontend, | 336 | .get_frontend = vp702x_fe_get_frontend, |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index fdab2562bf5d..02bd61aaac66 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c | |||
@@ -22,50 +22,54 @@ module_param_named(debug,dvb_usb_vp702x_debug, int, 0644); | |||
22 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS); | 22 | MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DVB_USB_DEBUG_STATUS); |
23 | 23 | ||
24 | struct vp702x_state { | 24 | struct vp702x_state { |
25 | u8 pid_table[17]; /* [16] controls the pid_table state */ | 25 | int pid_filter_count; |
26 | int pid_filter_can_bypass; | ||
27 | u8 pid_filter_state; | ||
28 | }; | ||
29 | |||
30 | struct vp702x_device_state { | ||
31 | u8 power_state; | ||
26 | }; | 32 | }; |
27 | 33 | ||
28 | /* check for mutex FIXME */ | 34 | /* check for mutex FIXME */ |
29 | int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) | 35 | int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) |
30 | { | 36 | { |
31 | int ret = 0,try = 0; | 37 | int ret = -1; |
32 | 38 | ||
33 | while (ret >= 0 && ret != blen && try < 3) { | ||
34 | ret = usb_control_msg(d->udev, | 39 | ret = usb_control_msg(d->udev, |
35 | usb_rcvctrlpipe(d->udev,0), | 40 | usb_rcvctrlpipe(d->udev,0), |
36 | req, | 41 | req, |
37 | USB_TYPE_VENDOR | USB_DIR_IN, | 42 | USB_TYPE_VENDOR | USB_DIR_IN, |
38 | value,index,b,blen, | 43 | value,index,b,blen, |
39 | 2000); | 44 | 2000); |
40 | deb_info("reading number %d (ret: %d)\n",try,ret); | ||
41 | try++; | ||
42 | } | ||
43 | 45 | ||
44 | if (ret < 0 || ret != blen) { | 46 | if (ret < 0) { |
45 | warn("usb in operation failed."); | 47 | warn("usb in operation failed. (%d)", ret); |
46 | ret = -EIO; | 48 | ret = -EIO; |
47 | } else | 49 | } else |
48 | ret = 0; | 50 | ret = 0; |
49 | 51 | ||
50 | deb_xfer("in: req. %x, val: %x, ind: %x, buffer: ",req,value,index); | 52 | |
53 | deb_xfer("in: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index); | ||
51 | debug_dump(b,blen,deb_xfer); | 54 | debug_dump(b,blen,deb_xfer); |
52 | 55 | ||
53 | return ret; | 56 | return ret; |
54 | } | 57 | } |
55 | 58 | ||
56 | static int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, | 59 | int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, |
57 | u16 index, u8 *b, int blen) | 60 | u16 index, u8 *b, int blen) |
58 | { | 61 | { |
59 | deb_xfer("out: req. %x, val: %x, ind: %x, buffer: ",req,value,index); | 62 | int ret; |
63 | deb_xfer("out: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index); | ||
60 | debug_dump(b,blen,deb_xfer); | 64 | debug_dump(b,blen,deb_xfer); |
61 | 65 | ||
62 | if (usb_control_msg(d->udev, | 66 | if ((ret = usb_control_msg(d->udev, |
63 | usb_sndctrlpipe(d->udev,0), | 67 | usb_sndctrlpipe(d->udev,0), |
64 | req, | 68 | req, |
65 | USB_TYPE_VENDOR | USB_DIR_OUT, | 69 | USB_TYPE_VENDOR | USB_DIR_OUT, |
66 | value,index,b,blen, | 70 | value,index,b,blen, |
67 | 2000) != blen) { | 71 | 2000)) != blen) { |
68 | warn("usb out operation failed."); | 72 | warn("usb out operation failed. (%d)",ret); |
69 | return -EIO; | 73 | return -EIO; |
70 | } else | 74 | } else |
71 | return 0; | 75 | return 0; |
@@ -78,12 +82,10 @@ int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int il | |||
78 | if ((ret = mutex_lock_interruptible(&d->usb_mutex))) | 82 | if ((ret = mutex_lock_interruptible(&d->usb_mutex))) |
79 | return ret; | 83 | return ret; |
80 | 84 | ||
81 | if ((ret = vp702x_usb_out_op(d,REQUEST_OUT,0,0,o,olen)) < 0) | 85 | ret = vp702x_usb_out_op(d,REQUEST_OUT,0,0,o,olen); |
82 | goto unlock; | ||
83 | msleep(msec); | 86 | msleep(msec); |
84 | ret = vp702x_usb_in_op(d,REQUEST_IN,0,0,i,ilen); | 87 | ret = vp702x_usb_in_op(d,REQUEST_IN,0,0,i,ilen); |
85 | 88 | ||
86 | unlock: | ||
87 | mutex_unlock(&d->usb_mutex); | 89 | mutex_unlock(&d->usb_mutex); |
88 | 90 | ||
89 | return ret; | 91 | return ret; |
@@ -108,29 +110,65 @@ static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o, | |||
108 | return ret; | 110 | return ret; |
109 | } | 111 | } |
110 | 112 | ||
111 | static int vp702x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) | 113 | static int vp702x_set_pld_mode(struct dvb_usb_adapter *adap, u8 bypass) |
114 | { | ||
115 | u8 buf[16] = { 0 }; | ||
116 | return vp702x_usb_in_op(adap->dev, 0xe0, (bypass << 8) | 0x0e, 0, buf, 16); | ||
117 | } | ||
118 | |||
119 | static int vp702x_set_pld_state(struct dvb_usb_adapter *adap, u8 state) | ||
120 | { | ||
121 | u8 buf[16] = { 0 }; | ||
122 | return vp702x_usb_in_op(adap->dev, 0xe0, (state << 8) | 0x0f, 0, buf, 16); | ||
123 | } | ||
124 | |||
125 | static int vp702x_set_pid(struct dvb_usb_adapter *adap, u16 pid, u8 id, int onoff) | ||
112 | { | 126 | { |
113 | struct vp702x_state *st = adap->priv; | 127 | struct vp702x_state *st = adap->priv; |
114 | u8 buf[9]; | 128 | u8 buf[16] = { 0 }; |
115 | 129 | ||
116 | if (onoff) { | 130 | if (onoff) |
117 | st->pid_table[16] |= 1 << index; | 131 | st->pid_filter_state |= (1 << id); |
118 | st->pid_table[index*2] = (pid >> 8) & 0xff; | 132 | else { |
119 | st->pid_table[index*2+1] = pid & 0xff; | 133 | st->pid_filter_state &= ~(1 << id); |
120 | } else { | 134 | pid = 0xffff; |
121 | st->pid_table[16] &= ~(1 << index); | ||
122 | st->pid_table[index*2] = st->pid_table[index*2+1] = 0; | ||
123 | } | 135 | } |
124 | 136 | ||
125 | return vp702x_usb_inout_cmd(adap->dev,SET_PID_FILTER,st->pid_table,17,buf,9,10); | 137 | id = 0x10 + id*2; |
138 | |||
139 | vp702x_set_pld_state(adap, st->pid_filter_state); | ||
140 | vp702x_usb_in_op(adap->dev, 0xe0, (((pid >> 8) & 0xff) << 8) | (id), 0, buf, 16); | ||
141 | vp702x_usb_in_op(adap->dev, 0xe0, (((pid ) & 0xff) << 8) | (id+1), 0, buf, 16); | ||
142 | return 0; | ||
126 | } | 143 | } |
127 | 144 | ||
128 | static int vp702x_power_ctrl(struct dvb_usb_device *d, int onoff) | 145 | |
146 | static int vp702x_init_pid_filter(struct dvb_usb_adapter *adap) | ||
129 | { | 147 | { |
130 | vp702x_usb_in_op(d,RESET_TUNER,0,0,NULL,0); | 148 | struct vp702x_state *st = adap->priv; |
149 | int i; | ||
150 | u8 b[10] = { 0 }; | ||
131 | 151 | ||
132 | vp702x_usb_in_op(d,SET_TUNER_POWER_REQ,0,onoff,NULL,0); | 152 | st->pid_filter_count = 8; |
133 | return vp702x_usb_in_op(d,SET_TUNER_POWER_REQ,0,onoff,NULL,0); | 153 | st->pid_filter_can_bypass = 1; |
154 | st->pid_filter_state = 0x00; | ||
155 | |||
156 | vp702x_set_pld_mode(adap, 1); // bypass | ||
157 | |||
158 | for (i = 0; i < st->pid_filter_count; i++) | ||
159 | vp702x_set_pid(adap, 0xffff, i, 1); | ||
160 | |||
161 | vp702x_usb_in_op(adap->dev, 0xb5, 3, 0, b, 10); | ||
162 | vp702x_usb_in_op(adap->dev, 0xb5, 0, 0, b, 10); | ||
163 | vp702x_usb_in_op(adap->dev, 0xb5, 1, 0, b, 10); | ||
164 | |||
165 | //vp702x_set_pld_mode(d, 0); // filter | ||
166 | return 0; | ||
167 | } | ||
168 | |||
169 | static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | ||
170 | { | ||
171 | return 0; | ||
134 | } | 172 | } |
135 | 173 | ||
136 | /* keys for the enclosed remote control */ | 174 | /* keys for the enclosed remote control */ |
@@ -166,26 +204,45 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
166 | return 0; | 204 | return 0; |
167 | } | 205 | } |
168 | 206 | ||
207 | int vp702x_power_ctrl(struct dvb_usb_device *d, int onoff) | ||
208 | { | ||
209 | struct vp702x_device_state *st = d->priv; | ||
210 | |||
211 | if (st->power_state == 0 && onoff) | ||
212 | vp702x_usb_out_op(d, SET_TUNER_POWER_REQ, 1, 7, NULL, 0); | ||
213 | else if (st->power_state == 1 && onoff == 0) | ||
214 | vp702x_usb_out_op(d, SET_TUNER_POWER_REQ, 0, 7, NULL, 0); | ||
215 | |||
216 | st->power_state = onoff; | ||
217 | |||
218 | return 0; | ||
219 | } | ||
220 | |||
169 | static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6]) | 221 | static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6]) |
170 | { | 222 | { |
171 | u8 macb[9]; | 223 | u8 i; |
172 | if (vp702x_usb_inout_cmd(d, GET_MAC_ADDRESS, NULL, 0, macb, 9, 10)) | 224 | for (i = 6; i < 12; i++) |
173 | return -EIO; | 225 | vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1, &mac[i - 6], 1); |
174 | memcpy(mac,&macb[3],6); | ||
175 | return 0; | 226 | return 0; |
176 | } | 227 | } |
177 | 228 | ||
178 | static int vp702x_frontend_attach(struct dvb_usb_adapter *adap) | 229 | static int vp702x_frontend_attach(struct dvb_usb_adapter *adap) |
179 | { | 230 | { |
180 | u8 buf[9] = { 0 }; | 231 | u8 buf[10] = { 0 }; |
232 | |||
233 | vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 0, 7, NULL, 0); | ||
181 | 234 | ||
182 | if (vp702x_usb_inout_cmd(adap->dev, GET_SYSTEM_STRING, NULL, 0, buf, 9, 10)) | 235 | if (vp702x_usb_inout_cmd(adap->dev, GET_SYSTEM_STRING, NULL, 0, buf, 10, 10)) |
183 | return -EIO; | 236 | return -EIO; |
184 | 237 | ||
185 | buf[8] = '\0'; | 238 | buf[9] = '\0'; |
186 | info("system string: %s",&buf[1]); | 239 | info("system string: %s",&buf[1]); |
187 | 240 | ||
241 | vp702x_init_pid_filter(adap); | ||
242 | |||
188 | adap->fe = vp702x_fe_attach(adap->dev); | 243 | adap->fe = vp702x_fe_attach(adap->dev); |
244 | vp702x_usb_out_op(adap->dev, SET_TUNER_POWER_REQ, 1, 7, NULL, 0); | ||
245 | |||
189 | return 0; | 246 | return 0; |
190 | } | 247 | } |
191 | 248 | ||
@@ -194,39 +251,36 @@ static struct dvb_usb_device_properties vp702x_properties; | |||
194 | static int vp702x_usb_probe(struct usb_interface *intf, | 251 | static int vp702x_usb_probe(struct usb_interface *intf, |
195 | const struct usb_device_id *id) | 252 | const struct usb_device_id *id) |
196 | { | 253 | { |
197 | struct usb_device *udev = interface_to_usbdev(intf); | ||
198 | |||
199 | usb_clear_halt(udev,usb_sndctrlpipe(udev,0)); | ||
200 | usb_clear_halt(udev,usb_rcvctrlpipe(udev,0)); | ||
201 | |||
202 | return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL); | 254 | return dvb_usb_device_init(intf,&vp702x_properties,THIS_MODULE,NULL); |
203 | } | 255 | } |
204 | 256 | ||
205 | static struct usb_device_id vp702x_usb_table [] = { | 257 | static struct usb_device_id vp702x_usb_table [] = { |
206 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7021_COLD) }, | 258 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7021_COLD) }, |
207 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7021_WARM) }, | 259 | // { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_COLD) }, |
208 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_COLD) }, | 260 | // { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_WARM) }, |
209 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_TWINHAN_VP7020_WARM) }, | ||
210 | { 0 }, | 261 | { 0 }, |
211 | }; | 262 | }; |
212 | MODULE_DEVICE_TABLE(usb, vp702x_usb_table); | 263 | MODULE_DEVICE_TABLE(usb, vp702x_usb_table); |
213 | 264 | ||
214 | static struct dvb_usb_device_properties vp702x_properties = { | 265 | static struct dvb_usb_device_properties vp702x_properties = { |
215 | .usb_ctrl = CYPRESS_FX2, | 266 | .usb_ctrl = CYPRESS_FX2, |
216 | .firmware = "dvb-usb-vp702x-01.fw", | 267 | .firmware = "dvb-usb-vp702x-02.fw", |
268 | .no_reconnect = 1, | ||
269 | |||
270 | .size_of_priv = sizeof(struct vp702x_device_state), | ||
217 | 271 | ||
218 | .num_adapters = 1, | 272 | .num_adapters = 1, |
219 | .adapter = { | 273 | .adapter = { |
220 | { | 274 | { |
221 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING, | 275 | .caps = DVB_USB_ADAP_RECEIVES_204_BYTE_TS, |
222 | .pid_filter_count = 8, /* !!! */ | ||
223 | 276 | ||
224 | .pid_filter = vp702x_pid_filter, | 277 | .streaming_ctrl = vp702x_streaming_ctrl, |
225 | .frontend_attach = vp702x_frontend_attach, | 278 | .frontend_attach = vp702x_frontend_attach, |
279 | |||
226 | /* parameter for the MPEG2-data transfer */ | 280 | /* parameter for the MPEG2-data transfer */ |
227 | .stream = { | 281 | .stream = { |
228 | .type = USB_BULK, | 282 | .type = USB_BULK, |
229 | .count = 7, | 283 | .count = 10, |
230 | .endpoint = 0x02, | 284 | .endpoint = 0x02, |
231 | .u = { | 285 | .u = { |
232 | .bulk = { | 286 | .bulk = { |
@@ -235,9 +289,8 @@ static struct dvb_usb_device_properties vp702x_properties = { | |||
235 | } | 289 | } |
236 | }, | 290 | }, |
237 | .size_of_priv = sizeof(struct vp702x_state), | 291 | .size_of_priv = sizeof(struct vp702x_state), |
292 | } | ||
238 | }, | 293 | }, |
239 | }, | ||
240 | .power_ctrl = vp702x_power_ctrl, | ||
241 | .read_mac_address = vp702x_read_mac_addr, | 294 | .read_mac_address = vp702x_read_mac_addr, |
242 | 295 | ||
243 | .rc_key_map = vp702x_rc_keys, | 296 | .rc_key_map = vp702x_rc_keys, |
@@ -245,23 +298,23 @@ static struct dvb_usb_device_properties vp702x_properties = { | |||
245 | .rc_interval = 400, | 298 | .rc_interval = 400, |
246 | .rc_query = vp702x_rc_query, | 299 | .rc_query = vp702x_rc_query, |
247 | 300 | ||
248 | .num_device_descs = 2, | 301 | .num_device_descs = 1, |
249 | .devices = { | 302 | .devices = { |
250 | { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7021)", | 303 | { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7021)", |
251 | .cold_ids = { &vp702x_usb_table[0], NULL }, | 304 | .cold_ids = { &vp702x_usb_table[0], NULL }, |
252 | .warm_ids = { &vp702x_usb_table[1], NULL }, | 305 | .warm_ids = { NULL }, |
253 | }, | 306 | }, |
254 | { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7020)", | 307 | /* { .name = "TwinhanDTV StarBox DVB-S USB2.0 (VP7020)", |
255 | .cold_ids = { &vp702x_usb_table[2], NULL }, | 308 | .cold_ids = { &vp702x_usb_table[2], NULL }, |
256 | .warm_ids = { &vp702x_usb_table[3], NULL }, | 309 | .warm_ids = { &vp702x_usb_table[3], NULL }, |
257 | }, | 310 | }, |
258 | { 0 }, | 311 | */ { NULL }, |
259 | } | 312 | } |
260 | }; | 313 | }; |
261 | 314 | ||
262 | /* usb specific object needed to register this driver with the usb subsystem */ | 315 | /* usb specific object needed to register this driver with the usb subsystem */ |
263 | static struct usb_driver vp702x_usb_driver = { | 316 | static struct usb_driver vp702x_usb_driver = { |
264 | .name = "dvb-usb-vp702x", | 317 | .name = "dvb_usb_vp702x", |
265 | .probe = vp702x_usb_probe, | 318 | .probe = vp702x_usb_probe, |
266 | .disconnect = dvb_usb_device_exit, | 319 | .disconnect = dvb_usb_device_exit, |
267 | .id_table = vp702x_usb_table, | 320 | .id_table = vp702x_usb_table, |
@@ -290,5 +343,5 @@ module_exit(vp702x_usb_module_exit); | |||
290 | 343 | ||
291 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 344 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
292 | MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones"); | 345 | MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones"); |
293 | MODULE_VERSION("1.0-alpha"); | 346 | MODULE_VERSION("1.0"); |
294 | MODULE_LICENSE("GPL"); | 347 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.h b/drivers/media/dvb/dvb-usb/vp702x.h index c2f97f96c21f..25a9dee4c824 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.h +++ b/drivers/media/dvb/dvb-usb/vp702x.h | |||
@@ -102,5 +102,7 @@ extern struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d); | |||
102 | 102 | ||
103 | extern int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec); | 103 | extern int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec); |
104 | extern int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); | 104 | extern int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); |
105 | extern int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); | ||
106 | extern int vp702x_power_ctrl(struct dvb_usb_device *d, int onoff); | ||
105 | 107 | ||
106 | #endif | 108 | #endif |