20 static int dvb_usb_digitv_debug;
26 #define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
29 u8 cmd,
u8 vv,
u8 *wbuf,
int wlen,
u8 *rbuf,
int rlen)
31 int wo = (rbuf ==
NULL || rlen == 0);
37 sndbuf[2] = wo ? wlen : rlen;
40 memcpy(&sndbuf[3],wbuf,wlen);
44 memcpy(rbuf,&rcvbuf[3],rlen);
59 warn(
"more than 2 i2c messages at a time is not handled yet. TODO.");
61 for (i = 0; i < num; i++) {
65 msg[i+1].buf,msg[i+1].len) < 0)
70 &msg[i].buf[1],msg[i].len-1,
NULL,0) < 0)
84 .master_xfer = digitv_i2c_xfer,
85 .functionality = digitv_i2c_func,
89 static int digitv_identify_state (
struct usb_device *
udev,
struct
93 *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0;
97 static int digitv_mt352_demod_init(
struct dvb_frontend *fe)
99 static u8 reset_buf[] = { 0x89, 0x38, 0x8a, 0x2d, 0x50, 0x80 };
100 static u8 init_buf[] = { 0x68, 0xa0, 0x8e, 0x40, 0x53, 0x50,
101 0x67, 0x20, 0x7d, 0x01, 0x7c, 0x00, 0x7a, 0x00,
102 0x79, 0x20, 0x57, 0x05, 0x56, 0x31, 0x88, 0x0f,
106 for (i = 0; i <
ARRAY_SIZE(reset_buf); i += 2)
107 mt352_write(fe, &reset_buf[i], 2);
112 mt352_write(fe, &init_buf[i], 2);
118 .demod_init = digitv_mt352_demod_init,
121 static int digitv_nxt6000_tuner_set_params(
struct dvb_frontend *fe)
126 fe->
ops.tuner_ops.calc_regs(fe, b,
sizeof(b));
127 if (fe->
ops.i2c_gate_ctrl)
128 fe->
ops.i2c_gate_ctrl(fe, 1);
133 .clock_inversion = 1,
141 &adap->
dev->i2c_adap);
147 &digitv_nxt6000_config,
148 &adap->
dev->i2c_adap);
164 adap->
fe_adap[0].fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params;
245 for (i = 0; i < d->
props.rc.legacy.rc_map_size; i++) {
246 if (rc5_custom(&d->
props.rc.legacy.rc_map_table[i]) == key[1] &&
247 rc5_data(&d->
props.rc.legacy.rc_map_table[i]) == key[2]) {
248 *
event = d->
props.rc.legacy.rc_map_table[
i].keycode;
256 deb_rc(
"key: %*ph\n", 5, key);
293 .firmware =
"dvb-usb-digitv-02.fw",
302 .frontend_attach = digitv_frontend_attach,
303 .tuner_attach = digitv_tuner_attach,
319 .identify_state = digitv_identify_state,
323 .rc_map_table = rc_map_digitv_table,
324 .rc_map_size =
ARRAY_SIZE(rc_map_digitv_table),
325 .rc_query = digitv_rc_query,
328 .i2c_algo = &digitv_i2c_algo,
330 .generic_bulk_ctrl_endpoint = 0x01,
332 .num_device_descs = 1,
334 {
"Nebula Electronics uDigiTV DVB-T USB2.0)",
335 { &digitv_table[0],
NULL },
342 static struct usb_driver digitv_driver = {
343 .name =
"dvb_usb_digitv",
344 .probe = digitv_probe,
346 .id_table = digitv_table,