Skip to contentSkip to conversation

ASoC: tlv320dac33: FIFO mode updates

PATCH In review Peter Ujfalusi 3 participants 5 messages Jul 28, 2010 – Jul 29, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ASoC: tlv320dac33: FIFO mode updates

Hello,

Changes since v1:
- mode1_i2c_latecy renamed to mode1_latency

Intro mail from the first series:

The main feature of this series is the automatic FIFO configuration of the FIFO, when one of the FIFO mode is selected.
The first patch simplifies the handling of the Mode1 in manual mode, and also removes the hardwired latency definition from the code, so it can be adjusted based on the underlying platform.

The second patch adds option to select the automatic FIFO configuration. When this mode is selected the driver will configure the FIFO to match the stream's period size with the burst length (in terms of samples bursted out from the host).
In Mode1 this is trivial, since I can configure the nSample to match with the period size. However the Mode7 is a bit more complicated. The formula (UTHR_FROM_PERIOD_SIZE) calculates the UTHR configuration for the given number of samples.

The patches are generated against:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git:topic/asoc

---
Peter Ujfalusi (2):
ASoC: tlv320dac33: Revisit the FIFO Mode1 handling
ASoC: tlv320dac33: Add support for automatic FIFO configuration

 include/sound/tlv320dac33-plat.h |    2 +
 sound/soc/codecs/tlv320dac33.c   |  125 ++++++++++++++++++++++++--------------
 2 files changed, 82 insertions(+), 45 deletions(-)

--
1.7.2

#1 lore raw

PATCH v2 1/2 ASoC: tlv320dac33: Revisit the FIFO Mode1 handling

Replace the hardwired latency definition with platform data parameter, and simplify the nSample parameter calculation.

---
 include/sound/tlv320dac33-plat.h |    1 +
 sound/soc/codecs/tlv320dac33.c   |   71 ++++++++++++++++++--------------------
 2 files changed, 35 insertions(+), 37 deletions(-)
include/sound/tlv320dac33-plat.h +1 -0
index 3f428d5..1aa7bdb 100644
@@ -15,6 +15,7 @@
 
 struct tlv320dac33_platform_data {
 	int power_gpio;
+	int mode1_latency; /* latency caused by the i2c writes in us */
 	int keep_bclk;	/* Keep the BCLK running in FIFO modes */
 	u8 burst_bclkdiv;
 };
sound/soc/codecs/tlv320dac33.c +34 -37

115 lines not on this page · raw message

Signature · 1 line
1.7.2
#2 lore raw

PATCH v2 2/2 ASoC: tlv320dac33: Add support for automatic FIFO configuration

In reply to Peter Ujfalusi

Platform parameter to enable automatic FIFO configuration when the codec is in Mode1 or Mode7 FIFO mode.
When this mode is selected, the controls for changing nSample (in Mode1), and UTHR (in Mode7) are not added. The driver configures the FIFO configuration based on the stream's period size in a way, that every burst will read period size of data from the host.
In Mode7 we need to use a formula, which gives close enough aproximation for the burst length from the host point of view.

---
 include/sound/tlv320dac33-plat.h |    1 +
 sound/soc/codecs/tlv320dac33.c   |   90 +++++++++++++++++++++++++++-----------
 2 files changed, 65 insertions(+), 26 deletions(-)
include/sound/tlv320dac33-plat.h +1 -0
index 1aa7bdb..6c66496 100644
@@ -16,6 +16,7 @@
 struct tlv320dac33_platform_data {
 	int power_gpio;
 	int mode1_latency; /* latency caused by the i2c writes in us */
+	int auto_fifo_config; /* FIFO config based on the period size */
 	int keep_bclk;	/* Keep the BCLK running in FIFO modes */
 	u8 burst_bclkdiv;
 };
sound/soc/codecs/tlv320dac33.c +64 -26

135 lines not on this page · raw message

Signature · 1 line
1.7.2
#4 lore raw
Quoted 9 lines · Mark Brown
Quoted 4 lines · Peter Ujfalusi

Hello,

Changes since v1:
- mode1_i2c_latecy renamed to mode1_latency

Both

Both now applied.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk