Commit Graph

17459 Commits

Author SHA1 Message Date
Nicolin Chen 1d70030927 ASoC: fsl_sai: Use snd_pcm_format_width()
Use common helper function snd_pcm_format_width() to make code neater.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:47:24 +00:00
Nicolin Chen 1fb2d9d746 ASoC: fsl_sai: Keep symmetry for clk_enable() and clk_disable()
There are two functions haven't clk_disable_unprepare() if having error.
Thus fix them.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:47:10 +00:00
Xiubo Li dd41e0c4e3 ASoC: simple-card: Add cpu_dai and codec_dai names NULL check
The name of cpu DAI maybe omitted, and then strlen() will lead
kernel panic.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:42:48 +00:00
Xiubo Li dd9f40602e ASoC: fsl-sai: Use snd_soc_dai_init_dma_data()
Makes the code slightly shorter

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:33:10 +00:00
Xiubo Li e5180df396 ASoC: fsl-sai: Use devm_snd_dmaengine_pcm_register()
Makes the code slightly shorter

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:33:10 +00:00
Xiubo Li a6af47ae53 ASoC: fsl-sai: Remove fsl_sai_remove()
There is no need of this function and makes the code slightly shorter

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:33:10 +00:00
Lars-Peter Clausen 5e8154332f ASoC: tegra: Don't set unused struct snd_pcm_hardware fields
The ASoC core assumes that the PCM component of the ASoC card transparently
moves data around and does not impose any restrictions on the memory layout or
the transfer speed. It ignores all fields from the snd_pcm_hardware struct for
the PCM driver that are related to this. Setting these fields in the PCM driver
might suggest otherwise though, so rather not set them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:26:52 +00:00
Lars-Peter Clausen f467a0f513 ASoC: au1x: Don't set unused struct snd_pcm_hardware fields
The ASoC core assumes that the PCM component of the ASoC card transparently
moves data around and does not impose any restrictions on the memory layout or
the transfer speed. It ignores all fields from the snd_pcm_hardware struct for
the PCM driver that are related to this. Setting these fields in the PCM driver
might suggest otherwise though, so rather not set them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-21 14:23:20 +00:00
Takashi Iwai 19570d7477 ALSA: usb-audio: Add a quirk for Plantronics Gamecom 780
Plantronics Gamecom 780 headset has a firmware problem, and when the
FU 0x09 volume is changed, it results in either too loud or silence
except for a very narrow range.  This patch provides a workaround,
ignoring the node, initialize the volume in a sane value and keep
untouched.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65251
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 16:37:02 +01:00
David Henningsson 0f4881dc1f ALSA: hda - Enable subwoofer on Dell Vostro 5460/5470
In this case, there are two DACs, and DAC 0x03 is mono. In order
to make headphones and front speaker use DAC 0x02, and subwoofer use
DAC 0x03, we artificially cut the connection from nodes 0x14 and 0x15
to node 0x03, so they can only use DAC 0x02.

In addition, the 5460 and 5470 differs in the sense that 5470 also
needs a headset mic patch, whereas 5460 has individual detection for
headphone and headset mic.

BugLink: https://bugs.launchpad.net/bugs/1211920
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 16:34:19 +01:00
Lv Zheng d171ebc5b9 ALSA: hda - Fix wrong <acpi/acpi.h> inclusion in Thinkpad ACPI users.
CONFIG_ACPI dependent code should include <linux/acpi.h> instead of
directly including <acpi/acpi.h>.  This patch cleans up such wrong
inclusions for Thinkpad ACPI users.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-20 10:14:05 +01:00
Peter Ujfalusi 626bcacb89 ASoC: twl6040: Remove self managed local reg_cache support
We can rely on mfd driver to manage the register caching via regmap. The
driver still need to cache some registers associated with DL1/2 routes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 18:37:07 +00:00
Peter Ujfalusi 79ae513038 ASoC: twl6040: Remove register restore functionality
The MFD core takes care of the restore via standard regmap API, no need to
do this anymore here.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 18:37:07 +00:00
Peter Ujfalusi 53509108f7 ASoC: twl6040: Custom caching for sensitive DL1/2 path registers
Introduce a small register cache for registers which needs special caching
to reduce pop noise:
TWL6040_REG_HSLCTL, TWL6040_REG_HSRCTL, TWL6040_REG_EARCTL, TWL6040_REG_HFLCTL
and TWL6040_REG_HFRCTL.
Switch over and use the new small cache for these registers instead of the
main reg_cache.
This is in preparation to remove the local ASoC reg_cache from the driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 18:37:06 +00:00
Peter Ujfalusi 0d35d080ac ASoC: twl6040: Rename twl6040_is_path_unmuted -> twl6040_can_write_to_chip
Matches more precisely of the functionality.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 18:37:06 +00:00
Nicolin Chen aafa85e71a ASoC: fsl_ssi: Add DAI master mode support for SSI on i.MX series
This patch adds three main functions for DAI master mode: set_dai_fmt(),
set_dai_sysclk() and set_dai_tdm_slot(), and one essential baud clock
accordingly. After appending this patch, the fsl_ssi driver on i.MX series
has the ability to derive LRCLK and BCLK from baud clock source so as to
support some audio Codecs which can only be used in slave mode.

Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 15:03:52 +00:00
Matthew Garrett 05004cb4cd ASoC: fsl/mxs: Remove unnecessarily gendered language
The kernel as a number of cases of gendered language. The majority of these
refer to objects that don't have gender in English, and so I've replaced
them with "it" and "its". Some refer to people (developers or users), and
I've replaced these with the singular "they" variant. Some are simply
typos that I've fixed up.

I've left cases where gendered language was used to refer to specific
individuals, was a quote or is part of license text.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 15:03:37 +00:00
Takashi Iwai d8f66c71d5 ALSA: hda - Add warning texts when codec driver Kconfig doesn't match
When a Kconfig of a codec driver doesn't match with the controller
(CONFIG_SND_HDA_INTEL), it'll result in the non-working automatic
probing.  Unfortunately kbuild can't give such a restriction, but at
least, it's possible to show a warning if such a condition is found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 15:09:14 +01:00
Takashi Iwai 2698ea9805 ALSA: hda - Kill EXPORT_SYMBOL_HDA()
Replace all with the standard EXPORT_SYMBOL_GPL().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 14:36:19 +01:00
Takashi Iwai 595fe1b702 ALSA: hda - Make CONFIG_SND_HDA_CODEC_* tristate
So far, CONFIG_SND_HDA_CODEC_* kconfigs have been booleans due to
historical reasons.  The major reason was that the automatic codec
driver probing wouldn't work if user sets a codec driver as a module
while the controller driver as a built-in.  And, another reason was to
avoid exporting symbols of the helper codes when all drivers are built
in.

But, this sort of "kindness" rather confuses people in the end,
especially makes the config refinement via localmodconfig unhappy.
Also, a codec module would still work if you re-bind the controller
driver via sysfs (although it's no automatic loading), so there might
be a slight use case.

That said, better to let people fallen into a pitfall than being too
smart and restrict something.  Let's make things straightforward: now
all CONFIG_SND_HDA_CODEC_* become tristate, and all symbols exported
unconditionally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-19 14:36:11 +01:00
Takashi Iwai 356f402da0 ASoC: Fixes for v3.13
The fixes here are all driver specific ones, none of which particularly
 stand out but all of which are useful to users of those drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQIcBAABAgAGBQJSstRwAAoJELSic+t+oim9zPcP/3bbMKIGKrRhnkGrYWrJQqBS
 NVj327bouHo8TwvW/PDrApY9QOXMxv9Z5GMeazJJ4Y6rOZ/zYVOpO1kU6vwGZ+so
 GMtMGFzV5+aF0Rvud+YAKFFV6uj/hkP08YKt9tDFAXBia/Ff8MVdvCW1xt1a6wO4
 En+tmZKenhELKjtbnhpfCZClcFLYZxmtYR94Tr3NvzaIDMG0cdR5hKF8V93Wr66v
 mCyBG8AblRoWklKNoB2UXJup9/xDR1yggaCq8ObSRbNfs8Zxso6fN7LrqjWuNz7w
 Yvh/UiRNqWjcrmihaqRvt0KayEXF5ZSvTUB0U7InYmeZZArITMIJ2Z/BXzi1SazG
 /kCg9qkNigeUYMpJPDOm71SKjvzSB1mL+Eol/5wC/GxmdFMEriKf5ob7D3Kq1zR+
 c83bZZqK+663OXTdmASTB5wDAyDqwHBFVdOQlY4s8L11nP/bHDgeiRAcni4wdfOW
 xovgyPY+PMGFJBfqqvoXShNtDsp2gMDhWYDrH9vUvwUQAhdikPbfEU9KhlOfEpiv
 /HMD3r0VKbsstBhE9CE5dnmketQNHPDBkBCzhoFmKOQPKhR9lBwNkLiLQEYfvWaB
 omg0vPUubTb+EN6lechRoPYI/s6+mZ+nBaj3skI3MUcqfsegL7QLl6O4RNlCOFD9
 S83sp2o6MK1qHspj1MP4
 =pOaJ
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v3.13

The fixes here are all driver specific ones, none of which particularly
stand out but all of which are useful to users of those drivers.
2013-12-19 12:22:11 +01:00
Mark Brown 96b7fe0119 Merge remote-tracking branches 'asoc/fix/adsp', 'asoc/fix/arizona', 'asoc/fix/atmel', 'asoc/fix/fsl', 'asoc/fix/kirkwood', 'asoc/fix/tegra', 'asoc/fix/wm8904' and 'asoc/fix/wm8962' into asoc-linus 2013-12-19 10:25:27 +00:00
Mark Brown 3c19a0a2bd Merge remote-tracking branch 'asoc/fix/dma' into asoc-linus 2013-12-19 10:25:27 +00:00
Mark Brown 6da37d470b Merge remote-tracking branch 'asoc/fix/core' into asoc-linus 2013-12-19 10:25:26 +00:00
Xiubo Li e1acb40a3a ASoC: simple-card: Use devm_snd_soc_register_card()
Makes the code slightly shorter.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 10:23:04 +00:00
Charles Keepax 56d37d8543 ASoC: wm5110: Add support for ASRC RATE 1
Add support for configuring the sample rate on the SYSCLK side of the
ASRC.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 10:20:31 +00:00
Charles Keepax fbedc8cbc3 ASoC: wm5110: Add FSH for ISRCs
Currently, the driver only supports configuration of the lower sample
rate (FSL) on the ISRCs. With the higher rate being fixed a SYSCLK, this
patch adds support for configuring the higher sample rate (FSH).

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 10:20:31 +00:00
Charles Keepax a4c0d2735c ASoC: wm5110: Expose switch controls for DRE
Certain use-cases require the DRE to be disabled so expose controls for
the enables.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-19 10:17:51 +00:00
Stephen Warren e1771bcf99 ASoC: SPEAr: remove custom DMA alloc compat function
spear_pcm_request_chan() is almost identical to
dmaengine_pcm_compat_request_channel(), with the exception that the
latter:

a) Assumes that the DAI DMA data is a struct snd_dmaengine_dai_dma_data
   pointer rather than some custom type.

b) dma_data->filter_data rather than dma_data should be passed to
   snd_dmaengine_pcm_request_channel() as the filter data.

Make minor changes to the SPEAr DAI drivers so that those two conditions
are met. This allows removal of the custom .compat_request_channel().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:55:06 +00:00
Stephen Warren ede38884ac ASoC: SPEAr: get rid of spear-pcm-audio struct device
Modify the SPEAr PCM driver so that it's a utility library that can be
registered on each DAI, rather than a separate struct device. This is
more in line with how many recent DT-converted platforms operate, and
avoids the need for yet another struct device.

This is also required as a pre-cursor to removing
spear_pcm_request_chan().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:55:02 +00:00
Stephen Warren a8983d4b0a ASoC: ep93xx: remove custom DMA alloc compat function
ep93xx_compat_request_channel() is almost identical to
dmaengine_pcm_compat_request_channel(), with the exception that the
latter:

a) Assumes that the DAI DMA data is a struct snd_dmaengine_dai_dma_data
   pointer rather than some custom type.

b) dma_data->filter_data rather than dma_data should be passed to
   snd_dmaengine_pcm_request_channel() as the filter data.

Make minor changes to the ep93xx DAI drivers so that those two conditions
are met. This allows removal of the custom .compat_request_channel().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:54:03 +00:00
Stephen Warren 6f2032a189 ASoC: ep93xx: get rid of ep93xx-pcm-audio struct device
Modify the ep93xx PCM driver so that it's a utility library that can be
registered on each DAI, rather than a separate struct device. This is
more in line with how many recent DT-converted platforms operate, and
avoids the need for yet another struct device.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:54:00 +00:00
Shawn Guo 11db0da831 ASoC: sgtl5000: clean up sgtl5000_enable_regulators()
Function sgtl5000_enable_regulators() is somehow odd in handling the
optional external VDDD supply.  The driver can only enable this supply
on SGTL5000 chip before revision 0x11, and of course when this external
VDDD is present.  It currently does something like below.

1. Check if regulator_bulk_get() on VDDA, VDDIO and VDDD will fail.  If
   it fails, VDDD must be absent and it falls on internal LDO by calling
   sgtl5000_replace_vddd_with_ldo().  Otherwise, VDDD is used.  And in
   either case, regulator_bulk_enable() will be called to enable
   3 supplies.

2. In case that SGTL5000 revision is later than 0x11, even if external
   VDDD is present, it has to roll back the 'enable' and 'get' calls
   with regulator_bulk_disable() and regulator_bulk_free(), and starts
   over again by calling sgtl5000_replace_vddd_with_ldo() and
   regulator_bulk_enable().

Such back and forth calls sequence is complicated and unnecessary.
Also, since commit 4ddfebd (regulator: core: Provide a dummy regulator
with full constraints), regulator_bulk_get() will always succeeds
because of the dummy regulator.  Thus the VDDD detection is broken.

The patch changes the flow to something like the following, which should
be more reasonable and clear, and also fix the VDDD detection breakage.

1. Check if we're running a chip before revision 0x11, on which an
   external VDDD can possibly be an option.

2. If it is an early revision, call regulator_get_optional() to detect
   whether an external VDDD supply is available.

3. If external VDDD is present, call sgtl5000_replace_vddd_with_ldo() to
   update sgtl5000->supplies info.

4. Drop regulator_bulk_get() call in sgtl5000_replace_vddd_with_ldo(),
   and call it in sgtl5000_enable_regulators() no matter it's an
   external VDDD or internal LDO.

5. Call regulator_bulk_enable() to enable these 3 regulators.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:49:17 +00:00
Xiubo Li 4355082149 ASoC: Add SAI SoC Digital Audio Interface driver.
This adds Freescale SAI ASoC Audio support.
This implementation is only compatible with device tree definition.
Features:
o Supports playback/capture
o Supports 16/20/24 bit PCM
o Supports 8k - 96k sample rates
o Supports master and slave mode.

Signed-off-by: Alison Wang <b18965@freescale.com>
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 18:27:59 +00:00
Mark Brown dd407a3243 ASoC: fsl/mxs: Remove unnecessarily gendered language
The kernel as a number of cases of gendered language. The majority of these
refer to objects that don't have gender in English, and so I've replaced
them with "it" and "its". Some refer to people (developers or users), and
I've replaced these with the singular "they" variant. Some are simply
typos that I've fixed up.

I've left cases where gendered language was used to refer to specific
individuals, was a quote or is part of license text.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 13:51:32 +00:00
David Henningsson da4a7a3926 ALSA: hda - Explicitly keep codec powered up in hdmi_present_sense
This should help us avoid the following mutex deadlock:

[] mutex_lock+0x2a/0x50
[] hdmi_present_sense+0x53/0x3a0 [snd_hda_codec_hdmi]
[] generic_hdmi_resume+0x5a/0x70 [snd_hda_codec_hdmi]
[] hda_call_codec_resume+0xec/0x1d0 [snd_hda_codec]
[] snd_hda_power_save+0x1e4/0x280 [snd_hda_codec]
[] codec_exec_verb+0x5f/0x290 [snd_hda_codec]
[] snd_hda_codec_read+0x5b/0x90 [snd_hda_codec]
[] snd_hdmi_get_eld_size+0x1e/0x20 [snd_hda_codec_hdmi]
[] snd_hdmi_get_eld+0x2c/0xd0 [snd_hda_codec_hdmi]
[] hdmi_present_sense+0x9a/0x3a0 [snd_hda_codec_hdmi]
[] hdmi_repoll_eld+0x34/0x50 [snd_hda_codec_hdmi]

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-18 12:40:45 +01:00
Hui Wang 3a6c5d8ad0 ALSA: hda - Add Dell headset detection quirk for one more laptop model
On the Dell machines with codec whose Subsystem Id is 0x10280640,
no external microphone can be detected when plugging a 3-ring headset.
Using ALC255_FIXUP_DELL1_MIC_NO_PRESENCE can fix this problem.

The codec (Vendor ID: 0x10ec0255) on the machine belongs to alc_269
family.

BugLink: https://bugs.launchpad.net/bugs/1260303
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>
2013-12-18 12:40:29 +01:00
Bo Shen f0199bc5e3 ASoC: wm8904: fix DSP mode B configuration
When wm8904 work in DSP mode B, we still need to configure it to
work in DSP mode. Or else, it will work in Right Justified mode.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-18 11:30:50 +00:00
Charles Keepax 939fd1e8d9 ASoC: wm_adsp: Add small delay while polling DSP RAM start
Some devices are getting very close to the limit whilst polling the RAM
start, this patch adds a small delay to this loop to give a longer
startup timeout.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-18 11:22:25 +00:00
Charles Keepax 5095f55d7c ASoC: wm_adsp: Remove duplicate info message for DSP RAM ready
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-18 11:22:09 +00:00
JongHo Kim ed697e1aaf ALSA: Add SNDRV_PCM_STATE_PAUSED case in wait_for_avail function
When the process is sleeping at the SNDRV_PCM_STATE_PAUSED
state from the wait_for_avail function, the sleep process will be woken by
timeout(10 seconds). Even if the sleep process wake up by timeout, by this
patch, the process will continue with sleep and wait for the other state.

Signed-off-by: JongHo Kim <furmuwon@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-17 16:56:11 +01:00
Jean-Francois Moine 02fc17c102 ASoC: kirkwood: Fix the CPU DAI rates
This patch fixes the rates declared in the CPU DAI parameters:
- SNDRV_PCM_RATE_KNOT and the discrete rates SNDRV_PCM_RATE_xxx should
  not be used with SNDRV_PCM_RATE_CONTINUOUS,
- SNDRV_PCM_RATE_CONTINUOUS asks for rate_min and rate_max,
- the device may do streaming down to 5512Hz.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-17 14:10:17 +00:00
Lucas Stach 58e354be33 ASoC: tegra: Tweak matching of AC97 components
Matching works completely based on the cpu of_node.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-17 13:55:07 +00:00
Charles Keepax 280484e708 ASoC: wm5110: Correct HPOUT3 DAPM route typo
Reported-by: Kyung-Kwee Ryu <kyung-kwee.ryu@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-17 13:51:12 +00:00
Qiao Zhou 48b752ac2f ASoC: mmp-pcm: config pcm slave via generic dmaengine
use snd_dmaengine_pcm_prepare_slave_config to set slave config,
and remove the max_burst_size = 4 hard code.

select SND_SOC_GENERIC_DMAENGINE_PCM for mmp-pcm.

Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-17 12:48:45 +00:00
Mark Brown 1f4fe272f0 ASoC: wm8997: Use async writes
When writing the patch write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-12-17 11:35:11 +00:00
Mark Brown 959e4083cd ASoC: wm5110: Use async writes
When writing the patch write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.

Signed-off-by: Mark Brown <broonie@linaro.org>
Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-12-17 11:35:07 +00:00
Mark Brown bd4893492b ASoC: wm5102: Use async writes
When writing the patch write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.

Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-12-17 11:35:01 +00:00
Mark Brown 3c43c69537 ASoC: arizona: Use async writes
Where possible write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.

Signed-off-by: Mark Brown <broonie@linaro.org>
Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-12-17 11:34:39 +00:00
Xiubo Li 2b67f8ba41 ASoC: dmaengine: Add config parameter NULL check.
Because the "ASoC: dmaengine-pcm: Provide default config" has provided
us one defualt config of DMA. When using this, the config parameter of
devm_snd_dmaengine_pcm_register() will be NULL, so here we need to have
a check before using it.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-17 11:17:56 +00:00
Fengguang Wu bbe580302d ASoC: axi-spdif: Use devm_ioremap_resource() instead of devm_request_and_ioremap()
devm_request_and_ioremap() has been deprecated in favour of
devm_ioremap_resource(). Fixes the following coccinelle warning:

	sound/soc/adi/axi-spdif.c:194:8-32: ERROR: deprecated devm_request_and_ioremap() API used on line 194

Generated by: coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 20:45:43 +00:00
Fengguang Wu 7fd7a48bd5 ASoC: axi-spdif: Use devm_ioremap_resource() instead of devm_request_and_ioremap()
devm_request_and_ioremap() has been deprecated in favour of
devm_ioremap_resource(). Fixes the following coccinelle warning:

	sound/soc/adi/axi-i2s.c:195:8-32: ERROR: deprecated devm_request_and_ioremap() API used on line 195

Generated by: coccinelle/api/devm_ioremap_resource.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 20:45:39 +00:00
Shawn Guo 252e91ff10 ASoC: sgtl5000: read chip revision for once
Store chip revision in struct sgtl5000_priv when sgtl5000_i2c_probe()
reads it out from register, so that we can use it in
sgtl5000_enable_regulators() with no need to read register again.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 20:14:44 +00:00
Nenghua Cao 5276597667 ASoC: dapm: update DPCM runtime when mixer/mux changes
DPCM can dynamically alter the FE to BE PCM links at runtime based
on mixer/mux setting updates. Add soc_dpcm_runtime_update() calling in
get/put function for mixer/mux to support this feature.

Signed-off-by: Nenghua Cao <nhcao@marvell.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 20:13:50 +00:00
Wei Yongjun 753834cb59 ASoC: tegra20-ac97: add missing clk_disable_unprepare() on error path
Add the missing clk_disable_unprepare() before return from
tegra20_ac97_platform_probe() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-16 18:37:27 +00:00
Takashi Iwai d09476018b Merge branch 'for-linus' into for-next 2013-12-16 15:53:52 +01:00
Takashi Iwai afdcd431ce ASoC: Fixes for v3.13
A few driver and error handling fixes plus a fix to ensure that we
 mute streams when we should.  The Atmel trigger addition is a fix to
 ensure that we do the correct sequence of interactions with the
 hardware.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQIcBAABAgAGBQJSqw2GAAoJELSic+t+oim99qEQAIuy+UMY0xpOPMjuRlI+OMo0
 d/BRK6icfJXWJMVNEjUvjYJBsX6okOddKc2hKAjeOL3S1mqkFrvH+mH/Ub6LsY3E
 GvOe/aV6hcrtQj7FJ0dABRWAeK8OquUGq9LTlGF34iLOhWbvogDLl+t4BNrSmSnz
 QWLLOB6aW34t0VOrAGKxwcQ6cfFGHp9n5PgSV7QWdUopyTYbjpFoeHhVk1UREr4i
 vo5PsGkWqF5SMkMRDTV8Li2u8Ntz4xwWQ+RWiFzDMUUVkDDTznRVM1YpYzaZZ2+3
 hB6dc+gcxsTDltgjKc1xWo7yDY9auAhvwdiTpbTV+jgYMgOwR9iAM2n4g14RstsW
 Hqo6ecwd9MoGzrCrAxksM4BIr5PYAYaD/suvDXpSQEk7Ap/KhWC/r3e3j+tKIwbw
 0EgOxR/QpEG2EJGYLBFUPDP+p1tG1M+v4zdfCsvULccoELMfrlTRXsLno2SdwtSC
 K7lmzaJOYUbqmTyuj9PJEAeGKHL4aOrCZyezULPT2CNA9HkvwwZFpyMwQFyb8T3E
 W7b0uDKJYnSlbHdwgLHPVeN1PCX/B1qCYneNsky6z37dx1ou2pkspsGFrw/d8Rpl
 pe7Hkg1kjrmscc21ugCGbRcONWA2AFkP6Zb39l0qcMPLTj65AzJLMLTeMm9adnhs
 xZqsNJ5018OZhRBZyknO
 =xcNc
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v3.13

A few driver and error handling fixes plus a fix to ensure that we
mute streams when we should.  The Atmel trigger addition is a fix to
ensure that we do the correct sequence of interactions with the
hardware.
2013-12-13 14:54:53 +01:00
Hui Wang c29cb5eb81 ALSA: hda - Add Dell headset detection quirk for three laptop models
On the Dell machines with codec whose Subsystem Id is 0x10280610,
0x10280629 or 0x1028063e, no external microphone can be detected when
plugging a 3-ring headset. If we add "model=dell-headset-multi" for
the snd-hda-intel.ko, the problem will disappear.

The codecs on these machines belong to alc_269 family.

BugLink: https://bugs.launchpad.net/bugs/1260303
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>
2013-12-13 09:40:31 +01:00
David Henningsson 693e0cb052 ALSA: hda - Add enable_msi=0 workaround for four HP machines
While enabling these machines, we found we would sometimes lose an
interrupt if we change hardware volume during playback, and that
disabling msi fixed this issue. (Losing the interrupt caused underruns
and crackling audio, as the one second timeout is usually bigger than
the period size.)

The machines were all machines from HP, running AMD Hudson controller,
and Realtek ALC282 codec.

Cc: stable@vger.kernel.org
BugLink: https://bugs.launchpad.net/bugs/1260225
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-12 17:46:39 +01:00
Mark Brown e20ab019e2 Merge remote-tracking branches 'asoc/fix/atmel', 'asoc/fix/fsl', 'asoc/fix/tegra' and 'asoc/fix/wm8962' into asoc-linus 2013-12-12 00:30:04 +00:00
Mark Brown caa3df8f46 Merge remote-tracking branch 'asoc/fix/dma' into asoc-linus 2013-12-12 00:30:04 +00:00
Mark Brown 2ff7085046 Merge remote-tracking branch 'asoc/fix/core' into asoc-linus 2013-12-12 00:30:03 +00:00
Mark Brown d37bdf736d ASoC: samsung: Use ASoC dmaengine code where possible
Since all Exynos platforms have been converted to dmaengine and many of
the older platforms are in the process of conversion they do not need to
use the legacy s3c-dma APIs for DMA but can instead use the standard ASoC
dmaengine helpers. This both allows them to benefit from improvements
implemented in the generic code and supports multiplatform.

This patch includes some fixes from Padma for Exynos SoCs, her testing
was on a slightly earlier version of the patch due to unrelated breakage
preventing testing.

Signed-off-by: Mark Brown <broonie@linaro.org>
Tested By: Padmavathi Venna <padma.v@samsung.com>
2013-12-12 00:29:00 +00:00
Mark Brown 3688569e81 ASoC: samsung: Provide helper for DMA init
In preparation for using the dmaengine helpers in ASoC rather than the
dmaengine wrappers for the Samsung API wrap the configuration of dma_data.
The dmaengine code expects different data to that used by the legacy API.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-12 00:28:57 +00:00
Stephen Warren e9036c2a60 ASoC: dmaengine: fix deferred probe detection
Check the return value of dma_request_slave_channel_reason() to see if
deferred probe happens, not the variable the return value will be
assigned to later.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 5eda87b890 ("ASoC: dmaengine: support deferred probe for DMA channels")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-11 22:45:36 +00:00
Stephen Warren 5eda87b890 ASoC: dmaengine: support deferred probe for DMA channels
Enhance dmaengine_pcm_request_chan_of() to support deferred probe for
DMA channels, by using the new dma_request_slave_channel_or_err() API.
This prevents snd_dmaengine_pcm_register() from succeeding without
acquiring DMA channels due to the relevant DMA controller not yet being
registered.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-11 11:15:05 +00:00
Kuninori Morimoto a073278228 ASoC: fsi: remove original filter from fsi_dma_probe()
Remove original filter from fsi_dma_probe(),
and use SH-DMA suitable filter.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-11 11:07:56 +00:00
Takashi Iwai 3690739b01 ALSA: hda - Add static DAC/pin mapping for AD1986A codec
AD1986A codec is a pretty old codec and has really many hidden
restrictions.  One of such is that each DAC is dedicated to certain
pin although there are possible connections.  Currently, the generic
parser tries to assign individual DACs as much as possible, and this
lead to two bad situations: connections where the sound actually
doesn't work, and connections conflicting other channels.

We may fix this by trying to find the best connections more harder,
but as of now, it's easier to give some hints for paired DAC/pin
connections and honor them if available, since such a hint is needed
only for specific codecs (right now only AD1986A, and there will be
unlikely any others in future).

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66621
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-11 07:16:20 +01:00
Hui Wang 7dca4bc6f3 ALSA: hda - One more Dell headset detection quirk
On the Dell machines with codec whose Subsystem Id is 0x10280624,
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/bugs/1259790
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>
2013-12-11 07:12:55 +01:00
Anssi Hannula c9a6338aec ALSA: hda - hdmi: Fix IEC958 ctl indexes for some simple HDMI devices
In case a single HDA card has both HDMI and S/PDIF outputs, the S/PDIF
outputs will have their IEC958 controls created starting from index 16
and the HDMI controls will be created starting from index 0.

However, HDMI simple_playback_build_controls() as used by old VIA and
NVIDIA codecs incorrectly requests the IEC958 controls to be created
with an S/PDIF type instead of HDMI.
In case the card has other codecs that have HDMI outputs, the controls
will be created with wrong index=16, causing them to e.g. be unreachable
by the ALSA "hdmi" alias.

Fix that by making simple_playback_build_controls() request controls
with HDMI indexes.

Not many cards have an affected configuration, but e.g. ASUS M3N78-VM
contains an integrated NVIDIA HDA "card" with:
- a VIA codec that has, among others, an S/PDIF pin incorrectly
  labelled as an HDMI pin, and
- an NVIDIA MCP7x HDMI codec.

Reported-by: MysterX on #openelec
Tested-by: MysterX on #openelec
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org> # 3.8+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-11 07:12:07 +01:00
Paul Walmsley 337bb336b9 ALSA: atmel_abdac: clk_round_rate() can return a zero upon error
Treat both negative and zero return values from clk_round_rate()
as errors.  This is needed since subsequent patches will convert
clk_round_rate()'s return value to be an unsigned type, rather
than a signed type, since some clock sources can generate rates higher
than (2^31)-1 Hz.

Eventually, when calling clk_round_rate(), only a return value of
zero will be considered a error; all other values will be
considered valid rates.  The comparison against values less than
0 is kept to preserve the correct behavior in the meantime.

Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 21:19:49 +01:00
Paul Walmsley f62438ac53 ALSA: at73c213: clk_round_rate() can return a zero upon error
Treat both negative and zero return values from clk_round_rate()
as errors.  This is needed since subsequent patches will convert
clk_round_rate()'s return value to be an unsigned type, rather
than a signed type, since some clock sources can generate rates higher
than (2^31)-1 Hz.

Eventually, when calling clk_round_rate(), only a return value of
zero will be considered a error.  All other values will be
considered valid rates.  The comparison against values less than
0 is kept to preserve the correct behavior in the meantime.

Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 21:19:47 +01:00
Takashi Iwai ebb93c057d ALSA: hda - Mute all aamix inputs as default
Not all channels have been initialized, so far, especially when aamix
NID itself doesn't have amps but its leaves have.  This patch fixes
these holes.  Otherwise you might get unexpected loopback inputs,
e.g. from surround channels.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 21:16:50 +01:00
Peter Ujfalusi ae726e9394 ASoC: davinci-mcasp: Support for fck reparenting
Optional DT property to specify the desired parent clock for the McASP fck
clock.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:25 +00:00
Peter Ujfalusi b14899da9d ASoC: davinci-mcasp: Correct am33xx snd_platform_data name
An earlier patch overlooked this when the compatible has been changed from
omap2 -> am33x.
Rename omap2_mcasp_pdata to am33xx_mcasp_pdata.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:17 +00:00
Peter Ujfalusi f68205a7f8 ASoC: davinci-mcasp: Change IO functions parameter list
Instead of passing __iomem address (mcasp->base + register_offset) pass
the main mcasp structure and only access the mcasp->base in the low level
IO functions.
In most cases this helps with code readability and it will make it easier
to switch over to regmap in the future.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 453c499028 ASoC: davinci-mcasp: Support for McASP version found in DRA7xx
The IP in DRA7xx is similar to the IP found in TI81xxAM3xxx/AM4xxx type of
SoCs but it is is integrated with sDMA instead of eDMA. The suitable pcm
driver for DRA7xx is the omap-pcm driver which is using dmaengine.
In the driver we can configure both dma related structures used for eDMA and
sDMA. The only thing we need to make sure that we set the correct dma_data
at startup with snd_soc_dai_set_dma_data()

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 4dcb5a0bff ASoC: davinci-mcasp: Fix synchronous master receive mode
In synchronous mode both transmit and receive sections are using the TX
clocks. In setup like this the TX clocks need to be enabled when capture
is running.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi cbc7956c81 ASoC: davinci-mcasp: Data source (bus) selection support
The audio data to/from McASP can be sent/received via two method:
Via the data port (preferred) or via the configuration bus.
Currently the driver assumes that all data communication will be done via
the data port.
This patch adds support for selecting the configuration port as data
interface.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 487dce8823 ASoC: davinci-mcasp: Simplify FIFO configuration code
The FIFO registers base address is different in dm646x compared to newer
SoCs with McASP IP. Instead of using two paths (switch/case) to handle the
difference we can simply pick the correct base address beforehand and use
offsets to address the register we need to configure.
With this change the indentation depth can be reduced as well.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 8f113b77b5 ASoC: davinci-mcasp: Be consistent with the use of base in davinci_mcasp_set_dai_fmt
Replace mcasp->base use with plain base in the davinci_mcasp_set_dai_fmt()
function since it has been already used by the remaining part of the function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 70091a3e6a ASoC: davinci-mcasp: Rename private struct and it's users (dev -> mcasp)
Rename the private struct from davinci_audio_dev to davinci_mcasp.
Change the local use of the pointer to this struct from *dev to *mcasp.

The aim is to have better readable code for the first look since having
dev->xxxx in the code when using the local private struct is a bit
surprising.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi eba0ecf067 ASoC: davinci-mcasp: Do not inline the mcasp_set_ctl_reg function
It brings no benefit to inline this function due to it's size and function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 57f439b867 ASoC: davinci-mcasp: Remove unused DAVINCI_MCASP_NUM_SERIALIZER define
It is not used in the code.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:16 +00:00
Peter Ujfalusi 21400a72d6 ASoC: davinci-mcasp: Move private struct definition to source file
Since it is a private struct strictly used by the davinci-mcasp driver it
can be moved from header file to the source file.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi 02e08d9b6b ASoC: davinci-mcasp: Move register definitions to header file
It is better for readability to have the register definitions out from the
source file.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi 58e48d9774 ASoC: davinci-mcasp: Correct dai driver struct initialization for 2nd dai
Add .name when assigning the dai name.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi 18f9350662 ASoC: davinci-mcasp: Remove unused DAVINCI_MCASP_I2S/DIT_DAI defines
These are not used, probably leftovers from the past.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi ed29cd5e8d ASoC: davinci-mcasp: Move DAVINCI_MCASP_RATE from header to source file
It is not used outside of the .c file.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi d38970e136 ASoC: davinci-evm: Switch to use .dai_fmt of snd_soc_dai_link(s)
Specify the dai formats to use within the snd_soc_dai_link structures. In
this way we can remove the code dealing with the dai format configuration
from the machin driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi 7b6a772932 ASoC: davinci-evm: Do not include davinci-mcasp.h
There's no need to include this header file here.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi a42efd97f7 ASoC: davinci: kconfig: Prepare for AM43xx support
AM43xx have the same McASP IP as AM33xx and both platform uses eDMA. Modify
the Kconfig so it will be possible to add audio support for AM43xx based
boards later.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi c3238a4c05 ASoC: davinci: Kconfig/Makefile: Generic EVM machine driver related cleanup
We have several boards using the same machine driver for audio support.
All of these machines can select a generic machine driver config option to
build the needed driver while keeping the config options used within the
driver for compile time code path selection.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:15 +00:00
Peter Ujfalusi 860d0c0dd2 ASoC: davinci: Kconfig: Remove help section for SND_DAVINCI_SOC
The help text is misleading and the prompt itself explains the purpose of
this config section.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 11:22:14 +00:00
Kuninori Morimoto 1a1c75a798 ASoC: rsnd: gen: fixup Gen2 channel size
Gen2 has 0 - 9, total 10 channels, not 9 channels.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-10 10:21:51 +00:00
Hui Wang 0dfb9809e9 ALSA: hda - Another Dell headset detection quirk
On the Dell Inspiron 3045 machine (codec Subsystem Id: 0x10280628),
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/hwe-somerville/+bug/1259437
CC: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 09:02:58 +01:00
Hui Wang 6c6eb4270c ALSA: hda - A Dell headset detection quirk
On the Dell Optiplex 3030 machine (codec Subsystem Id: 0x10280623),
no external microphone can be detected when plugging a 3-ring
headset. If we add "model=dell-headset-multi" for the
snd-hda-intel.ko, the problem will disappear.

BugLink: https://bugs.launchpad.net/hwe-somerville/+bug/1259435
CC: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-10 09:02:49 +01:00
Stephen Warren 194c7dea00 ASoC: dmaengine: add custom DMA config to snd_dmaengine_pcm_config
Add fields to struct snd_dmaengine_pcm_config to allow custom:

- DMA channel names.

  This is useful when the default "tx" and "rx" channel names don't
  apply, for example if a HW module supports multiple channels, each
  having different DMA channel names. This is the case with the FIFOs
  in Tegra's AHUB. This new facility can replace
  SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME.

- DMA device

  This allows requesting DMA channels for a device other than the device
  which is registering the "PCM" driver. This is quite unusual, but is
  currently useful on Tegra. In much HW, and in Tegra20, each DAI HW
  module contains its own FIFOs which DMA writes to. However, in Tegra30,
  the DMA FIFOs were split out AHUB HW module, which then routes the data
  through a cross-bar, and into the DAI HW modules. However, the current
  ASoC driver structure does not expose this detail, and acts as if the
  FIFOs are still part of the DAI HW modules. Consequently, the "PCM"
  driver is registered with the DAI HW module, yet the DMA channels must
  be looked up in the AHUB HW module's device tree node. This new config
  field allows that to happen. Eventually, the Tegra drivers will be
  reworked to fully expose the AHUB, and this config field can be
  removed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 18:45:01 +00:00
Mark Brown a715d01e9c Merge remote-tracking branch 'asoc/fix/dma' into asoc-dma 2013-12-09 18:44:55 +00:00
Stephen Warren 6b9f3e6528 ASoC: don't leak on error in snd_dmaengine_pcm_register
If snd_dmaengine_pcm_register()'s call to snd_soc_add_platform() fails,
all objects allocated during registration are leaked. Fix this by adding
error-handling code.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 18:43:06 +00:00
Stephen Warren 11b3a7add2 ASoC: restructure dmaengine_pcm_request_chan_of()
Restructure the internals of dmaengine_pcm_request_chan_of() as a loop
over all channels to be allocated. This makes it easier to add logic
that applies to all allocated channels, without having to duplicate that
logic in each of the half-duplex/full-duplex paths.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 18:42:27 +00:00
Jan Weitzel 58381da687 ASoC: tlv320aic3x: no mono controls 3007 model
if codec driver is used for AIC3X_MODEL_3007 the mono iout controls overwrite
registers for class-d amplifier.
classd amplifier controls are only used for AIC3X_MODEL_3007.

Removing all mono snd_kcontrol_new, snd_soc_dapm_widget, snd_soc_dapm_route
and aic3x_init stuff from common code and call only for not AIC3X_MODEL_3007
codecs.

Testet only with AIC3X_MODEL_3007

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 18:00:38 +00:00
Lars-Peter Clausen 429e4374cc ASoC: Add support for the Analog Devices AXI-SPDIF driver
This patch adds a ASoC driver for the AXI-SPDIF softcore. The core implements a
simple SPDIF transmitter and is used on some Analog Devices' reference designs
for various FPGA platforms. For now the driver only support the PL330 as the the
DMA controller.

The driver uses the generic PCM dmaengine driver for its PCM. The only
restriction is that we need to set the SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag as
the dmaengine driver for the DMA core (PL330) that is used with this core has no
residue reporting capabilities yet. This will be fixed in the future though.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 17:57:36 +00:00
Lars-Peter Clausen 8f2fe34682 ASoC: Add support for the Analog Devices AXI-I2S core
This patch adds support for the AXI-I2S softcore. The core implements a simple
bidirectional I2S transceiver and is used by Analog Devices in some of their
reference designs for various FPGA platforms.

The driver uses the generic PCM dmaengine driver for its PCM. The only
restriction is that we need to set the SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag as
the dmaengine driver for the DMA core (PL330) that is used with this core has no
residue reporting capabilities yet. This will be fixed in the future though.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 17:57:35 +00:00
Nicolin Chen 5dfc03f141 ASoC: fsl: imx-wm8962: Don't update bias_level in machine driver
If we update it here, the set_bias_level() of Codec driver won't be normally
called and we will then miss some essential procedures in set_bias_level() of
the Codec driver. Thus drop it.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 17:51:00 +00:00
Stephen Warren 241bf43321 ASoC: tegra: fix uninitialized variables in set_fmt
In tegra*_i2s_set_fmt(), in the (fmt == SND_SOC_DAIFMT_CBM_CFM) case,
"val" is never assigned to, but left uninitialized. The other case does
initialized it. Fix this by initializing val at the start of the
function, and only ever ORing into it.

Update the handling of "mask" so it works the same way for consistency.

Update tegra20_spdif.c to use the same code-style for consistency, even
though it doesn't happen to suffer from the same problem at present.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Fixes: 0f163546a7 ("ASoC: tegra: use regmap more directly")
Cc: <stable@vger.kernel.org>
2013-12-09 17:14:32 +00:00
Takashi Iwai ed326363d7 ALSA: hda - Split verb definitions into sound/hda_verbs.h
Since there are more HD-audio compatible codecs, move the definitions
of HD-audio verbs into common header location, include/sound, so that
it can be included cleanly from other drivers than HD-audio driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-09 17:31:40 +01:00
Takashi Iwai f1e762ddc8 ALSA: hda - Enable stereo mix as default for AD and VIA codecs
AD and VIA codecs had stereo mixer input enabled as default before
moving to the generic parser, and people think the lack of such a
regression.  In this patch, the stereo mixer input is added back to
the input selection if no auto-mic is available, and if it's not
disabled explicitly via hint.  This should satisfy most of demands,
i.e. stereo mix on desktop machines like what it worked before, and it
still keeps the new auto-mic feature on laptops.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-09 16:02:24 +01:00
Takashi Iwai e8648e5e33 ALSA: hda - Ignore small negative LPIB delay correction
Sometimes the hardware reports LPIB being advanced than POSBUF.
When this happens, the driver adjusts to a positive value by adding
the buffer size.  Then the driver detects it as an error (greater than
the period size), and stops the LPIB delay account from this point
on.

When I took a close look at these conditions, the values shown are all
very small numbers, and it'd be better to just ignore these values
instead of discontinuing the LPIB delay correction.

In this patch, the driver checks a negative delay value and ignores if
it's a significantly small error.  Currently the threshold is set to
64 frames, but could be smaller.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 17:28:49 +01:00
Takashi Iwai 4f7f67fb77 ALSA: hda - Add missing initialization of aamix paths
The loopback mixing paths aren't initialized correctly at init
callback.  Mostly this is harmless as codecs usually set the mute
state as default, but we still should make sure.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 17:10:32 +01:00
Takashi Iwai c9e4bdb755 ALSA: hda - Allow capture-only configuration
We have blindly assumed that all valid configurations should have
either analog or digital playback, but there can be capture-only
configurations.  The parser shouldn't escape in such a case.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 09:31:40 +01:00
Mengdong Lin 5b8620bb84 ALSA: hda - skip depop delay before D3 for Haswell and Valleyview2 display codec
This patch skips the default depop delay before D3 for Haswell (10 ms) and
Valleyview2 (100 ms) display codec, to reduce codec suspend time.

The analog part of display audio is implemented in the external display. Some
displays have weak pop noise while others not when suspending, no matter there
is the default delay or not.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:53:08 +01:00
David Henningsson 31660e9084 ALSA: hda - Remove quirk for Dell Vostro 131
I've tested the old Dell Vostro 131 with the latest generic parser
and it works just fine, and as a bonus we get better jack detection
features in userspace. Therefore this quirk can be removed.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:52:40 +01:00
Takashi Iwai f4d6a55d7b ALSA: hda - Clean up async codec PM using standard async infrastructure
This simplifies lots of codes indeed.

Tested-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-06 08:51:51 +01:00
Mikulas Patocka 18e4753ff3 ALSA: usb-audio: fix uninitialized variable compile warning
Fix the following warning when optimizing for size with gcc-4.6.4:
sound/usb/mixer_quirks.c:1514:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-05 21:13:18 +01:00
Nicolin Chen 75704ecfbb ASoC: wm8962: Enable SYSCLK provisonally before fetching generated DSPCLK_DIV
DSPCLK_DIV can be only generated correctly after enabling SYSCLK. But if the
current bias_level hasn't reached SND_SOC_BIAS_ON, DAPM won't enable SYSCLK,
which would cause the calculation result from DSPCLK_DIV invalid since bit
DSPCLK_DIV will be finally turned to its true value after DAPM enables SYSCLK
while the driver won't calculate it again for the current instance. In this
circumstance, a playback which needs non-zero DSPCLK_DIV would be distorted
due to unexpected clock frequency resulted from an invalid DSPCLK_DIV value.

So this patch provisionally enables the SYSCLK to get a valid DSPCLK_DIV for
calculation and then disables it afterward.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-05 14:59:41 +00:00
Stephen Warren 7637af2e17 ASoC: tegra: add tegra+MAX98090 machine driver
Initially, this binding and driver only describe/support playback to
headphones and speakers, and capture from the external microphone, with
GPIO-based jack detection for the headphone jack only.

This driver is useful for the Venice2 board.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-05 13:31:37 +00:00
Oleksij Rempel b1e8972e39 ALSA: hda - fix mic issues on Acer Aspire E-572
This patch add quirk for Acer Aspire E-572:
- fix external mic
- limit mic boost for internal mic with maximal noise level of -24dB

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-05 07:43:03 +01:00
Fabio Estevam 24f4bd57a7 ASoC: imx-ssi: Check the return value from clk_prepare_enable()
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-05 00:01:18 +00:00
Mark Brown 1552c32547 ASoC: adsp: Use async writes where possible
This will allow a marginal speed improvement when used with a bus that
supports async I/O by reducing the amount of context thrashing between
writes, allowing the bus to be more fully utilised.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 13:47:04 +00:00
Takashi Iwai 0756f09c49 ALSA: hda - Fix silent output on MacBook Air 2,1
MacBook Air 2,1 has a fairly different pin assignment from its brother
MBA 1,1, and yet another quirks are needed for pin 0x18 and 0x19,
similarly like what iMac 9,1 requires, in order to make the sound
working on it.

Reported-and-tested-by: Bruno Prémont <bonbons@linux-vserver.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 13:59:45 +01:00
Bo Shen bc567a9350 ASoC: sam9x5_wm8731: change to work in DSP A mode
Change sam9x5 with wm8731 work in DSP A mode, this will fix the
left/right channel swap issue.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 12:27:15 +00:00
Bo Shen a8f1f100ad ASoC: atmel_ssc_dai: add dai trigger ops
According to the SSC specifiation, it should be enabled after DMA is
enabled. So, add trigger operation to make sure the right sequence.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 12:27:08 +00:00
Mark Brown 07ac582c85 Merge remote-tracking branch 'asoc/topic/symmetry' into asoc-core
Conflicts (Trivial add/delete):
	sound/soc/soc-pcm.c
2013-12-04 11:54:29 +00:00
Kuninori Morimoto 60dbb4f174 ASoC: rcar: use devm_clk_get() instead of clk_get()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 11:50:04 +00:00
Nicolin Chen 7f62b6ee76 ASoC: soc-pcm: Use valid condition for snd_soc_dai_digital_mute() in hw_free()
The snd_soc_dai_digital_mute() here will be never executed because we only
decrease codec->active in snd_soc_close(). Thus correct it.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 11:46:40 +00:00
Nicolin Chen 0b4bbae85e ASoC: soc-pcm: Drop the redundant snd_soc_dai_digital_mute() in soc_pcm_close()
This patch removed the redundant snd_soc_dai_digital_mute() in close() since
it's better to mute in hw_free() which's slightly earlier and symmetrical for
the case of reconfiguration: 'aplay 44k1.wav 48k.wav', for example, will be
open()->hw_params()->prepare(unmute)->playi1ng->hw_free(mute)->hw_params()->
parepare(unmute)->playing->hw_free(mute)->close()

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-04 11:45:29 +00:00
Takashi Iwai b0e6989c96 ASoC: Fixes for v3.13
A smattering of fixes here, some core ones for the rate combination
 issues for things other than simple bitmasks, for readback of byte
 controls and for updating the power of value muxes plus a bunch of
 driver fixes of varying severity.
 
 The warning fix in the i.MX FIQ driver is fixing a warning introduced
 by a previous fix.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQIcBAABAgAGBQJSnxQYAAoJELSic+t+oim9JPUQAJprZ2T8xrEV9IVDdu0P3HxB
 Mk6Hp2r+GjNDxjeKGtSer1uni35YHfQuMa79b+O3j7X35ufFPiJrwnSuzQJ6muHA
 nBmIeWC5aNC0JcOy+Ga/j22YnsuOtEJk/Hv1M6tLOMAHv+mWL0CgUVgc0YguOhJe
 bhpMx9Z1EfPkjfSp39uLIqrd9mpsLGm+VNmuNjZCs707EWVKEe2figcRDkabZQPg
 CdH7K65oEsxxzzvbs5HEByo/WKp43E4ENb7j8Y/2UutwxggWrCLf00d6qWMNBzCG
 9Q+pXIY5M6FFpToyvi+w0W5vZdEony8qDN8P9VLIjzX4LkliIF+hYvtVtbHP87Ft
 +H7G7IHNeIQlac6w1d2hLfIBhocpGf8nX5kt7NyNU5J4Ceuv7FQTk5ZSGnjA9Oky
 3scLM2Y5PNvSLFgXWmJHzcLd1PoGF+O9AHFOjZCES1si2yZRFdHth5Q5YHimozpQ
 dcVUGn/NfKmXD0PAXLj9Jfg2IhIqv1EFgSBtxCT2COfWhBS0bFLprxFT0p9SVzCC
 Cn5XPosBwmmbWqKWm+wORaWUz4f6gxFzKxGiGT8mUL8Xql3TGKXkXrVo7Io1hU+T
 P3ATiYoYaPasi5duJ0q9M6aiH1iY+D3PdD0b7VJMtb3uTl2bMcNDsZTmxt+Zo8lP
 pF67+iKpsaKYbqbvpCRm
 =Uu21
 -----END PGP SIGNATURE-----

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

ASoC: Fixes for v3.13

A smattering of fixes here, some core ones for the rate combination
issues for things other than simple bitmasks, for readback of byte
controls and for updating the power of value muxes plus a bunch of
driver fixes of varying severity.

The warning fix in the i.MX FIQ driver is fixing a warning introduced
by a previous fix.
2013-12-04 12:40:59 +01:00
David Henningsson 20ce902978 ALSA: hda - Fix missing ELD info when using jackpoll_ms parameter
In the case of using jackpoll_ms instead of unsol events, the jack
was correctly detected, but ELD info was not refreshed on plug-in.

And without ELD info, no proper restriction of pcm, which can in turn
break sound output on some devices.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 09:02:51 +01:00
Kailang Yang eb21aad9fd ALSA: hda/realtek - remove hp_automute_hook from alc283_fixup_chromebook
I forgot to remove the hp_automute_hook from alc283_fixup_chromebook.
It doesn't need this for other chrome os machine.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-04 08:59:30 +01:00
Mark Brown 29e248829d Merge remote-tracking branches 'asoc/fix/arizona', 'asoc/fix/atmel', 'asoc/fix/fsl', 'asoc/fix/kirkwood', 'asoc/fix/omap', 'asoc/fix/rcar', 'asoc/fix/wm8731' and 'asoc/fix/wm8990' into asoc-linus 2013-12-03 18:09:00 +00:00
Mark Brown 1c4b578aa4 Merge remote-tracking branch 'asoc/fix/core' into asoc-linus 2013-12-03 18:08:59 +00:00
Lars-Peter Clausen 0406a40a09 ASoC: jz4740: Use the generic dmaengine PCM driver
Now that there is a dmaengine driver for the jz4740 DMA core we can use the
generic dmaengine PCM driver. This allows us to remove the custom jz4740-pcm
code completely.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-03 18:07:49 +00:00
Lars-Peter Clausen b84c9ce809 ASoC: jz4740-i2s: Use managed resources
Makes the code a bit shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-03 18:07:48 +00:00
Ulf Hansson b13a714923 ALSA: AACI: Convert to modern PM ops
Even if the CONFIG_PM explicity is undefined, let's convert to the
modern PM ops.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 17:43:42 +01:00
Bo Shen b4af6ef99a ASoC: wm8731: fix dsp mode configuration
According to WM8731 "PD, Rev 4.9 October 2012" datasheet, when it
works in DSP mode A, LRP = 1, while works in DSP mode B, LRP = 0.
So, fix LRP for DSP mode as the datesheet specification.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-03 16:04:31 +00:00
Lars-Peter Clausen a010ff628c ASoC: ssm2602: Use core for applying symmetry constraints
Let the core take care of applying sample rate and sample bits constraints
instead of open-coding this in the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-03 15:06:17 +00:00
Mark Brown 647dc469e6 Merge remote-tracking branch 'asoc/topic/symmetry' into asoc-ssm2602 2013-12-03 15:06:08 +00:00
Nicolin Chen 07a9483aac ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits
Since we introduced symmetric_channels and symmetric_samplebits, we implement
these two features to fsl_ssi so as to drop some no-more-needed code and make
the driver neat and clean.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-03 14:58:17 +00:00
Mark Brown e73462f573 Merge remote-tracking branch 'asoc/topic/symmetry' into asoc-fsl 2013-12-03 14:58:07 +00:00
Mengdong Lin 84d2dc3e57 ALSA: hda - fixup ALC262 to skip depop delay before D3 on Intel BayleyBay
This patch sets a 0ms depop delay in fixup funtion 'alc_fixup_no_depop_delay'.
And Realteck ALC262 applies this on Intel Baytrail BayleyBay platform to reduce
codec suspend time.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Reviewed-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 11:35:43 +01:00
Kailang Yang 0202e99c69 ALSA: hda/realtek - Independent of model for HP
Create single model for HP.
The headset jack module was difference between other chrome book.
It need to manual control Mic jack detect.

Chrome OS loaded driver by models. Remove old assigned fixup table from
ALC269 fixup list entry.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 09:27:23 +01:00
David Henningsson d59915d065 ALSA: hda - Fix headset mic input after muted internal mic (Dell/Realtek)
By trial and error, I found this patch could work around an issue
where the headset mic would stop working if you switch between the
internal mic and the headset mic, and the internal mic was muted.

It still takes a second or two before the headset mic actually starts
working, but still better than nothing.

Information update from Kailang:
  The verb was ADC digital mute(bit 6 default 1).
  Switch internal mic and headset mic will run alc_headset_mode_default.
  The coef index 0x11 will set to 0x0041.
  Because headset mode was fixed type. It doesn't need to run
  alc_determine_headset_type.
  So, the value still keep 0x0041. ADC was muted.

BugLink: https://bugs.launchpad.net/bugs/1256840
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-03 09:26:14 +01:00
Nicolin Chen 2924a99810 ASoC: fsl_ssi: Add monaural audio support for non-ac97 interface
The normal mode of SSI allows it to send/receive data to/from the first
slot of each period. So we can use this normal mode to trick I2S signal
by puting/getting data to/from the first slot only (the left channel)
so as to support monaural audio playback and recording.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 17:37:07 +00:00
Takashi Iwai b3bd4fc382 ALSA: hda - Use always amps for auto-mute on AD1986A codec
It seems that AD1986A cannot manage the dynamic pin on/off for
auto-muting, but rather gets confused.  Since each output has own amp,
let's use it instead.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Cc: <stable@vger.kernel.org> [v3.11+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:40:14 +01:00
Takashi Iwai ce8e0fd239 ALSA: hda/analog - Handle inverted EAPD properly in vmaster hook
ad_vmaster_eapd_hook() needs to handle the inverted EAPD case
properly, too.  Otherwise the output gets broken on Lenovo N100 with
AD1986A codec.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64971
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:40:14 +01:00
Takashi Iwai e7ca237bfc ALSA: hda - Another fixup for ASUS laptop with ALC660 codec
ASUS Z35HL laptop also needs the very same fix as the previous one
that was applied to ASUS W7J.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66231
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:27:19 +01:00
Takashi Iwai aad730d070 ALSA: hda - Always do delayed probes for HD-audio devices
HD-audio devices tend to take long time for finishing the whole
probing procedure.  In this patch, the time-consuming part of the
probing procedure, the codec probe and the rest initializations, are
moved in the work, so that they can be done asynchronously in parallel
with probes of other devices.

Since we already have this mechanism in the driver code for the
firmware and i915 request_symbol() stuff, we just need to enable it
always; the resultant patch even reduces more lines, which is an
additional bonus.

Credit goes to David Henningsson, who suggested this workaround.

Reported-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:17:39 +01:00
Takashi Iwai e4de211cd3 ALSA: atmel: Fix possible array overflow
The static checker found a possible array overflow in atmel/abdac.c:
  static checker warning: "sound/atmel/abdac.c:373 set_sample_rates()
        error: buffer overflow 'dac->rates' 6 <= 6"

This patch papers over the buggy point, by ensuring that dac->rates[]
update not overflowing the actual array size.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 15:10:41 +01:00
Mark Brown 2f54d2a1cf ASoC: ak4642: Convert to module_i2c_driver()
The device does not support anything other than I2C (at least with the
current driver) so save code.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 13:50:34 +00:00
Kuninori Morimoto fa558c2801 ASoC: simple-card: add Device Tree support
Support for loading the simple-card module via DeviceTree.
It requests CPU/CODEC information.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 12:37:28 +00:00
Takashi Iwai b95ff8e61a Merge branch 'for-linus' into for-next 2013-12-02 13:32:41 +01:00
Takashi Iwai 88d071fc9a ALSA: hda - Fix complete_all() timing in deferred probes
When the probe of snd-hda-intel driver is deferred due to f/w loading
or the nested module loading, complete_all() should be also delayed
until the initialization really finished.  Otherwise, vga-switcheroo
client would start switching before the actual init is done.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 13:23:40 +01:00
Takashi Iwai 1cd9b2f78b ALSA: hda - Fix bad EAPD setup for HP machines with AD1984A
It seems that EAPD on NID 0x16 is the only control over all outputs on
HP machines with AD1984A while turning EAPD on NID 0x12 breaks the
output.  Thus we need to avoid fiddling EAPD on NID.  As a quick
workaround, just set own_eapd_ctrl flag for the wrong EAPD, then
implement finer EAPD controls.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66321
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-02 13:23:39 +01:00
Oskar Schirmer 3621dbbc27 ASoC: fsl: imx-ssi: omit ssi counter to avoid harm in unbalanced situation
Unbalanced calls to imx_ssi_trigger() may result in endless
SSI activity and thus provoke eternal sound. While on the first glance,
the switch statement looks pretty symmetric, the SUSPEND/RESUME
pair is not: the suspend case comes along snd_pcm_suspend_all(),
which for fsl/imx-pcm-fiq is called only at snd_soc_suspend(),
but the resume case originates straight from the SNDRV_PCM_IOCTL_RESUME.
This way userland may provoke an unbalanced resume, which might cause
the ssi->enabled counter to increase and never return to zero again,
so eventually SSI_SCR_SSIEN is never disabled.

As the information on whether to enable the SSI or not is contained
in the two bits for TE/RE, we save all the software mirroring of
hardware state here and simply use the hardware register itself
to keep the state of whether someone is currently playing or capturing.

This is essentially the same stuff as in sound/soc/fsl/imx-pcm-fiq.c
which I send a patch for three days ago. Astonishing enough this
highly fragile scheme is used twice in parallel to serve the very
same control function, synchronously: Once out of sync you are lost
until reboot.

Note, that these fixes wont prevent state machine distortion on alsa
level to cut sound or the like. It just makes sure we have a chance
to synchronise again later on.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:57:02 +00:00
Mark Brown 4574cd94a7 ASoC: ak4642: Convert to direct regmap API usage
This moves us towards being able to remove the ASoC level I/O code which
duplicates regmap functionality. Currently the only difference between
the supported devices in the driver is the regmap so we can replace the
CODEC driver selections with regmap selection instead.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:53:30 +00:00
Mark Brown a8ca52b791 ASoC: ak4642: Convert to table based control init
Improves error handling and saves code.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:53:28 +00:00
Shawn Guo ebff65473f ASoC: core: fix devres parameter in devm_snd_soc_register_card()
Since devm_card_release() expects parameter 'res' to be a pointer to
struct snd_soc_card, devm_snd_soc_register_card() should really pass
such a pointer rather than the one to struct device.

This bug causes the kernel Oops below with imx-sgtl500 driver when we
remove the module.  It happens because with 'card' pointing to the wrong
structure, card->num_rtd becomes 0 in function soc_remove_dai_links().
Consequently, soc_remove_link_components() and in turn
soc_cleanup_codec[platform]_debugfs() will not be called on card
removal.  It results in that debugfs_card_root is being removed while
its child entries debugfs_codec_root and debugfs_platform_root are still
there, and thus the kernel Oops.

Fix the bug by correcting the parameter 'res' to be the pointer to
struct snd_soc_card.

$ lsmod
Module                  Size  Used by
snd_soc_imx_sgtl5000     3506  0
snd_soc_sgtl5000       13677  2
snd_soc_imx_audmux      5324  1 snd_soc_imx_sgtl5000
snd_soc_fsl_ssi         8139  2
imx_pcm_dma             1380  1 snd_soc_fsl_ssi
$ rmmod snd_soc_imx_sgtl5000
Unable to handle kernel paging request at virtual address e594025c
pgd = be134000
[e594025c] *pgd=00000000
Internal error: Oops: 5 [#1] SMP ARM
Modules linked in: snd_soc_imx_sgtl5000(-) snd_soc_sgtl5000 snd_soc_imx_audmux snd_soc_fsl_ssi imx_pcm_dma
CPU: 0 PID: 1793 Comm: rmmod Not tainted 3.13.0-rc1 #1570
task: bee28900 ti: bfbec000 task.ti: bfbec000
PC is at debugfs_remove_recursive+0x28/0x154
LR is at snd_soc_unregister_card+0xa0/0xcc
pc : [<80252b38>]    lr : [<80496ac4>]    psr: a0000013
sp : bfbede00  ip : bfbede28  fp : bfbede24
r10: 803281d4  r9 : bfbec000  r8 : 803271ac
r7 : bef54440  r6 : 00000004  r5 : bf9a4010  r4 : bf9a4010
r3 : e5940224  r2 : 00000000  r1 : bef54450  r0 : 803271ac
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 4e13404a  DAC: 00000015
Process rmmod (pid: 1793, stack limit = 0xbfbec240)
Stack: (0xbfbede00 to 0xbfbee000)
de00: 00000000 bf9a4010 bf9a4010 00000004 bef54440 bec89000 bfbede44 bfbede28
de20: 80496ac4 80252b1c 804a4b60 bfbede60 bf9a4010 00000004 bfbede54 bfbede48
de40: 804a4b74 80496a30 bfbede94 bfbede58 80328728 804a4b6c bfbede94 a0000013
de60: bf1b5800 bef54440 00000002 bf9a4010 7f0169f8 bf9a4044 00000081 8000e9c4
de80: bfbec000 00000000 bfbedeac bfbede98 80328cb0 80328618 7f016000 bf9a4010
dea0: bfbedec4 bfbedeb0 8032561c 80328c84 bf9a4010 7f0169f8 bfbedee4 bfbedec8
dec0: 80325e84 803255a8 bee28900 7f0169f8 00000000 78208d30 bfbedefc bfbedee8
dee0: 80325410 80325dd4 beca8100 7f0169f8 bfbedf14 bfbedf00 803264f8 803253c8
df00: 7f01635c 7f016a3c bfbedf24 bfbedf18 80327098 803264d4 bfbedf34 bfbedf28
df20: 7f016370 80327090 bfbedfa4 bfbedf38 80085ef0 7f016368 bfbedf54 5f646e73
df40: 5f636f73 5f786d69 6c746773 30303035 00000000 78208008 bfbedf84 bfbedf68
df60: 800613b0 80061194 fffffffe 78208d00 7efc2f07 00000081 7f016a3c 00000800
df80: bfbedf84 00000000 00000000 fffffffe 78208d00 7efc2f07 00000000 bfbedfa8
dfa0: 8000e800 80085dcc fffffffe 78208d00 78208d30 00000800 a8c82400 a8c82400
dfc0: fffffffe 78208d00 7efc2f07 00000081 00000002 00000000 78208008 00000800
dfe0: 7efc2e1c 7efc2ba8 76f5ca47 76edec7c 80000010 78208d30 00000000 00000000
Backtrace:
[<80252b10>] (debugfs_remove_recursive+0x0/0x154) from [<80496ac4>] (snd_soc_unregister_card+0xa0/0xcc)
 r8:bec89000 r7:bef54440 r6:00000004 r5:bf9a4010 r4:bf9a4010
r3:00000000
[<80496a24>] (snd_soc_unregister_card+0x0/0xcc) from [<804a4b74>] (devm_card_release+0x14/0x18)
 r6:00000004 r5:bf9a4010 r4:bfbede60 r3:804a4b60
[<804a4b60>] (devm_card_release+0x0/0x18) from [<80328728>] (release_nodes+0x11c/0x1dc)
[<8032860c>] (release_nodes+0x0/0x1dc) from [<80328cb0>] (devres_release_all+0x38/0x54)
[<80328c78>] (devres_release_all+0x0/0x54) from [<8032561c>] (__device_release_driver+0x80/0xd4)
 r4:bf9a4010 r3:7f016000
[<8032559c>] (__device_release_driver+0x0/0xd4) from [<80325e84>] (driver_detach+0xbc/0xc0)
 r5:7f0169f8 r4:bf9a4010
[<80325dc8>] (driver_detach+0x0/0xc0) from [<80325410>] (bus_remove_driver+0x54/0x98)
 r6:78208d30 r5:00000000 r4:7f0169f8 r3:bee28900
[<803253bc>] (bus_remove_driver+0x0/0x98) from [<803264f8>] (driver_unregister+0x30/0x50)
 r4:7f0169f8 r3:beca8100
[<803264c8>] (driver_unregister+0x0/0x50) from [<80327098>] (platform_driver_unregister+0x14/0x18)
 r4:7f016a3c r3:7f01635c
[<80327084>] (platform_driver_unregister+0x0/0x18) from [<7f016370>] (imx_sgtl5000_driver_exit+0x14/0x1c [snd_soc_imx_sgtl5000])
[<7f01635c>] (imx_sgtl5000_driver_exit+0x0/0x1c [snd_soc_imx_sgtl5000]) from [<80085ef0>] (SyS_delete_module+0x130/0x18c)
[<80085dc0>] (SyS_delete_module+0x0/0x18c) from [<8000e800>] (ret_fast_syscall+0x0/0x48)
 r6:7efc2f07 r5:78208d00 r4:fffffffe
Code: 889da9f8 e5983020 e3530000 089da9f8 (e5933038)
---[ end trace 825e7e125251a225 ]---

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:50:53 +00:00
Lars-Peter Clausen 2650bc4f6d ASoC: mxs: Use devm_snd_dmaengine_pcm_register()
Makes the code shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:49:36 +00:00
Lars-Peter Clausen 7e6d18ac7e ASoC: fsl: Use devm_snd_dmaengine_pcm_register()
Makes the code shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:48:54 +00:00
Mark Brown 75ab73bc5d Merge remote-tracking branch 'asoc/topic/dma' into asoc-fsl 2013-12-02 11:48:48 +00:00
Lars-Peter Clausen 237eeb1c04 ASoC: ep93xx: Use devm_snd_dmaengine_pcm_register()
Makes the code slightly shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:48:11 +00:00
Lars-Peter Clausen 3990c516de ASoC: bcm2835-i2s: Use devm_snd_dmaengine_pcm_register()
Makes the code slightly shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:47:16 +00:00
Mark Brown c0d38da61d Merge remote-tracking branch 'asoc/topic/dma' into asoc-bcm2835 2013-12-02 11:47:11 +00:00
Lars-Peter Clausen 62e5f676f6 ASoC: Set SNDRV_PCM_INFO_JOINT_DUPLEX for PCMs with symmetry constraints
If there are symmetry constraints between the playback and the capture channel
set the SNDRV_PCM_INFO_JOINT_DUPLEX flag to let userspace know about this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:27:14 +00:00
Lars-Peter Clausen a22f33b003 ASoC: generic-dmaengine-pcm: Set BATCH flag when residue reporting is not supported
For dmaengine drivers which do not support transfer residue reporting we update
the PCM pointer with period granularity. Set the SNDRV_PCM_INFO_BATCH flag in
this case to let userspace know about this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:24:31 +00:00
Jarkko Nikula fb28a75ad4 ASoC: omap: n810: Convert to clk_prepare_enable/clk_disable_unprepare
N810 audio driver has stopped working at some point. Probably when
OMAP2 was converted to common clock framework since now call to clk_enable
dumps the stack trace in drivers/clk/clk.c: __clk_enable() due
clk->prepare_count is zero.

Fix this by converting clk_enable/_disable calls to those that take care
of clock prepare/unprepare.

I'm not queueing this to linux-stable since OMAP2 common clock framework
conversion in commit ed1ebc4948 ("ARM: OMAP2: clock: Convert to common clk")
happened before N810 was really usable in mainline and user base for N810 is
anyway small. Potential linux-stable candidates are only those after
commit 3d3a6d18ab ("watchdog: introduce retu_wdt driver").

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:14:46 +00:00
Wei Yongjun 6c7ef410c9 ASoC: fsl: set correct platform drvdata in pcm030_fabric_probe()
platform_set_drvdata(op, pdata) in pcm030_fabric_probe()
will be overwrited when calling snd_soc_register_card(card),
but cm030_fabric_remove() use drvdata as a type of struct
pcm030_audio_data, so we should move platform_set_drvdata()
below snd_soc_register_card() call.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:13:19 +00:00
Fabio Estevam 23d8bb3bb6 ASoC: fsl: imx-pcm-fiq: Remove unused 'runtime' variable
Commit 68f9672b (ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation)
introduced the following build warning:

sound/soc/fsl/imx-pcm-fiq.c:53:26: warning: unused variable 'runtime' [-Wunused-variable]

Remove the unused 'runtime' variable.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:13:19 +00:00
Oskar Schirmer d6437c14df ASoC: fsl: imx-pcm-fiq: remove bogus period delta calculation
Originally snd_hrtimer_callback() used iprtd->period_time for
some jiffies based estimation to determine the right moment
to call snd_pcm_period_elapsed(). As timer drifts may well be a
problem, this was changed in commit b4e82b5b78 to be based
on buffer transmission progress, using iprtd->offset and
runtime->buffer_size to calculate the amount of data since last
period had elapsed.

Unfortunately, iprtd->offset counts in bytes, while
runtime->buffer_size counts frames, so adding these to find some
delta is like comparing apples and oranges, and eventually results
in negative delta values every now and then. This is no big harm,
because it simply causes snd_pcm_period_elapsed() being called
more often than necessary, as negative delta is taken for a
large unsigned value by implicit conversion rule.
Nonetheless, the calculation is broken, so one would replace
the runtime->buffer_size by its equivalent in bytes.

But then, there are chances snd_pcm_period_elapsed() is called
late, because calculating the moment for the elapsed period
into delta is based against the iprtd->last_offset, which is not
necessarily the first byte of the period in question, but some
random byte which the FIQ handler left us with in r8/r9 by
accident. Again, negative impact is low, as there are plenty of
periods already prefilled with data, and snd_pcm_period_elapsed()
will probably be called latest when the following period is
reached. However, the calculation is conceptually broken, and we
are best off removing the clever stuff altogether.

snd_pcm_period_elapsed() is now simply called once everytime
snd_hrtimer_callback() is run, which may not be most accurate,
but at least this way we are quite sure we dont miss an end of
period. There is not much extra effort wasted by superfluous
calls to snd_pcm_period_elapsed(), as the timer frequency
closely matches the period size anyway.

Signed-off-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:13:19 +00:00
Fabio Estevam 4ded61eb3e ASoC: imx-spdif: Remove error message upon devm_kzalloc() failure
No need to have a specific OOM message, since there is generic MM out of memory
message in place.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-02 11:12:39 +00:00
Takashi Iwai 6ddf0fd1c4 ALSA: hda - Fix silent output on ASUS W7J laptop
The recent kernels got regressions on ASUS W7J with ALC660 codec where
no sound comes out.  After a long debugging session, we found out that
setting the pin control on the unused NID 0x10 is mandatory for the
outputs.  And, it was found out that another magic of NID 0x0f that is
required for other ASUS laptops isn't needed on this machine.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=66081
Reported-and-tested-by: Andrey Lipaev <lipaev@mail.ru>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 16:20:02 +01:00
Charles Keepax 8f1ec93ae9 ASoC: core: Use consistent byte ordering in snd_soc_bytes_get
snd_soc_bytes_put treats the data in the binary control as big endian
words, however snd_soc_bytes_get uses the endian of the host machine.
This causes the two functions to be inconsistant with how the mask is
applied on little endian machines.

This patch applies the big_endian format used in snd_soc_bytes_put to
snd_soc_bytes_get.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 15:09:44 +00:00
Mengdong Lin 7f13292743 ALSA: hda - allow a codec to define its own depop delay time
This patch adds 'depop_delay' to struct hda_codec, to indicate a depop delay
time in ms when power-down, in function set_power_state() to D3.

Default value is -1, for a default delay time.
Machine fixup can set a suitable value according to the codec chip and HW audio
design.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 14:47:46 +01:00
Mengdong Lin b5c6611fb4 ALSA: hda - fixup ALC262 to remove depop delay on Intel BayleyBay board
This patch defines a fixup 'alc_fixup_no_depop_delay', which sets alc_spec flag
'no_depop_delay' to indicate skipping delay in Realtek codec suspend/resume.

And Intel Baytrail BayleyBay board applies this fixup to reduce driver
suspend/resume time.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:43 +01:00
Kailang Yang 97a2657076 ALSA: hda/realtek - Remove depop delay for suspend and resume if applicable
This patch defines a flag "no_depop_delay" in alc_spec. If this flag is set,
delay in alc_eapd_shutup and alc_resume will be skipped.

Machine-specific fixup can set this flag to reduce suspend/resume time, if
the codec and hardware analog design can avoid pop noise without this delay.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:38 +01:00
Kailang Yang 4b016931a9 ALSA: hda/realtek - Add more codecs alias name for Dell
Dell assigned alias name for more codecs.
ALC3220 ALC3221 ALC3223 ALC3226 ALC3234 ALC3661.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 13:55:21 +01:00
Mark Brown 69ae848907 ASoC: cs42l52: Fix build
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:28:44 +00:00
Kuninori Morimoto 507d466c73 ASoC: rcar: add Gen2 sound support
This patch adds Gen2 sound support for Renesas R-Car.
But, it is supporting PIO transfer only at this point

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Kuninori Morimoto 531eaf491e ASoC: rcar: remove rcar_gen_ops
Current rcar driver gen.c is using rcar_gen_ops
which was made with the assumption that
Gen1 and Gen2 need different behavior.
but it was not needed.
This patch removes unnecessary complex method.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Kuninori Morimoto 994a9df1e3 ASoC: rcar: remove .path_init/exit from rsnd_gen_ops
rsnd_gen_ops has .path_init/exit callback function
which cares SRU/SSI (if Gen1) SCU/SSIU/SSI (if Gen2)
path settings.
But, the differences between Gen1/Gen2 are cared
in ssi.c/scu.c, and the path itself is same in Gen1/Gen2.
This patch removes .path_init/exit callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Kuninori Morimoto 42ee5d22e3 ASoC: rcar: add rsnd_is_accessible_reg()
Current rcar driver is supporting Gen1,
and Gen2 will be supported soon.
Then, some registers are used from Gen1 only,
or from Gen2 only.
To avoid NULL pointer access, this patch adds
register accessible check function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Kuninori Morimoto c1e6cc5e57 ASoC: rcar: separate regmap init common field
The repmap initialization difference between Gen1/Gen2 is
only register offset.
This patch separates rsnd_gen1_regmap_init()
into common part and Gen1 specific part.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Kuninori Morimoto 17b9a2b785 ASoC: rcar: remove unused register settings
AUDIO_CLK_SEL4/5 are not used

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-29 12:09:54 +00:00
Dan Carpenter 4d6ff25085 ALSA: dice: fix array limits in dice_proc_read()
The array limits are supposed to be in units of u32 instead of in bytes.
The current code has a potential array overflow.

Fixes: c614475b0e ('ALSA: dice: add a proc file to show device information')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 10:23:04 +01:00
David Henningsson eb82594b75 ALSA: hda - Add mono speaker quirk for Dell Inspiron 5439
This machine also has mono output if run through DAC node 0x03.

Cc: stable@vger.kernel.org (v3.10+)
BugLink: https://bugs.launchpad.net/bugs/1256212
Tested-by: David Chen <david.chen@canonical.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-29 08:21:15 +01:00
Charles Keepax d733dc0828 ASoC: wm_adsp: Stop region iteration when the desired region is found
When locating the memory region relating to a coefficient block written
through a bin file we keep processing the list of regions even after we
have found the region we require. This patch adds a break, so we don't
process redundant list items.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 18:12:41 +00:00
Takashi Iwai eb9ca3ab21 ALSA: hda - Add LFE chmap to ASUS ET2700
As the previous commit 1f0bbf03cb added the pin config for the bass
speaker, this patch adds the corresponding LFE-only channel map on
ASUS ET2700.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65961
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 15:24:34 +01:00
Takashi Iwai 1f0bbf03cb ALSA: hda - Initialize missing bass speaker pin for ASUS AIO ET2700
Add a fixup entry for the missing bass speaker pin 0x16 on ASUS ET2700
AiO desktop.  The channel map will be added in the next patch, so that
this can be backported easily to stable kernels.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65961
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 15:21:21 +01:00
Lars-Peter Clausen d71b3ef44f ASoC: spear: Use devm_snd_dmaengine_pcm_register
Makes the code slightly shorter.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 13:36:16 +00:00
Lars-Peter Clausen 21585ee848 ASoC: Add resource managed snd_dmaengine_pcm_register()
For many drivers using the generic dmaengine PCM driver one of the few (or the
only) things left to do in the drivers remove function is to unregister the PCM
device. This patch adds a resource managed version of snd_dmaengine_pcm_register()
which makes it possible to simplify the remove function as well as the error
path in the probe function for those drivers.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 13:35:36 +00:00
Brian Austin 391fc59db8 ASoC: cs42l52: Add devicetree support for CS42L52
This patch adds device tree support for the CS42L52 Codec

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 10:57:01 +00:00
Takashi Iwai 696620a6cd Merge branch 'for-linus' into for-next 2013-11-28 11:43:30 +01:00
Oleksij Rempel 2cede30379 ALSA: hda - limit mic boost on Asus UX31[A,E]
This both devices need limit for internal dmic.

[cosmetic change; renamed fixup name by tiwai]

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 11:38:27 +01:00
Takashi Iwai 2ded3e5b61 ALSA: hda - Check leaf nodes to find aamix amps
The current generic parser assumes blindly that the volume and mute
amps are found in the aamix node itself.  But on some codecs,
typically Analog Devices ones, the aamix amps are separately
implemented in each leaf node of the aamix node, and the current
driver can't establish the correct amp controls.  This is a regression
compared with the previous static quirks.

This patch extends the search for the amps to the leaf nodes for
allowing the aamix controls again on such codecs.
In this implementation, I didn't code to loop through the whole paths,
since usually one depth should suffice, and we can't search too
deeply, as it may result in the conflicting control assignments.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65641
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-28 11:32:00 +01:00
Brian Austin 44b2ed5403 ASoC: cs42l52: Make MICA/B mixer dependent on mic config
MICA/B Single-Ended input selection depends on mica/b config so lets
make the mixer controls for them only show for selected mic's

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 10:20:51 +00:00
Brian Austin a3d36bc2ab ASoC: cs42l52: Reorganize MICA/B Config and Select
This patch reworks the MICA an MICB config for single-ended or
differential and the selection of which MIC for the single config

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-28 10:20:51 +00:00
Fabio Estevam 7ae10ed2ee ASoC: cs42l52: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:47:01 +00:00
Fabio Estevam 9a199b8e99 ASoC: wm9081: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:24:59 +00:00
Fabio Estevam 3f3002692c AsoC: wm9081: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:21:44 +00:00
Fabio Estevam 6358711681 ASoC: wm8988: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:21:01 +00:00
Fabio Estevam 50c9697320 ASoC: wm8985: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:20:25 +00:00
Fabio Estevam f25cf34969 ASoC: wm8900: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:19:03 +00:00
Fabio Estevam f3f9a60f79 ASoC: wm8804: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:18:29 +00:00
Fabio Estevam 1769267bb0 ASoC: wm8776: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:18:05 +00:00
wangbiao b888edbc68 ASoC: wm8994: Move DCS done IRQ request later
once code return from request_threaded_irq, irq was setup enabled by
default, but completion var dcs_done not got initialized yet, if then a
dcs done irq was raised, system will got hung as the sync mechanism is
invalid now.

so this patch move dcs done irq request to the end of initialization
of completion.

Signed-off-by: wang, biao <biao.wang@intel.com>
Signed-off-by: Zhang, Di <di.zhang@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:17:22 +00:00
Fabio Estevam 2c4864334c ASoC: wm8753: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:16:09 +00:00
Fabio Estevam 9ea6fbc66d ASoC: wm8750: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:15:35 +00:00
Fabio Estevam 26090a834b ASoC: wm8741: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:14:57 +00:00
Fabio Estevam b65ab73e5d ASoC: wm8731: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:13:59 +00:00
Fabio Estevam e42644c64c ASoC: ssm2602: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:13:24 +00:00
Fabio Estevam 25c1a63f43 ASoC: da7210: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:12:56 +00:00
Fabio Estevam 516ea4b584 ASoC: cs4271: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 18:12:15 +00:00
Jean-Francois Moine 4f6f1478c1 ASoC: kirkwood: Fix erroneous double output while playing
This patch fixes the setting of the register KIRKWOOD_PLAYCTL which did
always streaming on both I2S and SPDIF, ignoring the DAI ID.

The bug was introduced by the commit 75b9b65ee5
 "ASoC: kirkwood: add S/PDIF support"

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 17:16:21 +00:00
Jean-Francois Moine 1c195ddb1d ASoC: kirkwood: Fix invalid S/PDIF format
This patch removes the 32 bits format which is not supported by S/PDIF
output.

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 16:48:24 +00:00
Fabio Estevam 4d9127faa8 ASoC: soc-io: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 16:45:38 +00:00
Lars-Peter Clausen 78e45c99f6 ASoC: pcm: Always honor DAI min and max sample rate constraints
snd_pcm_limit_hw_rates() will initialize the minimum and maximum sample rate for
the PCM stream based on the rates specified in the rates field. Since we call
snd_pcm_limit_hw_rates() after soc_pcm_init_runtime_hw() it will essentially
overwrite the min and max rate set in soc_pcm_init_runtime_hw(). This may cause
the minimum or maximum rate to be set to a value outside the range of one of the
components if one of the components sets either SNDRV_PCM_RATE_CONTINUOUS or
SNDRV_PCM_RATE_KNOT and the other component specified a discrete rate via
SNDRV_PCM_RATE_[0-9]* that is outside of the first component's rate range. To
fix this first calculate the minimum and maximum rates using
snd_pcm_limit_hw_rates() and then on top of that apply the contraints specified
in the snd_soc_pcm_stream structs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Takashi iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 16:43:12 +00:00
Lars-Peter Clausen 17b6c19b34 ASoC: pcm: Fix rate_max calculation
In order to make sure that the sample rate is in the supported range of both
components the maximum rate of the card should be the minimum of the maximum
rate of each components. There is one special case to consider though, if
max_rate is set to 0 this means there is no maximum specified, so use
min_not_zero() macro which will give use the desired result.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Takashi iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 16:42:37 +00:00
Charles Keepax df9e356092 ASoC: wm5110: Remove output OSR and PGA volume controls
These are managed automatically in current revisions.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 16:30:06 +00:00
Bo Shen 46bec25da6 ASoC: atmel: sam9x5_wm8731: fix oops when unload module
As the priv is not assigned to card->drvdata, it is NULL, so when
unload module, it will cause NULL pointer oops.
Assign priv to card->drvdata to fix this issue.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-27 15:50:05 +00:00
Takashi Iwai 16c0cefe89 ALSA: hda - Fix hp-mic mode without VREF bits
When the hp mic pin has no VREF bits, the driver forgot to set PIN_IN
bit.  Spotted during debugging old MacBook Airs.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65681
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 14:55:45 +01:00
Takashi Iwai ced4cefc75 ALSA: hda - Create Headhpone Mic Jack Mode when really needed
When a headphone jack is configurable as input, the generic parser
tries to make it retaskable as Headphone Mic.  The switching can be
done smoothly if Capture Source control exists (i.e. there is another
input source).  Or when user explicitly enables the creation of jack
mode controls, "Headhpone Mic Jack Mode" will be created accordingly.

However, if the headphone mic is the only input source, we have to
create "Headphone Mic Jack Mode" control because there is no capture
source selection.  Otherwise, the generic parser assumes that the
input is constantly enabled, thus the headphone is permanently set
as input.  This situation happens on the old MacBook Airs where no
input is supported properly, for example.

This patch fixes the problem: now "Headphone Mic Jack Mode" is created
when such an input selection isn't possible.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=65681
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 14:55:40 +01:00
Mengdong Lin 12edb89308 ALSA: hda - resume codecs in parallel
To reduce driver resume time, this patch resumes the codecs in parallel
if there are multiple codecs on the bus.

- The PM workqueue of bus is also used to parallel resuming multiple codecs.
- The work item 'pm_work' is renamed to 'suspend_work' to parallel suspending
  codecs.
- Add a work item 'resume_work' to parallel resuming codecs.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 12:37:07 +01:00
Takashi Iwai 351892a827 Merge branch 'topic/hda' into for-next 2013-11-27 12:17:11 +01:00
Mengdong Lin 0e24dbb7f4 ALSA: hda - suspend codecs in parallel
The time to suspend a single codec may be several hundreds of ms. When runtime
power saving is disabled, driver suspend time can be long especially when there
are more than one codec on the bus.

To reduce driver suspend time, this patch creates a work queue for the bus, and
suspends the codecs in parallel if there are multiple codecs on the bus.

[fixed cosmetic issues by tiwai]

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 12:16:32 +01:00
Thomas Pugliese a93455e1c3 ALSA: usb: use multiple packets per urb for Wireless USB inbound audio
For Wireless USB audio devices, use multiple isoc packets per URB for
inbound endpoints with a datainterval < 5.  This allows the WUSB host
controller to take advantage of bursting to service endpoints whose
logical polling interval is less than the 4ms minimum polling interval
limit in WUSB.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 11:55:13 +01:00
Hui Wang 2fd3f170e5 ALSA: hda - Enable mute/mic-mute LEDs for more Thinkpads with Conexant codec
Most Thinkpad Edge series laptops use conexant codec, so far although
the codecs have different minor Vendor Id and minor Subsystem Id,
they all belong to the cxt5066 family, this change can make the
mute/mic-mute LEDs support more generic among cxt_5066 family.

This design refers to the similar solution for the realtek codec
ALC269 family in the patch_realtek.c.

Cc: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-27 08:52:37 +01:00
Takashi Iwai d2208ca056 Merge branch 'topic/cs46xx-drop-fw' into for-next 2013-11-26 18:39:33 +01:00
Takashi Iwai 049da9e8f8 Merge branch 'fix/firewire' into for-linus 2013-11-26 18:37:40 +01:00
Takashi Iwai 3e9bc58fef ALSA: hda - Disable runtime PM when EPSS is unavailable
According to Mengdong, we shouldn't enable runtime PM when a codec
doesn't support EPSS, based on the experiences on Windows.
We have already this check in HDMI codec drivers, but now apply it in
general in hda_codec.c.

Credit goes to Mengdong Lin <mengdong.lin@intel.com>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:43:02 +01:00
Takashi Iwai b1920c2110 ALSA: hda - Enable runtime PM on Panther Point
Now we fixed the long-standing bugs of runtime PM, let's enable
Panther Point again.  The runtime PM was disabled in the HDMI codec
driver due to the S3 issue, and this should have been fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:39 +01:00
Takashi Iwai a40e0a880b ALSA: hda - Refactor pm notification in hda_codec.c
No functional change.

- codec->pm_down_notified flag is renamed to codec->pm_up_notified
  flag (and takes the reversed meaning), which is managed solely in
  hda_call_pm_notify() now.

- The explicit call of hda_call_pm_notify() is moved into
  hda_keep_power_on().

- Removed a redundant call of hda_call_pm_notify() in
  snd_hda_power_up(), as it's called in hda_call_codec_resume()
  anyway.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai f0639272d6 ALSA: hda - Bind with HDMI codec parser automatically
If a codec contains only the digital outputs, it's very likely a
HDMI/DP codec, which isn't supported by the generic parser but via
HDMI codec parser code.  Detect such a case and bind with the proper
parser object if available.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai b21bdd0d34 ALSA: hda - Split the generic parser as an individual module
Drop the hard dependency on the generic parser code and load / unload
the generic parser code dynamically if built as a module.  This allows
us to avoid the generic parser if only HDMI/DP codecs are found.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:42:38 +01:00
Takashi Iwai 873ce8ad50 ALSA: hda - Drop bus->avoid_link_reset flag
Use bus->power_keep_link_on instead.  The controller shouldn't go to
D3 when the link isn't reset, so essentially avoiding the link reset
means avoiding the runtime PM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
Kailang Yang 9ad54547cf ALSA: hda/realtek - Set pcbeep amp for ALC668
Set the missing pcbeep default amp for ALC668.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
Kailang Yang ba4c4d0a90 ALSA: hda/realtek - Add support of ALC231 codec
It's compatible with ALC269.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-26 13:40:14 +01:00
Florian Meier c6aeb7de22 ASoC: Add support for BCM2835
This driver adds support for digital audio (I2S)
for the BCM2835 SoC that is used by the
Raspberry Pi. External audio codecs can be
connected to the Raspberry Pi via P5 header.

It relies on cyclic DMA engine support for BCM2835.

Signed-off-by: Florian Meier <florian.meier@koalo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-25 17:17:08 +00:00
Fabio Estevam d44008b358 ASoC: wm8995: Use IS_ENABLED() macro
Using the IS_ENABLED() macro can make the code shorter and simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-25 17:14:25 +00:00
Mark Brown 0112b62b12 ASoC: wm8990: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-25 15:50:00 +00:00
Mark Brown d2fd5fe7ee ASoC: wm8990: Use supplies to manage input power
Instead of using a fake register use a supply widget to manage the power
for the inputs, this is more idiomatic and supports regmap conversion.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-25 15:49:49 +00:00
Mark Brown f6b415b606 ASoC: wm8990: Convert to table based control and DAPM init
Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-25 15:49:46 +00:00
Mark Brown 93818c9a12 ASoC: wm8990: Convet to module_i2c_driver()
The device is I2C only (or at least current support is).

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-25 15:49:43 +00:00
Mark Brown 2ab2b74277 ASoC: wm8990: Mark the register map as dirty when powering down
Otherwise we'll skip sync on resume.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
2013-11-25 15:49:35 +00:00
Charles Keepax 0da2e5baf4 ASoC: wm5110: Add basic support for ISRCs
Add support for the ISRCs that matches the current support on the w5102.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-24 14:35:44 +00:00
Mark Brown 9a3e1b8c50 ASoC: wm5110: Hook up ADSP2 cores
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-24 14:35:43 +00:00
Mark Brown 30c27abd28 Linux 3.13-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQEcBAABAgAGBQJSj7D4AAoJEHm+PkMAQRiGMU4H/iX/fPopg3y6aPqt24aujcdf
 VgIp+zvWBDtXgCBfk47EEopgPIj4Dr94gT0V+Tv38ilwGQk3cJdDMeyB4cx/Nv6k
 nsYfaj3+gafW6MHpPRJVKav4v37sLidPbjFvsiADn/4yXZxN0TF5UACg6eKrQWDz
 OJjrSdhmPLepvr259UVTsNHft3BYLd1irMWZ/0IabSgfMIF+CqpmXeaJe/lOB4CK
 bpHt6J/54rb79NkAIwtPGsJrzAVoSrw4cYw6s5fuU5rfB6bkS9CitqavkdY+qGTD
 BfF+NUTN0k1dCd1AWxeTrQ+Zl7Atw50R7+ZQ5iIC68LJ4RBaqgpbN5wpot9nFoo=
 =ZVPw
 -----END PGP SIGNATURE-----

Merge tag 'v3.13-rc1' into asoc-arizona

Linux 3.13-rc1
2013-11-24 14:35:18 +00:00
Mark Brown 4f534777c1 ASoC: ak4641: Convert to direct regmap API usage
We're trying to remove the ASoC level I/O functions.

Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-24 13:54:45 +00:00
Mark Brown a0a05916cf ASoC: wm8991: Verify device ID during probe()
Just in case.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-24 13:53:27 +00:00
Mark Brown e4634804ca ASoC: wm8991: Move basic initialisation to I2C level probe
This is better practice, though some of this stuff ought not to be here at
all.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2013-11-24 13:53:27 +00:00