Lines Matching +full:2 +full:d

78 MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
84 MODULE_PARM_DESC(demod, "demod to probe (1=cx24116 2=stv0903+stv6110 4=stv0903+stb6100(or-able)).");
117 struct dvb_usb_device *d = i2c_get_adapdata(adap); in dw2102_i2c_transfer() local
122 if (!d) in dw2102_i2c_transfer()
124 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dw2102_i2c_transfer()
128 case 2: in dw2102_i2c_transfer()
136 dw210x_op_rw(d->udev, 0xb5, value + i, 0, in dw2102_i2c_transfer()
137 buf6, 2, DW210X_READ_MSG); in dw2102_i2c_transfer()
144 if (msg[0].len < 2) { in dw2102_i2c_transfer()
151 buf6[2] = msg[0].buf[1]; in dw2102_i2c_transfer()
152 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2102_i2c_transfer()
164 buf6[2] = 0xc0; in dw2102_i2c_transfer()
167 buf6[5] = msg[0].buf[2]; in dw2102_i2c_transfer()
169 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2102_i2c_transfer()
177 dw210x_op_rw(d->udev, 0xb5, 0, 0, in dw2102_i2c_transfer()
183 if (msg[0].len < 2) { in dw2102_i2c_transfer()
187 dw210x_op_rw(d->udev, 0xb8, 0, 0, in dw2102_i2c_transfer()
188 buf6, 2, DW210X_READ_MSG); in dw2102_i2c_transfer()
199 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2102_i2c_transfer()
200 buf6, 2, DW210X_WRITE_MSG); in dw2102_i2c_transfer()
207 mutex_unlock(&d->i2c_mutex); in dw2102_i2c_transfer()
214 struct dvb_usb_device *d = i2c_get_adapdata(adap); in dw2102_serit_i2c_transfer() local
217 if (!d) in dw2102_serit_i2c_transfer()
219 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dw2102_serit_i2c_transfer()
223 case 2: in dw2102_serit_i2c_transfer()
225 warn("i2c rd: len=%d is not 1!\n", in dw2102_serit_i2c_transfer()
231 if (2 + msg[1].len > sizeof(buf6)) { in dw2102_serit_i2c_transfer()
232 warn("i2c rd: len=%d is too big!\n", in dw2102_serit_i2c_transfer()
241 buf6[2] = msg[0].buf[0]; in dw2102_serit_i2c_transfer()
242 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2102_serit_i2c_transfer()
243 buf6, msg[0].len + 2, DW210X_WRITE_MSG); in dw2102_serit_i2c_transfer()
245 dw210x_op_rw(d->udev, 0xc3, 0xd0, 0, in dw2102_serit_i2c_transfer()
246 buf6, msg[1].len + 2, DW210X_READ_MSG); in dw2102_serit_i2c_transfer()
247 memcpy(msg[1].buf, buf6 + 2, msg[1].len); in dw2102_serit_i2c_transfer()
253 if (2 + msg[0].len > sizeof(buf6)) { in dw2102_serit_i2c_transfer()
254 warn("i2c wr: len=%d is too big!\n", in dw2102_serit_i2c_transfer()
263 memcpy(buf6 + 2, msg[0].buf, msg[0].len); in dw2102_serit_i2c_transfer()
264 dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6, in dw2102_serit_i2c_transfer()
265 msg[0].len + 2, DW210X_WRITE_MSG); in dw2102_serit_i2c_transfer()
268 dw210x_op_rw(d->udev, 0xb8, 0, 0, in dw2102_serit_i2c_transfer()
269 buf6, 2, DW210X_READ_MSG); in dw2102_serit_i2c_transfer()
276 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2102_serit_i2c_transfer()
277 buf6, 2, DW210X_WRITE_MSG); in dw2102_serit_i2c_transfer()
283 mutex_unlock(&d->i2c_mutex); in dw2102_serit_i2c_transfer()
289 struct dvb_usb_device *d = i2c_get_adapdata(adap); in dw2102_earda_i2c_transfer() local
292 if (!d) in dw2102_earda_i2c_transfer()
294 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dw2102_earda_i2c_transfer()
298 case 2: { in dw2102_earda_i2c_transfer()
303 if (2 + msg[0].len != sizeof(obuf)) { in dw2102_earda_i2c_transfer()
304 warn("i2c rd: len=%d is not 1!\n", in dw2102_earda_i2c_transfer()
310 if (2 + msg[1].len > sizeof(ibuf)) { in dw2102_earda_i2c_transfer()
311 warn("i2c rd: len=%d is too big!\n", in dw2102_earda_i2c_transfer()
319 obuf[2] = msg[0].buf[0]; in dw2102_earda_i2c_transfer()
320 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2102_earda_i2c_transfer()
321 obuf, msg[0].len + 2, DW210X_WRITE_MSG); in dw2102_earda_i2c_transfer()
323 dw210x_op_rw(d->udev, 0xc3, 0xd1, 0, in dw2102_earda_i2c_transfer()
324 ibuf, msg[1].len + 2, DW210X_READ_MSG); in dw2102_earda_i2c_transfer()
325 memcpy(msg[1].buf, ibuf + 2, msg[1].len); in dw2102_earda_i2c_transfer()
335 if (2 + msg[0].len > sizeof(obuf)) { in dw2102_earda_i2c_transfer()
336 warn("i2c wr: len=%d is too big!\n", in dw2102_earda_i2c_transfer()
344 memcpy(obuf + 2, msg[0].buf, msg[0].len); in dw2102_earda_i2c_transfer()
345 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2102_earda_i2c_transfer()
346 obuf, msg[0].len + 2, DW210X_WRITE_MSG); in dw2102_earda_i2c_transfer()
353 if (2 + msg[0].len > sizeof(obuf)) { in dw2102_earda_i2c_transfer()
354 warn("i2c wr: len=%d is too big!\n", in dw2102_earda_i2c_transfer()
362 memcpy(obuf + 2, msg[0].buf, msg[0].len); in dw2102_earda_i2c_transfer()
363 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2102_earda_i2c_transfer()
364 obuf, msg[0].len + 2, DW210X_WRITE_MSG); in dw2102_earda_i2c_transfer()
368 u8 ibuf[2]; in dw2102_earda_i2c_transfer()
370 dw210x_op_rw(d->udev, 0xb8, 0, 0, in dw2102_earda_i2c_transfer()
371 ibuf, 2, DW210X_READ_MSG); in dw2102_earda_i2c_transfer()
372 memcpy(msg[0].buf, ibuf, 2); in dw2102_earda_i2c_transfer()
376 u8 obuf[2]; in dw2102_earda_i2c_transfer()
380 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2102_earda_i2c_transfer()
381 obuf, 2, DW210X_WRITE_MSG); in dw2102_earda_i2c_transfer()
391 mutex_unlock(&d->i2c_mutex); in dw2102_earda_i2c_transfer()
397 struct dvb_usb_device *d = i2c_get_adapdata(adap); in dw2104_i2c_transfer() local
400 if (!d) in dw2104_i2c_transfer()
402 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dw2104_i2c_transfer()
408 u8 ibuf[2]; in dw2104_i2c_transfer()
410 dw210x_op_rw(d->udev, 0xb8, 0, 0, in dw2104_i2c_transfer()
411 ibuf, 2, DW210X_READ_MSG); in dw2104_i2c_transfer()
412 memcpy(msg[j].buf, ibuf, 2); in dw2104_i2c_transfer()
416 u8 obuf[2]; in dw2104_i2c_transfer()
420 dw210x_op_rw(d->udev, 0xb2, 0, 0, in dw2104_i2c_transfer()
421 obuf, 2, DW210X_WRITE_MSG); in dw2104_i2c_transfer()
434 if (2 + msg[j].len > sizeof(ibuf)) { in dw2104_i2c_transfer()
435 warn("i2c rd: len=%d is too big!\n", in dw2104_i2c_transfer()
441 dw210x_op_rw(d->udev, 0xc3, in dw2104_i2c_transfer()
443 ibuf, msg[j].len + 2, in dw2104_i2c_transfer()
445 memcpy(msg[j].buf, ibuf + 2, msg[j].len); in dw2104_i2c_transfer()
454 obuf[2] = msg[j].buf[0]; in dw2104_i2c_transfer()
460 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2104_i2c_transfer()
470 if (2 + msg[j].len > sizeof(obuf)) { in dw2104_i2c_transfer()
471 warn("i2c wr: len=%d is too big!\n", in dw2104_i2c_transfer()
479 memcpy(obuf + 2, msg[j].buf, msg[j].len); in dw2104_i2c_transfer()
480 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw2104_i2c_transfer()
481 obuf, msg[j].len + 2, in dw2104_i2c_transfer()
491 mutex_unlock(&d->i2c_mutex); in dw2104_i2c_transfer()
498 struct dvb_usb_device *d = i2c_get_adapdata(adap); in dw3101_i2c_transfer() local
502 if (!d) in dw3101_i2c_transfer()
504 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dw3101_i2c_transfer()
508 case 2: { in dw3101_i2c_transfer()
513 if (2 + msg[0].len != sizeof(obuf)) { in dw3101_i2c_transfer()
514 warn("i2c rd: len=%d is not 1!\n", in dw3101_i2c_transfer()
519 if (2 + msg[1].len > sizeof(ibuf)) { in dw3101_i2c_transfer()
520 warn("i2c rd: len=%d is too big!\n", in dw3101_i2c_transfer()
527 obuf[2] = msg[0].buf[0]; in dw3101_i2c_transfer()
528 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw3101_i2c_transfer()
529 obuf, msg[0].len + 2, DW210X_WRITE_MSG); in dw3101_i2c_transfer()
531 dw210x_op_rw(d->udev, 0xc3, 0x19, 0, in dw3101_i2c_transfer()
532 ibuf, msg[1].len + 2, DW210X_READ_MSG); in dw3101_i2c_transfer()
533 memcpy(msg[1].buf, ibuf + 2, msg[1].len); in dw3101_i2c_transfer()
544 if (2 + msg[0].len > sizeof(obuf)) { in dw3101_i2c_transfer()
545 warn("i2c wr: len=%d is too big!\n", in dw3101_i2c_transfer()
552 memcpy(obuf + 2, msg[0].buf, msg[0].len); in dw3101_i2c_transfer()
553 dw210x_op_rw(d->udev, 0xc2, 0, 0, in dw3101_i2c_transfer()
554 obuf, msg[0].len + 2, DW210X_WRITE_MSG); in dw3101_i2c_transfer()
558 u8 ibuf[2]; in dw3101_i2c_transfer()
560 dw210x_op_rw(d->udev, 0xb8, 0, 0, in dw3101_i2c_transfer()
561 ibuf, 2, DW210X_READ_MSG); in dw3101_i2c_transfer()
562 memcpy(msg[0].buf, ibuf, 2); in dw3101_i2c_transfer()
578 mutex_unlock(&d->i2c_mutex); in dw3101_i2c_transfer()
585 struct dvb_usb_device *d = i2c_get_adapdata(adap); in s6x0_i2c_transfer() local
589 if (!d) in s6x0_i2c_transfer()
591 udev = d->udev; in s6x0_i2c_transfer()
592 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in s6x0_i2c_transfer()
600 dw210x_op_rw(d->udev, 0xb8, 0, 0, in s6x0_i2c_transfer()
602 memcpy(msg[j].buf, ibuf + 3, 2); in s6x0_i2c_transfer()
606 u8 obuf[2]; in s6x0_i2c_transfer()
610 dw210x_op_rw(d->udev, 0x8a, 0, 0, in s6x0_i2c_transfer()
611 obuf, 2, DW210X_WRITE_MSG); in s6x0_i2c_transfer()
614 dw210x_op_rw(d->udev, 0x8a, 0, 0, in s6x0_i2c_transfer()
615 obuf, 2, DW210X_WRITE_MSG); in s6x0_i2c_transfer()
619 u8 obuf[2]; in s6x0_i2c_transfer()
623 dw210x_op_rw(d->udev, 0x8a, 0, 0, in s6x0_i2c_transfer()
624 obuf, 2, DW210X_WRITE_MSG); in s6x0_i2c_transfer()
639 warn("i2c rd: len=%d is too big!\n", in s6x0_i2c_transfer()
645 dw210x_op_rw(d->udev, 0x91, 0, 0, in s6x0_i2c_transfer()
657 obuf[2] = msg[j].buf[0]; in s6x0_i2c_transfer()
663 dw210x_op_rw(d->udev, 0x80, 0, 0, in s6x0_i2c_transfer()
673 if (2 + msg[j].len > sizeof(obuf)) { in s6x0_i2c_transfer()
674 warn("i2c wr: len=%d is too big!\n", in s6x0_i2c_transfer()
682 memcpy(obuf + 2, msg[j].buf, msg[j].len); in s6x0_i2c_transfer()
683 dw210x_op_rw(d->udev, in s6x0_i2c_transfer()
685 0, 0, obuf, msg[j].len + 2, in s6x0_i2c_transfer()
692 if (2 + msg[j].len > sizeof(obuf)) { in s6x0_i2c_transfer()
693 warn("i2c wr: len=%d is too big!\n", in s6x0_i2c_transfer()
700 memcpy(obuf + 2, msg[j].buf, msg[j].len); in s6x0_i2c_transfer()
701 dw210x_op_rw(d->udev, 0x80, 0, 0, in s6x0_i2c_transfer()
702 obuf, msg[j].len + 2, in s6x0_i2c_transfer()
713 mutex_unlock(&d->i2c_mutex); in s6x0_i2c_transfer()
720 struct dvb_usb_device *d = i2c_get_adapdata(adap); in su3000_i2c_transfer() local
724 if (!d) in su3000_i2c_transfer()
727 state = d->priv; in su3000_i2c_transfer()
729 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in su3000_i2c_transfer()
731 if (mutex_lock_interruptible(&d->data_mutex) < 0) { in su3000_i2c_transfer()
732 mutex_unlock(&d->i2c_mutex); in su3000_i2c_transfer()
742 state->data[2] = 0; in su3000_i2c_transfer()
743 if (dvb_usb_generic_rw(d, state->data, 3, in su3000_i2c_transfer()
749 if (dvb_usb_generic_rw(d, state->data, 1, in su3000_i2c_transfer()
750 state->data, 2, 0) < 0) in su3000_i2c_transfer()
763 warn("i2c combined wr/rd: write len=%d is too big!\n", in su3000_i2c_transfer()
769 warn("i2c combined wr/rd: read len=%d is too big!\n", in su3000_i2c_transfer()
777 state->data[2] = msg[j + 1].len; in su3000_i2c_transfer()
781 if (dvb_usb_generic_rw(d, state->data, msg[j].len + 4, in su3000_i2c_transfer()
793 warn("i2c rd: len=%d is too big!\n", msg[j].len); in su3000_i2c_transfer()
800 state->data[2] = msg[j].len; in su3000_i2c_transfer()
804 if (dvb_usb_generic_rw(d, state->data, 4, in su3000_i2c_transfer()
814 warn("i2c wr: len=%d is too big!\n", msg[j].len); in su3000_i2c_transfer()
821 state->data[2] = msg[j].len; in su3000_i2c_transfer()
825 if (dvb_usb_generic_rw(d, state->data, msg[j].len + 3, in su3000_i2c_transfer()
832 mutex_unlock(&d->data_mutex); in su3000_i2c_transfer()
833 mutex_unlock(&d->i2c_mutex); in su3000_i2c_transfer()
877 static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) in dw210x_read_mac_address() argument
884 if (dw210x_op_rw(d->udev, 0xb6, 0xa0, i, ibuf, 2, DW210X_READ_MSG) < 0) { in dw210x_read_mac_address()
901 static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) in s6x0_read_mac_address() argument
922 ret = s6x0_i2c_transfer(&d->i2c_adap, msg, 2); in s6x0_read_mac_address()
923 if (ret != 2) { in s6x0_read_mac_address()
957 static int su3000_power_ctrl(struct dvb_usb_device *d, int i) in su3000_power_ctrl() argument
959 struct dw2102_state *state = d->priv; in su3000_power_ctrl()
962 info("%s: %d, initialized %d", __func__, i, state->initialized); in su3000_power_ctrl()
965 mutex_lock(&d->data_mutex); in su3000_power_ctrl()
972 ret = dvb_usb_generic_rw(d, state->data, 2, NULL, 0, 0); in su3000_power_ctrl()
973 mutex_unlock(&d->data_mutex); in su3000_power_ctrl()
979 static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) in su3000_read_mac_address() argument
989 .len = 2, in su3000_read_mac_address()
1000 if (i2c_transfer(&d->i2c_adap, msg, 2) != 2) in su3000_read_mac_address()
1028 .len = 2, in dw210x_set_voltage()
1046 struct dvb_usb_adapter *d = fe->dvb->priv; in s660_set_voltage() local
1047 struct dw2102_state *st = d->dev->priv; in s660_set_voltage()
1076 struct dvb_usb_adapter *d = fe->dvb->priv; in tt_s2_4600_read_status() local
1077 struct dw2102_state *st = d->dev->priv; in tt_s2_4600_read_status()
1084 su3000_streaming_ctrl(d, 1); in tt_s2_4600_read_status()
1148 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
1149 .diseqc_mode = 2,/* 2/3 PWM */
1151 .tun1_adc = 0,/* 2 Vpp */
1165 .diseqc_mode = 2,
1181 .clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
1182 .diseqc_mode = 2,/* 2/3 PWM */
1184 .tun1_adc = 0,/* 2 Vpp */
1230 static int dw2104_frontend_attach(struct dvb_usb_adapter *d) in dw2104_frontend_attach() argument
1235 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &dw2104a_stv0900_config, in dw2104_frontend_attach()
1236 &d->dev->i2c_adap, 0); in dw2104_frontend_attach()
1237 if (d->fe_adap[0].fe) { in dw2104_frontend_attach()
1238 if (dvb_attach(stb6100_attach, d->fe_adap[0].fe, in dw2104_frontend_attach()
1240 &d->dev->i2c_adap)) { in dw2104_frontend_attach()
1241 tuner_ops = &d->fe_adap[0].fe->ops.tuner_ops; in dw2104_frontend_attach()
1246 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2104_frontend_attach()
1253 if (demod_probe & 2) { in dw2104_frontend_attach()
1254 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &dw2104_stv0900_config, in dw2104_frontend_attach()
1255 &d->dev->i2c_adap, 0); in dw2104_frontend_attach()
1256 if (d->fe_adap[0].fe) { in dw2104_frontend_attach()
1257 if (dvb_attach(stv6110_attach, d->fe_adap[0].fe, in dw2104_frontend_attach()
1259 &d->dev->i2c_adap)) { in dw2104_frontend_attach()
1260 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2104_frontend_attach()
1268 d->fe_adap[0].fe = dvb_attach(cx24116_attach, &dw2104_config, in dw2104_frontend_attach()
1269 &d->dev->i2c_adap); in dw2104_frontend_attach()
1270 if (d->fe_adap[0].fe) { in dw2104_frontend_attach()
1271 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2104_frontend_attach()
1277 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config, in dw2104_frontend_attach()
1278 &d->dev->i2c_adap); in dw2104_frontend_attach()
1279 if (d->fe_adap[0].fe) { in dw2104_frontend_attach()
1280 dvb_attach(ts2020_attach, d->fe_adap[0].fe, in dw2104_frontend_attach()
1281 &dw2104_ts2020_config, &d->dev->i2c_adap); in dw2104_frontend_attach()
1282 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2104_frontend_attach()
1294 static int dw2102_frontend_attach(struct dvb_usb_adapter *d) in dw2102_frontend_attach() argument
1298 d->fe_adap[0].fe = dvb_attach(si21xx_attach, &serit_sp1511lhb_config, in dw2102_frontend_attach()
1299 &d->dev->i2c_adap); in dw2102_frontend_attach()
1300 if (d->fe_adap[0].fe) { in dw2102_frontend_attach()
1301 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2102_frontend_attach()
1308 d->fe_adap[0].fe = dvb_attach(stv0288_attach, &earda_config, in dw2102_frontend_attach()
1309 &d->dev->i2c_adap); in dw2102_frontend_attach()
1310 if (d->fe_adap[0].fe) { in dw2102_frontend_attach()
1311 if (dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61, in dw2102_frontend_attach()
1312 &d->dev->i2c_adap)) { in dw2102_frontend_attach()
1313 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2102_frontend_attach()
1322 d->fe_adap[0].fe = dvb_attach(stv0299_attach, &sharp_z0194a_config, in dw2102_frontend_attach()
1323 &d->dev->i2c_adap); in dw2102_frontend_attach()
1324 if (d->fe_adap[0].fe) { in dw2102_frontend_attach()
1325 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in dw2102_frontend_attach()
1333 static int dw3101_frontend_attach(struct dvb_usb_adapter *d) in dw3101_frontend_attach() argument
1335 d->fe_adap[0].fe = dvb_attach(tda10023_attach, &dw3101_tda10023_config, in dw3101_frontend_attach()
1336 &d->dev->i2c_adap, 0x48); in dw3101_frontend_attach()
1337 if (d->fe_adap[0].fe) { in dw3101_frontend_attach()
1344 static int zl100313_frontend_attach(struct dvb_usb_adapter *d) in zl100313_frontend_attach() argument
1346 d->fe_adap[0].fe = dvb_attach(mt312_attach, &zl313_config, in zl100313_frontend_attach()
1347 &d->dev->i2c_adap); in zl100313_frontend_attach()
1348 if (d->fe_adap[0].fe) { in zl100313_frontend_attach()
1349 if (dvb_attach(zl10039_attach, d->fe_adap[0].fe, 0x60, in zl100313_frontend_attach()
1350 &d->dev->i2c_adap)) { in zl100313_frontend_attach()
1351 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in zl100313_frontend_attach()
1360 static int stv0288_frontend_attach(struct dvb_usb_adapter *d) in stv0288_frontend_attach() argument
1364 d->fe_adap[0].fe = dvb_attach(stv0288_attach, &earda_config, in stv0288_frontend_attach()
1365 &d->dev->i2c_adap); in stv0288_frontend_attach()
1367 if (!d->fe_adap[0].fe) in stv0288_frontend_attach()
1370 if (dvb_attach(stb6000_attach, d->fe_adap[0].fe, 0x61, &d->dev->i2c_adap) == NULL) in stv0288_frontend_attach()
1373 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in stv0288_frontend_attach()
1375 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG); in stv0288_frontend_attach()
1382 static int ds3000_frontend_attach(struct dvb_usb_adapter *d) in ds3000_frontend_attach() argument
1384 struct dw2102_state *st = d->dev->priv; in ds3000_frontend_attach()
1387 d->fe_adap[0].fe = dvb_attach(ds3000_attach, &s660_ds3000_config, in ds3000_frontend_attach()
1388 &d->dev->i2c_adap); in ds3000_frontend_attach()
1390 if (!d->fe_adap[0].fe) in ds3000_frontend_attach()
1393 dvb_attach(ts2020_attach, d->fe_adap[0].fe, &s660_ts2020_config, in ds3000_frontend_attach()
1394 &d->dev->i2c_adap); in ds3000_frontend_attach()
1396 st->old_set_voltage = d->fe_adap[0].fe->ops.set_voltage; in ds3000_frontend_attach()
1397 d->fe_adap[0].fe->ops.set_voltage = s660_set_voltage; in ds3000_frontend_attach()
1399 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG); in ds3000_frontend_attach()
1406 static int prof_7500_frontend_attach(struct dvb_usb_adapter *d) in prof_7500_frontend_attach() argument
1410 d->fe_adap[0].fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config, in prof_7500_frontend_attach()
1411 &d->dev->i2c_adap, 0); in prof_7500_frontend_attach()
1412 if (!d->fe_adap[0].fe) in prof_7500_frontend_attach()
1415 d->fe_adap[0].fe->ops.set_voltage = dw210x_set_voltage; in prof_7500_frontend_attach()
1417 dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG); in prof_7500_frontend_attach()
1426 struct dvb_usb_device *d = adap->dev; in su3000_frontend_attach() local
1427 struct dw2102_state *state = d->priv; in su3000_frontend_attach()
1429 mutex_lock(&d->data_mutex); in su3000_frontend_attach()
1433 state->data[2] = 0; in su3000_frontend_attach()
1435 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in su3000_frontend_attach()
1440 state->data[2] = 1; in su3000_frontend_attach()
1442 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in su3000_frontend_attach()
1448 state->data[2] = 0; in su3000_frontend_attach()
1450 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in su3000_frontend_attach()
1455 state->data[2] = 1; in su3000_frontend_attach()
1457 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in su3000_frontend_attach()
1462 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0) in su3000_frontend_attach()
1465 mutex_unlock(&d->data_mutex); in su3000_frontend_attach()
1468 &d->i2c_adap); in su3000_frontend_attach()
1474 &d->i2c_adap)) { in su3000_frontend_attach()
1485 struct dvb_usb_device *d = adap->dev; in t220_frontend_attach() local
1486 struct dw2102_state *state = d->priv; in t220_frontend_attach()
1488 mutex_lock(&d->data_mutex); in t220_frontend_attach()
1492 state->data[2] = 0x0; in t220_frontend_attach()
1494 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in t220_frontend_attach()
1499 state->data[2] = 1; in t220_frontend_attach()
1501 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in t220_frontend_attach()
1506 state->data[2] = 0; in t220_frontend_attach()
1508 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in t220_frontend_attach()
1515 state->data[2] = 1; in t220_frontend_attach()
1517 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in t220_frontend_attach()
1522 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0) in t220_frontend_attach()
1525 mutex_unlock(&d->data_mutex); in t220_frontend_attach()
1528 &d->i2c_adap, NULL); in t220_frontend_attach()
1531 &d->i2c_adap, &tda18271_config)) { in t220_frontend_attach()
1543 struct dvb_usb_device *d = adap->dev; in m88rs2000_frontend_attach() local
1544 struct dw2102_state *state = d->priv; in m88rs2000_frontend_attach()
1546 mutex_lock(&d->data_mutex); in m88rs2000_frontend_attach()
1550 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0) in m88rs2000_frontend_attach()
1553 mutex_unlock(&d->data_mutex); in m88rs2000_frontend_attach()
1557 &d->i2c_adap); in m88rs2000_frontend_attach()
1564 &d->i2c_adap)) { in m88rs2000_frontend_attach()
1573 static int tt_s2_4600_frontend_attach_probe_demod(struct dvb_usb_device *d, in tt_s2_4600_frontend_attach_probe_demod() argument
1576 struct dw2102_state *state = d->priv; in tt_s2_4600_frontend_attach_probe_demod()
1580 state->data[2] = 0x1; in tt_s2_4600_frontend_attach_probe_demod()
1584 if (dvb_usb_generic_rw(d, state->data, 5, state->data, 2, 0) < 0) { in tt_s2_4600_frontend_attach_probe_demod()
1598 struct dvb_usb_device *d = adap->dev; in tt_s2_4600_frontend_attach() local
1599 struct dw2102_state *state = d->priv; in tt_s2_4600_frontend_attach()
1607 mutex_lock(&d->data_mutex); in tt_s2_4600_frontend_attach()
1611 state->data[2] = 0x0; in tt_s2_4600_frontend_attach()
1613 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in tt_s2_4600_frontend_attach()
1618 state->data[2] = 1; in tt_s2_4600_frontend_attach()
1620 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in tt_s2_4600_frontend_attach()
1626 state->data[2] = 0; in tt_s2_4600_frontend_attach()
1628 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in tt_s2_4600_frontend_attach()
1633 state->data[2] = 1; in tt_s2_4600_frontend_attach()
1635 if (dvb_usb_generic_rw(d, state->data, 3, state->data, 1, 0) < 0) in tt_s2_4600_frontend_attach()
1640 if (dvb_usb_generic_rw(d, state->data, 1, state->data, 1, 0) < 0) in tt_s2_4600_frontend_attach()
1645 if (tt_s2_4600_frontend_attach_probe_demod(d, 0x68)) in tt_s2_4600_frontend_attach()
1647 else if (tt_s2_4600_frontend_attach_probe_demod(d, 0x69)) in tt_s2_4600_frontend_attach()
1649 else if (tt_s2_4600_frontend_attach_probe_demod(d, 0x6a)) in tt_s2_4600_frontend_attach()
1652 mutex_unlock(&d->data_mutex); in tt_s2_4600_frontend_attach()
1680 client = i2c_new_client_device(&d->i2c_adap, &board_info); in tt_s2_4600_frontend_attach()
1742 static int dw2102_rc_query(struct dvb_usb_device *d) in dw2102_rc_query() argument
1744 u8 key[2]; in dw2102_rc_query()
1749 .len = 2 in dw2102_rc_query()
1752 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { in dw2102_rc_query()
1756 rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, key[0], 0); in dw2102_rc_query()
1763 static int prof_rc_query(struct dvb_usb_device *d) in prof_rc_query() argument
1765 u8 key[2]; in prof_rc_query()
1770 .len = 2 in prof_rc_query()
1773 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { in prof_rc_query()
1777 rc_keydown(d->rc_dev, RC_PROTO_UNKNOWN, key[0] ^ 0xff, in prof_rc_query()
1785 static int su3000_rc_query(struct dvb_usb_device *d) in su3000_rc_query() argument
1787 u8 key[2]; in su3000_rc_query()
1792 .len = 2 in su3000_rc_query()
1795 if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) { in su3000_rc_query()
1799 rc_keydown(d->rc_dev, RC_PROTO_RC5, in su3000_rc_query()
1944 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2, in dw2102_load_firmware()
1947 dw210x_op_rw(dev, 0xb5, 0, 0, &reset16[0], 2, in dw2102_load_firmware()
1957 reset16[2] = 0; in dw2102_load_firmware()
1962 if (reset16[2] == 0x11) { in dw2102_load_firmware()
1968 dw210x_op_rw(dev, 0xbc, 0x0030, 0, &reset16[0], 2, in dw2102_load_firmware()
1974 dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2, in dw2102_load_firmware()
2082 .num_device_descs = 2,
2285 {"TeVii S480.2 USB",
2397 { "Terratec Cinergy S2 USB HD Rev.2",
2409 { "Terratec Cinergy S2 PCIe Dual Port 2",
2460 .num_device_descs = 2,
2572 { "TeVii S482 (tuner 2)",
2620 struct dvb_usb_device *d = usb_get_intfdata(intf); in dw2102_disconnect() local
2621 struct dw2102_state *st = d->priv; in dw2102_disconnect()