change module name to "ti_audio_s" for stereo
[tas2555sw-android/tas2555-util-stereo.git] / main.c
diff --git a/main.c b/main.c
index d9478d0fb4bd949cde88835672cc0aaaa357d15e..8e691e356a28899371afb4cb0485662276eb2d99 100755 (executable)
--- a/main.c
+++ b/main.c
 static void usage(){
 
        fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
-               "usage: ti_audio -r channel book page register [count]               (read, hexdecimal)",
-               "       ti_audio -w channel book page register value1 [value2 ...]  (write, hexdecimal)",
-               "       ti_audio -d on                                    (turn on the debug msg, bool)",
-               "       ti_audio -p [n]                                (get/[set] DSP program, decimal)",
-               "       ti_audio -c [n]                          (get/[set] DSP configuration, decimal)",
-               "       ti_audio -s [n]                                (get/[set] sample rate, decimal)",
-               "       ti_audio -b channel [n]                           (get/[set] bit rate, decimal)",
-               "       ti_audio -v channel [n]                             (get/[set] volume, decimal)",
-               "       ti_audio -f                                           (trigger firmware reload)",               
-               "       ti_audio -o on                                      (turn on/off TAS2555, bool)",
-               "       ti_audio -t                                            (get firmware timestamp)",
+               "usage: ti_audio_s -r channel book page register [count]               (read, hexdecimal)",
+               "       ti_audio_s -w channel book page register value1 [value2 ...]  (write, hexdecimal)",
+               "       ti_audio_s -d on                                    (turn on the debug msg, bool)",
+               "       ti_audio_s -p [n]                                (get/[set] DSP program, decimal)",
+               "       ti_audio_s -c [n]                          (get/[set] DSP configuration, decimal)",
+               "       ti_audio_s -s [n]                                (get/[set] sample rate, decimal)",
+               "       ti_audio_s -b channel [n]                           (get/[set] bit rate, decimal)",
+               "       ti_audio_s -v channel [n]                             (get/[set] volume, decimal)",
+               "       ti_audio_s -f                                           (trigger firmware reload)",             
+               "       ti_audio_s -o on                                      (turn on/off TAS2555, bool)",
+               "       ti_audio_s -t                                            (get firmware timestamp)",
                "                channel: 1 - left channel, 2 - right channel, 3 - both channels",
                TIAUDIO_VERSION);       
 }
@@ -150,7 +150,7 @@ static int TiAudio_Reg_Write(int fileHandle, int argc, char **argv){
        unsigned int whole_reg = 0;
        unsigned int temp_reg = 0;
        int i=0, reg_count = 0;
-       unsigned char *pChannel;
+       char *pChannel;
        
        if(argc < 7){
                fprintf(stderr, "invalid para numbers\n");
@@ -240,7 +240,7 @@ static int TiAudio_Reg_Read(int fileHandle, int argc, char **argv){
        unsigned char channel;
        unsigned int temp_reg = 0;
        int i=0, reg_count = 0;
-       unsigned char *pChannel;
+       char *pChannel;
        
        if((argc != 6) &&(argc != 7))  {
                fprintf(stderr, "invalid para numbers\n");
@@ -579,8 +579,8 @@ static int TiAudio_BitRate(int fileHandle, int argc, char **argv){
        unsigned char pBuff[5];
        unsigned char bSet = 0;
        unsigned char channel;
-       unsigned int nBitRate;
-       unsigned char *pChannel;
+       int nBitRate = -1;
+       char *pChannel;
        
        if(argc == 3){
                bSet = 0;
@@ -680,7 +680,7 @@ static int TiAudio_DACVolume(int fileHandle, int argc, char **argv){
        unsigned char bSet = 0;
        unsigned int nVol;
        unsigned char channel;
-       unsigned char *pChannel;
+       char *pChannel;
                
        if(argc == 3){
                bSet = 0;
@@ -801,7 +801,7 @@ err:
        return err;
 }
 
-static int TiAudio_Timestamp(int fileHandle, int argc, char **argv){
+static int TiAudio_Timestamp(int fileHandle){
        int err = -1;
        unsigned char pBuff[4];
        
@@ -836,7 +836,7 @@ err:
        return err;
 }
 
-static int TiAudio_TriggerFWReload(int fileHandle, int argc, char **argv){
+static int TiAudio_TriggerFWReload(int fileHandle){
        int err = -1;
        unsigned char pBuff[4]; 
        pBuff[0] = TIAUDIO_CMD_FW_RELOAD;
@@ -911,10 +911,10 @@ int main(int argc, char **argv)
                        ret = TiAudio_SpeakerOn(fileHandle, argc, argv);
                        break;                          
                case 't':
-                       ret = TiAudio_Timestamp(fileHandle, argc, argv);
+                       ret = TiAudio_Timestamp(fileHandle);
                        break;          
                case 'f':
-                       ret = TiAudio_TriggerFWReload(fileHandle, argc, argv);
+                       ret = TiAudio_TriggerFWReload(fileHandle);
                        break;
                default:
                        usage();