Commit graph

24 commits

Author SHA1 Message Date
Lars-Peter Clausen
dd943d36f1 ASoC: tlv320aic31xx: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15 11:57:05 +00:00
Mark Brown
37850831ab Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tegra', 'asoc/topic/tfa9879', 'asoc/topic/tlv320aic23' and 'asoc/topic/tlv320aic31xx' into asoc-next 2014-12-08 13:12:16 +00:00
Lars-Peter Clausen
a43a262901 ASoC: tlv320aix31xx: Cleanup manual bias level transitions
Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.

Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-27 11:16:07 +00:00
Jyri Sarha
bbc686b346 ASoC: tlv320aic31xx: Fix off by one error in the loop stucture.
Fix off by one read beyond the end of a table.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2014-11-24 18:45:57 +00:00
Jyri Sarha
7ed36e96fd ASoC: tlv320aic31xx: Choose PLL p divider automatically
This simplifies aic31xx_divs table. There is no more need for p_val or
separate lines for 12 and 24 MHz mclks.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-03 15:25:44 +01:00
Mark Brown
94fe356f4c Merge branch 'fix/tlv320aic31xx' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-tlv320aic31xx 2014-09-03 15:25:17 +01:00
Jyri Sarha
03be88ee4a ASoC: tlv320aic31xx: Fix 24bit samples with I2S format and 12MHz mclk
I2S format requires bitclock to have an exact amount of cycles in a
frame for audio to work cleanly. With dsp formats that is not so
important.

Updates aic31xx_setup_pll() to look for a line in aic31xx_divs table
that produces the best match for the bitclock and adds lines to
aic31xx_divs for 12MHz mclk and 24bit samples.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-03 15:23:56 +01:00
Peter Ujfalusi
085f3ec6fd ASoC: tlv320aic31xx: Correct interface register 2 variable name
Rename iface_reg3 to iface_reg2 since this variable is actually used for
interface register 2.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-01 10:53:37 +01:00
Mark Brown
e99a866c4c Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', 'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next 2014-08-04 16:32:18 +01:00
Mark Brown
c5e64c7636 Merge remote-tracking branches 'asoc/topic/tlv', 'asoc/topic/tlv320aic23', 'asoc/topic/tlv320aic31xx' and 'asoc/topic/tlv320aic32x4' into asoc-next 2014-08-04 16:32:12 +01:00
Mark Brown
88be681b46 ASoC: tlv320aic31xx: Convert to params_width()
The CODEC doesn't care how data is laid out in memory.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-31 13:30:16 +01:00
Peter Ujfalusi
a72d2abbe5 ASoC: tlv320aic31xx: Do not ignore errors in aic31xx_device_init()
We need to return the error codes from aic31xx_device_init() and return
from the i2c_probe with the error code.
We will have kernel panic (NULL pointer dereference) in
regulator_register_notifier() in case the devm_regulator_bulk_get() fails
(with -EPROBE_DEFER for example).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-07-25 19:00:05 +01:00
Shahina Shaik
423ca88eb5 ASoC: tlv320aic31xx: Fixed Coding Style Issues
Fixed coding style issues of "Missing Blank line after declaration"

Signed-off-by: Shahina Shaik <sharab.shaik@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-22 12:03:26 +01:00
Lars-Peter Clausen
914bc160ef ASoC: tlv320aic31xx: Remove duplicate const
SOC_ENUM_SINGLE_DECL() already adds the const qualifier, so there is no need to
manually specify it.

Fixes the following warnings from sparse:
	sound/soc/codecs/tlv320aic31xx.c:253:1: warning: duplicate const
	sound/soc/codecs/tlv320aic31xx.c:255:1: warning: duplicate const
	sound/soc/codecs/tlv320aic31xx.c:257:1: warning: duplicate const
	sound/soc/codecs/tlv320aic31xx.c:260:1: warning: duplicate const
	sound/soc/codecs/tlv320aic31xx.c:262:1: warning: duplicate const

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21 20:57:18 +01:00
Mark Brown
6630f30ed5 Merge remote-tracking branches 'asoc/topic/headers', 'asoc/topic/intel', 'asoc/topic/jz4740', 'asoc/topic/max98090', 'asoc/topic/max98095', 'asoc/topic/mc13783' and 'asoc/topic/multicodec' into asoc-next 2014-05-22 00:23:54 +01:00
Joe Perches
2a1c23e339 ASoC: tlv320aic31xx: Convert /n to \n
Use a newline character appropriately.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-25 12:14:46 +01:00
Sachin Kamat
0faabc4f4c ASoC: tlv320aic23: Include of.h
of_match_ptr is defined in of.h. Include it explicitly.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14 20:35:13 +01:00
Lars-Peter Clausen
ab64246cf8 ASoC: codecs: Replace instances of rtd->codec with dai->codec
With CODEC to CODEC links rtd->codec does not necessarily point to the driver's
CODEC. CODEC drivers should always use dai->codec and never even look at the PCM
runtime.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18 12:47:49 +00:00
Axel Lin
dac7e40404 ASoC: tlv320aic31xx: Don't call kfree for memory allocated by devm_kzalloc
The kfree call is not necessary, but we need to call snd_soc_unregister_codec()
in remove().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-18 12:00:27 +00:00
Jyri Sarha
fd218aa3e5 ASoC: tlv320aic31xx: Turn power off only once.
Regulator code keep count of enables and disables. Double disable
causes an ugly warning.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-17 13:16:59 +00:00
Mark Brown
9296f4da3b ASoC: tlv320aic31xx: Staticise non-exported symbols
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13 17:44:22 +00:00
Jyri Sarha
bc236fa730 ASoC: tlv320aic31xx: Remove snd_soc_codec_set_cache_io() call
Remove snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP) call
and codec->control_data = aic31xx->regmap assignment since that
already done by core.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13 17:32:05 +00:00
Jyri Sarha
a2d57678ce ASoC: tlv320aic31xx: Fix unused variable warning from aic31xx_clk_off
Fix "warning: unused variable 'aic31xx'" from function 'aic31xx_clk_off'.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13 17:31:31 +00:00
Jyri Sarha
e00447fafb ASoC: tlv320aic31xx: Add basic codec driver implementation
This commit adds a bare bones driver support for TLV320AIC31XX family
audio codecs. The driver adds basic stereo playback trough headphone
and speaker outputs and mono capture trough microphone inputs.

The driver is currently missing support at least for mini DSP features
and jack detection. I have tested the driver only on TLV320AIC3111,
but based on the data sheets TLV320AIC3100, TLV320AIC3110, and
TLV320AIC3120 should work Ok too.

The base for the implementation was taken from:
git@gitorious.org:ti-codecs/ti-codecs.git ajitk/topics/k3.10.1-aic31xx
-branch at commit 77504eba0294764e9e63b4a0c696b44db187cd13.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13 12:09:51 +00:00