Commit graph

18892 commits

Author SHA1 Message Date
Mark Brown 497c11a946 Merge remote-tracking branch 'asoc/topic/pcm512x' into asoc-next 2014-05-22 00:23:45 +01:00
Mark Brown b79e16cb4a Merge remote-tracking branch 'asoc/topic/pcm' into asoc-next 2014-05-22 00:23:44 +01:00
Mark Brown e3ac3f2510 Merge remote-tracking branch 'asoc/topic/enum' into asoc-next 2014-05-22 00:23:44 +01:00
Mark Brown 566d4eeff8 Merge remote-tracking branch 'asoc/topic/dt' into asoc-next 2014-05-22 00:23:43 +01:00
Mark Brown 8e8fbd8f58 Merge remote-tracking branch 'asoc/topic/dapm-init' into asoc-next 2014-05-22 00:23:42 +01:00
Mark Brown 6bf88ab2ec Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next 2014-05-22 00:23:42 +01:00
Mark Brown 1450da3cf6 Merge remote-tracking branch 'asoc/topic/core' into asoc-next 2014-05-22 00:23:41 +01:00
Mark Brown 0f4019e6f4 Merge remote-tracking branch 'asoc/topic/component' into asoc-next 2014-05-22 00:23:41 +01:00
Mark Brown 228704bbdd Merge remote-tracking branch 'asoc/fix/max98090' into asoc-linus 2014-05-22 00:23:37 +01:00
Mark Brown 95b9cff321 ASoC: Intel fixes for v3.15
This is a relatively large batch of fixes for the newly added
 Haswell/Baytrail drivers from Intel.  It's a bit larger than is good for
 this point in the cycle but it's all for a newly added driver so not so
 worrying as it might otherwise be.  Some of it's integration problems,
 some of it's the sort of problem usually turned up in stress tests.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1YrAAoJELSic+t+oim9losP/0I50EKB6hrEugvFrNT+vBkR
 OQxhcj+WGgIguVQNqaHPBr3rQ1iGG54C5Yf1KDSi2jNIjkHSTIJ1bT2QB40rmclT
 14V6LZJL481TadcKcjLux1jgmaMvNO5Fa1gqYdLLVZFUYP/yTCLhqYrVIDO7NC6M
 VCKtZ965l4u6TMJACTdz9MzCbAwlhb7OTpgxIiyVQlE4SPq2D7M8W9IceLjiDzGg
 rviGK7MejMxc2b4i2vJGi4msaqK8aazDmMhoqrI+HZr/6pZgWkvKJ2S/zZf8AdEH
 6KfEQ8vPU/ag8M4UoH72JJtn1gsjphkEY8GyNWCvP7fIXnpcYB34c/cyaaMQ6lGN
 fGPfwQpbNobx3sJsPMRj21kFgy61rXM2PcbA4QEhPniHd6UlVPUgjkxBNE2YVM3d
 0+tWtgzWVT10F10fcKIkw00/gDohBK+4rViAu0VK5Ml90F0eYLeITWYFVyjmU52f
 7Q+0Duwm65LsA4hqFKcH5lRbk6IM29yRte/wGYY8mLWODADO0+cU6WmVRDHTlRFo
 35HidtfY8EGcU+rS24XyGd0+GRoO+nghzKTckoD3z9OCPilePkMb/dD5vC7NvmMO
 5Q15VbxmJgsus0aTDOPD634XoVTlQ/ESBA6bj5APylZorNKyANorJBphn4rBfZV+
 GXtzzjFrllDCOpKtjDzB
 =ROtF
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-intel' into asoc-linus

ASoC: Intel fixes for v3.15

This is a relatively large batch of fixes for the newly added
Haswell/Baytrail drivers from Intel.  It's a bit larger than is good for
this point in the cycle but it's all for a newly added driver so not so
worrying as it might otherwise be.  Some of it's integration problems,
some of it's the sort of problem usually turned up in stress tests.

# gpg: Signature made Wed 14 May 2014 12:40:27 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
2014-05-22 00:23:36 +01:00
Mark Brown dd97254f5c ASoC: Driver fixes for v3.15
A small set of driver fixes, nothing remarkable in itself or of any
 relevance outside of the driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1hlAAoJELSic+t+oim9H/sP/A6r/9/qBesBiBvK7q+jXKNo
 FW6M6zM2lZpLuAnUlSLNC6nb6e6nQYTvvCV4VIXfuj8r8NPMmxwdreg5Vp2fJdAk
 0Qlr3l025B4VmPxqik5wA04jE74G8BW8ttXHpWxxOXdceaUJ4uDzryJBuCpV3vJk
 +2gprKcnR4/wgqpzkGBAwNfurkfXOxpqB8DfPj+FcfRdWyxTqFtvZi+9dSwm2bLv
 T7z8alaMcG/ZpkH7nF+Q4Vu/0tJhgyHIVRTFsJvBKNYVr8cdGi+VDq++AE/62YOE
 v6EGpsrjn243AA8UDBnCznVVZcnwhSf33OpBg44DHb0/1J343x5r4bsGlQkb+19V
 FkBBnhiozWRwVjTBU/E6ss5eua+ESNqL6/EFLpCrD7ykduNOxC/qyKJxcWmmYq9K
 B7Z3tWjX/EzdQ/tMEt26MTnXWSmtk/Yq8dg2UDkdF5r4zBsGyNgHwpi1nbYDCNcm
 alBF7TKkhCV5woJcF+ygG7oFarnQnjSL+J+LTuKRo1gn6k4/NWaVmb/8K9pkN5wS
 hZhL12rjySVXcijrbwVJC9HfFYCtGDjJeTC0ifGQ9jTvEan/Hwi/vwk5XocTywbF
 PglDm9ygwyLAC3A602RWhd/WdgLdmfCYuyKJEcnlnVlkEFmpa5LyJ7wSi6qYYmAk
 j+xPZI2ROuKtebPAP6Es
 =0trh
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-drivers' into asoc-linus

ASoC: Driver fixes for v3.15

A small set of driver fixes, nothing remarkable in itself or of any
relevance outside of the driver.

# gpg: Signature made Wed 14 May 2014 12:49:57 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
2014-05-22 00:23:31 +01:00
Mark Brown 266bd275b9 ASoC: Core fixes for v3.15
A few things here:
 
  - Fix the creation of spurious CODEC<->CODEC links which caused DAPM to
    have audio paths which shouldn't be present causing spurious powerups
    and potential audible issues for users.
  - Ensure the suspend->off transition doesn't have spurious transitions
    to prepare added to the sequence.
  - Fix incorrect skipping of PCM suspension for active audio streams.
  - Remove Timur Tabi from the CS4270 maintainers, Cirrus are now doing
    this and Timur no longer has the boards that he was using.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1qXAAoJELSic+t+oim9rQsP/0plEA4KmnSUAD5l+LnFLZVI
 l4PrbTM9BrjdNpGk/dn0yeF9xAmKvlEa6hcclhPMSF5QIVWUxK5wiNZ4ZN1W64as
 VQsh9XHnD0AHSCD1v7ugz3vh4bvDk2cQkQUsJb9CS4Eh4Dgt1T2bjk74K3AnUBCV
 3yDkGW+15Yumo7WW8TKB1Qd7fIsuo95qua+caC1btnFz2VLWkdWixZ5D/t7tp4G2
 SriITNMqUF6gT0RWCue9sDKyfMkCN8tIOh5mvckHEYWLC5/pSgi7zKabDulUayS9
 GgG8mQIto49LL6NmzeyzBsDlf8Gk0O50BZOrEHvHQWw4dMiQ6ml8NTTxuz6oynzE
 k/b1aBUlnOf7wFHA1ILIgAHq3rMah9+/XVkxnHqPBxmP9IgIZoL//rc3DwCtqMbs
 CiIgHOPONdfiHtxMPJwCiBNqfQKDCerYVq4dmZTwU3m99Zn1keFKSZ2dcEWJK02S
 s3kQlYQ6sStpGjPrlrDbS7UcNtX+pqSI2c46GXHHRsLZbAAhHe2kwQ2y/Iry0ntc
 eh1ztL8FLZylEiXmYWjC2Sx5azKOhWVMJGdlKBbX3CNtxFTKzG0NXwHjXJXH72Y3
 Zm8SS9lK4uuJz4IKr7k2RHXETxFb1vdFlijYN5VvkGmYBoGo69G/dFDv6QAg0Ow/
 ANnqLBtrgKir3q49T2YQ
 =s9u3
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-core' into asoc-linus

ASoC: Core fixes for v3.15

A few things here:

 - Fix the creation of spurious CODEC<->CODEC links which caused DAPM to
   have audio paths which shouldn't be present causing spurious powerups
   and potential audible issues for users.
 - Ensure the suspend->off transition doesn't have spurious transitions
   to prepare added to the sequence.
 - Fix incorrect skipping of PCM suspension for active audio streams.
 - Remove Timur Tabi from the CS4270 maintainers, Cirrus are now doing
   this and Timur no longer has the boards that he was using.

# gpg: Signature made Wed 14 May 2014 12:59:19 BST using RSA key ID 7EA229BD
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
2014-05-22 00:23:30 +01:00
Tushar Behera 1d55417e12 ASoC: samsung: Add devm_clk_get to pcm.c
clk_get in probe function can be safely replaced with devm_clk_get.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22 00:20:11 +01:00
Tushar Behera 7253e354e7 ASoC: samsung: Use devm_snd_soc_register_component
Replaced snd_soc_register_component with its devres equivalent,
devm_snd_soc_register_component.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22 00:20:11 +01:00
Tushar Behera 55313bd3b0 ASoC: samsung: Use devm_snd_soc_register_platform
Replaced snd_soc_register_platform with devm_snd_soc_register_platform
in samsung_asoc_dma_platform_register(). This makes the function
samsung_asoc_dma_platform_unregister() redundant. This is removed and
all its users are updated.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22 00:20:11 +01:00
Tushar Behera c583883ecd ASoC: samsung: Use devm_snd_soc_register_card
Replace snd_soc_register_card with devm_snd_soc_register_card.
With this change, we can delete the empty remove functions.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-22 00:20:11 +01:00
Kailang Yang 13fd08a339 ALSA: hda/realtek - Add support headset mode for ALC233
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-21 11:13:17 +02:00
Toralf Förster 2d3a277822 ALSA: lola: fix format type mismatch in sound/pci/lola/lola_proc.c
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-21 11:12:15 +02:00
Toralf Förster e7fc496066 ALSA: hda - fix format type mismatch in sound/pci/hda/patch_sigmatel.c
Signed-off-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-21 11:11:50 +02:00
Takashi Iwai e9bd7d5ce8 ALSA: hda - Disable AA-mix on Sony Vaio S13
The analog-loopback causes the speaker noises even if it's set to zero
volume.  As a simple workaround, just get rid of the loopback mixer.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=873704
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-21 11:06:49 +02:00
Gabriele Mazzotta 5e6db6699b ALSA: hda - White noise fix for XPS13 9333
Disable the AA-loopback path to get rid of the constant white noise
that can be heard when headphones are used.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-21 11:00:06 +02:00
Lars-Peter Clausen fbfad49076 ASoC: neo1973_wm8753: Automatically disconnected non-connected pins
The DAPM routes for this board are complete, hence we can let the core take care
of disconnecting non-connected pins rather than doing it manually.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:29:22 +01:00
Sylwester Nawrocki c86d50f9dc ASoC: samsung: Allow setting OP_CLK of the IIS Multi Audio Interface
This patch adds support for setting source clock of the "Core CLK"
of the IIS Multi Audio Interface.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:20:57 +01:00
Arnd Bergmann b45281412a ASoC: pxa: remove mach header dependency
As we are moving the mmp platform towards multiplatform support,
we have to stop including platform header files.

This changes the pxa-ssp sound driver file to no longer depend
on mach/hardware.h and mach/dma.h. The code using the definitions
from those headers is actually gone already, the only thing
that was still being used was the pxa_dma_desc typedef, which
we can easily work around by using the normal 'struct pxa_dma_desc'
name.

The pxa2xx-dma driver still uses this header, so we include it
explicitly there, which is ok because that is only used on pxa,
not on mmp.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:14:49 +01:00
Andrew Lunn 7d6d478f38 ASoC: alc5623: Add device tree binding
Let the ALC5623 codec be instantiated from DT. Add a simple binding
for the additional control register and the jack detect register.

Also, add a prompt to the Kconfig entry for this CODEC, so that it can
be selected. Since kirkwood-t5325.c will no longer be used, we need to
be able to enable the CODEC in the mvebu_v5_defconfig etc.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:12:23 +01:00
Sascha Hauer ee9daad495 ASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params
fsl_ssi_set_dai_sysclk will be called from fsl_ssi_hw_params in the
next patch. Move up to avoid forward declaration and to keep the next patch
more readable. No functional change.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:05:03 +01:00
Markus Pargmann 504894799f ASoC: fsl-ssi: Transmit enable synchronization
When the fsl-ssi unit is used in i2s slave mode, it is possible that the
SSI unit starts transmitting data on the wrong channel. This happens
because the SSI does not synchronize with the left-right-clock by
default.

This patch enables transmit enable synchronization.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:04:11 +01:00
Markus Pargmann 171d683d2a ASoC: fsl-ssi: Remove unnecessary variables from ssi_private
There are some variables defined in struct fsl_ssi_private that describe
states that are also described by other variables.

This patch adds some helper functions that return exactly the same
information based on available variables. This helps to clean up struct
fsl_ssi_private and remove them from the probe function.

It also removes some not really used variables (new_binding, name).

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:46 +01:00
Markus Pargmann 4d9b7926f2 ASoC: fsl-ssi: Cleanup probe function
Reorder the probe function to be able to move the second imx-specific
block to the seperate imx probe function. The patch also removes some
comments/variables/code that are not used anymore or could be simply
replaced by other variables.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:42 +01:00
Markus Pargmann ed0f1604e9 ASoC: fsl-ssi: Remove useless DMA code
Simplify dma DT property handling. fsl,ssi-dma-events is not used
anymore. It passes invalid data to imx_pcm_dma_params_init_data() which
copies some data into an imx dma struct. This struct is never used in
imx-dma or imx-sdma because of generic OF DMA handling. The
"fsl,ssi-dma-events" is not used anywhere in dts files.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:38 +01:00
Markus Pargmann 49da09e265 ASoC: fsl-ssi: Move imx-specific probe to seperate function
Move imx specific probe code to a seperate function. It reduces the
size of the probe() function and makes the code and error handling
easier to understand.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:34 +01:00
Markus Pargmann 2a1d102de4 ASoC: fsl-ssi: Use dev_name for DAI driver struct
Instead of creating a name using string manipulation functions, we can
simply use the device name for the DAI driver struct.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:31 +01:00
Markus Pargmann f138e62124 ASoC: fsl-ssi: Move debugging to seperate file
Move all code that is only used for debugging to a seperate file. This
makes it easier to see what functions are used for debugging only.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:26 +01:00
Markus Pargmann 65c961cc59 ASoC: fsl-ssi: Fix register values when disabling
The bits we have to clear when disabling are different when the other
stream is still active.

This patch fixes the calculation of new register values after disabling
one stream. It also adds a more detailed description of the new register
value calculation.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Tested-By: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 23:02:22 +01:00
Lars-Peter Clausen 55bc825369 ASoC: mop500_ab8500: Replace instances of rtd->codec->card with rtd->card
No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 22:55:39 +01:00
Lars-Peter Clausen 0596f70069 ASoC: omap: Replace instances of rtd->codec->card with rtd->card
No need to go via the CODEC to get a pointer to the card. This will help to
eventually remove the card field from the snd_soc_codec struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 22:54:54 +01:00
Lars-Peter Clausen cf7b71f46b ASoC: ad1980: Replace goto loop with do-while loop
Using a proper do-while loop here instead of a open-coded goto loop is both
cleaner and shorter.

Also fixes the following warnings from smatch:
	sound/soc/codecs/ad1980.c:213 ad1980_reset() info: loop could be replaced with if statement.
	sound/soc/codecs/ad1980.c:212 ad1980_reset() info: ignoring unreachable code.
	sound/soc/codecs/ad1980.c:215 ad1980_reset() info: ignoring unreachable code.

While we are at it also change retry_cnt to unsigned int, using u16 for a
on-stack loop counter doesn't make that much sense.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-20 22:53:36 +01:00
Dylan Reid f73387cb6b ALSA: hda/tegra - Fix MODULE_DEVICE_TABLE typo.
I missed a rename during the review process.  Fix the
MODULE_DEVICE_TABLE to match the structure.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-20 20:56:49 +02:00
Dylan Reid 3c320f3f56 ALSA: hda - Add driver for Tegra SoC HDA
This adds a driver for the HDA block in Tegra SoCs.  The HDA bus is
used to communicate with the HDMI codec on Tegra124.

Most of the code is re-used from the Intel/PCI HDA driver.  It brings
over only two of the module params, power_save and probe_mask.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-20 09:38:38 +02:00
Sumit Bhattacharya 9674678633 ALSA: hda/hdmi - Add Nvidia Tegra124 HDMI support
Add the Tegra12x HDA codec id to patch_hdmi.

Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-20 09:38:27 +02:00
Kevin Strasser 2fa190ce33 ASoC: Intel: Fix pcm stream context restore crash
In some cases the pcm stream is closed while context has been
scheduled to be restored, causing a null pointer deref panic.
Cancel work to ensure stream does not get freed while work is
still active/pending.

Also, restoring the pcm context can be safely skipped after the
stream has been stopped. Check if pcm stream is still running
before restoring stream context to help pending work finish
more quickly in stream close path.

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:30:56 +01:00
Axel Lin 8c32570441 ASoC: rt5645: Fix updating wrong register for T5645_AIF2 case
This looks like a copy-paste bug, fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:23:14 +01:00
Jarkko Nikula d77a14b579 ASoC: Remove needless snd_soc_dapm_enable_pin() from machine driver inits
ALSA SoC core marks widgets as connected by default when they are
initialized in snd_soc_dapm_new_control() so there is no need to call
snd_soc_dapm_enable_pin() from machine driver init functions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:19:18 +01:00
Jarkko Nikula 831ffa45e7 ASoC: Remove needless snd_soc_dapm_sync() from machine driver inits
ALSA SoC core takes care of calling snd_soc_dapm_sync() at the end
snd_soc_instantiate_card() so there is no need to call it from machine
driver init functions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:19:18 +01:00
Lars-Peter Clausen c1406846e4 ASoC: rt5651: Do not use rtd->codec
rtd->codec does not necessarily point to the CODEC instance for which the
callback was called (e.g. for CODEC<->CODEC or multi-CODEC links). Use
dai->codec instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:16:04 +01:00
Lars-Peter Clausen 5958de23ed ASoC: cs42xx8: Do not use rtd->codec
rtd->codec does not necessarily point to the CODEC instance for which the
callback was called (e.g. for CODEC<->CODEC or multi-CODEC links). Use
dai->codec instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-19 17:14:02 +01:00
Andy Shevchenko 052c233e98 ALSA: fm801: convert struct description to kernel-doc
Just move field descriptions to the struct description in the kernel-doc
format. There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-19 14:33:36 +02:00
Tushar Behera 02fb05a598 ALSA: pcm_dmaengine: Add check during device suspend
Currently snd_dmaengine_pcm_trigger() calls dmaengine_pause()
unconditinally during device suspend. In case where DMA controller
doesn't support PAUSE/RESUME functionality, this call is not able
to stop the DMA controller. In this scenario, audio playback doesn't
resume after device resume.

Calling dmaengine_pause/dmaengine_terminate_all conditionally fixes
the issue.

It has been tested with audio playback on Samsung platform having
PL330 DMA controller which doesn't support PAUSE/RESUME.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-19 11:31:24 +02:00
Julia Lawall 47c9807425 sound: mpu401.c: make return of 0 explicit
Delete unnecessary local variable whose value is always 0 and that hides
the fact that the result is always 0.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression ret;
expression e;
position p;
@@

-ret = 0;
... when != ret = e
return
- ret
+ 0
  ;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-19 10:08:43 +02:00
Jarkko Nikula a735d992c2 ASoC: max98090: Move microphone bias voltage setting to probe function
Microphone bias level configuration register can configure voltage between
2.2 V and 2.8 V but doesn't manage is voltage on or off. Microphone bias
on/off state is controlled by "MICBIAS" DAPM widget.

Therefore there is no need to update bias voltage conditionally depending on
jack state each time when codec goes to SND_SOC_BIAS_ON state and setting
can be moved to max98090_probe() as driver currently doesn't support other
levels than 2.8 V.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:59:26 +01:00
Liam Girdwood 541423dde4 ASoC: max98090: Make sure we configure BCLK in one place
BCL is being configured in two places producing a warning message.
Make sure we only configure BCLK once and when we are master.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:59:25 +01:00
Jarkko Nikula 70f29d3889 ASoC: max98090: Add ACPI probing support
Add ACPI ID for MAX98090 and ACPI 5 I2C device probing support.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:59:25 +01:00
Liam Girdwood f1c0bc9145 ASoC: max98090: Mark cache as dirty prior to restoring
Make sure the cache is fully flushed at resume time.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:57:15 +01:00
Liam Girdwood 46b0e97dcf ASoC: max98090: Reset codec on resume
Make sure we reset codec and clear any IRQs on resume. This matches
the init sequence in probe.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:57:15 +01:00
Liam Girdwood 25b4ab430f ASoC: max98090: Fix reset at resume time
Reset needs to wait 20ms before other codec IO is performed. This wait
was not being performed. Fix this by making sure the reset register is not
restored with the cache, but use the manual reset method in resume with
the wait.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-05-16 19:56:23 +01:00
Liam Girdwood 729af1ce6c ASoC: max98090: Fix digital sidetone gain TLV
TLV for digital sidetone volume is wrong, this fix matches it to the
datasheet.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:56:20 +01:00
Vinod Koul d7b54c3083 ASoC: Intel: remove codec memeber from codec structs
As we already have a memeber struct snd_sst_params.codec to fill this.
so removing duplicate instance

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:46:06 +01:00
Vinod Koul bd17aa45cd ASoC: Intel: add drain_notify support
This patch adds the support to implement drain_notify in Intels mfld driver

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:46:06 +01:00
Vinod Koul 5106f5a17e ASoC: Intel: Revert "rename pcm dias to media dai"
This reverts commit 0cac6fc3eb.
This comiit was dropped from rev2 and would not be required as it renames the
platform ops as well which is not required.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-16 19:44:49 +01:00
Jarkko Nikula 8c44b2b1ae ASoC: Intel: Fix simultaneous Baytrail SST capture and playback
I managed to drop a change to stream ID setting from commit 49fee17816
("ASoC: Intel: Only export one Baytrail DAI") leading to non-working
simultaneous capture-playback since after one DAI conversion
rtd->cpu_dai->id + 1 will be the same for both playback and capture.

Use substream->stream + 1 like it was in original Liam's patch.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-15 16:53:07 +01:00
Laurent Pinchart e6b0d896ab ASoC: rsnd: Fix warnings due to improper printk formats
Use the %pap printk specifier to print resource_size_t variables. This
fixes warnings on platforms where resource_size_t has a different size
than int.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-15 11:13:17 +01:00
Liam Girdwood 49fee17816 ASoC: Intel: Only export one Baytrail DAI
We don't need more than one DAI for Baytrail SST. Usage becomes also more
straightforward by grouping playback and capture streams under the same PCM
device.

[Jarkko: I made Liam's sst-baytrail-pcm.c change a few lines smaller and
squashed together with my byt-rt5640.c change]

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 16:57:27 +01:00
Liam Girdwood 3a46c7b7cc ASoC: Intel: Make Baytrail PCM data per stream rather than per DAI device
Prepare for single Baytrail DAI playback/capture link by accessing PCM data
using stream ID instead of rtd->dev. Now rtd->dev is unique for playback
and capture since they are exported as separate DAIs but not once converted
to single DAI.

[Jarkko: Separated from another commit with updated commit log]

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 16:57:26 +01:00
Dan Carpenter 15b8e94f74 ASoC: compress: indent an if statement
The return statement was not indented correctly.  I lined up the
condition a bit as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 16:15:03 +01:00
Dan Carpenter d576422eda ALSA: hda - if statement not indented
The "break;" should be indented.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-14 16:47:27 +02:00
Dan Carpenter 665ebe926e ALSA: sb_mixer: missing return statement
The if condition here was supposed to return on error but the return
statement is missing.  The effect is that the ->mixername is set to
"???" instead of "DT019X".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-14 16:46:48 +02:00
Takashi Iwai ff2354bc6e ASoC: Intel fixes for v3.15
This is a relatively large batch of fixes for the newly added
 Haswell/Baytrail drivers from Intel.  It's a bit larger than is good for
 this point in the cycle but it's all for a newly added driver so not so
 worrying as it might otherwise be.  Some of it's integration problems,
 some of it's the sort of problem usually turned up in stress tests.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1YrAAoJELSic+t+oim9losP/0I50EKB6hrEugvFrNT+vBkR
 OQxhcj+WGgIguVQNqaHPBr3rQ1iGG54C5Yf1KDSi2jNIjkHSTIJ1bT2QB40rmclT
 14V6LZJL481TadcKcjLux1jgmaMvNO5Fa1gqYdLLVZFUYP/yTCLhqYrVIDO7NC6M
 VCKtZ965l4u6TMJACTdz9MzCbAwlhb7OTpgxIiyVQlE4SPq2D7M8W9IceLjiDzGg
 rviGK7MejMxc2b4i2vJGi4msaqK8aazDmMhoqrI+HZr/6pZgWkvKJ2S/zZf8AdEH
 6KfEQ8vPU/ag8M4UoH72JJtn1gsjphkEY8GyNWCvP7fIXnpcYB34c/cyaaMQ6lGN
 fGPfwQpbNobx3sJsPMRj21kFgy61rXM2PcbA4QEhPniHd6UlVPUgjkxBNE2YVM3d
 0+tWtgzWVT10F10fcKIkw00/gDohBK+4rViAu0VK5Ml90F0eYLeITWYFVyjmU52f
 7Q+0Duwm65LsA4hqFKcH5lRbk6IM29yRte/wGYY8mLWODADO0+cU6WmVRDHTlRFo
 35HidtfY8EGcU+rS24XyGd0+GRoO+nghzKTckoD3z9OCPilePkMb/dD5vC7NvmMO
 5Q15VbxmJgsus0aTDOPD634XoVTlQ/ESBA6bj5APylZorNKyANorJBphn4rBfZV+
 GXtzzjFrllDCOpKtjDzB
 =ROtF
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Intel fixes for v3.15

This is a relatively large batch of fixes for the newly added
Haswell/Baytrail drivers from Intel.  It's a bit larger than is good for
this point in the cycle but it's all for a newly added driver so not so
worrying as it might otherwise be.  Some of it's integration problems,
some of it's the sort of problem usually turned up in stress tests.
2014-05-14 14:27:12 +02:00
Takashi Iwai 7ca33c7a1d ASoC: Driver fixes for v3.15
A small set of driver fixes, nothing remarkable in itself or of any
 relevance outside of the driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1hlAAoJELSic+t+oim9H/sP/A6r/9/qBesBiBvK7q+jXKNo
 FW6M6zM2lZpLuAnUlSLNC6nb6e6nQYTvvCV4VIXfuj8r8NPMmxwdreg5Vp2fJdAk
 0Qlr3l025B4VmPxqik5wA04jE74G8BW8ttXHpWxxOXdceaUJ4uDzryJBuCpV3vJk
 +2gprKcnR4/wgqpzkGBAwNfurkfXOxpqB8DfPj+FcfRdWyxTqFtvZi+9dSwm2bLv
 T7z8alaMcG/ZpkH7nF+Q4Vu/0tJhgyHIVRTFsJvBKNYVr8cdGi+VDq++AE/62YOE
 v6EGpsrjn243AA8UDBnCznVVZcnwhSf33OpBg44DHb0/1J343x5r4bsGlQkb+19V
 FkBBnhiozWRwVjTBU/E6ss5eua+ESNqL6/EFLpCrD7ykduNOxC/qyKJxcWmmYq9K
 B7Z3tWjX/EzdQ/tMEt26MTnXWSmtk/Yq8dg2UDkdF5r4zBsGyNgHwpi1nbYDCNcm
 alBF7TKkhCV5woJcF+ygG7oFarnQnjSL+J+LTuKRo1gn6k4/NWaVmb/8K9pkN5wS
 hZhL12rjySVXcijrbwVJC9HfFYCtGDjJeTC0ifGQ9jTvEan/Hwi/vwk5XocTywbF
 PglDm9ygwyLAC3A602RWhd/WdgLdmfCYuyKJEcnlnVlkEFmpa5LyJ7wSi6qYYmAk
 j+xPZI2ROuKtebPAP6Es
 =0trh
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Driver fixes for v3.15

A small set of driver fixes, nothing remarkable in itself or of any
relevance outside of the driver.
2014-05-14 14:24:09 +02:00
Takashi Iwai 927cdab3b6 ASoC: Core fixes for v3.15
A few things here:
 
  - Fix the creation of spurious CODEC<->CODEC links which caused DAPM to
    have audio paths which shouldn't be present causing spurious powerups
    and potential audible issues for users.
  - Ensure the suspend->off transition doesn't have spurious transitions
    to prepare added to the sequence.
  - Fix incorrect skipping of PCM suspension for active audio streams.
  - Remove Timur Tabi from the CS4270 maintainers, Cirrus are now doing
    this and Timur no longer has the boards that he was using.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTc1qXAAoJELSic+t+oim9rQsP/0plEA4KmnSUAD5l+LnFLZVI
 l4PrbTM9BrjdNpGk/dn0yeF9xAmKvlEa6hcclhPMSF5QIVWUxK5wiNZ4ZN1W64as
 VQsh9XHnD0AHSCD1v7ugz3vh4bvDk2cQkQUsJb9CS4Eh4Dgt1T2bjk74K3AnUBCV
 3yDkGW+15Yumo7WW8TKB1Qd7fIsuo95qua+caC1btnFz2VLWkdWixZ5D/t7tp4G2
 SriITNMqUF6gT0RWCue9sDKyfMkCN8tIOh5mvckHEYWLC5/pSgi7zKabDulUayS9
 GgG8mQIto49LL6NmzeyzBsDlf8Gk0O50BZOrEHvHQWw4dMiQ6ml8NTTxuz6oynzE
 k/b1aBUlnOf7wFHA1ILIgAHq3rMah9+/XVkxnHqPBxmP9IgIZoL//rc3DwCtqMbs
 CiIgHOPONdfiHtxMPJwCiBNqfQKDCerYVq4dmZTwU3m99Zn1keFKSZ2dcEWJK02S
 s3kQlYQ6sStpGjPrlrDbS7UcNtX+pqSI2c46GXHHRsLZbAAhHe2kwQ2y/Iry0ntc
 eh1ztL8FLZylEiXmYWjC2Sx5azKOhWVMJGdlKBbX3CNtxFTKzG0NXwHjXJXH72Y3
 Zm8SS9lK4uuJz4IKr7k2RHXETxFb1vdFlijYN5VvkGmYBoGo69G/dFDv6QAg0Ow/
 ANnqLBtrgKir3q49T2YQ
 =s9u3
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.15-rc5-core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Core fixes for v3.15

A few things here:

 - Fix the creation of spurious CODEC<->CODEC links which caused DAPM to
   have audio paths which shouldn't be present causing spurious powerups
   and potential audible issues for users.
 - Ensure the suspend->off transition doesn't have spurious transitions
   to prepare added to the sequence.
 - Fix incorrect skipping of PCM suspension for active audio streams.
 - Remove Timur Tabi from the CS4270 maintainers, Cirrus are now doing
   this and Timur no longer has the boards that he was using.
2014-05-14 14:23:48 +02:00
Mark Brown cf86197ec5 Merge remote-tracking branch 'asoc/fix/pcm' into asoc-linus 2014-05-14 12:52:41 +01:00
Mark Brown f9a405961e Merge remote-tracking branches 'asoc/fix/audmux', 'asoc/fix/cs42l52', 'asoc/fix/fsl-esai', 'asoc/fix/fsl-spdif', 'asoc/fix/rcar', 'asoc/fix/tlv320aic31xx' and 'asoc/fix/wm8962' into asoc-linus 2014-05-14 12:49:10 +01:00
Tushar Behera deeaa686b9 ASoC: samsung: Add missing pm ops for Snow sound card driver
Adding missing pm ops so that audio playback works across
suspend and resume cycle.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 12:34:50 +01:00
Sascha Hauer 5cd15e29a4 ASoC: ak4642: Add support for extended sysclk frequencies of the ak4648
Additionally to the ak4642 pll frequencies the ak4648 also supports 13MHz,
19.2MHz and 26MHz. This adds support for these frequencies.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 12:32:04 +01:00
Sascha Hauer d815c703ce ASoC: ak4642: Add driver data and driver private struct
Currently unused, this is done to let the driver distinguish between
the different supported codec types in later patches.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 12:32:03 +01:00
Sascha Hauer 370f83a156 ASoC: ak4642: Add ALC controls
ALC and ALC Zero crossing detection has been enabled unconditionally.
Add controls for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 12:32:03 +01:00
Sascha Hauer da731845d5 ASoC: ak4642: Fix typo zoro -> zero
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 12:32:03 +01:00
Kuninori Morimoto bff58ea4f4 ASoC: rsnd: add DVC support
This patch adds DVC (Digital Volume Controller)
support which is member of CMD unit.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 19:06:16 +01:00
Kuninori Morimoto 68b6af3656 ASoC: rsnd: enable to use multi parameter on rsnd_dai_call/rsnd_mod_call
rsnd_mod_ops would like to come to use multi parameter.
modify macro to enable it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 19:06:16 +01:00
Kuninori Morimoto b42fccf69c ASoC: rsnd: remove duplicate parameter from rsnd_mod_ops
Now, it can get rsnd_dai_stream pointer from rsnd_mod.
Remove duplicate parameter from rsnd_mod_ops

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 19:06:16 +01:00
Kuninori Morimoto d7bdbc5d9e ASoC: rsnd: add rsnd_get_adinr()
SRC module needs ADINR register settings,
but, it has many similar xxx_ADINR register,
and needs same settings.
This patch adds rsnd_get_adinr() to sharing code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 19:06:16 +01:00
Kuninori Morimoto 739f9502fd ASoC: rsnd: add rsnd_path_parse() macro
Current R-Car sound supports only SRC/SSI,
but, other module will be supported.
This patch adds rsnd_path_parse() macro to share code

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 19:06:15 +01:00
Charles Keepax 44330ab516 ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile
The register CLASS_D_CONTROL_1 is marked as volatile because it contains
a bit, DAC_MUTE, which is also mirrored in the ADC_DAC_CONTROL_1
register. This causes problems for the "Speaker Switch" control, which
will report an error if the CODEC is suspended because it relies on a
volatile register.

To resolve this issue mark CLASS_D_CONTROL_1 as non-volatile and
manually keep the register cache in sync by updating both bits when
changing the mute status.

Reported-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2014-05-13 19:02:30 +01:00
Mark Brown 8bee1fd482 Merge branch 'fix/intel' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
Conflicts:
	sound/soc/intel/sst-baytrail-dsp.c
2014-05-13 18:23:56 +01:00
Jarkko Nikula cffd6665f5 ASoC: Intel: Fix Baytrail SST DSP firmware loading
Commit 10df350977 ("ASoC: Intel: Fix Audio DSP usage when IOMMU is
enabled.") caused following regression in Baytrail SST:

baytrail-pcm-audio baytrail-pcm-audio: error: DMA alloc failed
baytrail-pcm-audio baytrail-pcm-audio: error: failed to load firmware

Fix this by calling dma_coerce_mask_and_coherent() in sst_byt_init() with
the same dma_dev device what is now used in sst_fw_new() when allocating the
DMA buffer.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 18:21:02 +01:00
Jarkko Nikula dfe1951b0c ASoC: Intel: Use ACPI device for Baytrail PCM buffer allocation
This follows the same idea than commit 10df350977
("ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.") by using only
ACPI device for all DMA allocations. Since DMA masking is already done in
firmware loading it can be removed from here.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-13 11:54:11 +01:00
Mengdong Lin 7189eb9b8f ALSA: hda - mask buggy stream DMA0 for Broadwell display controller
Broadwell display controller has 3 stream DMA engines. DMA0 cannot update DMA
postion buffer properly while DMA1 and DMA2 can work well. So this patch masks
the buggy DMA0 by keeping it as opened.

This is a tentative workaround, so keep the change small as Takashi suggested.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-13 12:11:58 +02:00
Aaron Plattner ec5fe98886 ALSA: hda - Add new GPU codec ID to snd-hda
Vendor ID 0x10de0071 is used by a yet-to-be-named GPU chip.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-13 09:14:13 +02:00
Nicolin Chen f975ca46f6 ASoC: fsl_esai: Bypass divider settings if clock requirement is not changed
We don't need to change those dividers if bclk and mclk remains the same
directions and values.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 23:15:25 +01:00
Nicolin Chen 4f8210f66e ASoC: fsl_esai: Set PCRC and PRRC registers at the end of hw_params()
According to Reference Manual -- ESAI Initialization chapter, as the
standard procedure of ESAI personal reset, the PCRC and PRRC registers
should be remained in its reset value and then configured after T/RCCR
and T/RCR configurations's done but before TE/RE's enabling.

So this patch moves PCRC and PRRC settings to the end of hw_params().

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 23:13:13 +01:00
Nicolin Chen 57ebbcafab ASoC: fsl_esai: Only bypass sck_div for EXTAL source
ESAI can only output EXTAL clock source directly. But for FSYS clock source,
ESAI can not output it without getting through PSR PM dividers.

So this patch adds an extra check in the code.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 23:13:13 +01:00
Nicolin Chen 89e47f62cf ASoC: fsl_esai: Fix incorrect condition within ratio range check for FP
The range here from 1 to 16 is confined to FP divider only while the
sck_div indicates if the calculation contains PSR and PM dividers. So
for the case using PSR and PM since the sck_div is true, the range of
ratio would simply become bigger than 16.

So this patch fixes the condition here and adds one line comments to
make the purpose here clear.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 23:13:13 +01:00
Bard Liao 57f174f47e ASoC: rt5640: add default case for unexpected ID
We may read an unexpected value when detemining which codec is attached.
In that case, either a unsupported codec is attached or something wrong
with I2C. The driver will not work properly on both cases. So we return
an error for that.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:09:30 +01:00
Lars-Peter Clausen 797f283b61 ASoC: Remove runtime field from DAI
This was initially removed in commit 6423c1875 ("ASoC: Remove runtime field from
DAI"), but was, presumably by accident, brought back in commit f0fba2ad1 ("ASoC:
multi-component - ASoC Multi-Component Support"). But has never been
initialized to anything but NULL ever since. This commit removes it again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:08:36 +01:00
Lars-Peter Clausen b74f7be90f ASoC: atmel-pcm-pdc: Remove broken suspend/resume code
Suspend/resume support for the atmel-pcm-pdc driver was broken in commit
f0fba2ad1 ("ASoC: multi-component - ASoC Multi-Component Support"). It
essentially reverted the modifications done in commit 10cab262 ("ASoC: Change
how suspend and resume obtain the PCM runtime"). The suspend and resume handlers
at the beginning check if dai->runtime is not NULL, but dai->runtime is always
NULL, hence the code never runs. Considering that nobody noticed any problems in
the last 4 years since the code was broken and that the driver does not set
SNDRV_PCM_INFO_RESUME, which means applications are expected to stop and restart
the audio stream during suspend/resume, it is probably safe to assume that his
code is not needed and can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:08:36 +01:00
Lars-Peter Clausen ce85a4d726 ASoC: dapm: Fix SUSPEND -> OFF bias sequence
Currently when the DAPM context bias level is SUSPEND and the target bias level
is OFF dapm_pre_sequence_async() will first transition to PREPARE and
dapm_post_sequence_async() will then transition back from PREPARE to STANDBY and
then to OFF.

This patch makes sure that dapm_pre_sequence_async() only transitions to PREPARE
when either going to ON or away from ON. This avoids the extra unnecessary
transitions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:06:34 +01:00
Jarkko Nikula 6fb8b02b4b ASoC: Intel: Allow byt-5640 machine driver and SST core go to suspend
Since there is no support for compressed audio in Baytrail ADSP firmware
there is no need to leave it on during suspend since ALSA PCM buffers are
too small for leaving ADSP on for playing or recording.

Implement PM callbacks to Baytrail byt-rt5640.c machine driver that call
snd_soc_suspend and snd_soc_resume functions and unset the ignore_suspend
fields in DAI links.

This makes soc-core and ALSA core gracefully suspend and resume active
stream and call sst_byt_pcm_trigger() during suspend-resume cycle.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:18 +01:00
Liam Girdwood af94aa558b ASoC: Intel: Add Baytrail suspend/resume support
Add suspend and resume support to Baytrail SST DSP. This is implemented by
unloading firmware modules and putting DSP into reset prior suspend and
restarting DSP again in normal boot state after resume.

Context restore for running streams is implemented by scheduling a work from
sst_byt_pcm_trigger() that will allocate a stream with existing parameters
and start it from last known buffer position before suspend.

[Jarkko: Squashed together 5 WIP patches from Liam and 1 from me]

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:18 +01:00
Liam Girdwood 609a13e5c9 ASoC: Intel: Allow Rx/Tx message list can be cleared prior to suspend
Suspend/resume requires reloading FW to boot state so we need to also make
sure that the driver matches the FW state at boot.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula 800be5900b ASoC: Intel: Move Baytrail extended fw address saving to sst_byt_boot()
We have to save the physical address of extended firmware block in the
beginning of mailbox every time when we boot the DSP firmware since that
mailbox address is re-used after DSP firmware is running. Otherwise DSP
firmware will get bogus extended firmware block address during next DSP
boot.

Currently this is not problem but becomes when DSP runtime rebooting is
implemented. Prepare for that by moving extended firmware address saving
from sst_byt_init() to sst_byt_boot().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula a6686ed553 ASoC: Intel: Pass stream start position to sst_byt_stream_start()
Stream start position will be needed in resume code. Prepare for it by
adding start offset argument to sst_byt_stream_start().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula 65ee9e8fb6 ASoC: Intel: Simplify Baytrail stream control IPC construction
Baytrail ADSP stream IPC simplifies a little by moving IPC_IA_START_STREAM
construction and sending directly into sst_byt_stream_start() from
sst_byt_stream_operations(). This is because IPC_IA_START_STREAM is only
stream IPC with extra message data so this move saves a few code lines.

Main motivation for this is to prepare for passing stream start position
to sst_byt_stream_start() which will be needed in resume code.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Jarkko Nikula c83649e3cd ASoC: Intel: Sample Baytrail DSP DMA pointer only after each period
This is for preparing suspend/resume support but can give also more
safeguard against concurrent timestamp structure access between DSP firmware
and host.

Now DSP DMA pointer is sampled in each pcm pointer callback in
sst_byt_pcm_pointer() but that is unneeded since DSP updates the timestamp
period basis and can potentially be racy if sst_byt_pcm_pointer() is called
when DSP is updating the timestamp.

By taking DSP DMA pointer only after period elapsed IPC messages in
byt_notify_pointer() and returning stored hw pointer in
sst_byt_pcm_pointer() there is less risk for concurrent access.

The same stored hw pointer can be also used in suspend/resume code for
restarting the stream at the same position.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 22:02:17 +01:00
Lars-Peter Clausen 94986198f5 ASoC: dapm: Handle SND_SOC_DAPM_REG() generically
Commit commit de9ba98b6d ("ASoC: dapm: Make widget power register settings more
flexible") added generic support for on_val/off_val in the DAPM core. With this
in place there is no need anymore for having a special event callback for
SND_SOC_DAPM_REG() widgets.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:48:08 +01:00
Lars-Peter Clausen 0f9bd7b194 ASoC: dapm: Simplify snd_soc_dapm_link_dai_widgets()
If we find a widget who's stream name matches the name of a DAI widget then
thats the one it should be connected to. Based on the widget id we can say in
which direction the path should be. No need to go back to the DAI and check the
stream names.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:37:17 +01:00
Lars-Peter Clausen fe83897fc5 ASoC: dapm: Use snd_soc_dapm_add_path() in snd_soc_dapm_new_pcm()
We already know the widgets we want to connect, so use snd_soc_dapm_add_path()
instead of snd_soc_dapm_add_route() in snd_soc_dapm_new_pcm().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:34:49 +01:00
Lars-Peter Clausen 9887c20b9f ASoC: dapm: Use snd_soc_dapm_add_path() in connect_dai_link_widgets()
We already know which two widgets should be connected, so use
snd_soc_dapm_add_path() instead of snd_soc_dapm_add_route() in
snd_soc_dapm_connect_dai_link_widgets().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:34:48 +01:00
Lars-Peter Clausen a4e9154c42 ASoC: dapm: Revert "ASoC: dapm: Fix double prefix addition"
This reverts commit bd23c5b661.

The patch claims that the patch is necessary to avoid double prefix addition
when calling snd_soc_dapm_add_route() from snd_soc_dapm_connect_dai_link_widgets().
But snd_soc_dapm_add_route() is called with the card's DAPM context, which does
not have a prefix, which means there is no prefix that could be added a second
time.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:34:43 +01:00
Lars-Peter Clausen ca5106ae3d ASoC: dapm: Skip CODEC<->CODEC links in connect_dai_link_widgets()
For CODEC to CODEC DAI links the paths are created in snd_soc_dapm_new_pcm().
Also for CODEC to CODEC links the widgets are connected cross-over via a DAI
link widget, meaning that the capture widget of one CODEC will be connected to
the playback widget of the other and vice versa. Whereas
snd_soc_dapm_connect_dai_link_widgets() directly connects the playback widget of
the CPU DAI to the playback widget of the CODEC DAI and the capture widget of
the CPU DAI to the capture widget of the CODEC DAI. So not skipping
CODEC<->CODEC links in snd_soc_dapm_connect_dai_link_widgets() will create
incorrect connections between the two CODECs which will cause DAPM to detect
active paths where there are none and unnecessarily power up widgets.

Fixes: b893ea5 ("ASoC: sapm: Automatically connect DAI link widgets in DAPM graph.")
Cc: <stable@vger.kernel.org> (for 3.14+)
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:33:36 +01:00
Nicolin Chen 868a6ca84e ASoC: pcm: Fix incorrect condition check for case SNDRV_PCM_TRIGGER_SUSPEND
The regular state before we execute SNDRV_PCM_TRIGGER_SUSPEND should be
SNDRV_PCM_TRIGGER_START, not SNDRV_PCM_TRIGGER_STOP. Thus fix it.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-12 21:16:06 +01:00
Mark Brown b9d4cf74b9 ASoC: Intel: Build Medfield compressed ops
Since commit 4b68b4e1c5 (ASoC: Intel: split the pcm and compress to
different files) the compressed ops haven't been built causing link
failures on allyesconfig and making the driver unbuildable.  Add the
object to the Makefile to fix that.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by Vinod Koul <vinod.koul@intel.com>
2014-05-09 10:28:42 +01:00
Hui Wang a1f3b5fa11 ALSA: hda - add headset mic detect quirks for three Dell laptops
When we plug a 3-ring headset on the Dell machines (VID: 0x10ec0255,
SID: 0x1028065c; VID: 0x10ec0255, SID: 0x10280680; VID: 0x10ec0292,
SID: 0x10280684), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

And on the machine with SID 0x10280684, and the Lineout and external
microphone should be routed to docking, this patch also fix this
problem.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-09 07:25:44 +02:00
Vinod Koul 0cac6fc3eb ASoC: Intel: rename pcm dias to media dai
this is for further updates to driver which supports DPCM :)

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 6f46c0d33e ASoC: Intel: remove unused sst-mfld platform dais
With DPCM we have media dai used and no seperate headset and speaker dai so
remove the speaker dai
The vibra is no longer supported thru audio, so remove

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 4b68b4e1c5 ASoC: Intel: split the pcm and compress to different files
For manging them and adding support for more platforms
Code move only

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 4496ffab7d ASoC: Intel: mark sst_set_stream_status as non static
as this will be used in compressed split file in subsequent patch

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul e11fd7c3ac ASoc: Intel: rename sst-mfld-platform.c
to sst-mfld-platform-pcm.c so that we can split pcm and compress to different
files for upcoming changes to support more platforms

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 300f53bf19 ASoC: Intel: remove FSF snail mail address
As this address can move

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:25:05 +01:00
Vinod Koul 2b4c78df05 ASoC: Intel: move component registration blob
to the place near it is used

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:24:54 +01:00
Liam Girdwood 555f8a80c3 ASoC: Intel: Add support to unload/reload firmware modules.
Add some SST API calls to unload and reload firmware modules. This can be used
by PM code to restore state and also allow modular FW to unload and release
memory blocks.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 18:20:58 +01:00
Kuninori Morimoto 29e69fd2cd ASoC: rsnd: remove compatibility code
Now, all platform is using new style rsnd_dai_platform_info.
Keeping compatibility is no longer needed.
We can cleanup code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 12:17:59 +01:00
Kuninori Morimoto 5e392ea0da ASoC: rsnd: remove old clock style support
All platform which used old style was
switched to new style.
R-Car sound can remove old style clock support,
use device dependent clock now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 12:17:59 +01:00
Oder Chiou 71bfa9b4d6 ASoC: rt5645: fix coccinelle warnings
Return statements in functions returning bool should use
true/false instead of 1/0.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 09:02:41 +01:00
Oder Chiou 0f776efd86 ASoC: rt5645: Correct the cache sync function
The patch corrects the cache sync function

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 09:02:41 +01:00
Oder Chiou 4809b96ebb ASoC: rt5645: Move settings from probe() to reg_default struct
The patch moves the private register settings from probe() to reg_default
struct.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 09:02:41 +01:00
Oder Chiou 9e22f7826a ASoC: rt5645: Staticise non-exported symbols
The patch is for staticising non-exported symbols

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 08:00:43 +01:00
Oder Chiou 92e160ddf6 ASoC: rt5645: Remove the unused variable
The patch is for removing the unused variable.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-08 08:00:43 +01:00
Nicolas Ferre 15fb63a08b ASoC: sam9g20_wm8731: remove useless mach/gpio.h
This include file is about to disapear. In addition it is
useless for this code. So it is time to remove it.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Mark Brown <broonie@linaro.org>
2014-05-07 18:27:20 +02:00
Takashi Iwai 1c37c22332 ALSA: hda - Add dock pin setups for Thinkpad T440
The headphone and mic jacks on Thinkpad T440 are assigned to pins NID
0x16 and 0x19, respectively.  These need to be set up manually by a
fixup.

Reported-and-tested-by: Joschi Brauchle <joschi.brauchle@tum.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-07 11:40:27 +02:00
Lars-Peter Clausen db88a8e3ca ASoC: Remove unused num_dai field from CODEC
Commit d191bd8de8 ("ASoC: snd_soc_codec includes snd_soc_component") removed the
last user of the num_dai field. Also remove the field itself.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 10:21:26 +01:00
Lars-Peter Clausen af0881ffbd ASoC: Remove unused 'list' field form card
The global card list was removed in commit b19e6e7b7 ("ASoC: core: Use driver
core probe deferral"). The 'list' field of the snd_soc_card struct has been
unused since then. This patch removes the field.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 10:21:25 +01:00
Lars-Peter Clausen 24faf76568 ASoC: Remove card's DAI list
Commit f0fba2ad1 ("ASoC: multi-component - ASoC Multi-Component Support") added
a per card list that keeps track of all the DAIs that have been registered with
the card, but the list has never been used. This patch removes it again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 10:21:25 +01:00
Mark Brown 387f837b3d Merge branch 'topic/component' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core 2014-05-07 10:21:22 +01:00
Liam Girdwood 2b39aab18a ASoC: Intel: Fix block offset calculations.
Block offset calculations are done in the contiguous allocator so
are not required here.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 09:38:29 +01:00
Brian Austin 272b5edd3b ASoC: Add support for CS42L56 CODEC
This patch adds support for the Cirrus Logic Low Power Stereo I2C CODEC

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 18:20:22 -07:00
Daniel Mack 7c2fcccc32 ASoC: sta350: add support for bits in miscellaneous registers
Add support for RPDNEN, NSHHPEN, BRIDGOFF, CPWMEN and PNDLSL, and add DT
bindings to access them.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:52:59 -07:00
Liam Girdwood e9024f0ba3 ASoC: Intel: Fix check for pdata usage before dereference.
This patch fixes the following dereference check ordering.

 sound/soc/intel/sst-haswell-pcm.c:749 hsw_pcm_probe() warn: variable dereferenced before check 'pdata' (see line 746)

 git remote add asoc git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
 git remote update asoc
 git checkout 0b708c87f6
 vim +/pdata +749 sound/soc/intel/sst-haswell-pcm.c

 a4b12990 Mark Brown    2014-03-12  740  };
 a4b12990 Mark Brown    2014-03-12  741
 a4b12990 Mark Brown    2014-03-12  742  static int hsw_pcm_probe(struct snd_soc_platform *platform)
 a4b12990 Mark Brown    2014-03-12  743  {
 a4b12990 Mark Brown    2014-03-12  744  	struct sst_pdata *pdata = dev_get_platdata(platform->dev);
 a4b12990 Mark Brown    2014-03-12  745  	struct hsw_priv_data *priv_data;
 0b708c87 Liam Girdwood 2014-05-02 @746  	struct device *dma_dev = pdata->dma_dev;
 0b708c87 Liam Girdwood 2014-05-02  747  	int i, ret = 0;
 a4b12990 Mark Brown    2014-03-12  748
 a4b12990 Mark Brown    2014-03-12 @749  	if (!pdata)
 a4b12990 Mark Brown    2014-03-12  750  		return -ENODEV;
 a4b12990 Mark Brown    2014-03-12  751
 a4b12990 Mark Brown    2014-03-12  752  	priv_data = devm_kzalloc(platform->dev, sizeof(*priv_data), GFP_KERNEL);

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:42:00 -07:00
Lars-Peter Clausen c9e065c27f ASoC: dapm: Make sure to always update the DAPM graph in _put_volsw()
When using auto-muted controls it may happen that the register value will not
change when changing a control from enabled to disabled (since the control might
be physically disabled due to the auto-muting). We have to make sure to still
update the DAPM graph and disconnect the mixer input.

Fixes: commit 5729507 ("ASoC: dapm: Implement mixer input auto-disable")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:31:14 -07:00
Lars-Peter Clausen 6b0a0b3b4e ASoC: Make soc_find_matching_codec() static
The function is only used locally, make it static.

Fixes the following warning from sparse:
	sound/soc/soc-core.c:1644:22: warning: symbol 'soc_find_matching_codec' was not declared. Should it be static?

Fixes: 3ca041ed ("ASoC: dt: Allow Aux Codecs to be specified using DT")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-By: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:29:25 -07:00
Nicolin Chen b8a832a0b6 ASoc: fsl_spdif: Add descriptions for fsl_spdif_priv
Other people would clearly understand each member and improve if they want.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:27:40 -07:00
Nicolin Chen 527cda78eb ASoC: fsl_spdif: Print actual sample rate for debug
People would simply know what the driver gets the best for the current
sample rate playback.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:27:39 -07:00
Nicolin Chen 27c647bff2 ASoC: fsl_spdif: Add sysclk df support to derive txclk from sysclk
The sysclk is one the clock sources that could be selected to derive
tx clock. But the route for sysclk is a bit different that it does
not only contain txclk df divider but also have an extra sysclk df.

So this patch mainly adds syclk df configuration support so as to
let the driver be able to get clock from sysclk.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:27:39 -07:00
Nicolin Chen e41a4a79af ASoC: fsl_spdif: Rename all _div to _df
We should have used _df by following the reference manual at the beginning.
So this patch just renames them.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:27:39 -07:00
Mark Brown af46929e6e Linux 3.15-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJTZuYPAAoJEHm+PkMAQRiGC/wIAJhgGkofnbEv4x0QEXJuNQOv
 rXxId3RQpLQ2PGjJHbrYRvwyK9X7L+JREDJGMyKh8VCMHaYQ1safpI6KII+BvkVb
 9FxcledNEB4sDNiShsckG39iBGBAsi2R630XgygLoydfrvNnCrhPB5vi1TbWE37t
 xTsaMJxZncSZ6nMsO8w5klVhSOlBPGUp9cVLZhvKTR66eF4JGX3hZHVPwlpZZd2J
 ExhxmhnwBATuP3IexRyZ/3/J/zGdJJ9e5JLlEwdLo2hKVgqVosDu7teEucLGzZL1
 YdGz7Ndl+Ky9rG/RSuZSCfG7XF5DCroqcDNhT+sqvoTWXU0iunAjFIKavy3CxNA=
 =7moZ
 -----END PGP SIGNATURE-----

Merge tag 'v3.15-rc4' into asoc-fsl-spdif

Linux 3.15-rc4
2014-05-05 12:27:30 -07:00
Nicolin Chen 9c6344b3fa ASoC: fsl_spdif: Use clk_set_rate() for spdif root clock only
The clock mux for the Freescale S/PDIF controller has eight clock sources
while most of them are from other moudles and even system clocks that do
not allow a rate-changing operation.

So we here only allow the clk_set_rate() and clk_round_rate() happened to
spdif root clock, the private clock for S/PDIF controller.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-05 12:26:05 -07:00
Anssi Hannula 561a7d6e85 ALSA: hda - hdmi: Set infoframe and channel mapping even without sink
Currently infoframe contents and channel mapping are only set when a
sink (monitor) is present.

However, this does not make much sense, since
1) We can make a very reasonable guess on CA after 18e391862c ("ALSA:
   hda - hdmi: Fallback to ALSA allocation when selecting CA") or by
   relying on a previously valid ELD (or we may be using a
   user-specified channel map).
2) Not setting infoframe contents and channel count simply means they
   are left at a possibly incorrect state - playback is still allowed
   to proceed (with missing or wrongly mapped channels).

Reasons for monitor_present being 0 include disconnected cable, video
driver issues, or codec not being spec-compliant. Note that in
actual disconnected-cable case it should not matter if these settings
are wrong as they will be re-set after jack detection, though.

Change the behavior to allow the infoframe contents and the channel
mapping to be set even without a sink/monitor, either based on the
previous valid ELD contents, if any, or based on sensible defaults
(standard channel layouts or provided custom map, sink type HDMI).

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Tested-by: Stephan Raue <stephan@openelec.tv>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-05 16:55:34 +02:00
Takashi Iwai 59991da498 Merge branch 'for-linus' into for-next
... for applying the further HDMI fixes.
2014-05-05 16:54:33 +02:00
Anssi Hannula f06ab794af ALSA: hda - hdmi: Set converter channel count even without sink
Since commit 1df5a06a ("ALSA: hda - hdmi: Fix programmed active channel
count") channel count is no longer being set if monitor_present is 0.
This is because setting the count was moved after the CA value is
determined, which is only after the monitor_present check in
hdmi_setup_audio_infoframe().

Unfortunately, in some cases, such as with a non-spec-compliant codec or
with a problematic video driver, monitor_present is always 0. As a
specific example, this seems to happen with gen1 ATV (SiI1390 codec),
causing left-channel-only stereo playback (multi-channel playback has
apparently never worked with this codec despite it reporting 8 channels,
reason unknown).

Simply setting converter channel count without setting the pin infoframe
and channel mapping as well does not theoretically make much sense as
this will just mean they are out-of-sync and multichannel playback will
have a wrong channel mapping.

However, adding back just setting the converter channel count even in
no-monitor case is the safest change which at least fixes the stereo
playback regression on SiI1390 codec. Do that.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Reported-by: Stephan Raue <stephan@openelec.tv>
Tested-by: Stephan Raue <stephan@openelec.tv>
Cc: <stable@vger.kernel.org> # 3.12+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-05 16:28:10 +02:00
Oder Chiou 1319b2f6a5 ASoC: rt5645: Add codec driver
This patch adds the Realtek ALC5645 codec driver. It is the base
version that because the jack detect function is not implemented to
it, the headphone and AMIC1 are not workable. We will fill up the
further functions later.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-03 10:36:10 -07:00
Vinod Koul d98812082c ASoC: add SND_SOC_BYTES_EXT
we need _EXT version for SND_SOC_BYTES so that DSPs can use this to pass data
for DSP modules

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 13:44:24 -07:00
Mark Brown eba17e6868 Merge branch 'topic/input' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-cs42l51
Conflicts:
	sound/soc/codecs/Kconfig
2014-05-02 10:00:35 -07:00
Liam Girdwood 51b4e24f38 ASoC: Intel: Fix stream position pointer.
Read the stream offset and presentation position from DSP memory rather
than using the old estimated position. This fixes timing issues with
pulseaudio.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:54:05 -07:00
Liam Girdwood 916152c488 ASoC: Intel: Fix allow hw_params to be called more than once.
hw_params() can be called multiple times. Make sure we release the DSP
stream that was allocated on previous hw_params() calls before allocating
a new DSP stream.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:53:02 -07:00
Liam Girdwood 10df350977 ASoC: Intel: Fix Audio DSP usage when IOMMU is enabled.
The Intel IOMMU requires that the ACPI device is used to allocate all
DMA memory buffers. This means we need to pass the DMA device pointer into child
component devices that allocate DMA memory.

We also only set the DMA mask for the ACPI device now instead of for each
component device.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:53:02 -07:00
Liam Girdwood 0b708c87f6 ASoC: Intel: Fix Haswell/Broadwell DSP page table creation.
Fix page table creation on Haswell and Broadwell to remove unsafe
virt_to_phys mappings and use more portable SG buffer. Use audio buffer
APIs to allocate DMA buffers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:53:01 -07:00
Liam Girdwood 84fbdd5861 ASoC: Intel: Fix allocated block list usage when adding blocks.
Make sure we add the allocated blocks to the modules list of blocks.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:53:01 -07:00
Liam Girdwood 48695f3d4e ASoC: Intel: Fix block allocation so we only allocate blocks once.
Make sure we dont alloc blocks twice with requests spanning more
than one block.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:51:58 -07:00
Brian Austin c894e394d4 ASoC: Remove IS_ENABLED for INPUT in CS42L52 and WM8962
Now that INPUT is required for the CS42L52 and WM8962 we can remove the
IS_ENABLED(INPUT) check in the drivers.

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-02 09:41:09 -07:00
Clemens Ladisch 7040b6d1fe ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data
The TEAC UD-H01 firmware sends wrong feedback frequency values, thus
causing the PC to send the samples at a wrong rate, which results in
clicks and crackles in the output.

Add a workaround to detect and fix the corruption.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
[mick37@gmx.de: use sender->udh01_fb_quirk rather than
 ep->udh01_fb_quirk in snd_usb_handle_sync_urb()]
Reported-and-tested-by: Mick <mick37@gmx.de>
Reported-and-tested-by: Andrea Messa <andr.messa@tiscali.it>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-02 18:21:55 +02:00
Takashi Iwai 1ee23fe07e ALSA: usb-audio: Fix deadlocks at resuming
The recent addition of the USB audio mixer suspend/resume may lead to
deadlocks when the driver tries to call usb_autopm_get_interface()
recursively, since the function tries to sync with the finish of the
other calls.  For avoiding it, introduce a flag indicating the resume
operation and avoids the recursive usb_autopm_get_interface() calls
during the resume.

Reported-and-tested-by: Bryan Quigley <gquigs@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-02 18:17:06 +02:00
Takashi Iwai 1c53e7253e ALSA: usb-audio: Save mixer status only once at suspend
The suspend callback of usb-audio driver may be called multiple times
per suspend when multiple USB interfaces are bound to a single sound
card instance.  In such a case, it's superfluous to save the mixer
values multiple times.  This patch fixes it by checking the counter.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-02 18:14:42 +02:00
Sander Eikelenboom b7a7723513 ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined
This (widely used) construction:

if(printk_ratelimit())
	dev_dbg()

Causes the ratelimiting to spam the kernel log with the "callbacks suppressed"
message below, even while the dev_dbg it is supposed to rate limit wouldn't
print anything because DEBUG is not defined for this device.

[  533.803964] retire_playback_urb: 852 callbacks suppressed
[  538.807930] retire_playback_urb: 852 callbacks suppressed
[  543.811897] retire_playback_urb: 852 callbacks suppressed
[  548.815745] retire_playback_urb: 852 callbacks suppressed
[  553.819826] retire_playback_urb: 852 callbacks suppressed

So use dev_dbg_ratelimited() instead of this construction.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-05-02 18:10:59 +02:00
Arnd Bergmann 31ee2bfd72 ASoC: fsl: select SND_SOC_IMX_PCM_DMA where needed
Since commit 204dec93ea "ASoC: fsl: Allow to select individual common
options", it is possible to enable SND_SOC_FSL_SSI and SND_SOC_FSL_SPDIF
manually, either as loadable modules or built-in. This unfortunately
leads to a link error if one or both of them are built-in, while
the imx-pcm-dma framework is a loadable module:

sound/built-in.o: In function `fsl_ssi_probe':
:(.text+0x51fb8): undefined reference to `imx_pcm_dma_init'
sound/built-in.o: In function `fsl_spdif_probe':
:(.text+0x52e20): undefined reference to `imx_pcm_dma_init'

This changes Kconfig to prevent this case by using 'select' to turn
on the imx-pcm-dma code from both drivers. For consistency, we also
turn on the imx-pcm-fiq code, which is an alternative to the dma
implementation.

Note that imx-pcm-fiq is platform dependent, so we must not enable
that unless we are building a kernel for i.MX. Note also the
"if SND_IMX_SOC != n" syntax as opposed to the normal "if SND_IMX_SOC".
This is needed to avoid turning on the options as 'm' if 'SND_IMX_SOC'
is a module.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 13:47:28 -07:00
Arnd Bergmann b7a80379aa ASoC: omap: Amstrad E3 needs TTY support for codec
The cx20442 codec driver used here requires the TTY layer to
be enabled, or we get a link error:

sound/built-in.o: In function `cx20442_codec_remove':
cx20442.c:398: undefined reference to `tty_hangup'
sound/built-in.o: In function `ams_delta_remove':
ams-delta.c:613: undefined reference to `tty_unregister_ldisc'
sound/built-in.o: In function `ams_delta_cx20442_init':
ams-delta.c:559: undefined reference to `tty_register_ldisc'

This adds the missing dependency in the E3 configuration, there
was already one for the codec.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 13:31:05 -07:00
Arnd Bergmann 7b6ad9e85b ASoC: sh: Migo-R sound needs I2C
The WM8978 driver needs I2C to be enabled, so the
SND_SIU_MIGOR option also requires this.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 13:29:54 -07:00
Arnd Bergmann 7ec91cd017 ASoC: samsung: TLV320AIC23 and Simtec Hermes audio need I2C
This codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 13:28:26 -07:00
Arnd Bergmann a4519ecbd0 ASoC: atmel: Atmel WM8904 codec support needs I2C
The WM8904 codec driver needs I2C to be enabled, so the
SND_ATMEL_SOC_WM8904 option also requires this.

Found using randconfig build testing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 12:09:21 -07:00
Xiubo Li 40e3b934be ASoC: fsl: Allow to select ESAI device individually
This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 11:09:05 -07:00
Xiubo Li b71fc4e6c9 ASoC: fsl: Allow to select SAI device individually
This will be useful for out-of-tree drivers since in-tree drivers
could select it automatically.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 11:08:29 -07:00
Arnd Bergmann 482b91c7f1 ASoC: pxa: TTC DKB audio needs I2C
The missing dependency can lead to build errors, so
make it explicit in Kconfig.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 11:00:34 -07:00
Arnd Bergmann 654da9f522 ASoC: samsung: UDA1380 needs I2C
The UDA1380 driver needs I2C to be enabled, so
SND_SOC_SAMSUNG_H1940_UDA1380 and
SND_SOC_SAMSUNG_RX1950_UDA1380 also
require this.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:59:40 -07:00
Arnd Bergmann 36a26e1a9a ASoC: omap: RX-51 audio needs I2C
The codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:59:03 -07:00
Sebastian Reichel d052a3d6a7 ASoC: omap: rx51: Add DT support
This patch adds device tree support to the Nokia N900 audio driver and
adds documentation for the DT binding.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:57:34 -07:00
Mark Brown f29b542183 Merge branch 'asoc-dt' into asoc-omap 2014-05-01 10:57:03 -07:00
Sebastian Reichel 3ca041ed04 ASoC: dt: Allow Aux Codecs to be specified using DT
This patch adds support for specifying auxiliary codecs and
codec configuration via device tree phandles.

This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf
and adds support for the changes to SoC core methods.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:56:45 -07:00
Sebastian Reichel 0265e1ae64 ASoC: omap: rx51: Add some error messages
Add more error messages making it easier to identify problems.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:54:35 -07:00
Sebastian Reichel 386e81ab3b ASoC: omap: rx51: get GPIO numbers via gpiod API
Update the driver to get GPIO numbers from the
devm gpiod API instead of requesting hardcoded
GPIO numbers.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:54:34 -07:00
Sebastian Reichel 0a17a37046 ASoC: omap: rx51: omap_mcbsp_st_add_controls: add id parameter
This is a preparation for DT based booting where the McBSP id
is set to -1 for all McBSP instances.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-01 10:54:34 -07:00
Fabio Estevam a0b148b423 ASoC: wm8985: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 20:36:06 -07:00
Arnd Bergmann 49e3c6418b ASoC: nuc900: export nuc900_ac97_data
The symbol "nuc900_ac97_data" is used by the nuc900_pcm driver,
which may be a loadable module, so we should export it.

If one tries to build SND_SOC_NUC900 without SND_SOC_NUC900_AC97,
the kernel fails to link because of the reference to nuc900_ac97_data.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 20:32:20 -07:00
Arnd Bergmann 1aa91b6dd4 ASoC: samsung-idma: avoid 64-bit division
dma_addr_t may be 64 bit wide, which causes a build failure
when doing a division on it. Here it is safe to cast to an
u32 type, which avoids the problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Tested-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 20:31:13 -07:00
Arnd Bergmann 01c2cb67ea ASoC: samsung: SMDK_WM8580_PCM needs REGMAP_I2C
This adds a missing dependency for SND_SOC_SMDK_WM8580_PCM to
require REGMAP_I2C to be enabled, avoiding possible build
erorrs.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 20:30:43 -07:00
Arnd Bergmann 24fc81d5fe ASoC: davinci: add dependencies for SND_SOC_TLV320AIC3X
This codec requires I2C to be enabled, so any other option
that selects it should also depend on I2C.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 20:29:39 -07:00
Arnd Bergmann a2915d4fef ASoC: CS42L51 and WM8962 codecs depend on INPUT
Building ARM randconfig got into a situation where CONFIG_INPUT
is turned off and SND_SOC_ALL_CODECS is turned on, which failed
for two codecs trying to use the input subsystem. Some other
drivers also select one of these codecs and consequently need an
explicit dependency added.

Appending to the dependency list seems the easiest way out,
since this is not a practical limitation. If anyone really
needs to build these codecs for a kernel with no input support,
a more sophisticated solution can be implemented.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Xia Kaixu <kaixu.xia@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 18:29:33 -07:00
Arnd Bergmann a8784dd0f4 ASoC: cq93vc: fix cq93vc_get_regmap build error
49101a25ac "ASoC: cq93vc: Remove the set_cache_io() entirely from
ASoC probe" introduced the cq93vc_get_regmap function that has an
obvious build error referring to the 'codec' variable that is not
declared anywhere"

sound/soc/codecs/cq93vc.c: In function 'cq93vc_get_regmap':
sound/soc/codecs/cq93vc.c:157:34: error: 'codec' undeclared (first use in this function)
  struct davinci_vc *davinci_vc = codec->dev->platform_data;
                                  ^

This changes the code to compile again, presumably in the way it was
intended. Not tested.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 18:23:49 -07:00
Bard Liao 4eefa0d850 ASoC: rt5640: correct 5640's device ID
This patch correct rt5640's device ID

Signed-off-by: Bard Liao <bardliao@realtek.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-30 11:25:19 -07:00
Hui Wang 91943954e3 ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
SID: 0x1028067e), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-30 12:36:48 +02:00
Alexander Shiyan 780aaeff96 ASoC: mc13783: Add devicetree support
This patch adds devicetree support for mc13783-codec.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 15:24:54 -07:00
Sebastian Reichel a7d5202855 ASoC: omap: rx51: Use devm_snd_soc_register_card
This patch converts the rx51 ASoC module to use
devm_snd_soc_register_card.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 15:22:15 -07:00
Sebastian Reichel beab3da155 ASoC: omap: rx51: Add module alias
Add module alias to support driver autoloading.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 15:22:15 -07:00
Sebastian Reichel 441dc45aa2 ASoC: omap: rx51: Use static const char * const arrays
Mark the array and the string const by using "static const char * const
foo[]" instead of "static const char* foo[]".

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 15:22:14 -07:00
Tushar Behera 31c26a6a84 ASoC: samsung: Add sound card driver for Snow board
Added machine driver to instantiate I2S based sound card on Snow
board. It has MAX98095 audio codec on board.

There are some other variants for Snow board which have MAX98090
audio codec. Hence support for MAX98090 is also added to this
driver.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 12:09:38 -07:00
Nicolin Chen 0b8643900a ASoC: fsl_spdif: Fix clock source for rxclk rate measurement
The rxclk rate actually uses sysclk, ipg clock for example, as its
reference clock to calculate it. But the driver currently doesn't
pass a correct clock source. So fix it.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 12:07:17 -07:00
Jarkko Nikula 4792b0dbcf ASoC: core: Add support for machine specific trigger callback
Machine specific trigger callback allows to do final stream start/stop
related operations in a machine driver after setting up the codec, DMA and
DAI.

One example could be clock management for linked streams case where machine
driver can start/stop synchronously the linked streams.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 12:04:32 -07:00
Jarkko Nikula 4da533932d ASoC: core: Fix component_list corruption when unloading modules
This fixes module unload regressions introduced by commits 98e639fb8a
("ASoC: Track which components have been registered with
snd_soc_register_component()") and b37f1d123c ("ASoC: Let snd_soc_platform
subclass snd_soc_component").

First commit causes component_list to be corrupted when removing codec and
second when removing platform. Reason for both is that components associated
with platform or codec are never removed from the list because for them
registered_as_component field in struct snd_soc_component is always false.

Now list becomes corrupted when snd_soc_unregister_platform() or
snd_soc_unregister_codec() frees the platform or codec structure and where
the associated struct snd_soc_component is embedded.

Fix these by moving component unregistration and cleanup to a new local
function __snd_soc_unregister_component() that takes component as its
argument.

Since component is known for platforms and codecs the
__snd_soc_unregister_component() can be called directly and
snd_soc_unregister_component() takes care to find and unregister only
components that were registered using snd_soc_register_component().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 10:09:11 -07:00
Mark Brown 00a41d9fe2 Merge branch 'topic/component' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-dapm 2014-04-29 09:49:49 -07:00
Takashi Iwai 6ba736dd02 ALSA: hda - Suppress CORBRP clear on Nvidia controller chips
The recent commit (ca460f8652) changed the CORB RP reset procedure to
follow the specification with a couple of sanity checks.
Unfortunately, Nvidia controller chips seem not following this way,
and spew the warning messages like:
  snd_hda_intel 0000:00:10.1: CORB reset timeout#1, CORBRP = 0

This patch adds the workaround for such chips.  It just skips the new
reset procedure for the known broken chips.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29 18:41:22 +02:00
Lars-Peter Clausen c471fdd1b6 ASoC: dapm: Factor out duplicated code in soc_dapm_stream_event()
In soc_dapm_stream_event() we have the same code twice, once for the codec_dai
and once for the cpu_dai.  This patch factors the duplicated code out into a
separate function. This will make it easier to modify the implementation (since
there is only one place that needs to be updated) and also easier to add support
for more than two DAIs per DAI link.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 09:40:51 -07:00
Andy Shevchenko 02fd1a76bf ALSA: fm801: introduce fm801_ac97_is_ready()/fm801_ac97_is_valid() helpers
The introduced functios check AC97 if it's ready for communication and
read data is valid.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29 16:30:15 +02:00
Andy Shevchenko 215dacc281 ALSA: fm801: introduce macros to access the hardware
It will help to maintain HW accessors and, for example, switch from the
direct I/O to MMIO which is more convenient for PCI devices.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-29 16:29:57 +02:00
Masanari Iida af831eef4c ALSA: usb-audio: Fix format string mismatch in mixer.c
Fix format string mismatch in parse_audio_selector_unit().

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:19:13 +02:00
Masanari Iida 53403a8013 ALSA: core: Fix format string mismatch in seq_midi.c
Fix format string mismatch in snd_seq_midisynth_register_port().
Argument type of p is unsigned int.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:18:47 +02:00
Kailang Yang a22aa26f75 ALSA: hda/realtek - Add new codec ALC293/ALC3235 UAJ supported
New codec ALC293/ALC3235 support multifunction jacks.
It used for menual select the input device.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:17:53 +02:00
Kailang Yang 193177de4f ALSA: hda/realtek - Add two codecs alias name for Dell
Add ALC3235 ALC3263.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:17:50 +02:00
Hui Wang e32dfbed8c ALSA: hda - add headset mic detect quirk for a Dell laptop
When we plug a 3-ring headset on the Dell machine (VID: 0x10ec0255,
SID: 0x10280674), the headset mic can't be detected, after apply this
patch, the headset mic can work well.

BugLink: https://bugs.launchpad.net/bugs/1297581
Cc: David Henningsson <david.henningsson@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-04-28 12:15:02 +02:00
Oder Chiou 33fcec2920 ASoC: rt5640: Add the rt5639 support to the OF match table
The patch adds the rt5639 support to the OF match table.

Signed-off-by: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-28 10:08:09 +01:00
Lars-Peter Clausen 7b4a469e58 ASoC: Remove name_prefix unset during DAI link init hack again
This was initially removed in commit 6479f15ad ("ASoC: Remove name_prefix unset
during DAI link init hack"), but was brought back in commit 503ae5e0 ("ASoC:
core: Add helpers for dai link and aux dev init") by accident. This patch
removes it again.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-26 17:55:33 +01:00
Fabio Estevam e90c7b456b ASoC: wm8955: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-25 12:24:26 +01:00
Fabio Estevam 3598aad547 ASoC: wm8731: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-25 12:17:18 +01:00
Fabio Estevam a3086791eb ASoC: wm8804: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-25 12:17:00 +01:00
Fabio Estevam e9382e3b7a ASoC: tlv320dac33: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-25 12:16:03 +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
Fabio Estevam 63e54cd9ca ASoC: sgtl5000: Use devm_regulator_bulk_get()
Using devm_regulator_bulk_get() can make the code cleaner and smaller as we
do not need to call regulator_bulk_free() in the error and remove paths.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 18:32:40 +01:00
Jyri Sarha 648722155d ASoC: simple-card: is_top_level_node parameter to simple_card_dai_link_of()
Restore correct parsing of dai-link subnodes with more explicit
implementation for applying the "simple-audio-card,"-prefix to
dai-link property and subnode names.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 18:23:49 +01:00
Benoit Cousson 3701861060 ASoC: core: Add one dai_get_widget helper instead of two rtd based ones
Replace rtd_get_codec_widget() and rtd_get_cpu_widget() by a simple
dai_get_widget() in preparation for DAI-multicodec support, per Lars
suggestion.

No functional change.

Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:25:16 +01:00
Misael Lopez Cruz 503ae5e036 ASoC: core: Add helpers for dai link and aux dev init
Separate DAI link and aux dev initialization in preparation for
DAI multicodec support.
Since aux dev will remain using single codecs but DAI links
will be able to support multiple codecs.

No functional change.

Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
[fparent@baylibre.com: Adapt to 3.14+]
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:24:03 +01:00
Nicolin Chen 781cbebed7 ASoC: simple-card: Improve coding style
Improve indentation and space.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Nicolin Chen 966b806360 ASoC: simple-card: Simplify error msg in simple_card_dai_link_of()
It would look better to use prop instead.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Nicolin Chen 50e6c718a1 ASoC: simple-card: Drop node->name checking
The current simple-card driver limits the DT node name to "sound".
Any of other names is forbidden while actually we should allow DT
to pass other node names.

And if this function is being called, the node must already have
the compatible "simple-audio-card" in DTB. So there should be no
need to check the name here.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:20:11 +01:00
Nicolin Chen e9ffb5ba4d ASoC: fsl: Drop formats limitation for imx-pcm-dma.c
Now ASoC core is getting the intersection of supported formats not only
from CPU and CODEC dai's but also from DMA's. However, there should be
no specific width limitation from SDMA side.

So drop it. Otherwise, we would only support S16_LE format for all i.MX
platforms.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:14:26 +01:00
Nicolin Chen 08f7336e64 ASoC: fsl_spdif: Add core clock control for DMA access
Regmap is able to enable/disable the core clock automatically each time
it's going to access the registers. But for DMA cases during playback or
recording, it's totally beyong control of regmap. So we have to open the
clock manually.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 13:11:16 +01:00
Jarkko Nikula de30a2ccb2 ASoC: Intel: Cancel hsw_notification_work before freeing the stream
I suppose there is a possibility that hsw_notification_work() may run after
sst_hsw_stream_free() which can lead to a kernel crash since struct
sst_hsw_stream is freed at that point and
stream = container_of(work, struct sst_hsw_stream, notify_work) is not valid
when hsw_notification_work() is run.

Reported-by: Derek Basehore <dbasehore@chromium.org>
Reported-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 11:32:23 +01:00
Lars-Peter Clausen b8909783a2 ASoC: imx-audmux: Fix section mismatch
audmux_debugfs_init() is marked as __init, but is called from imx_audmux_probe()
which is not marked as __init. This creates a section mismatch and a potential
runtime crash (if imx_audmux_probe() is called after the .init section was
dropped). This patch removes the __init annotation from audmux_debugfs_init(),
which fixes the following warning:
	WARNING: sound/soc/built-in.o(.text+0x86960): Section mismatch in reference
	from the function imx_audmux_probe() to the function
	.init.text:audmux_debugfs_init()

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-24 11:22:53 +01:00
Nicolin Chen 3dcba280f7 ASoC: core: Don't break component searching if both id and num_dai are 0
The commit e41975ed (ASoC: core: Fix the DAI name getting) added a break
within the "if (id < 0 || id >= pos->num_dai)" while the original design
of the search didn't break the loop if that condition contented but only
mark the ret error and let it go on to search the next component.

In a case like dmaengine which's not a dai but as a component sharing an
identical name with a dai, both the id and pos->num_dai here could be 0.
If we break the search, we may never find the dai we want as it might be
placed behind its dmaengine in the component list.

So this patch fixes the issue above by following the original design to
let the search carry on.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:49:15 +01:00
Daniel Mack b38d10ed60 ASoC: ak4104: add regulator consumer support
The AK4104 has only one power supply, called VDD. Enable it as long as
the codec is in use.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:20:07 +01:00
Jyri Sarha b3ca11ff59 ASoC: simple-card: Move dai-link level properties away from dai subnodes
The properties like format, bitclock-master, frame-master,
bitclock-inversion, and frame-inversion should be common to the dais
connected with a dai-link. For bitclock-master and frame-master
properties to be unambiguous they need to indicate the mastering dai
node with a phandle.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:14:27 +01:00
Jyri Sarha 389cb8348c ASoC: core: Update snd_soc_of_parse_daifmt() interface
Adds struct device_node **bitclkmaster and struct device_node **framemaster
function parameters. With the new syntax bitclock-master and frame-master
properties can explicitly indicate the dai-link bit-clock and frame masters
with a phandle. This patch also makes the minimal changes to simple-card
for it to work with the updated snd_soc_of_parse_daifmt(). Simple-card appears
to be the only user of snd_soc_of_parse_daifmt() for now.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Acked-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 13:14:27 +01:00
Tushar Behera d66eac3e2b ASoC: samsung: Don't clear clock setting during i2s_startup
In exiting kernel, if DAIFMT flags are set in dai_link and I2S is
set to run in master mode, the I2S clocks are not getting configured
resulting in no output.

Existing code clears the current I2S clock settings during i2s_startup
and requires that the clocks are reconfigured. It then assumes that
sound-card driver would call snd_soc_dai_{set_sysclk/set_fmt} to
configure the root clock.

1. Since I2S clock settings remain fixed for a board, it would be better
to set the clocks once during sound-card probe.

2. Also if the DAIFMT flags are set in dai_link, snd_soc_dai_set_fmt is
called during DAI probe.

If both these conditions are true, then I2S clock remains unconfigured
during audio playback. Fix this by removing the code to clear
rclk_srcrate in i2s_startup. Instead, reset this during DAI probe.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 12:30:12 +01:00
Lars-Peter Clausen 0aa2a15a7b ASoC: jz4740: Improve build test coverage
Allow the jz4740 audio drivers to be build when CONFIG_COMPILE_TEST is selected.
This should improve the build test coverage. There is one small piece of
platform dependent code in the jz4740-i2s driver. It uses the DMA request type
constants which are defined in a platform specific header. We can solve this by
moving them from the platform specific header to the I2S driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 12:18:44 +01:00
Lars-Peter Clausen 218e18a372 ASoC: qi_lb60: Use GPIO descriptor API
The new GPIO descriptor API is now the preferred way for handling GPIOs. It also
allows us to separate the platform depended code from the platform independent
code (Which will make it possible to increase build test coverage of the
platform independent code).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 12:18:36 +01:00
Kuninori Morimoto 836b31fe1a ASoC: rsnd: call rsnd_dai_pointer_update() from outside of lock
rsnd_soc_dai_trigger() will be called
after rsnd_dai_pointer_update() function
which is using rsnd_lock().
Thus, it should be called from outside of rsnd_lock().
Kernel will be hangup without this patch.
Special thanks to Kataoka-san

Reported-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 12:17:12 +01:00
Wenkai Du d132cb0a16 ASoC: Intel: Fix audio crash due to race condition in stream deletion
There is a race between sst_byt_stream_free() and sst_byt_get_stream()
if sst_byt_get_stream() called from sst_byt_irq_thread() context is
accessing the byt->stream_list while a stream is deleted from the list.

A stream is added to byt->stream_list in sst_byt_stream_new() and deleted in
sst_byt_stream_free(). sst_byt_get_stream() is always protected by
sst->spinlock, but the stream addition and deletion are not protected.

The patch adds spinlock to both stream addition and deletion.

[Jarkko: Same fix added to sst-haswell-ipc.c too]

Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 12:11:20 +01:00
Tushar Behera c4839c87f5 ASoC: max98095: Add an explicit of_match_table
Create an explicit of_match_table entry for MAX98095 codec. Also
add a binding Documentation for this compatible string.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-23 11:37:27 +01:00
Mark Brown 98810a6dcf Merge remote-tracking branches 'asoc/fix/intel', 'asoc/fix/jz4740', 'asoc/fix/rcar', 'asoc/fix/tlv320aic31xx' and 'asoc/fix/tlv320aic3x' into asoc-linus 2014-04-22 22:01:07 +01:00
Mark Brown 22e0c14280 Merge remote-tracking branches 'asoc/fix/alc5623', 'asoc/fix/cs42l52', 'asoc/fix/cs42l73' and 'asoc/fix/fsl-spdif' into asoc-linus 2014-04-22 22:01:05 +01:00
Mark Brown 31835046be Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2014-04-22 22:01:04 +01:00
Lars-Peter Clausen 1f23380b80 ASoC: Export devm_snd_soc_register_platform()
devm_snd_soc_register_platform() is used in drivers which can be build as
modules, so it needs to be exported to avoid linkers errors like:

	ERROR: "devm_snd_soc_register_platform" [sound/soc/omap/snd-soc-omap.ko] undefined!
	ERROR: "devm_snd_soc_register_platform" [sound/soc/davinci/snd-soc-davinci.ko] undefined!

Fixes: 8931bf620 ("ASoC: Add resource managed snd_soc_register_platform()")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 22:00:42 +01:00
Lars-Peter Clausen 050f62e4de ASoC: qi_lb60: Use devm_snd_soc_register_card()
Makes the code a bit shorter and will also allow us to remove the drivers
remove() callback eventually.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 21:53:21 +01:00
Lars-Peter Clausen 0e746d7b2b ASoC: qi_lb60: Set .dai_fmt instead of calling snd_soc_set_dai_fmt()
Rather than calling snd_soc_set_dai_fmt(), just set the dai_fmt field in the
dai_link struct. Both have the same effect, but the later is a bit shorter and
also allows us to remove the now unused init callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 21:53:21 +01:00
Lars-Peter Clausen b8fb837b0c ASoC: qi_lb60: Set fully_routed flag
The routes for this sound card are fully specified, so set the fully_routed
flag. This allows us to remove the manual snd_soc_dapm_nc_pin() calls.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 21:53:21 +01:00
Lars-Peter Clausen eebdec044e ASoC: jz4740: Remove Makefile entry for removed file
Commit 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver")
jz4740-pcm.c file, but neglected to remove the Makefile entries.

Fixes: 0406a40a0 ("ASoC: jz4740: Use the generic dmaengine PCM driver")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 21:51:58 +01:00
Wenkai Du 95e9ee92e2 ASoC: Intel: Fix audio crash due to negative address offset
There were occasional ADSP crash during reboot testing:

[   11.883364] BUG: unable to handle kernel paging request at ffffc90121700000
[   11.883380] IP: [<ffffffffc024d8bc>] sst_module_insert_fixed_block+0x24f/0x26d [snd_soc_sst_dsp]
[   11.883397] PGD 7800b067 PUD 0
[   11.883405] Oops: 0002 [#1] SMP
[   11.886418] gsmi: Log Shutdown Reason 0x03

The virtual address, ffffc90121700000, was out of range. The virtual
address is calculated by adding LPE base address with an offset:

sst_memcpy32(dsp->addr.lpe + data->offset, data->data, data->size);

The offset is calculated in sst_byt_parse_module, by subtraction of
two virtual addresses dsp->addr.fw_ext and dsp->addr.lpe:

block_data.offset = block->ram_offset + (dsp->addr.fw_ext - dsp->addr.lpe);

These virtual addresses are assigned by kernel from ioremap:

sst->addr.lpe = ioremap(pdata->lpe_base, pdata->lpe_size);
sst->addr.fw_ext = ioremap(pdata->fw_base, pdata->fw_size);

In current driver code, offset is defined as unsigned int32:

struct sst_module_data {
...
	u32 offset;		/* offset in FW file */
};

Most of the time kernel assigned virtual addresses with addr.fw_ext
greater than addr.lpe. But sometimes it was the other way round.

Fix the problem by declaring offset as signed int32_t.

Signed-off-by: Wenkai Du <wenkai.du@intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 19:22:53 +01:00
Lars-Peter Clausen 907fe36a2c ASoC: Move standard kcontrol helpers to the component level
After moving the IO layer inside ASoC to the component level we can now easily
move the standard control helpers also to the component level. This allows to
reuse the same standard helper control implementations for other components.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 13:38:21 +01:00
Mark Brown 9f68730dc8 Merge branch 'topic/multicodec' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-component 2014-04-22 13:38:14 +01:00
Lars-Peter Clausen 111c0cf566 ASoC: Remove ASoC level IO tracing
The ASoC framework is in the process of migrating all IO operations to regmap.
regmap has its own more sophisticated tracing infrastructure for IO operations,
which means that the ASoC level IO tracing becomes redundant, hence this patch
removes them. There are still a handful of ASoC drivers left that do not use
regmap yet, but hopefully the removal of the ASoC IO tracing will be an
additional incentive to switch to regmap.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 13:24:24 +01:00
Lars-Peter Clausen 23d5442be9 ASoC: dapm: Rename soc_widget_update_bits_locked() to soc_widget_update_bits()
There is no unlocked version of soc_widget_update_bits_locked() and there is no
plan to introduce it in the near future, so drop the _locked suffix.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 13:24:24 +01:00
Lars-Peter Clausen b0a9f8e06c ASoC: Remove snd_soc_update_bits_locked()
There are no users of snd_soc_update_bits_locked() left and it is identical to
snd_soc_update_bits(). So it can be removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 13:24:24 +01:00
Lars-Peter Clausen e2c330b9b5 ASoC: Move IO abstraction to the component level
We currently have two very similar IO abstractions in ASoC, one for CODECs, the
other for platforms. Moving this to the component level will allow us to unify
those two. It will also enable us to move the standard kcontrol helpers as well
as DAPM support to the component level.

The new component level abstraction layer is primarily build around regmap.
There is a per component pointer for the regmap instance for the underlying
device. There are four new function snd_soc_component_read(),
snd_soc_component_write(), snd_soc_component_update_bits() and
snd_soc_component_update_bits_async(). They have the same signature as their
regmap counter-part and will internally forward the call one-to-one to regmap.
If the component it not using regmap it will fallback to using the custom IO
callbacks. This is done to be able to support drivers that haven't been
converted to regmap yet, but it is expected that this will eventually be removed
in the future once all component drivers have been converted to regmap.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 13:23:35 +01:00
Mark Brown 2b17ef4071 Merge branches 'topic/sta350', 'topic/core', 'topic/dapm' and 'topic/cache' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-component 2014-04-22 13:22:52 +01:00
Bard Liao 8bfc6d2d1b ASoC: rt5640: Add minimal support for RT5642
We have been using rt5640.c codec driver with RT5642 codec chip before commit
022d21f004 ("ASoC: rt5640: add rt5639 support"). That commits starts using
device ID reading in reset register for adding device specific controls and
routes runtime.

Now since device ID appears to be different between RT5640 and RT5642 the
driver doesn't add those controls and routes that are valid also on RT5642.

Fix this by adding a device ID found by debugging and minimal code for
supporting RT5642.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 12:52:08 +01:00
Peter Ujfalusi b6bb370956 ASoC: davinci-mcasp: Convert to use devm_snd_soc_register_component()
It allows to remove code from the cleanup paths.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-22 12:51:22 +01:00