change module name to "ti_audio_s" for stereo
authora0220410 <peter-li@ti.com>
Wed, 10 Aug 2016 15:55:54 +0000 (23:55 +0800)
committera0220410 <peter-li@ti.com>
Wed, 10 Aug 2016 15:55:54 +0000 (23:55 +0800)
Android.mk
main.c
ti_audio.h

index 6597f47d903219169231aca4fa91abbc60a4127c..f1638c9de3e5fc94c1137cbb623da2ae783815c9 100755 (executable)
@@ -6,11 +6,11 @@ include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := main.c
 
-LOCAL_C_INCLUDES := external/ti_audio/
+LOCAL_C_INCLUDES := external/ti_audio_s/
 
 LOCAL_CFLAGS := -O2 -g -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 
-LOCAL_MODULE := ti_audio
+LOCAL_MODULE := ti_audio_s
 LOCAL_MODULE_TAGS := debug
 LOCAL_SYSTEM_SHARED_LIBRARIES := libc libm
 
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();
index 21d5dbda0ea4862e4d1d024c951f3ad93f647025..dc06c49da9b8ed96396a28a1ea0e71c6a3a8aae3 100755 (executable)
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define        TIAUDIO_VERSION         "Version : 3.1 (20th, May, 2016)"
+#define        TIAUDIO_VERSION         "Version : 3.2 (10th, August, 2016)"
 #define        TI_AUDIO_NAME           "/dev/tas2555s"
 
 #define MAX_INT_STR    "4294967295"