linux/sound/soc/codecs
Peter Ujfalusi f57d2cfaad ASoC: tlv320dac33: FIFO caused delay reporting
Delay reporting for the three implemented DAC33 FIFO modes.
DAC33 has FIFO depth status register(s), but it can not be used, since
inside of pcm_pointer we can not send I2C commands.
Timestamp based estimation need to be used. The method of calculating
the delay depends on the active FIFO mode.

Bypass mode: FIFO is bypassed, report 0 as delay

Mode1: nSample fill mode. In this mode I need to use two timestamp
ts1: taken when the interrupt has been received
ts2: taken before writing to nSample register.

Interrupts are coming when DAC33 FIFO depth goes under alarm threshold.

Phase1: when we received the alarm threshold, but our workqueue has
        not been executed (safeguard phase). Just count the played out
        samples since ts1 and subtract it from the alarm threshold
        value.
Phase2: During nSample burst (after writing to nSample register), count
        the played out samples since ts1, count the samples received
        since ts2 (in a burst). Estimate the FIFO depth using these and
        alarm threshold value.
Phase3: Draining phase (after the burst read), count the played out
        samples since ts1. Estimate the FIFO depth using the nSample
        configuration and the alarm threshold value.

Mode7: Threshold based fill mode. In this mode one timestamp is enough.
ts1: taken when the interrupt has been received

Interrupts are coming when DAC33 FIFO depth reaches upper threshold.

Phase1: Draining phase (after the burst), counting the played out
        samples since ts1, and subtract it from the upper threshold
        value.
Phase2: During burst operation. Using the pre calculated time needed to
        play out samples from the buffer during the drain period (from
        upper to lower threshold), move the time window to cover the
        estimated time from the burst start to the current time.
        Calculate the samples played out since lower threshold and also
        the samples received during the same time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-26 15:16:39 +01:00
..
ac97.c ASoC: Fix passing platform_data to ac97 bus users and fix a leak 2010-03-29 21:00:37 +01:00
ac97.h ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai. 2008-07-10 09:32:39 +02:00
ad193x.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ad193x.h ASoC: Unexport AD193x bus probe/remove functions 2010-03-19 12:22:03 +00:00
ad1836.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ad1836.h ASoC: ad1836: reset and restore clock control mode in suspend/resume entry 2010-01-25 14:52:22 +00:00
ad1980.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
ad1980.h ALSA: ASoC codec: fix compiling error in ad1980 driver after ASoC API changed 2008-09-09 09:10:54 +02:00
ad73311.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
ad73311.h ASoC: Blackfin: fix typo in MUTE definition 2009-03-06 13:37:18 +00:00
ads117x.c ASoC: Update ads117x to current APIs 2009-11-04 21:43:27 +00:00
ads117x.h ASoC: ADS117x ADC driver 2009-11-04 21:27:53 +00:00
ak4104.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ak4104.h ASoC: Add a driver for AK4104 S/PDIF transmitter 2009-03-09 10:46:17 +00:00
ak4535.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ak4535.h ALSA: ASoC: Convert ak4535 to a new-style i2c driver 2008-09-04 10:34:21 +02:00
ak4642.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ak4642.h ASoC: Add ak4642/ak4643 codec support 2009-08-21 10:54:02 +01:00
ak4671.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ak4671.h ASoC: AK4671: add ak4671 codec driver 2009-09-10 00:27:57 +01:00
cq93vc.c ASoC: update gfp/slab.h includes 2010-03-29 21:28:43 +02:00
cq93vc.h ASoC: DaVinci: CQ93VC Voice Codec 2010-03-12 11:12:22 +00:00
cs4270.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
cs4270.h ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai. 2008-07-10 09:32:39 +02:00
cx20442.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
cx20442.h ASoC: CX20442: push down machine independent line discipline bits 2009-07-31 22:38:44 +01:00
da7210.c ASoC: da7210: Fencepost error in reg cache read 2010-04-21 01:41:26 +09:00
da7210.h ASoC: Add DA7210 codec device support for ALSA 2009-12-16 17:31:04 +00:00
Kconfig ASoC: rename ad1938 to ad193x and add support for ad1936/7/8/9 2010-03-19 12:12:16 +00:00
l3.c ASoC: UDA134x codec driver 2008-11-17 11:45:39 +00:00
Makefile ASoC: rename ad1938 to ad193x and add support for ad1936/7/8/9 2010-03-19 12:12:16 +00:00
max9877.c ASoC: MAX9877: fix write operation for register 2009-07-23 11:08:30 +01:00
max9877.h ASoC: MAX9877: add MAX9877 amp driver 2009-07-15 16:59:31 +01:00
pcm3008.c ASoC: Factor out snd_soc_init_card() 2009-11-03 22:14:43 +00:00
pcm3008.h ASoC: Add PCM3008 ALSA SoC driver 2008-11-19 13:16:38 +00:00
spdif_transciever.c ASoC: spdif: set module licence to GPL 2009-07-13 23:01:30 +01:00
spdif_transciever.h ASoC: Add dummy S/PDIF codec support 2009-05-28 14:48:38 +01:00
ssm2602.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
ssm2602.h sound: ASoC codec: SSM2602 audio codec driver 2008-09-09 09:11:15 +02:00
stac9766.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
stac9766.h ASoC: Codec for STAC9766 used on the Efika 2009-05-24 13:15:21 +01:00
tlv320aic3x.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
tlv320aic3x.h ASoC: tlv320aic3x: Change to use device model 2009-08-21 10:52:49 +01:00
tlv320aic23.c ASoC: AIC23: Fixing writes to non-existing registers in resume function 2010-01-29 13:42:37 +00:00
tlv320aic23.h ALSA: ASoC: Add TLV320AIC23 codec driver 2008-10-13 02:16:48 +02:00
tlv320aic26.c ASoC: missing conversions to snd_soc_codec_*_drvdata() 2010-04-20 08:29:19 +02:00
tlv320aic26.h ALSA: ASoC: Export DAI and codec for TLV320AIC26 2008-07-29 21:32:25 +02:00
tlv320dac33.c ASoC: tlv320dac33: FIFO caused delay reporting 2010-04-26 15:16:39 +01:00
tlv320dac33.h ASoC: tlv320dac33: typo fix in the header 2009-10-21 19:08:21 +01:00
tpa6130a2.c ASoC: Add missing __devexit and __devinit annotations 2010-01-12 14:13:00 +00:00
tpa6130a2.h ASoC: TPA6130A2: Make tpa6130a2_power as static 2009-10-12 13:40:54 +01:00
twl4030.c ASoC: missing conversions to snd_soc_codec_*_drvdata() 2010-04-20 08:29:19 +02:00
twl4030.h ASoC: TWL4030: Fix typo in comment in header file 2010-01-14 10:36:52 +00:00
twl6040.c ASoC: missing conversions to snd_soc_codec_*_drvdata() 2010-04-20 08:29:19 +02:00
twl6040.h ASoC: TWL6040: Add twl6040 codec driver 2010-03-19 11:29:33 +00:00
uda134x.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
uda134x.h ASoC: Move uda134x_codec.h to uda134x.h 2008-11-18 12:32:33 +00:00
uda1380.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
uda1380.h ASoC: UDA1380: refactor device registration 2009-06-15 21:54:48 +01:00
wm2000.c ASoC: wm2000: remove unused #include <linux/version.h> 2010-04-08 15:16:00 +01:00
wm2000.h ASoC: Add WM2000 driver 2010-02-12 10:31:06 +00:00
wm8350.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8350.h ASoC: Implement WM835x microphone jack detection support 2010-03-17 09:27:19 +00:00
wm8400.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8400.h ASoC: Add initial driver for the WM8400 CODEC 2009-03-11 13:49:46 +00:00
wm8510.c ASoC: fix params_rate() macro use in several codecs 2009-12-24 11:41:21 +00:00
wm8510.h ALSA: ASoC: Add WM8510 SPI support 2008-10-13 02:17:15 +02:00
wm8523.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8523.h ASoC: Add WM8523 CODEC driver 2009-07-01 18:47:45 +01:00
wm8580.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8580.h ASoC: Move WM8580 to normal I2C device probe 2009-03-12 15:43:24 +00:00
wm8711.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8711.h ASoC: Add WM8711 CODEC driver 2009-08-18 20:37:49 +01:00
wm8727.c ASoC: Register the CODEC in WM8727 2009-12-16 17:30:51 +00:00
wm8727.h ASoC: Add support for the WM8727 DAC. 2009-11-02 15:24:19 +00:00
wm8728.c ASoC: Remove redundant snd_soc_dapm_new_widgets() calls 2009-11-12 23:15:08 +00:00
wm8728.h ASoC: Add WM8728 codec driver 2008-11-14 14:44:53 +00:00
wm8731.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8731.h ASoC: Refactor WM8731 device registration 2009-02-18 11:55:22 +00:00
wm8750.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8750.h sound: ASoC: Add WM8750 SPI support 2008-09-23 08:18:19 +02:00
wm8753.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8753.h ASoC: Convert WM8753 to register via normal device probe 2009-02-24 23:49:53 +00:00
wm8776.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8776.h ASoC: Add WM8776 CODEC driver 2009-08-06 11:36:45 +01:00
wm8900.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8900.h ASoC: Convert WM8900 to do more work at I2C probe time 2008-12-10 19:47:40 +00:00
wm8903.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8903.h ASoC: Implement interrupt driven microphone detection for WM8903 2010-03-16 15:57:43 +00:00
wm8904.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8904.h ASoC: Support GPIO based microphone detection for WM8904 2010-03-16 16:03:30 +00:00
wm8940.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8940.h ASoC WM8940 Driver 2009-04-27 20:37:13 +01:00
wm8955.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8955.h ASoC: Add initial WM8955 CODEC driver 2009-12-18 13:06:47 +00:00
wm8960.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8960.h ASoC: Move WM8960 platform data into include/sound 2010-03-03 17:08:42 +00:00
wm8961.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8961.h ASoC: Add WM8961 driver 2009-06-12 17:16:06 +01:00
wm8971.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8971.h sound: ASoC: Add WM8971 CODEC driver 2008-09-23 08:18:05 +02:00
wm8974.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8974.h ASoC: clean up wm8974 and wm8978 clock divider handling 2010-01-29 14:32:52 +00:00
wm8978.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8978.h ASoC: clean up wm8974 and wm8978 clock divider handling 2010-01-29 14:32:52 +00:00
wm8988.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8988.h ASoC: Add WM8988 CODEC driver 2009-04-07 18:51:23 +01:00
wm8990.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8990.h ASoC: Enable WM8990 ADC clocking workaround 2008-11-17 17:24:54 +00:00
wm8993.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm8993.h ASoC: Add WM8993 CODEC driver 2009-07-08 17:20:20 +01:00
wm8994.c ASoC: Allow unspecified source when stopping WM8994 FLLs 2010-04-22 02:29:01 +09:00
wm8994.h ASoC: Support FLL input clock selection on WM8994 2010-04-21 01:41:26 +09:00
wm9081.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm9081.h ASoC: WM9081 mono DAC with integrated 2.6W class AB/D amplifier driver 2009-05-22 15:11:22 +01:00
wm9705.c ASoC: Revert missing reset_err in wm97*.c 2009-11-27 15:14:09 +01:00
wm9705.h ASoC: Driver for the WM9705 AC97 codec. 2009-01-16 16:40:25 +00:00
wm9712.c ASoC: Do not write to invalid registers on the wm9712. 2009-12-23 15:20:56 +00:00
wm9712.h ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai. 2008-07-10 09:32:39 +02:00
wm9713.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm9713.h ALSA: asoc: codecs - merge structs snd_soc_codec_dai and snd_soc_cpu_dai. 2008-07-10 09:32:39 +02:00
wm_hubs.c ASoC: Add indirection for CODEC private data 2010-04-17 10:46:22 +09:00
wm_hubs.h ASoC: Support second DC servo readback method for wm_hubs 2010-04-05 16:19:09 +01:00