19 "set debugging level (1=info,2=xfer,4=rc,8=fe (or-able))."
38 int wo = (rbuf ==
NULL || rlen == 0);
41 deb_xfer(
"write to PLL:0x%02x via FE reg:0x%02x, len:%d\n",
42 wbuf[1], wbuf[0], wlen - 1);
44 if (wo && wlen >= 2) {
49 req, type, value, index,
50 &wbuf[1], wlen - 1, 2000);
53 deb_xfer(
"not supported ctrl-msg, aborting.");
66 u16 value = addr << (8 + 1);
67 int wo = (rbuf ==
NULL || rlen == 0);
74 return gl861_i2c_ctrlmsg_data(d, addr, wbuf, wlen, rbuf, rlen);
79 pipe = usb_sndctrlpipe(d->
udev, 0);
83 pipe = usb_rcvctrlpipe(d->
udev, 0);
92 value = value + wbuf[1];
96 index = (wbuf[2] << 8) | wbuf[0];
97 value = value + wbuf[1];
100 deb_xfer(
"wlen = %x, aborting.", wlen);
105 value, index, rbuf, rlen, 2000);
122 for (i = 0; i < num; i++) {
125 if (gl861_i2c_msg(d, msg[i].addr,
126 msg[i].
buf, msg[i].len,
127 msg[i + 1].buf, msg[i + 1].len) < 0)
131 if (gl861_i2c_msg(d, msg[i].addr, msg[i].
buf,
132 msg[i].len,
NULL, 0) < 0)
146 u32 sat_color,
int lnb_on)
168 ret = gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
170 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
173 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
175 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
179 for (i = 0; i < 32; i++) {
181 if (sat_color & mask)
183 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
185 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
191 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
193 ret += gl861_i2c_xfer(&adap->
dev->i2c_adap, &msg, 1);
203 static u8 streaming_init_cmds[][2] = {
215 static int cmdlen =
sizeof(streaming_init_cmds) / 2;
244 ret = gl861_i2c_msg(d, 0x00, wbuf, 2,
NULL, 0);
251 ret = gl861_i2c_msg(d, 0x00, wbuf, 2,
NULL, 0);
263 0x1200, 0x0100, wbuf, 2, 2000);
271 ret = gl861_i2c_msg(d, 0x12 >> 1, wbuf, 3, rbuf, 2);
273 if (ret < 0 || rbuf[0] != 0xff || rbuf[1] != 0xff)
281 0x9000, 0x0100, wbuf, 2, 2000);
289 ret = gl861_i2c_msg(d, 0x90 >> 1, wbuf, 3, rbuf, 2);
291 if (ret < 0 || rbuf[0] != 0xff || rbuf[1] != 0xff)
321 if (rbuf[0] & 0x80) {
323 deb_info(
"failed to get the correct"
324 " FE demod status:0x%02x\n", rbuf[0]);
337 ret = gl861_i2c_msg(d, 0x00, wbuf, 2,
NULL, 0);
345 ret = gl861_i2c_msg(d, 0x00, wbuf, 2,
NULL, 0);
351 ret = gl861_i2c_msg(d, 0x00, wbuf, 2,
NULL, 0);
357 for (i = 0; i < cmdlen; i++) {
358 ret = gl861_i2c_msg(d, 0x00, streaming_init_cmds[i], 2,
367 ret = friio_streaming_ctrl(&d->
adapter[0], 0);
376 deb_info(
"%s:ret == %d\n", __func__, ret);
386 deb_info(
"%s called.(%d)\n", __func__, onoff);
390 ret = friio_ext_ctl(adap, 0x6400ff64, 1);
392 ret = friio_ext_ctl(adap, 0x96ff00ff, 1);
395 deb_info(
"%s failed to send cmdx. ret==%d\n", __func__, ret);
403 if (friio_initialize(adap->
dev) < 0)
420 struct usb_host_interface *alt;
428 deb_rc(
"not alt found!\n");
432 alt->desc.bInterfaceNumber,
433 alt->desc.bAlternateSetting);
435 deb_rc(
"failed to set alt-setting!\n");
442 friio_streaming_ctrl(&d->
adapter[0], 1);
454 .master_xfer = gl861_i2c_xfer,
455 .functionality = gl861_i2c_func,
480 .frontend_attach = friio_frontend_attach,
481 .streaming_ctrl = friio_streaming_ctrl,
498 .i2c_algo = &gl861_i2c_algo,
500 .num_device_descs = 1,
503 .name =
"774 Friio ISDB-T USB2.0",
504 .cold_ids = {
NULL },
505 .warm_ids = { &friio_table[0],
NULL },
510 static struct usb_driver friio_driver = {
511 .name =
"dvb_usb_friio",
512 .probe = friio_probe,
514 .id_table = friio_table,