kernels/linux-2.4.0/drivers/sound/aci.c
/*
 * This write command send 2 parameters instead of one.
 * Only used in PCM20 radio frequency tuning control
 */
This write command send 2 parameters instead of one.
Only used in PCM20 radio frequency tuning control
This write command send 2 parameters instead of one . Only used in PCM20 radio frequency tuning control
int aci_write_cmd_d(unsigned char opcode, unsigned char parameter, unsigned char parameter2)
{
	unsigned long flags;
	int status;
#ifdef DEBUG
	printk("ACI: aci_write_cmd_d(0x%02x, 0x%02x)\n", opcode, parameter, parameter2);
#endif
	save_flags(flags);
	cli();
	if (read_general_status() < 0 || busy_wait()) {
		restore_flags(flags);
		return -1;
	}
	outb_p(opcode, COMMAND_REGISTER);
	if (busy_wait()) {
		restore_flags(flags);
		return -1;
	}
	outb_p(parameter, COMMAND_REGISTER);
	if (busy_wait()) {
		restore_flags(flags);
		return -1;
	}
	outb_p(parameter2, COMMAND_REGISTER);
	if ((status = read_general_status()) < 0) {
		restore_flags(flags);
		return -1;
	}
	if ((aci_version <  0xb0 && (status & 0x40) != 0) ||
	  (aci_version >= 0xb0 && (status & 0x40) == 0)) {
		restore_flags(flags);
#if 0	
		printk("ACI: invalid write (double) command 0x%02x, 0x%02x, 0x%02x.\n",
			opcode, parameter, parameter2);
#endif
		return -1;
  	}
	restore_flags(flags);
	return 0;
}
int aci_write_cmd_d ( unsigned char opcode , unsigned char parameter , unsigned char parameter2 ) { unsigned long flags ; int status ; #ifdef DEBUG printk ( " \n " , opcode , parameter , parameter2 ) ; #endif save_flags ( flags ) ; cli ( ) ; if ( read_general_status ( ) < 0 || busy_wait ( ) ) { restore_flags ( flags ) ; return -1 ; } outb_p ( opcode , COMMAND_REGISTER ) ; if ( busy_wait ( ) ) { restore_flags ( flags ) ; return -1 ; } outb_p ( parameter , COMMAND_REGISTER ) ; if ( busy_wait ( ) ) { restore_flags ( flags ) ; return -1 ; } outb_p ( parameter2 , COMMAND_REGISTER ) ; if ( ( status = read_general_status ( ) ) < 0 ) { restore_flags ( flags ) ; return -1 ; } if ( ( aci_version < 0xb0 && ( status & 0x40 ) != 0 ) || ( aci_version >= 0xb0 && ( status & 0x40 ) == 0 ) ) { restore_flags ( flags ) ; #if 0 printk ( " \n " , opcode , parameter , parameter2 ) ; #endif return -1 ; } restore_flags ( flags ) ; return 0 ; }
This write command send 2 parameters instead of one.
This write command send 2 parameters instead of one .
/* polarity of the INVALID flag depends on ACI version */ /* Frequency tuning works, but the INVALID flag is set ??? */