From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: broonie@opensource.wolfsonmicro.com
Subject: [PATCH 2/2] ASoC: tlv320dac33: Burst mode BCLK divider configuration
Date: Wed, 20 Jan 2010 09:39:36 +0200 [thread overview]
Message-ID: <1263973176-15925-3-git-send-email-peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1263973176-15925-2-git-send-email-peter.ujfalusi@nokia.com>
Add possibility to configure the burst mode BCLK divider through platform
data structure.
The BCLK divider changes the actual speed of the serial bus in burst mode,
which is faster than the sampling frequency of the running stream.
In this way platforms can experiment with the optimal burst speed without
the need to modify the codec driver itself.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
include/sound/tlv320dac33-plat.h | 1 +
sound/soc/codecs/tlv320dac33.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h
index 5858d06..ac06652 100644
--- a/include/sound/tlv320dac33-plat.h
+++ b/include/sound/tlv320dac33-plat.h
@@ -15,6 +15,7 @@
struct tlv320dac33_platform_data {
int power_gpio;
+ u8 burst_bclkdiv;
};
#endif /* __TLV320DAC33_PLAT_H */
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index e1aa66f..1b35d0c 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -91,6 +91,7 @@ struct tlv320dac33_priv {
* this */
enum dac33_fifo_modes fifo_mode;/* FIFO mode selection */
unsigned int nsample; /* burst read amount from host */
+ u8 burst_bclkdiv; /* BCLK divider value in burst mode */
enum dac33_state state;
};
@@ -845,9 +846,18 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream)
dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_A, aictrl_a);
dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_B, aictrl_b);
- /* BCLK divide ratio */
+ /*
+ * BCLK divide ratio
+ * 0: 1.5
+ * 1: 1
+ * 2: 2
+ * ...
+ * 254: 254
+ * 255: 255
+ */
if (dac33->fifo_mode)
- dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 3);
+ dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C,
+ dac33->burst_bclkdiv);
else
dac33_write(codec, DAC33_SER_AUDIOIF_CTRL_C, 32);
@@ -1239,6 +1249,7 @@ static int __devinit dac33_i2c_probe(struct i2c_client *client,
i2c_set_clientdata(client, dac33);
dac33->power_gpio = pdata->power_gpio;
+ dac33->burst_bclkdiv = pdata->burst_bclkdiv;
dac33->irq = client->irq;
dac33->nsample = NSAMPLE_MAX;
/* Disable FIFO use by default */
--
1.6.6
next prev parent reply other threads:[~2010-01-20 7:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 7:39 [PATCH 0/2] ASoC: tlv320dac33: Burst mode BCLK divider fixes Peter Ujfalusi
2010-01-20 7:39 ` [PATCH 1/2] ASoC: tlv320dac33: BCLK divider fix Peter Ujfalusi
2010-01-20 7:39 ` Peter Ujfalusi [this message]
2010-01-20 11:35 ` [PATCH 0/2] ASoC: tlv320dac33: Burst mode BCLK divider fixes Liam Girdwood
2010-01-20 11:48 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263973176-15925-3-git-send-email-peter.ujfalusi@nokia.com \
--to=peter.ujfalusi@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox