%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_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 <i_value> integer
| L_USER { set_switch_iec958ocs( 4, 0x0020, ~0x0020 ); }
| L_VALID { set_switch_iec958ocs( 4, 0x0010, ~0x0010 ); }
| 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_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_GSTATUS { set_switch_iec958ocs( 5, 0x2000, ~0x2000 ); }
| error { yyerror( "unknown keyword in iec958ocs1() arguments" ); }
/* 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;
- if ( !end ) {
+ if ( end ) {
if ( Xswitchiec958ocs != sw -> value.enable ) {
sw -> value.enable = Xswitchiec958ocs;
*Xswitchchange = 1;
sw -> value.data16[5] = Xswitchiec958ocs1[5];
*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;
}
if ( Xswitchtype != SWITCH_MIXER || sw -> type != SND_MIXER_SW_TYPE_BOOLEAN ||
yyerror( "Switch '%s' doesn't have Cirrus Logic signature!!!", sw -> name );
Xswitchiec958ocs = 0;
Xswitchiec958ocs1[4] = 0x0000;
- Xswitchiec958ocs1[5] = 0x0000;
+ Xswitchiec958ocs1[5] = 0x0004; /* copy permitted */
}
static void set_switch_iec958ocs( int idx, unsigned short val, unsigned short mask )
Xswitchiec958ocs = val ? 1 : 0;
return;
}
- Xswitchiec958ocs1[ idx ] &= ~mask;
+ Xswitchiec958ocs1[ idx ] &= mask;
Xswitchiec958ocs1[ idx ] |= val;
}
if ( pdata -> data16[4] & 0x0020 ) fprintf( out, " user" );
if ( pdata -> data16[4] & 0x0010 ) fprintf( out, " valid" );
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 ) {
case 0x0008: fprintf( out, " pre2" ); 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 );
if ( pdata -> data16[5] & 0x2000 ) fprintf( out, " gstatus" );
fprintf( out, " )" );