258 .init_dev = az6027_stb0899_s1_init_1,
259 .init_s2_demod = stb0899_s2_init_2,
260 .init_s1_demod = az6027_stb0899_s1_init_3,
261 .init_s2_fec = stb0899_s2_init_4,
262 .init_tst = stb0899_s1_init_5,
264 .demod_address = 0xd0,
266 .xtal_freq = 27000000,
287 .tuner_get_frequency = stb6100_get_frequency,
288 .tuner_set_frequency = stb6100_set_frequency,
289 .tuner_set_bandwidth = stb6100_set_bandwidth,
290 .tuner_get_bandwidth = stb6100_get_bandwidth,
291 .tuner_set_rfsiggain =
NULL,
295 .tuner_address = 0xc0,
296 .refclock = 27000000,
308 usb_rcvctrlpipe(d->
udev, 0),
318 warn(
"usb in operation failed. (%d)", ret);
323 deb_xfer(
"in: req. %02x, val: %04x, ind: %04x, buffer: ", req, value, index);
339 deb_xfer(
"out: req. %02x, val: %04x, ind: %04x, buffer: ", req, value, index);
346 usb_sndctrlpipe(d->
udev, 0),
356 warn(
"usb out operation failed. (%d)", ret);
380 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
382 warn(
"usb out operation failed. (%d)", ret);
437 warn(
"usb in operation failed. (%d)", ret);
448 static int az6027_ci_write_attribute_mem(
struct dvb_ca_en50221 *ca,
472 ret = az6027_usb_out_op(d, req, value1, index,
NULL, blen);
474 warn(
"usb out operation failed. (%d)", ret);
510 warn(
"usb in operation failed. (%d)", ret);
514 warn(
"Read CI IO error");
517 deb_info(
"read cam data = %x from 0x%x", b[1], value);
548 ret = az6027_usb_out_op(d, req, value1, index,
NULL, blen);
550 warn(
"usb out operation failed. (%d)", ret);
581 warn(
"usb in operation failed. (%d)", ret);
590 static int az6027_ci_slot_reset(
struct dvb_ca_en50221 *ca,
int slot)
608 ret = az6027_usb_out_op(d, req, value, index,
NULL, blen);
610 warn(
"usb out operation failed. (%d)", ret);
620 ret = az6027_usb_out_op(d, req, value, index,
NULL, blen);
622 warn(
"usb out operation failed. (%d)", ret);
626 for (i = 0; i < 15; i++) {
629 if (CI_CamReady(ca, slot)) {
641 static int az6027_ci_slot_shutdown(
struct dvb_ca_en50221 *ca,
int slot)
646 static int az6027_ci_slot_ts_enable(
struct dvb_ca_en50221 *ca,
int slot)
664 ret = az6027_usb_out_op(d, req, value, index,
NULL, blen);
666 warn(
"usb out operation failed. (%d)", ret);
698 warn(
"usb in operation failed. (%d)", ret);
703 if (!ret && b[0] == 1) {
727 if (
NULL == state->
ca.data)
747 state->
ca.read_attribute_mem = az6027_ci_read_attribute_mem;
748 state->
ca.write_attribute_mem = az6027_ci_write_attribute_mem;
749 state->
ca.read_cam_control = az6027_ci_read_cam_control;
750 state->
ca.write_cam_control = az6027_ci_write_cam_control;
751 state->
ca.slot_reset = az6027_ci_slot_reset;
752 state->
ca.slot_shutdown = az6027_ci_slot_shutdown;
753 state->
ca.slot_ts_enable = az6027_ci_slot_ts_enable;
754 state->
ca.poll_slot_status = az6027_ci_poll_slot_status;
762 err(
"Cannot initialize CI: Error %d.", ret);
834 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
854 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
864 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
875 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
883 static int az6027_frontend_tsbypass(
struct dvb_usb_adapter *adap,
int onoff)
897 ret = az6027_usb_out_op(adap->
dev, req, value, index,
NULL, blen);
907 az6027_frontend_poweron(adap);
908 az6027_frontend_reset(adap);
910 deb_info(
"adap = %p, dev = %p\n", adap, adap->
dev);
917 adap->
fe_adap[0].fe->ops.set_voltage = az6027_set_voltage;
918 az6027_ci_init(adap);
923 warn(
"no front-end attached\n");
925 az6027_frontend_tsbypass(adap, 0);
951 static int az6027_i2c_xfer(
struct i2c_adapter *adap,
struct i2c_msg
msg[],
int num)
954 int i = 0,
j = 0,
len = 0;
971 warn(
"more than 2 i2c messages at a time is not handled yet. TODO.");
973 for (i = 0; i < num; i++) {
975 if (msg[i].
addr == 0x99) {
978 value = msg[
i].
buf[0] & 0x00ff;
980 az6027_usb_out_op(d, req, value, index, data, length);
983 if (msg[i].
addr == 0xd0) {
987 index = (((msg[
i].
buf[0] << 8) & 0xff00) | (msg[
i].
buf[1] & 0x00ff));
989 length = msg[i + 1].
len + 6;
993 msg[i + 1].buf[
j] = data[
j + 5];
1000 index = (((msg[
i].
buf[0] << 8) & 0xff00) | (msg[
i].
buf[1] & 0x00ff));
1001 value = msg[
i].
addr + (2 << 8);
1002 length = msg[
i].
len - 2;
1004 for (
j = 0;
j <
len;
j++)
1005 data[
j] = msg[i].buf[
j + 2];
1006 az6027_usb_out_op(d, req, value, index, data, length);
1010 if (msg[i].
addr == 0xc0) {
1011 if (msg[i].
flags & I2C_M_RD) {
1015 value = msg[
i].
addr;
1016 length = msg[
i].
len + 6;
1019 for (
j = 0;
j <
len;
j++)
1020 msg[i].buf[
j] = data[
j + 5];
1025 index = msg[
i].
buf[0] & 0x00FF;
1026 value = msg[
i].
addr + (1 << 8);
1027 length = msg[
i].
len - 1;
1030 for (
j = 0;
j <
len;
j++)
1031 data[
j] = msg[i].buf[
j + 1];
1033 az6027_usb_out_op(d, req, value, index, data, length);
1050 .master_xfer = az6027_i2c_xfer,
1051 .functionality = az6027_i2c_func,
1067 usb_rcvctrlpipe(udev, 0),
1074 USB_CTRL_GET_TIMEOUT);
1098 .firmware =
"dvb-usb-az6027-03.fw",
1108 .streaming_ctrl = az6027_streaming_ctrl,
1109 .frontend_attach = az6027_frontend_attach,
1130 .rc_map_table = rc_map_az6027_table,
1131 .rc_map_size =
ARRAY_SIZE(rc_map_az6027_table),
1133 .rc_query = az6027_rc_query,
1136 .i2c_algo = &az6027_i2c_algo,
1138 .num_device_descs = 6,
1141 .name =
"AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)",
1142 .cold_ids = { &az6027_usb_table[0],
NULL },
1143 .warm_ids = {
NULL },
1145 .name =
"TERRATEC S7",
1146 .cold_ids = { &az6027_usb_table[1],
NULL },
1147 .warm_ids = {
NULL },
1149 .name =
"TERRATEC S7 MKII",
1150 .cold_ids = { &az6027_usb_table[2],
NULL },
1151 .warm_ids = {
NULL },
1153 .name =
"Technisat SkyStar USB 2 HD CI",
1154 .cold_ids = { &az6027_usb_table[3],
NULL },
1155 .warm_ids = {
NULL },
1157 .name =
"Technisat SkyStar USB 2 HD CI",
1158 .cold_ids = { &az6027_usb_table[4],
NULL },
1159 .warm_ids = {
NULL },
1161 .name =
"Elgato EyeTV Sat",
1162 .cold_ids = { &az6027_usb_table[5],
NULL },
1163 .warm_ids = {
NULL },
1170 static struct usb_driver az6027_usb_driver = {
1171 .name =
"dvb_usb_az6027",
1172 .probe = az6027_usb_probe,
1173 .disconnect = az6027_usb_disconnect,
1174 .id_table = az6027_usb_table,