diff options
Diffstat (limited to 'firmware/target/coldfire/pcm-coldfire.c')
-rw-r--r-- | firmware/target/coldfire/pcm-coldfire.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c index 0782b116b4..209d227187 100644 --- a/firmware/target/coldfire/pcm-coldfire.c +++ b/firmware/target/coldfire/pcm-coldfire.c | |||
@@ -55,6 +55,24 @@ | |||
55 | 55 | ||
56 | #define FPARM_CLOCKSEL 0 | 56 | #define FPARM_CLOCKSEL 0 |
57 | #define FPARM_CLSEL 1 | 57 | #define FPARM_CLSEL 1 |
58 | |||
59 | /* SCLK = Fs * bit clocks per word | ||
60 | * so SCLK should be Fs * 64 | ||
61 | * | ||
62 | * CLOCKSEL sets SCLK freq based on Audio CLK | ||
63 | * 0x0c SCLK = Audio CLK/2 88200 * 64 = 5644800 Hz | ||
64 | * 0x06 SCLK = Audio CLK/4 44100 * 64 = 2822400 Hz | ||
65 | * 0x04 SCLK = Audio CLK/8 22050 * 64 = 1411200 Hz | ||
66 | * 0x02 SCLK = Audio CLK/16 11025 * 64 = 705600 Hz | ||
67 | * | ||
68 | * CLSEL sets MCLK1/2 DAC freq based on XTAL freq | ||
69 | * 0x01 MCLK1/2 = XTAL freq | ||
70 | * 0x02 MCLK1/2 = XTAL/2 freq | ||
71 | * | ||
72 | * Audio CLK can be XTAL freq or XTAL/2 freq (bit22 in PLLCR) | ||
73 | * we always set bit22 so Audio CLK is always XTAL freq | ||
74 | */ | ||
75 | |||
58 | #if CONFIG_CPU == MCF5249 && defined(HAVE_UDA1380) | 76 | #if CONFIG_CPU == MCF5249 && defined(HAVE_UDA1380) |
59 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = | 77 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = |
60 | { | 78 | { |
@@ -65,6 +83,16 @@ static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = | |||
65 | }; | 83 | }; |
66 | #endif | 84 | #endif |
67 | 85 | ||
86 | #if CONFIG_CPU == MCF5249 && defined(HAVE_WM8750) | ||
87 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = | ||
88 | { | ||
89 | [HW_FREQ_88] = { 0x0c, 0x01 }, | ||
90 | [HW_FREQ_44] = { 0x06, 0x01 }, | ||
91 | [HW_FREQ_22] = { 0x04, 0x01 }, | ||
92 | [HW_FREQ_11] = { 0x02, 0x01 }, | ||
93 | }; | ||
94 | #endif | ||
95 | |||
68 | #if (CONFIG_CPU == MCF5250 || CONFIG_CPU == MCF5249) && defined(HAVE_TLV320) | 96 | #if (CONFIG_CPU == MCF5250 || CONFIG_CPU == MCF5249) && defined(HAVE_TLV320) |
69 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = | 97 | static const unsigned char pcm_freq_parms[HW_NUM_FREQ][2] = |
70 | { | 98 | { |
@@ -324,6 +352,7 @@ const void * pcm_play_dma_get_peak_buffer(int *count) | |||
324 | return (void *)((addr + 2) & ~3); | 352 | return (void *)((addr + 2) & ~3); |
325 | } /* pcm_play_dma_get_peak_buffer */ | 353 | } /* pcm_play_dma_get_peak_buffer */ |
326 | 354 | ||
355 | #ifdef HAVE_RECORDING | ||
327 | /**************************************************************************** | 356 | /**************************************************************************** |
328 | ** Recording DMA transfer | 357 | ** Recording DMA transfer |
329 | **/ | 358 | **/ |
@@ -487,3 +516,4 @@ const void * pcm_rec_dma_get_peak_buffer(int *count) | |||
487 | *count = (end >> 2) - addr; | 516 | *count = (end >> 2) - addr; |
488 | return (void *)(addr << 2); | 517 | return (void *)(addr << 2); |
489 | } /* pcm_rec_dma_get_peak_buffer */ | 518 | } /* pcm_rec_dma_get_peak_buffer */ |
519 | #endif | ||