Changes for CS4237B/38B IEC-958 output setup...

This commit is contained in:
Jaroslav Kysela 1998-11-25 19:57:50 +00:00
parent 18fa888b68
commit 9f50cd5d60
3 changed files with 16 additions and 10 deletions

View file

@ -63,9 +63,9 @@ reset return L_RESET;
user return L_USER; user return L_USER;
valid return L_VALID; valid return L_VALID;
data return L_DATA; data return L_DATA;
protected return L_PROTECT; protect return L_PROTECT;
pre2 return L_PRE2; pre2 return L_PRE2;
fslock return L_FSLOCK; fsunlock return L_FSUNLOCK;
type return L_TYPE; type return L_TYPE;
gstatus return L_GSTATUS; gstatus return L_GSTATUS;
enable return L_ENABLE; enable return L_ENABLE;

View file

@ -103,7 +103,7 @@ static unsigned short Xswitchiec958ocs1[16];
%token L_SOUNDCARD L_MIXER L_CHANNEL L_STEREO L_MONO L_SWITCH L_RAWDATA %token L_SOUNDCARD L_MIXER L_CHANNEL L_STEREO L_MONO L_SWITCH L_RAWDATA
%token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_RECORD L_OUTPUT L_INPUT %token L_CONTROL L_PCM L_RAWMIDI L_PLAYBACK L_RECORD L_OUTPUT L_INPUT
%token L_IEC958OCS L_3D L_RESET L_USER L_VALID L_DATA L_PROTECT L_PRE2 %token L_IEC958OCS L_3D L_RESET L_USER L_VALID L_DATA L_PROTECT L_PRE2
%token L_FSLOCK L_TYPE L_GSTATUS L_ENABLE L_DISABLE L_MUTE L_SWOUT L_SWIN %token L_FSUNLOCK L_TYPE L_GSTATUS L_ENABLE L_DISABLE L_MUTE L_SWOUT L_SWIN
%type <b_value> boolean %type <b_value> boolean
%type <i_value> integer %type <i_value> integer
@ -262,9 +262,9 @@ iec958ocs1 : L_ENABLE { set_switch_iec958ocs( 0, 1, 0 ); }
| L_USER { set_switch_iec958ocs( 4, 0x0020, ~0x0020 ); } | L_USER { set_switch_iec958ocs( 4, 0x0020, ~0x0020 ); }
| L_VALID { set_switch_iec958ocs( 4, 0x0010, ~0x0010 ); } | L_VALID { set_switch_iec958ocs( 4, 0x0010, ~0x0010 ); }
| L_DATA { set_switch_iec958ocs( 5, 0x0002, ~0x0002 ); } | L_DATA { set_switch_iec958ocs( 5, 0x0002, ~0x0002 ); }
| L_PROTECT { set_switch_iec958ocs( 5, 0x0004, ~0x0004 ); } | L_PROTECT { set_switch_iec958ocs( 5, 0, ~0x0004 ); }
| L_PRE2 { set_switch_iec958ocs( 5, 0x0008, ~0x0018 ); } | L_PRE2 { set_switch_iec958ocs( 5, 0x0008, ~0x0018 ); }
| L_FSLOCK { set_switch_iec958ocs( 5, 0x0020, ~0x0020 ); } | L_FSUNLOCK { set_switch_iec958ocs( 5, 0x0020, ~0x0020 ); }
| L_TYPE '(' integer ')' { set_switch_iec958ocs( 5, ($3 & 0x7f) << 6, ~(0x7f<<6) ); } | L_TYPE '(' integer ')' { set_switch_iec958ocs( 5, ($3 & 0x7f) << 6, ~(0x7f<<6) ); }
| L_GSTATUS { set_switch_iec958ocs( 5, 0x2000, ~0x2000 ); } | L_GSTATUS { set_switch_iec958ocs( 5, 0x2000, ~0x2000 ); }
| error { yyerror( "unknown keyword in iec958ocs1() arguments" ); } | error { yyerror( "unknown keyword in iec958ocs1() arguments" ); }
@ -501,7 +501,7 @@ static void set_switch_iec958ocs_begin( int end )
/* ok.. this is a little bit wrong, but at these times are all switches same */ /* ok.. this is a little bit wrong, but at these times are all switches same */
snd_ctl_switch_t *sw = (snd_ctl_switch_t *)Xswitch; snd_ctl_switch_t *sw = (snd_ctl_switch_t *)Xswitch;
if ( !end ) { if ( end ) {
if ( Xswitchiec958ocs != sw -> value.enable ) { if ( Xswitchiec958ocs != sw -> value.enable ) {
sw -> value.enable = Xswitchiec958ocs; sw -> value.enable = Xswitchiec958ocs;
*Xswitchchange = 1; *Xswitchchange = 1;
@ -514,6 +514,12 @@ static void set_switch_iec958ocs_begin( int end )
sw -> value.data16[5] = Xswitchiec958ocs1[5]; sw -> value.data16[5] = Xswitchiec958ocs1[5];
*Xswitchchange = 1; *Xswitchchange = 1;
} }
#if 0
printf( "IEC958: enable = %i, ocs1[4] = 0x%x, ocs1[5] = 0x%x\n",
sw -> value.enable,
sw -> value.data16[4],
sw -> value.data16[5] );
#endif
return; return;
} }
if ( Xswitchtype != SWITCH_MIXER || sw -> type != SND_MIXER_SW_TYPE_BOOLEAN || if ( Xswitchtype != SWITCH_MIXER || sw -> type != SND_MIXER_SW_TYPE_BOOLEAN ||
@ -523,7 +529,7 @@ static void set_switch_iec958ocs_begin( int end )
yyerror( "Switch '%s' doesn't have Cirrus Logic signature!!!", sw -> name ); yyerror( "Switch '%s' doesn't have Cirrus Logic signature!!!", sw -> name );
Xswitchiec958ocs = 0; Xswitchiec958ocs = 0;
Xswitchiec958ocs1[4] = 0x0000; Xswitchiec958ocs1[4] = 0x0000;
Xswitchiec958ocs1[5] = 0x0000; Xswitchiec958ocs1[5] = 0x0004; /* copy permitted */
} }
static void set_switch_iec958ocs( int idx, unsigned short val, unsigned short mask ) static void set_switch_iec958ocs( int idx, unsigned short val, unsigned short mask )
@ -532,6 +538,6 @@ static void set_switch_iec958ocs( int idx, unsigned short val, unsigned short ma
Xswitchiec958ocs = val ? 1 : 0; Xswitchiec958ocs = val ? 1 : 0;
return; return;
} }
Xswitchiec958ocs1[ idx ] &= ~mask; Xswitchiec958ocs1[ idx ] &= mask;
Xswitchiec958ocs1[ idx ] |= val; Xswitchiec958ocs1[ idx ] |= val;
} }

View file

@ -576,12 +576,12 @@ static void soundcard_setup_write_switch( FILE *out, int interface, const unsign
if ( pdata -> data16[4] & 0x0020 ) fprintf( out, " user" ); if ( pdata -> data16[4] & 0x0020 ) fprintf( out, " user" );
if ( pdata -> data16[4] & 0x0010 ) fprintf( out, " valid" ); if ( pdata -> data16[4] & 0x0010 ) fprintf( out, " valid" );
if ( pdata -> data16[5] & 0x0002 ) fprintf( out, " data" ); if ( pdata -> data16[5] & 0x0002 ) fprintf( out, " data" );
if ( !(pdata -> data16[5] & 0x0004) ) fprintf( out, " protected" ); if ( !(pdata -> data16[5] & 0x0004) ) fprintf( out, " protect" );
switch ( pdata -> data16[5] & 0x0018 ) { switch ( pdata -> data16[5] & 0x0018 ) {
case 0x0008: fprintf( out, " pre2" ); break; case 0x0008: fprintf( out, " pre2" ); break;
default: break; default: break;
} }
if ( pdata -> data16[5] & 0x0020 ) fprintf( out, " fslock" ); if ( pdata -> data16[5] & 0x0020 ) fprintf( out, " fsunlock" );
fprintf( out, " type( 0x%x )", (pdata -> data16[5] >> 6) & 0x7f ); fprintf( out, " type( 0x%x )", (pdata -> data16[5] >> 6) & 0x7f );
if ( pdata -> data16[5] & 0x2000 ) fprintf( out, " gstatus" ); if ( pdata -> data16[5] & 0x2000 ) fprintf( out, " gstatus" );
fprintf( out, " )" ); fprintf( out, " )" );