Lines Matching +full:0 +full:xa400

26 module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
37 u8 regmask[8] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
62 st->data[0] = 14; /* rest of buffer length low */ in af9005_generic_read_write()
63 st->data[1] = 0; /* rest of buffer length high */ in af9005_generic_read_write()
71 st->data[6] = (u8) (reg & 0xff); in af9005_generic_read_write()
84 for (i = 0; i < len; i++) in af9005_generic_read_write()
88 st->data[8] = values[0]; in af9005_generic_read_write()
91 ret = dvb_usb_generic_rw(d, st->data, 16, st->data, 17, 0); in af9005_generic_read_write()
101 if (st->data[3] != 0x0d) { in af9005_generic_read_write()
118 if (st->data[16] != 0x01) { in af9005_generic_read_write()
125 for (i = 0; i < len; i++) in af9005_generic_read_write()
208 return 0; in af9005_read_register_bits()
218 if (pos == 0 && len == 8) in af9005_write_register_bits()
251 int ret, i, done = 0, fail = 0; in af9005_write_tuner_registers()
256 if (reg != 0xffff) { in af9005_write_tuner_registers()
257 /* check if write done (0xa40d bit 1) or fail (0xa40d bit 2) */ in af9005_write_tuner_registers()
258 for (i = 0; i < 200; i++) { in af9005_write_tuner_registers()
295 return 0; in af9005_write_tuner_registers()
307 buf[0] = addr; /* tuner i2c address */ in af9005_read_tuner_registers()
308 buf[1] = values[0]; /* tuner register */ in af9005_read_tuner_registers()
310 values[0] = addr + 0x01; /* i2c read address */ in af9005_read_tuner_registers()
313 /* write tuner i2c address to tuner, 0c00c0 undocumented, found by sniffing */ in af9005_read_tuner_registers()
314 ret = af9005_write_tuner_registers(d, 0x00c0, buf, 2); in af9005_read_tuner_registers()
325 for (i = 0; i < 200; i++) { in af9005_read_tuner_registers()
326 ret = af9005_read_ofdm_register(d, 0xa408, &temp); in af9005_read_tuner_registers()
329 if (temp & 0x01) in af9005_read_tuner_registers()
341 /* get read data (available from 0xa400) */ in af9005_read_tuner_registers()
342 for (i = 0; i < len; i++) { in af9005_read_tuner_registers()
343 ret = af9005_read_ofdm_register(d, 0xa400 + i, &temp); in af9005_read_tuner_registers()
348 return 0; in af9005_read_tuner_registers()
360 for (i = 0; i < len; i++) { in af9005_i2c_write()
361 buf[0] = i2caddr; in af9005_i2c_write()
374 return 0; in af9005_i2c_write()
383 for (i = 0; i < len; i++) { in af9005_i2c_read()
397 return 0; in af9005_i2c_read()
410 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in af9005_i2c_xfer()
418 reg = *msg[0].buf; in af9005_i2c_xfer()
419 addr = msg[0].addr; in af9005_i2c_xfer()
422 if (ret == 0) in af9005_i2c_xfer()
426 reg = msg[0].buf[0]; in af9005_i2c_xfer()
427 addr = msg[0].addr; in af9005_i2c_xfer()
428 value = &msg[0].buf[1]; in af9005_i2c_xfer()
429 ret = af9005_i2c_write(d, addr, reg, value, msg[0].len - 1); in af9005_i2c_xfer()
430 if (ret == 0) in af9005_i2c_xfer()
456 if (wlen < 0) { in af9005_send_command()
457 err("send command, wlen less than 0 bytes. Makes no sense."); in af9005_send_command()
472 st->data[0] = (u8) (packet_len & 0xff); in af9005_send_command()
473 st->data[1] = (u8) ((packet_len & 0xff00) >> 8); in af9005_send_command()
475 st->data[2] = 0x26; /* packet type */ in af9005_send_command()
480 for (i = 0; i < wlen; i++) in af9005_send_command()
482 ret = dvb_usb_generic_rw(d, st->data, wlen + 7, st->data, rlen + 7, 0); in af9005_send_command()
483 if (st->data[2] != 0x27) { in af9005_send_command()
489 } else if (st->data[5] != 0x01) { in af9005_send_command()
497 for (i = 0; i < rlen; i++) in af9005_send_command()
514 memset(st->data, 0, sizeof(st->data)); in af9005_read_eeprom()
516 st->data[0] = 14; /* length of rest of packet low */ in af9005_read_eeprom()
517 st->data[1] = 0; /* length of rest of packer high */ in af9005_read_eeprom()
519 st->data[2] = 0x2a; /* read/write eeprom */ in af9005_read_eeprom()
525 st->data[5] = 0; /* read */ in af9005_read_eeprom()
529 ret = dvb_usb_generic_rw(d, st->data, 16, st->data, 14, 0); in af9005_read_eeprom()
530 if (st->data[2] != 0x2b) { in af9005_read_eeprom()
545 for (i = 0; i < len; i++) in af9005_read_eeprom()
557 int act_len = 0, i, ret; in af9005_boot_packet()
559 memset(buf, 0, size); in af9005_boot_packet()
560 buf[0] = (u8) (FW_BULKOUT_SIZE & 0xff); in af9005_boot_packet()
561 buf[1] = (u8) ((FW_BULKOUT_SIZE >> 8) & 0xff); in af9005_boot_packet()
564 buf[2] = 0x11; in af9005_boot_packet()
565 buf[3] = 0x04; in af9005_boot_packet()
566 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
567 buf[5] = 0x03; in af9005_boot_packet()
569 buf[6] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
570 buf[7] = (u8) (checksum & 0xff); in af9005_boot_packet()
573 buf[2] = 0x11; in af9005_boot_packet()
574 buf[3] = 0x04; in af9005_boot_packet()
575 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
576 buf[5] = 0x01; in af9005_boot_packet()
578 buf[6] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
579 buf[7] = (u8) (checksum & 0xff); in af9005_boot_packet()
582 buf[2] = 0x10; in af9005_boot_packet()
583 buf[3] = 0x08; in af9005_boot_packet()
584 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
585 buf[5] = 0x97; in af9005_boot_packet()
586 buf[6] = 0xaa; in af9005_boot_packet()
587 buf[7] = 0x55; in af9005_boot_packet()
588 buf[8] = 0xa5; in af9005_boot_packet()
589 buf[9] = 0x5a; in af9005_boot_packet()
590 checksum = 0; in af9005_boot_packet()
593 buf[10] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
594 buf[11] = (u8) (checksum & 0xff); in af9005_boot_packet()
604 usb_sndbulkpipe(udev, 0x02), in af9005_boot_packet()
610 ret = act_len != FW_BULKOUT_SIZE + 2 ? -1 : 0; in af9005_boot_packet()
613 memset(buf, 0, 9); in af9005_boot_packet()
615 usb_rcvbulkpipe(udev, 0x01), buf, 9, &act_len, 2000); in af9005_boot_packet()
622 checksum = 0; in af9005_boot_packet()
625 if (buf[2] != 0x11) { in af9005_boot_packet()
629 if (buf[3] != 0x05) { in af9005_boot_packet()
633 if (buf[4] != 0x00) { in af9005_boot_packet()
637 if (buf[5] != 0x04) { in af9005_boot_packet()
650 if (buf[2] != 0x11) { in af9005_boot_packet()
654 if (buf[3] != 0x05) { in af9005_boot_packet()
658 if (buf[4] != 0x00) { in af9005_boot_packet()
662 if (buf[5] != 0x02) { in af9005_boot_packet()
675 if (buf[2] != 0x10) { in af9005_boot_packet()
679 if (buf[3] != 0x05) { in af9005_boot_packet()
683 if (buf[4] != 0x00) { in af9005_boot_packet()
687 if (buf[5] != 0x01) { in af9005_boot_packet()
691 if (buf[6] != 0x10) { in af9005_boot_packet()
705 return 0; in af9005_boot_packet()
723 if (reply != 0x01) { in af9005_download_firmware()
724 err("before downloading firmware, FW_CONFIG expected 0x01, received 0x%x", reply); in af9005_download_firmware()
729 buf[0] = (u8) (FW_BULKOUT_SIZE & 0xff); in af9005_download_firmware()
730 buf[1] = (u8) ((FW_BULKOUT_SIZE >> 8) & 0xff); in af9005_download_firmware()
731 for (i = 0; i < packets; i++) { in af9005_download_firmware()
737 usb_sndbulkpipe(udev, 0x02), in af9005_download_firmware()
748 if (reply != (u8) (packets & 0xff)) { in af9005_download_firmware()
749 err("after downloading firmware, FW_CONFIRM expected 0x%x, received 0x%x", packets & 0xff, reply); in af9005_download_firmware()
761 if (reply != 0x02) { in af9005_download_firmware()
762 err("after downloading firmware, FW_CONFIG expected 0x02, received 0x%x", reply); in af9005_download_firmware()
781 temp = 0; in af9005_led_control()
797 return 0; in af9005_led_control()
814 for (i = 0; i < 255; i += 8) { in af9005_frontend_attach()
819 adap->fe_adap[0].fe = af9005_fe_attach(adap->dev); in af9005_frontend_attach()
820 return 0; in af9005_frontend_attach()
832 return 0; in af9005_rc_query()
838 st->data[0] = 3; /* rest of packet length low */ in af9005_rc_query()
839 st->data[1] = 0; /* rest of packet length high */ in af9005_rc_query()
840 st->data[2] = 0x40; /* read remote */ in af9005_rc_query()
843 ret = dvb_usb_generic_rw(d, st->data, 5, st->data, 256, 0); in af9005_rc_query()
848 if (st->data[2] != 0x41) { in af9005_rc_query()
863 if (len > 0) { in af9005_rc_query()
885 return 0; in af9005_power_ctrl()
906 af9005_write_ofdm_register(adap->dev, XD_MP2IF_DMX_CTRL, 0); in af9005_pid_filter_control()
910 return 0; in af9005_pid_filter_control()
916 u8 cmd = index & 0x1f; in af9005_pid_filter()
932 (u8) (pid & 0xff)); in af9005_pid_filter()
941 cmd |= 0x20 | 0x40; in af9005_pid_filter()
943 if (adap->feedcount == 0) { in af9005_pid_filter()
954 return 0; in af9005_pid_filter()
974 if (reply == 0x01) in af9005_identify_state()
976 else if (reply == 0x02) in af9005_identify_state()
977 *cold = 0; in af9005_identify_state()
1042 .endpoint = 0x04,
1060 .rc_map_size = 0,
1115 return 0; in af9005_usb_module_init()