aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/vp702x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/vp702x.c')
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c
index b2f098a2d5f7..fdab2562bf5d 100644
--- a/drivers/media/dvb/dvb-usb/vp702x.c
+++ b/drivers/media/dvb/dvb-usb/vp702x.c
@@ -108,9 +108,9 @@ static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o,
108 return ret; 108 return ret;
109} 109}
110 110
111static int vp702x_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) 111static int vp702x_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff)
112{ 112{
113 struct vp702x_state *st = d->priv; 113 struct vp702x_state *st = adap->priv;
114 u8 buf[9]; 114 u8 buf[9];
115 115
116 if (onoff) { 116 if (onoff) {
@@ -122,7 +122,7 @@ static int vp702x_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int o
122 st->pid_table[index*2] = st->pid_table[index*2+1] = 0; 122 st->pid_table[index*2] = st->pid_table[index*2+1] = 0;
123 } 123 }
124 124
125 return vp702x_usb_inout_cmd(d,SET_PID_FILTER,st->pid_table,17,buf,9,10); 125 return vp702x_usb_inout_cmd(adap->dev,SET_PID_FILTER,st->pid_table,17,buf,9,10);
126} 126}
127 127
128static int vp702x_power_ctrl(struct dvb_usb_device *d, int onoff) 128static int vp702x_power_ctrl(struct dvb_usb_device *d, int onoff)
@@ -175,21 +175,21 @@ static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6])
175 return 0; 175 return 0;
176} 176}
177 177
178static int vp702x_frontend_attach(struct dvb_usb_device *d) 178static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
179{ 179{
180 u8 buf[9] = { 0 }; 180 u8 buf[9] = { 0 };
181 181
182 if (vp702x_usb_inout_cmd(d, GET_SYSTEM_STRING, NULL, 0, buf, 9, 10)) 182 if (vp702x_usb_inout_cmd(adap->dev, GET_SYSTEM_STRING, NULL, 0, buf, 9, 10))
183 return -EIO; 183 return -EIO;
184 184
185 buf[8] = '\0'; 185 buf[8] = '\0';
186 info("system string: %s",&buf[1]); 186 info("system string: %s",&buf[1]);
187 187
188 d->fe = vp702x_fe_attach(d); 188 adap->fe = vp702x_fe_attach(adap->dev);
189 return 0; 189 return 0;
190} 190}
191 191
192static struct dvb_usb_properties vp702x_properties; 192static struct dvb_usb_device_properties vp702x_properties;
193 193
194static int vp702x_usb_probe(struct usb_interface *intf, 194static int vp702x_usb_probe(struct usb_interface *intf,
195 const struct usb_device_id *id) 195 const struct usb_device_id *id)
@@ -211,28 +211,21 @@ static struct usb_device_id vp702x_usb_table [] = {
211}; 211};
212MODULE_DEVICE_TABLE(usb, vp702x_usb_table); 212MODULE_DEVICE_TABLE(usb, vp702x_usb_table);
213 213
214static struct dvb_usb_properties vp702x_properties = { 214static struct dvb_usb_device_properties vp702x_properties = {
215 .caps = DVB_USB_HAS_PID_FILTER | DVB_USB_NEED_PID_FILTERING,
216 .pid_filter_count = 8, /* !!! */
217
218 .usb_ctrl = CYPRESS_FX2, 215 .usb_ctrl = CYPRESS_FX2,
219 .firmware = "dvb-usb-vp702x-01.fw", 216 .firmware = "dvb-usb-vp702x-01.fw",
220 217
218 .num_adapters = 1,
219 .adapter = {
220 {
221 .caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
222 .pid_filter_count = 8, /* !!! */
223
221 .pid_filter = vp702x_pid_filter, 224 .pid_filter = vp702x_pid_filter,
222 .power_ctrl = vp702x_power_ctrl,
223 .frontend_attach = vp702x_frontend_attach, 225 .frontend_attach = vp702x_frontend_attach,
224 .read_mac_address = vp702x_read_mac_addr,
225
226 .rc_key_map = vp702x_rc_keys,
227 .rc_key_map_size = ARRAY_SIZE(vp702x_rc_keys),
228 .rc_interval = 400,
229 .rc_query = vp702x_rc_query,
230
231 .size_of_priv = sizeof(struct vp702x_state),
232
233 /* parameter for the MPEG2-data transfer */ 226 /* parameter for the MPEG2-data transfer */
234 .urb = { 227 .stream = {
235 .type = DVB_USB_BULK, 228 .type = USB_BULK,
236 .count = 7, 229 .count = 7,
237 .endpoint = 0x02, 230 .endpoint = 0x02,
238 .u = { 231 .u = {
@@ -241,6 +234,16 @@ static struct dvb_usb_properties vp702x_properties = {
241 } 234 }
242 } 235 }
243 }, 236 },
237 .size_of_priv = sizeof(struct vp702x_state),
238 },
239 },
240 .power_ctrl = vp702x_power_ctrl,
241 .read_mac_address = vp702x_read_mac_addr,
242
243 .rc_key_map = vp702x_rc_keys,
244 .rc_key_map_size = ARRAY_SIZE(vp702x_rc_keys),
245 .rc_interval = 400,
246 .rc_query = vp702x_rc_query,
244 247
245 .num_device_descs = 2, 248 .num_device_descs = 2,
246 .devices = { 249 .devices = {