Commit graph

17764 commits

Author SHA1 Message Date
Mark Brown
84f6965e2b Merge remote-tracking branches 'asoc/topic/da7213', 'asoc/topic/da732x', 'asoc/topic/da9055', 'asoc/topic/davinci', 'asoc/topic/fsl', 'asoc/topic/fsl-esai', 'asoc/topic/fsl-sai' and 'asoc/topic/fsl-spdif' into asoc-next 2014-03-12 23:04:22 +00:00
Mark Brown
696cda5b5b Merge remote-tracking branches 'asoc/topic/arizona', 'asoc/topic/atmel', 'asoc/topic/cirrus', 'asoc/topic/cs4271', 'asoc/topic/cs42l51', 'asoc/topic/cs42l52', 'asoc/topic/cs42l73' and 'asoc/topic/da7210' into asoc-next 2014-03-12 23:04:15 +00:00
Mark Brown
950c66721d Merge remote-tracking branches 'asoc/topic/88pm860x', 'asoc/topic/ad1836', 'asoc/topic/ad193x', 'asoc/topic/adau1977', 'asoc/topic/ak4104', 'asoc/topic/ak4641', 'asoc/topic/ak4671' and 'asoc/topic/alc5623' into asoc-next 2014-03-12 23:04:09 +00:00
Mark Brown
52db65f0a8 Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-next 2014-03-12 23:04:08 +00:00
Mark Brown
3b93f0598c Merge remote-tracking branch 'asoc/topic/pcm1792a' into asoc-next 2014-03-12 23:04:07 +00:00
Mark Brown
08fa654549 Merge remote-tracking branch 'asoc/topic/pcm1681' into asoc-next 2014-03-12 23:04:07 +00:00
Mark Brown
b8f861586c Merge remote-tracking branch 'asoc/topic/enum' into asoc-next 2014-03-12 23:03:59 +00:00
Mark Brown
53a2c4db8c Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next 2014-03-12 23:03:58 +00:00
Mark Brown
da8ab21cfe Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2014-03-12 23:03:58 +00:00
Mark Brown
c6c124225f Merge remote-tracking branch 'asoc/fix/spear' into asoc-linus 2014-03-12 23:03:57 +00:00
Lars-Peter Clausen
5c1d5f091d ASoC: Fix use after free
Freeing the current list element while iterating over the list will cause a use
after free since the iterator function will still use the current element to
look up the next. Use list_for_each_safe() and remove the element from the list
before freeing it to avoid this.

Fixes: 1438c2f60b ("ASoC: Add a per component dai list")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-12 12:06:57 +00:00
Lars-Peter Clausen
bde24030b5 ASoC: spear: spdif_out: Fix mute control
For controls registers with snd_soc_add_dai_controls snd_kcontrol_chip() returns
a pointer to the DAI, not to the CODEC.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 17:43:15 +00:00
Mark Brown
f9fa2b1855 ASoC: dapm: Sprinkle lockdep asserts through the code
Try to spot locking issues by asserting that the DAPM mutex is held when
it should be. There's a bit of fun due to us not requiring the lock to be
held prior to the card being instantiated which mean we need to wrap the
assert in some paths and this isn't methodical by any stretch of the
imagination.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 16:32:44 +00:00
Mark Brown
492c0a18b7 ASoC: dapm: Staticise dapm_mark_dirty()
The function is not called outside soc-dapm.c so there is no need for it
to be exported.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 12:34:24 +00:00
Lars-Peter Clausen
1438c2f60b ASoC: Add a per component dai list
Now that every DAI has a component we can track the DAIs on a per component
basis. This simplifies the DAI lookup when we are only interested in DAIs of a
specific component and also makes it possible to have multiple components with
the same parent device and also register DAIs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 12:17:54 +00:00
Lars-Peter Clausen
6cc240f39d ASoC: Pass CODEC to snd_soc_register_dais()
snd_soc_register_dais() looks up the CODEC that is registering the DAIs by
looping over all registered CODECs. This patch updates the code to
simply pass the CODEC that registers the DAIs to snd_soc_register_dais() thus
avoiding the lookup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 12:17:54 +00:00
Lars-Peter Clausen
32c9ba544b ASoC: Consolidate snd_soc_register_dai() and snd_soc_register_dais()
snd_soc_register_dais() has basically the same code as snd_soc_register_dai(),
but running in a loop. The only difference is that snd_soc_register_dai() calls
fmt_single_name() to generate the DAIs name and snd_soc_register_dais() calls
fmt_multiple_name(). This patch pushes the check in __snd_soc_register_component()
which decides whether to call snd_soc_register_dai() or snd_soc_register_dais()
to snd_soc_register_dais() to decide which naming scheme to use. This allows us
to remove snd_soc_register_dai().

The patch also updates snd_soc_register_dais() to unregister every DAI it finds
for the component rather than trying to unregister one DAI for each DAI that was
registered. Both have the same result since there won't be more DAIs than what
have been registered, but the former is easier to implement.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 12:17:53 +00:00
Mark Brown
a707d030da Merge branch 'topic/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core 2014-03-10 12:17:48 +00:00
Mark Brown
7f35afd44b Merge remote-tracking branches 'asoc/fix/88pm860', 'asoc/fix/omap' and 'asoc/fix/si476x' into asoc-linus 2014-03-10 11:30:56 +00:00
Mark Brown
b25b1b6d72 Merge remote-tracking branch 'asoc/fix/pcm' into asoc-linus 2014-03-10 11:30:55 +00:00
Lars-Peter Clausen
8eeb5c1513 ASoC: 88pm860: Fix IO setup
The 88pm860 is a MFD device and the CODEC driver is using the regmap struct of
the parent device, hence automatic IO setup will not work and we need to
manually call snd_soc_codec_set_cache_io(). The issue was introduced in commit
f9ded3b2e7 ("ASoC: 88pm860x: Use regmap for I/O").

Fixes: f9ded3b2e7 ("ASoC: 88pm860x: Use regmap for I/O").
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-03-10 11:27:06 +00:00
Lars-Peter Clausen
58d4d3c976 ASoC: si476x: Fix IO setup
The si476x is a MFD device and the CODEC driver is using the regmap struct of
the parent device, hence automatic IO setup will not work and we need to
manually call snd_soc_codec_set_cache_io(). The issue was introduced commit
d6173df35f ("ASoC: si476x: Remove custom register I/O implementation")

Fixes: d6173df35f ("ASoC: si476x: Remove custom register I/O implementation")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-03-10 11:24:59 +00:00
Lars-Peter Clausen
b0ffe9b1ab ASoC: sam9g20_wm8731: Convert to table based DAPM setup
Use table based setup to register the DAPM widgets and routes. This on one hand
makes the code a bit shorter and cleaner and on the other hand the board level
DAPM elements get registered in the card's DAPM context rather than in the
CODEC's DAPM context.

While we are at it also remove the snd_soc_dapm_enable_pin() in the init
callback. Pins are enabled by default.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-10 10:31:43 +00:00
Peter Ujfalusi
64ebdec36a ASoC: davinci-mcasp: Rename the pointer to davinci dma_params as dma_params
It is quite confusing to name the pointer to davinci_pcm_dma_params as
dma_data. Rename the pointer to avoid confusion.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:33:53 +00:00
Charles Keepax
d0800342bb ASoC: arizona: Support new fratio encoding on the wm5110 rev D
The reference clock path on newer IP FLLs requires a different
configuration, and should avoid integer mode operation. This patch adds
support for both the new encoding and updates the calculation.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:07 +00:00
Charles Keepax
5a3935c764 ASoC: arizona: Calculate FLL gain last
No part of the FLL calculation depends on the value determined for the
gain but the gain does depend on other values. In preparation for future
updates this patch moves the gain to be the last thing calculated.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:07 +00:00
Charles Keepax
f641aec62c ASoC: arizona: Calculate OUTDIV first
OUTDIV will remain unchanged whilst the rest of the FLL configuration is
calculated so do this first.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Charles Keepax
8ccefcd265 ASoC: arizona: Don't pass Fout into arizona_calc_fll
As we now calculate the FLL configuration at a later stage in the
process the fout member of the FLL structure will contain the desired
Fout frequency so no need to pass this in seperately.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Charles Keepax
23f785a8bc ASoC: arizona: Move calculation of FLL configuration
Currently the FLL configuration is calculated before it is known which
FLL path the configuration will be applied to. Newer versions of the IP
have differences in the configuration required for each FLL path, which
makes it complicated to calculate the FLL configuration in advance.

This patch simply checks the validity of a requested input and output
frequency before we know which FLL path they will be applied to and
saves the actual calculation of the configuration until we know where
the settings will be applied.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Charles Keepax
61719db814 ASoC: arizona: Move set of OUTDIV in to arizona_apply_fll
Since we know in arizona_apply_fll if we are setting the sync or ref
path there is no need to set the outdiv seperately anymore. This patch
moves this from arizona_enable_fll to arizona_apply_fll.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Charles Keepax
87383ac5a7 ASoC: arizona: Add defines for FLL configuration constants
Improve readability by adding defines for some of the constants
associated with FLL configuration.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Charles Keepax
da28ed585b ASoC: arizona: An OUTDIV of 1 is not valid, avoid this
One is not a valid value for the OUTDIV start searching at 2 instead.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 08:28:06 +00:00
Mark Brown
e97db9abf9 ASoC: pcm512x: Fix duplicate const warning
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 07:38:23 +00:00
Mark Brown
22066226b5 ASoC: pcm512x: Split out bus drivers
Move to the new style of defining the bus interfaces in separate modules
in order to simplify dependencies.

Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-09 07:38:22 +00:00
Mark Brown
8db0d35bee Merge branch 'topic/tlv320aic23' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fsl
Conflicts:
	sound/soc/fsl/Kconfig
2014-03-07 11:05:07 +08:00
Max Filippov
cc1bc54aa7 ASoC: update Kconfig of AIC23 users to select I2C variant
Now that AIC23 supports two control interfaces all existing I2C users
should select I2C variant.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:55:33 +08:00
Max Filippov
b3fc572596 ASoC: tlv320aic23: add support for SPI control mode
tlv320aic23 chip control interface may work in either I2C or SPI mode
depending on the MODE pin state. Functionality and register layout are
independent of the control mode.

Implement bus-specific parts as separate modules.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:55:33 +08:00
Charles Keepax
fab800cc33 ASoC: wm_adsp: Correct type specifier in printf
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-07 10:38:14 +08:00
Nenghua Cao
a1a564ed6a ASoC: core: use regmap's parse_val to do endian translation
In snd_soc_bytes_put function, it forces cpu to do cpu_to_be translation,
but for mmio bus which uses REGMAP_ENDIAN_NATIVE, it doesn't need to do
endian translation. So it is better to use regmap's api which can decide
if this translation is needed according to bus configuration.

Signed-off-by: Nenghua Cao <nhcao@marvell.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:46:31 +08:00
Mark Brown
d083f580e5 regmap: Add parse_val() API
This is useful for generic code built on top of regmap dealing with
 blocks of data.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTGEMzAAoJELSic+t+oim9HHEP/Rcw848w6mBeN7qKVAjI01a2
 SsIyFAcriP00XO6HiiB8WbFrApD0nbKinDKRmNvRKqPEdh45haNIfSllDBuvYSml
 Zw9NJSfszGpfwa5NzFnJW61+piBvh/vpzdHbmscFrDNOOepgUTS4rEOnoSwX3FtD
 MlmIUKCEo4pzZiPwJYzznay/Dd5ckBBtmt5KYWaswk0okQoVX5TVBkv/61ZWl44W
 gYQxDHqPsdSRXDCAlLNfZJjgPjk5lN8vqeHcL1JsKr03DCiV5HV02wbnS9oGYqs4
 407ahH4Wn0xr4GipAB/DHUKqQVarEMh55h+7IgjAG2mC86KDSlYcq5/wE1yOrl9c
 6MtmzglFb2c0ClQK5T64c6Hls0FqojleBAu5eaeSNVrMLFiQIGJqnKhfUPTUJNLa
 4HQ4HXiGpuRfcCZJmzWrYJzhJO6RiwWQfybcx0CDQ7b77TdpOO01TkJLQwOfCk5w
 mSRNzLquVgCu66T0e9tf3de8S5aW402FaQTIegWLkWkAG+pv/NhwbFvf7Z/LwdAr
 ruBCxdQWfYGvRolaohPcyh2HaxGurHSttA6KIeSxcMhPKs4lCOHWNbo9ntqUorLs
 bpvlPFlrpvtrYv1CUZbVIvMZmjdEo9LVeXEtyYz7kILsGV2EJbYY5RoCBCYeo+7R
 rZLnetDc2yXLv/HAqAZ8
 =uRux
 -----END PGP SIGNATURE-----

Merge tag 'parse-val' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into asoc-core

regmap: Add parse_val() API

This is useful for generic code built on top of regmap dealing with
blocks of data.
2014-03-06 17:44:28 +08:00
Mark Brown
6af5263cea Merge branch 'topic/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum
Conflicts:
	include/sound/soc.h
2014-03-06 17:07:39 +08:00
Lars-Peter Clausen
3d59400fe4 ASoC: Move ignore_pmdown_time from CODEC to component
In preparation for componentization move the ignore_pmdown_time field from the
snd_soc_codec struct to the snd_soc_component struct. Set it to true for non
CODEC components for now.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:56 +08:00
Lars-Peter Clausen
cdde4ccb14 ASoC: Move active count from CODEC to component
There is no reason why active count tracking should only be done for CODECs but
not for other components. Moving the active count from the snd_soc_codec struct
to the snd_soc_component struct reduces the differences between CODECs and other
components and will eventually allow component to component DAI links (Which is
a prerequisite for converting CODECs to components).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Lars-Peter Clausen
6106d12947 ASoC: Add component pointer to the DAI struct
Keep track of which component registered a DAI. We'll need this as
componentization progresses.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Lars-Peter Clausen
5c898e74d1 ASoC: Add helper function to check whether a CODEC is active
Instead of directly checking the 'active' field of the CODEC struct add a new
helper function that will return either true or false depending on whether the
CODEC is active. This will make the migration to the component level easier.

The patch also updates all CODEC drivers that check the active attribute to use
the new helper function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Lars-Peter Clausen
a1a0cc0646 ASoC: Fix active count tracking for CODEC to CODEC links
For CODEC to CODEC links we need to make sure to also manage the 'active' field
of the cpu_dai CODEC.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Lars-Peter Clausen
24894b7646 ASoC: Add helper functions for PCM runtime 'active' management
We have the same code that increments and decrements the active field of the
various PCM runtime components (all with the same bugs). Factor this out into
common helper functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Lars-Peter Clausen
208a1589db ASoC: Handle ignore_pmdown_time for CODEC to CODEC links
For CODEC to CODEC links we should only immediately power down if both CODECs
are configured to ignore the power down delay. Factor the logic for this
into a helper function that can be used for both compressed and normal PCMs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 17:04:55 +08:00
Charles Keepax
c1a7898d65 ASoC: wm_adsp: Split firmware load into smaller chunks
The firmware files can be quite large and allocating the whole firmware
a single DMA safe buffer can be problematic if the system is under a
high memory load. Ease the requirements slightly by writing the firmware
out in page sized chunks.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 12:34:31 +08:00
Takashi Iwai
9c369c6e88 ASoC: cs4271: Fix build error without CONFIG_SPI_MASTER
cs4271_common_probe() is called from cs4271_i2c_probe() but defined in
CONFIG_SPI_MASTER block, thus it results in a build error when
CONFIG_SPI_MASTER=n:
  sound/soc/codecs/cs4271.c:721:2: error: implicit declaration of function ‘cs4271_common_probe’ [-Werror=implicit-function-declaration]

Move the function out of #if block.

Fixes: d6cf89ee07 ('ASoC: cs4271: claim reset GPIO in bus probe function')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Daniel Mack <daniel@zonque.org>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-06 12:31:39 +08:00