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()
425 if (msg[0].len < 2) { in af9005_i2c_xfer()
430 reg = msg[0].buf[0]; in af9005_i2c_xfer()
431 addr = msg[0].addr; in af9005_i2c_xfer()
432 value = &msg[0].buf[1]; in af9005_i2c_xfer()
433 ret = af9005_i2c_write(d, addr, reg, value, msg[0].len - 1); in af9005_i2c_xfer()
434 if (ret == 0) in af9005_i2c_xfer()
461 if (wlen < 0) { in af9005_send_command()
462 err("send command, wlen less than 0 bytes. Makes no sense."); in af9005_send_command()
477 st->data[0] = (u8) (packet_len & 0xff); in af9005_send_command()
478 st->data[1] = (u8) ((packet_len & 0xff00) >> 8); in af9005_send_command()
480 st->data[2] = 0x26; /* packet type */ in af9005_send_command()
485 for (i = 0; i < wlen; i++) in af9005_send_command()
487 ret = dvb_usb_generic_rw(d, st->data, wlen + 7, st->data, rlen + 7, 0); in af9005_send_command()
488 if (st->data[2] != 0x27) { in af9005_send_command()
494 } else if (st->data[5] != 0x01) { in af9005_send_command()
502 for (i = 0; i < rlen; i++) in af9005_send_command()
519 memset(st->data, 0, sizeof(st->data)); in af9005_read_eeprom()
521 st->data[0] = 14; /* length of rest of packet low */ in af9005_read_eeprom()
522 st->data[1] = 0; /* length of rest of packer high */ in af9005_read_eeprom()
524 st->data[2] = 0x2a; /* read/write eeprom */ in af9005_read_eeprom()
530 st->data[5] = 0; /* read */ in af9005_read_eeprom()
534 ret = dvb_usb_generic_rw(d, st->data, 16, st->data, 14, 0); in af9005_read_eeprom()
535 if (st->data[2] != 0x2b) { in af9005_read_eeprom()
550 for (i = 0; i < len; i++) in af9005_read_eeprom()
562 int act_len = 0, i, ret; in af9005_boot_packet()
564 memset(buf, 0, size); in af9005_boot_packet()
565 buf[0] = (u8) (FW_BULKOUT_SIZE & 0xff); in af9005_boot_packet()
566 buf[1] = (u8) ((FW_BULKOUT_SIZE >> 8) & 0xff); in af9005_boot_packet()
569 buf[2] = 0x11; in af9005_boot_packet()
570 buf[3] = 0x04; in af9005_boot_packet()
571 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
572 buf[5] = 0x03; in af9005_boot_packet()
574 buf[6] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
575 buf[7] = (u8) (checksum & 0xff); in af9005_boot_packet()
578 buf[2] = 0x11; in af9005_boot_packet()
579 buf[3] = 0x04; in af9005_boot_packet()
580 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
581 buf[5] = 0x01; in af9005_boot_packet()
583 buf[6] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
584 buf[7] = (u8) (checksum & 0xff); in af9005_boot_packet()
587 buf[2] = 0x10; in af9005_boot_packet()
588 buf[3] = 0x08; in af9005_boot_packet()
589 buf[4] = 0x00; /* sequence number, original driver doesn't increment it here */ in af9005_boot_packet()
590 buf[5] = 0x97; in af9005_boot_packet()
591 buf[6] = 0xaa; in af9005_boot_packet()
592 buf[7] = 0x55; in af9005_boot_packet()
593 buf[8] = 0xa5; in af9005_boot_packet()
594 buf[9] = 0x5a; in af9005_boot_packet()
595 checksum = 0; in af9005_boot_packet()
598 buf[10] = (u8) ((checksum >> 8) & 0xff); in af9005_boot_packet()
599 buf[11] = (u8) (checksum & 0xff); in af9005_boot_packet()
609 usb_sndbulkpipe(udev, 0x02), in af9005_boot_packet()
615 ret = act_len != FW_BULKOUT_SIZE + 2 ? -1 : 0; in af9005_boot_packet()
618 memset(buf, 0, 9); in af9005_boot_packet()
620 usb_rcvbulkpipe(udev, 0x01), buf, 9, &act_len, 2000); in af9005_boot_packet()
627 checksum = 0; in af9005_boot_packet()
630 if (buf[2] != 0x11) { in af9005_boot_packet()
634 if (buf[3] != 0x05) { in af9005_boot_packet()
638 if (buf[4] != 0x00) { in af9005_boot_packet()
642 if (buf[5] != 0x04) { in af9005_boot_packet()
655 if (buf[2] != 0x11) { in af9005_boot_packet()
659 if (buf[3] != 0x05) { in af9005_boot_packet()
663 if (buf[4] != 0x00) { in af9005_boot_packet()
667 if (buf[5] != 0x02) { in af9005_boot_packet()
680 if (buf[2] != 0x10) { in af9005_boot_packet()
684 if (buf[3] != 0x05) { in af9005_boot_packet()
688 if (buf[4] != 0x00) { in af9005_boot_packet()
692 if (buf[5] != 0x01) { in af9005_boot_packet()
696 if (buf[6] != 0x10) { in af9005_boot_packet()
710 return 0; in af9005_boot_packet()
728 if (reply != 0x01) { in af9005_download_firmware()
729 err("before downloading firmware, FW_CONFIG expected 0x01, received 0x%x", reply); in af9005_download_firmware()
734 buf[0] = (u8) (FW_BULKOUT_SIZE & 0xff); in af9005_download_firmware()
735 buf[1] = (u8) ((FW_BULKOUT_SIZE >> 8) & 0xff); in af9005_download_firmware()
736 for (i = 0; i < packets; i++) { in af9005_download_firmware()
742 usb_sndbulkpipe(udev, 0x02), in af9005_download_firmware()
753 if (reply != (u8) (packets & 0xff)) { in af9005_download_firmware()
754 err("after downloading firmware, FW_CONFIRM expected 0x%x, received 0x%x", packets & 0xff, reply); in af9005_download_firmware()
766 if (reply != 0x02) { in af9005_download_firmware()
767 err("after downloading firmware, FW_CONFIG expected 0x02, received 0x%x", reply); in af9005_download_firmware()
786 temp = 0; in af9005_led_control()
802 return 0; in af9005_led_control()
819 for (i = 0; i < 255; i += 8) { in af9005_frontend_attach()
824 adap->fe_adap[0].fe = af9005_fe_attach(adap->dev); in af9005_frontend_attach()
825 return 0; in af9005_frontend_attach()
837 return 0; in af9005_rc_query()
843 st->data[0] = 3; /* rest of packet length low */ in af9005_rc_query()
844 st->data[1] = 0; /* rest of packet length high */ in af9005_rc_query()
845 st->data[2] = 0x40; /* read remote */ in af9005_rc_query()
848 ret = dvb_usb_generic_rw(d, st->data, 5, st->data, 256, 0); in af9005_rc_query()
853 if (st->data[2] != 0x41) { in af9005_rc_query()
868 if (len > 0) { in af9005_rc_query()
890 return 0; in af9005_power_ctrl()
911 af9005_write_ofdm_register(adap->dev, XD_MP2IF_DMX_CTRL, 0); in af9005_pid_filter_control()
915 return 0; in af9005_pid_filter_control()
921 u8 cmd = index & 0x1f; in af9005_pid_filter()
937 (u8) (pid & 0xff)); in af9005_pid_filter()
946 cmd |= 0x20 | 0x40; in af9005_pid_filter()
948 if (adap->feedcount == 0) { in af9005_pid_filter()
959 return 0; in af9005_pid_filter()
979 if (reply == 0x01) in af9005_identify_state()
981 else if (reply == 0x02) in af9005_identify_state()
982 *cold = 0; in af9005_identify_state()
1044 .endpoint = 0x04,
1062 .rc_map_size = 0,
1117 return 0; in af9005_usb_module_init()