]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Changes for CS4237B/38B IEC-958 output setup...
authorJaroslav Kysela <perex@perex.cz>
Wed, 25 Nov 1998 19:57:50 +0000 (19:57 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 25 Nov 1998 19:57:50 +0000 (19:57 +0000)
alsactl/alsactl_lexer.l
alsactl/alsactl_parser.y
alsactl/setup.c

index f16c76724aa3079c1caf87585bae1c746fcdf942..8b39d3b86e1298958ab2b5cbd13573741f6375c3 100644 (file)
@@ -63,9 +63,9 @@ reset                 return L_RESET;
 user                   return L_USER;
 valid                  return L_VALID;
 data                   return L_DATA;
-protected              return L_PROTECT;
+protect                        return L_PROTECT;
 pre2                   return L_PRE2;
-fslock                 return L_FSLOCK;
+fsunlock               return L_FSUNLOCK;
 type                   return L_TYPE;
 gstatus                        return L_GSTATUS;
 enable                 return L_ENABLE;
index 7382e06ca39b1515648dfce03319303992fc03a0..8bb3cbe99c15c84b3c6b6d85fe8dd257c3ad714d 100644 (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_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
@@ -262,9 +262,9 @@ iec958ocs1 : L_ENABLE               { set_switch_iec958ocs( 0, 1, 0 ); }
        | 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" ); }
@@ -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 */
   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;
@@ -514,6 +514,12 @@ static void set_switch_iec958ocs_begin( int end )
       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 ||
@@ -523,7 +529,7 @@ static void set_switch_iec958ocs_begin( int end )
     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 )
@@ -532,6 +538,6 @@ static void set_switch_iec958ocs( int idx, unsigned short val, unsigned short ma
     Xswitchiec958ocs = val ? 1 : 0;
     return;
   }
-  Xswitchiec958ocs1[ idx ] &= ~mask;
+  Xswitchiec958ocs1[ idx ] &= mask;
   Xswitchiec958ocs1[ idx ] |= val;
 }
index 07d9c557babbac4abbd209c4144250f8b85a240f..3af19a5d267a5a45b7de477c4db2d5024d9ab942 100644 (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] & 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, " )" );