aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-03-11 09:26:22 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-12 06:12:25 -0500
commiteeb309a8a6ff86ce462e072bc95ecbe85618505e (patch)
treeefd7344fd7ee5035835351bf5b552335390afee6 /sound/soc/codecs
parentc3746a07f13f8711885fd3909c03477a1b47ab82 (diff)
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>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/tlv320dac33.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index e845c4b9066e..a6f19271aaea 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -93,6 +93,8 @@ struct tlv320dac33_priv {
93 unsigned int nsample; /* burst read amount from host */ 93 unsigned int nsample; /* burst read amount from host */
94 u8 burst_bclkdiv; /* BCLK divider value in burst mode */ 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 enum dac33_state state; 98 enum dac33_state state;
97}; 99};
98 100
@@ -803,7 +805,10 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
803 */ 805 */
804 fifoctrl_a &= ~DAC33_FBYPAS; 806 fifoctrl_a &= ~DAC33_FBYPAS;
805 fifoctrl_a &= ~DAC33_FAUTO; 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 break; 812 break;
808 case DAC33_FIFO_MODE7: 813 case DAC33_FIFO_MODE7:
809 /* 814 /*
@@ -814,7 +819,10 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
814 */ 819 */
815 fifoctrl_a &= ~DAC33_FBYPAS; 820 fifoctrl_a &= ~DAC33_FBYPAS;
816 fifoctrl_a |= DAC33_FAUTO; 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 break; 826 break;
819 default: 827 default:
820 /* 828 /*
@@ -1234,6 +1242,7 @@ static int __devinit dac33_i2c_probe(struct i2c_client *client,
1234 1242
1235 dac33->power_gpio = pdata->power_gpio; 1243 dac33->power_gpio = pdata->power_gpio;
1236 dac33->burst_bclkdiv = pdata->burst_bclkdiv; 1244 dac33->burst_bclkdiv = pdata->burst_bclkdiv;
1245 dac33->keep_bclk = pdata->keep_bclk;
1237 dac33->irq = client->irq; 1246 dac33->irq = client->irq;
1238 dac33->nsample = NSAMPLE_MAX; 1247 dac33->nsample = NSAMPLE_MAX;
1239 /* Disable FIFO use by default */ 1248 /* Disable FIFO use by default */