[ARM] tegra: tegra_i2s_audio: add support for downsampling to 16kHz
authorIliyan Malchev <malchev@google.com>
Tue, 24 Aug 2010 20:40:26 +0000 (13:40 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:28:38 +0000 (16:28 -0700)
Signed-off-by: Iliyan Malchev <malchev@google.com>
arch/arm/mach-tegra/tegra_i2s_audio.c

index 65f1ec8a28fe3ab034f1854dfd98b207225351d0..395b33e4b8945bdd9dc35bf9dcef87271656bace 100644 (file)
@@ -84,10 +84,11 @@ struct i2s_pio_stats {
        u32 rx_fifo_read;
 };
 
-static const int divs_8000[] = { 5, 6, 6, 5 };
+static const int divs_8000[] = { 5, 6, 6, 5 }; /* 8018.(18) Hz */
 static const int divs_11025[] = { 4 };
 static const int divs_22050[] = { 2 };
 static const int divs_44100[] = { 1 };
+static const int divs_16000[] = { 2, 3, 3, 3, 3, 3, 3, 2 }; /* 16036.(36) Hz */
 
 /* per i2s controller */
 struct audio_driver_state {
@@ -1353,6 +1354,10 @@ static long tegra_audio_in_ioctl(struct file *file,
                        ads->in_divs = divs_11025;
                        ads->in_divs_len = ARRAY_SIZE(divs_11025);
                        break;
+               case 16000:
+                       ads->in_divs = divs_16000;
+                       ads->in_divs_len = ARRAY_SIZE(divs_16000);
+                       break;
                case 22050:
                        ads->in_divs = divs_22050;
                        ads->in_divs_len = ARRAY_SIZE(divs_22050);