diff options
Diffstat (limited to 'firmware/drivers/audio/tlv320.c')
-rw-r--r-- | firmware/drivers/audio/tlv320.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/drivers/audio/tlv320.c b/firmware/drivers/audio/tlv320.c index b2c5be8e61..c85627e683 100644 --- a/firmware/drivers/audio/tlv320.c +++ b/firmware/drivers/audio/tlv320.c | |||
@@ -152,21 +152,21 @@ void audiohw_postinit(void) | |||
152 | * 44100: 1 = MCLK MCLK SCLK, LRCK: Audio Clk / 4 (default) | 152 | * 44100: 1 = MCLK MCLK SCLK, LRCK: Audio Clk / 4 (default) |
153 | * 88200: 2 = MCLK*2 MCLK SCLK, LRCK: Audio Clk / 2 | 153 | * 88200: 2 = MCLK*2 MCLK SCLK, LRCK: Audio Clk / 2 |
154 | */ | 154 | */ |
155 | void audiohw_set_frequency(unsigned fsel) | 155 | void audiohw_set_frequency(int fsel) |
156 | { | 156 | { |
157 | /* All rates available for 11.2896MHz besides 8.021 */ | 157 | /* All rates available for 11.2896MHz besides 8.021 */ |
158 | unsigned char values_src[3] = | 158 | static const unsigned char values_src[HW_NUM_FREQ] = |
159 | { | 159 | { |
160 | /* Fs: */ | 160 | [HW_FREQ_11] = (0x8 << 2) | SRC_CLKIN, |
161 | (0x8 << 2) | SRC_CLKIN, /* 11025, 22050 */ | 161 | [HW_FREQ_22] = (0x8 << 2) | SRC_CLKIN, |
162 | (0x8 << 2), /* 44100 */ | 162 | [HW_FREQ_44] = (0x8 << 2), |
163 | (0xf << 2), /* 88200 */ | 163 | [HW_FREQ_88] = (0xf << 2), |
164 | }; | 164 | }; |
165 | 165 | ||
166 | unsigned value_dap, value_pc; | 166 | unsigned value_dap, value_pc; |
167 | 167 | ||
168 | if (fsel >= ARRAYLEN(values_src)) | 168 | if ((unsigned)fsel >= HW_NUM_FREQ) |
169 | fsel = 1; | 169 | fsel = HW_FREQ_DEFAULT; |
170 | 170 | ||
171 | /* Temporarily turn off the DAC and ADC before switching sample | 171 | /* Temporarily turn off the DAC and ADC before switching sample |
172 | rates or they don't choose their filters correctly */ | 172 | rates or they don't choose their filters correctly */ |