Commit eeb309a8a6ff86ce462e072bc95ecbe85618505e

Authored by Peter Ujfalusi
Committed by Mark Brown
1 parent c3746a07f1

ASoC: tlv320dac33: Add option for keeping the BCLK running

Platform data option for the codec to keep the BCLK clock
continuously running in FIFO modes (codec master).

OMAP3 McBSP when in slave mode needs continuous BCLK running
on the serial bus in order to operate correctly.

Since in FIFO mode the DAC33 can also shut down the BCLK clock
and enable it only when it is needed, let the platforms decide
if the CPU side needs the BCLK running or not.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 2 changed files with 12 additions and 2 deletions Side-by-side Diff

include/sound/tlv320dac33-plat.h
... ... @@ -15,6 +15,7 @@
15 15  
16 16 struct tlv320dac33_platform_data {
17 17 int power_gpio;
  18 + int keep_bclk; /* Keep the BCLK running in FIFO modes */
18 19 u8 burst_bclkdiv;
19 20 };
20 21  
sound/soc/codecs/tlv320dac33.c
... ... @@ -93,6 +93,8 @@
93 93 unsigned int nsample; /* burst read amount from host */
94 94 u8 burst_bclkdiv; /* BCLK divider value in burst mode */
95 95  
  96 + int keep_bclk; /* Keep the BCLK continuously running
  97 + * in FIFO modes */
96 98 enum dac33_state state;
97 99 };
98 100  
... ... @@ -803,7 +805,10 @@
803 805 */
804 806 fifoctrl_a &= ~DAC33_FBYPAS;
805 807 fifoctrl_a &= ~DAC33_FAUTO;
806   - aictrl_b &= ~DAC33_BCLKON;
  808 + if (dac33->keep_bclk)
  809 + aictrl_b |= DAC33_BCLKON;
  810 + else
  811 + aictrl_b &= ~DAC33_BCLKON;
807 812 break;
808 813 case DAC33_FIFO_MODE7:
809 814 /*
... ... @@ -814,7 +819,10 @@
814 819 */
815 820 fifoctrl_a &= ~DAC33_FBYPAS;
816 821 fifoctrl_a |= DAC33_FAUTO;
817   - aictrl_b &= ~DAC33_BCLKON;
  822 + if (dac33->keep_bclk)
  823 + aictrl_b |= DAC33_BCLKON;
  824 + else
  825 + aictrl_b &= ~DAC33_BCLKON;
818 826 break;
819 827 default:
820 828 /*
... ... @@ -1234,6 +1242,7 @@
1234 1242  
1235 1243 dac33->power_gpio = pdata->power_gpio;
1236 1244 dac33->burst_bclkdiv = pdata->burst_bclkdiv;
  1245 + dac33->keep_bclk = pdata->keep_bclk;
1237 1246 dac33->irq = client->irq;
1238 1247 dac33->nsample = NSAMPLE_MAX;
1239 1248 /* Disable FIFO use by default */