platform/kernel/linux-exynos.git
9 years agoALSA: core: Don't ignore errors at creating proc files
Takashi Iwai [Wed, 22 Apr 2015 20:29:10 +0000 (22:29 +0200)]
ALSA: core: Don't ignore errors at creating proc files

So far we've ignored the errors at creating proc files in many places.
But they should be rather treated seriously.

Also, by assuring the error handling, we can get rid of superfluous
snd_info_free_entry() calls as they will be removed by the parent in
the caller side.

This patch fixes the missing error checks and reduces the superfluous
free calls.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Remove superfluous exit calls for proc entries
Takashi Iwai [Wed, 22 Apr 2015 19:33:41 +0000 (21:33 +0200)]
ALSA: core: Remove superfluous exit calls for proc entries

Since each proc entry is freed automatically by the parent, we don't
have to take care of its life cycle any longer.  This allows us to
reduce a few more lines of codes.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Manage asound root directory with snd_info_entry
Takashi Iwai [Wed, 22 Apr 2015 20:14:41 +0000 (22:14 +0200)]
ALSA: core: Manage asound root directory with snd_info_entry

Using snd_info_entry for /proc/asound root makes easier to release the
all children, too.  Further cleanups will follow.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Remove child proc file elements recursively
Takashi Iwai [Wed, 22 Apr 2015 16:26:38 +0000 (18:26 +0200)]
ALSA: core: Remove child proc file elements recursively

This patch changes the way to manage the resource release of proc
files: namely, let snd_info_free_entry() freeing the whole children.

This makes it us possible to drop the snd_device_*() management.  Then
snd_card_proc_new() becomes merely a wrapper to
snd_info_create_card_entry().

Together with this change, now you need to call snd_info_free_entry()
for a proc entry created via snd_card_proc_new(), while it was freed
via snd_device_free() beforehand.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Fix possible memory leaks at error path in info.c
Takashi Iwai [Wed, 22 Apr 2015 15:54:25 +0000 (17:54 +0200)]
ALSA: core: Fix possible memory leaks at error path in info.c

Currently, snd_info_init() just returns an error without releasing the
previously assigned resources at error path.  The assigned proc and
info entries have to be released properly.  This patch covers it.

While we are at it, refactor the code a bit, too.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Use seq_file for text proc file reads
Takashi Iwai [Wed, 22 Apr 2015 14:10:22 +0000 (16:10 +0200)]
ALSA: core: Use seq_file for text proc file reads

seq_file is _the_ standard interface for simple text proc files.
Though, we still need to support the binary proc files and the text
file write, and also we need to manage the device disconnection
gracefully.  Thus this patch just replaces the text file read code
with seq_file while keeping the rest intact.

snd_iprintf() helper function is now a macro to expand itself to
seq_printf() to be compatible with the existing code.  The seq_file
object is stored to the unused entry->rbuffer->buffer pointer.

When the output size is expected to be large (greater than PAGE_SIZE),
the driver should set entry->size field beforehand.  Then the given
size will be preallocated and the multiple show calls can be avoided.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: remove deprecated use of pci api
Quentin Lambert [Wed, 15 Apr 2015 14:10:17 +0000 (16:10 +0200)]
ALSA: remove deprecated use of pci api

Replace occurences of the pci api by appropriate call to the dma api.

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

@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &id->dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &id->dev,
...
+ , GFP_ATOMIC
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &id->dev,
...
+ , GFP_ATOMIC
  )
)

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: intel8x0: Check pci_iomap() success for DEVICE_ALI
Scott Wood [Wed, 15 Apr 2015 23:16:47 +0000 (18:16 -0500)]
ALSA: intel8x0: Check pci_iomap() success for DEVICE_ALI

DEVICE_ALI previously would jump to port_inited after calling
pci_iomap(), bypassing the check for bmaddr being NULL.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - simplify azx_has_pm_runtime
David Henningsson [Wed, 15 Apr 2015 11:29:05 +0000 (13:29 +0200)]
ALSA: hda - simplify azx_has_pm_runtime

Because AZX_DCAPS_PM_RUNTIME is always defined as non-zero, the
initial part of the expression can be skipped.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - set GET bit when adding a vendor verb to the codec regmap
Mengdong Lin [Tue, 14 Apr 2015 03:25:36 +0000 (11:25 +0800)]
ALSA: hda - set GET bit when adding a vendor verb to the codec regmap

Some HD-A codecs may add their own vendor 'set' verb to the regmap, thru func
snd_hdac_add_vendor_verb(). This patch sets the GET bit (bit 11)  when adding
the verb so that its peer vendor 'get' verb is actually added. This can avoid
I/O error when writing the 'set' verb thru remap, since HD-A regmap internally
looks up a writable vendor verb with GET bit set at first.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge tag 'asoc-v4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Mon, 13 Apr 2015 12:14:29 +0000 (14:14 +0200)]
Merge tag 'asoc-v4.1-2' of git://git./linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v4.1

More updates for v4.1, pretty much all drivers:

 - Lots of cleanups from Lars, mainly moving things from the CODEC level
   to the card level.
 - Continuing improvements to rcar from Morimoto-san, pcm512x from
   Howard and Peter, the Intel platforms from Vinod, Jie, Jin and Han,
   and to rt5670 from Bard.
 - Support for some non-DSP Qualcomm platforms, Google's Storm
   platform, Maxmim MAX98925 CODECs and the Ingenic JZ4780 SoC.

9 years agoALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450
Jo-Philipp Wich [Mon, 13 Apr 2015 10:47:26 +0000 (12:47 +0200)]
ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450

The Lenovo Thinkpad T450 requires the ALC292_FIXUP_TPT440_DOCK as well in
order to get working sound output on the docking stations headphone jack.

Patch tested on a Thinkpad T450 (20BVCTO1WW) using kernel 4.0-rc7 in
conjunction with a ThinkPad Ultradock.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Fix another race in runtime PM refcounting
Takashi Iwai [Mon, 13 Apr 2015 09:01:14 +0000 (11:01 +0200)]
ALSA: hda - Fix another race in runtime PM refcounting

Although some races in runtime PM refcount was fixed by the commit
[664c715573c2: ALSA: hda - Work around races of power up/down with
runtime PM], there is still a race in the following case:

CPU0:                   CPU1 :
runtime suspend:
  codec->in_pm = 1
                        snd_hdac_power_up_pm():
                          pm_runtime_get_sync() skipped
suspend finished:
  codec->in_pm = 0
                        snd_hdac_power_down_pm():
                          pm_runtime_put_*() is called!

For avoiding this situation, increment in_pm flag atomically when it's
non-zero, and decrement accordingly, to ensure that in_pm is set
consistently for the whole concurrent operations.

Also, since atomic_inc_not_zero() and atomic_dec_if_positive() are
lengthy inline functions, move snd_hdac_power_up_pm() and _down_pm()
to sound/hda/hdac_device.c as no inline functions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Expose codec type sysfs
Takashi Iwai [Mon, 13 Apr 2015 08:43:54 +0000 (10:43 +0200)]
ALSA: hda - Expose codec type sysfs

The type field of HD-audio codec object should be exposed to
user-space so that it can identify which driver type to bind (legacy /
asoc).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ctl: fix to handle several elements added by one operation for userspace element
Takashi Sakamoto [Sun, 12 Apr 2015 01:12:25 +0000 (10:12 +0900)]
ALSA: ctl: fix to handle several elements added by one operation for userspace element

An element instance can have several elements with the same feature.
Some userspace applications can add such an element instance by add
operation with the number of elements. Then, the element instance
gets a memory object to keep states of these elements.

But the element instance has just one memory object for the elements.
This causes the same result to each read/write operations to the
different elements.

This commit fixes this bug by allocating enough memory objects to the
element instance for each of elements.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'for-next' into for-linus
Takashi Iwai [Mon, 13 Apr 2015 08:23:18 +0000 (10:23 +0200)]
Merge branch 'for-next' into for-linus

9 years agoMerge remote-tracking branches 'asoc/topic/wm2200', 'asoc/topic/wm5100', 'asoc/topic...
Mark Brown [Sun, 12 Apr 2015 18:49:22 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/wm2200', 'asoc/topic/wm5100', 'asoc/topic/wm8731', 'asoc/topic/wm8804' and 'asoc/topic/wm8996' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/tegra', 'asoc/topic/tlv320aic23' and ...
Mark Brown [Sun, 12 Apr 2015 18:49:20 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/tegra', 'asoc/topic/tlv320aic23' and 'asoc/topic/ux500' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/rt5641', 'asoc/topic/rt5677' and 'asoc...
Mark Brown [Sun, 12 Apr 2015 18:49:17 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/rt5641', 'asoc/topic/rt5677' and 'asoc/topic/sh-cleanup' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/qcom', 'asoc/topic...
Mark Brown [Sun, 12 Apr 2015 18:49:11 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/qcom', 'asoc/topic/rcar' and 'asoc/topic/rt286' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/link-param', 'asoc/topic/max98090', 'asoc...
Mark Brown [Sun, 12 Apr 2015 18:49:06 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/link-param', 'asoc/topic/max98090', 'asoc/topic/max98925' and 'asoc/topic/nuc900' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/jack', 'asoc/topic/jz4740' and 'asoc/topic...
Mark Brown [Sun, 12 Apr 2015 18:49:03 +0000 (19:49 +0100)]
Merge remote-tracking branches 'asoc/topic/jack', 'asoc/topic/jz4740' and 'asoc/topic/kirkwood' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/dmaengine', 'asoc/topic/fsi', 'asoc/topic...
Mark Brown [Sun, 12 Apr 2015 18:48:59 +0000 (19:48 +0100)]
Merge remote-tracking branches 'asoc/topic/dmaengine', 'asoc/topic/fsi', 'asoc/topic/fsl' and 'asoc/topic/fsl-ssi' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/cx20442' and 'asoc/topic/davinci' into...
Mark Brown [Sun, 12 Apr 2015 18:48:56 +0000 (19:48 +0100)]
Merge remote-tracking branches 'asoc/topic/cx20442' and 'asoc/topic/davinci' into asoc-next

9 years agoMerge remote-tracking branches 'asoc/topic/4554', 'asoc/topic/ab8500', 'asoc/topic...
Mark Brown [Sun, 12 Apr 2015 18:48:51 +0000 (19:48 +0100)]
Merge remote-tracking branches 'asoc/topic/4554', 'asoc/topic/ab8500', 'asoc/topic/ak4642', 'asoc/topic/arizona' and 'asoc/topic/atmel' into asoc-next

9 years agoMerge remote-tracking branch 'asoc/topic/rt5645' into asoc-next
Mark Brown [Sun, 12 Apr 2015 18:48:49 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next

9 years agoMerge remote-tracking branch 'asoc/topic/intel' into asoc-next
Mark Brown [Sun, 12 Apr 2015 18:48:33 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/topic/intel' into asoc-next

9 years agoMerge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Mark Brown [Sun, 12 Apr 2015 18:48:31 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next

9 years agoMerge remote-tracking branch 'asoc/topic/core' into asoc-next
Mark Brown [Sun, 12 Apr 2015 18:48:30 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/topic/core' into asoc-next

9 years agoMerge tag 'asoc-v4.1' into asoc-next
Mark Brown [Sun, 12 Apr 2015 18:48:29 +0000 (19:48 +0100)]
Merge tag 'asoc-v4.1' into asoc-next

ASoC: Changes for v4.1

A selection of changes for v4.1 so far.  The main things are:

 - Move of jack registration to the card where it belongs.
 - Support for DAPM routes specified by both the machine driver and DT.

# gpg: Signature made Thu 05 Mar 2015 01:10:27 GMT using RSA key ID 5D5487D0
# gpg: WARNING: digest algorithm MD5 is deprecated
# gpg: please see https://gnupg.org/faq/weak-digest-algos.html for more information
# gpg: Oops: keyid_from_fingerprint: no pubkey
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

9 years agoMerge remote-tracking branch 'asoc/fix/wm8741' into asoc-linus
Mark Brown [Sun, 12 Apr 2015 18:48:27 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/fix/wm8741' into asoc-linus

9 years agoMerge remote-tracking branches 'asoc/fix/ak4642', 'asoc/fix/atmel', 'asoc/fix/cs4271...
Mark Brown [Sun, 12 Apr 2015 18:48:22 +0000 (19:48 +0100)]
Merge remote-tracking branches 'asoc/fix/ak4642', 'asoc/fix/atmel', 'asoc/fix/cs4271', 'asoc/fix/davinci' and 'asoc/fix/rcar' into asoc-linus

9 years agoMerge remote-tracking branch 'asoc/fix/pcm512x' into asoc-linus
Mark Brown [Sun, 12 Apr 2015 18:48:21 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/fix/pcm512x' into asoc-linus

9 years agoMerge remote-tracking branch 'asoc/fix/intel' into asoc-linus
Mark Brown [Sun, 12 Apr 2015 18:48:20 +0000 (19:48 +0100)]
Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus

9 years agoMerge tag 'asoc-fix-v4.0-rc7' into asoc-linus
Mark Brown [Sun, 12 Apr 2015 18:48:19 +0000 (19:48 +0100)]
Merge tag 'asoc-fix-v4.0-rc7' into asoc-linus

ASoC: Last minute fix for v4.0

This patch backs out a change that came in during the merge window which
selects a configuration for GPIO4 on pcm512x CODECs that may not be
suitable for all systems using the device.  Changes for v4.1 will make
this properly configurable but for now it's safest to revert to the
v3.19 behaviour and leave the pin configuration alone.

Sorry for sending this direct at the last minute but due to the GPIO
misuse it'd be really good to get it in the release and I'd not realised
it hadn't been sent yet - between some travel, a job change and other
non-urgent fixes coming in I'd lost track of the urgency.  It's been in
-next for several weeks now, is isolated to the driver and fairly clear
to inspection.

# gpg: Signature made Sat 11 Apr 2015 22:14:17 BST using RSA key ID 5D5487D0
# gpg: WARNING: digest algorithm MD5 is deprecated
# gpg: please see https://gnupg.org/faq/weak-digest-algos.html for more information
# gpg: Oops: keyid_from_fingerprint: no pubkey
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"

9 years agoASoC: Intel: fix array_size.cocci warnings
kbuild test robot [Sun, 12 Apr 2015 18:16:21 +0000 (02:16 +0800)]
ASoC: Intel: fix array_size.cocci warnings

sound/soc/intel/haswell/sst-haswell-ipc.c:646:28-29: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

CC: Jie Yang <yang.jie@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: n810: Automatically disconnect non-connected pins
Lars-Peter Clausen [Sat, 11 Apr 2015 08:47:58 +0000 (10:47 +0200)]
ASoC: n810: Automatically disconnect non-connected pins

All CODEC input and output widgets are either in the DAPM routing table or
manually marked as non-connected. This means the card is fully routed and we
can let the core take care of disconnecting non-connected pins.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: n810: Consistently pass the card DAPM context to n810_ext_control()
Lars-Peter Clausen [Sat, 11 Apr 2015 08:47:57 +0000 (10:47 +0200)]
ASoC: n810: Consistently pass the card DAPM context to n810_ext_control()

Some callers of n810_ext_control() pass the card DAPM context and some pass
the CODEC DAPM context. Given that some of the widgets that are accessed in
the function are in the card's context, always passing it is the obvious
choice.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: davinci-evm: Use card DAPM context to access widgets
Lars-Peter Clausen [Sat, 11 Apr 2015 11:11:28 +0000 (13:11 +0200)]
ASoC: davinci-evm: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: mop500_ab8500: Use card DAPM context to access widgets
Lars-Peter Clausen [Sat, 11 Apr 2015 11:01:02 +0000 (13:01 +0200)]
ASoC: mop500_ab8500: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: wm1133-ev1: Use card DAPM context to access widgets
Lars-Peter Clausen [Sat, 11 Apr 2015 10:52:01 +0000 (12:52 +0200)]
ASoC: wm1133-ev1: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: atmel: Improve machine driver compile test coverage
Lars-Peter Clausen [Sat, 11 Apr 2015 09:16:19 +0000 (11:16 +0200)]
ASoC: atmel: Improve machine driver compile test coverage

The Atmel ASoC machine drivers don't have any compile time arch dependencies
anymore. Make it possible to select them when COMPILE_TEST is enabled to get
better compile test coverage.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: atmel: Add dependency to SND_SOC_I2C_AND_SPI where necessary
Lars-Peter Clausen [Sat, 11 Apr 2015 09:16:18 +0000 (11:16 +0200)]
ASoC: atmel: Add dependency to SND_SOC_I2C_AND_SPI where necessary

The SND_AT91_SOC_SAM9G20_WM8731 and SND_AT91_SOC_SAM9X5_WM8731 machine
driver symbols select SND_SOC_WM8731 which depends on SND_SOC_I2C_AND_SPI.
So the machine driver symbols need to depend on SND_SOC_I2C_AND_SPI as well,
otherwise we might end up with a invalid configuration, which will sooner or
later upset the randconfig auto-builders.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: control: Fix a typo of SNDRV_CTL_ELEM_ACCESS_TLV_* with SNDRV_CTL_TLV_OP_*
Takashi Iwai [Sun, 12 Apr 2015 07:16:11 +0000 (09:16 +0200)]
ALSA: control: Fix a typo of SNDRV_CTL_ELEM_ACCESS_TLV_* with SNDRV_CTL_TLV_OP_*

The commit [39d118677baa: ALSA: ctl: evaluate macro instead of
numerical value] replaced the numbers with constants, but one place
was replaced wrongly with a different type.  Fixed now.

Fixes: 39d118677baa ('ALSA: ctl: evaluate macro instead of numerical value')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: usb-audio: Don't attempt to get Microsoft Lifecam Cinema sample rate
Adam Honse [Sun, 12 Apr 2015 06:03:07 +0000 (01:03 -0500)]
ALSA: usb-audio: Don't attempt to get Microsoft Lifecam Cinema sample rate

Adds Microsoft LifeCam Cinema USB ID to the snd_usb_get_sample_rate_quirk list as the Lifecam Cinema does not appear to support getting the sample rate.

Fixes the issue where the LifeCam Cinema would wait for USB timeout and log the message "cannot get freq at ep 0x82" when accessed.

Addresses bug report https://bugzilla.kernel.org/show_bug.cgi?id=95961.

Signed-off-by: Adam Honse <calcprogrammer1@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: rnsd: fix build regression without CONFIG_OF
Arnd Bergmann [Fri, 10 Apr 2015 22:18:37 +0000 (00:18 +0200)]
ASoC: rnsd: fix build regression without CONFIG_OF

The r-car sound driver only works when CONFIG_OF is set, and
after a recent change has a compile-time dependency as well:

sound/built-in.o: In function `rsnd_dma_request_channel':
:(.text+0x9fb84): undefined reference to `of_dma_request_slave_channel'

This could be fixed either by adding a static inline wrapper
for the function, or by adding a Kconfig dependency. This
implements the second approach, which seems appropriate
because the driver in fact has a hard dependency.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 72adc61f4637aa3 ("ASoC: rsnd: 1st DMAC dma-names cares subnode")
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4
Howard Mitchell [Mon, 23 Mar 2015 21:17:01 +0000 (21:17 +0000)]
ASoC: pcm512x: Remove hardcoding of pll-lock to GPIO4

Currently GPIO4 is hardcoded to output the pll-lock signal.
Unfortunately this is after the pll-out GPIO is configured which
is selectable in the device tree. Therefore it is not possible to
use GPIO4 for pll-out. Therefore this patch removes the
configuration of GPIO4.

Signed-off-by: Howard Mitchell <hm@hmbedded.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: emu10k1: add toggles for E-mu 1010 optical ports
Michael Gernoth [Sat, 11 Apr 2015 16:00:19 +0000 (18:00 +0200)]
ALSA: emu10k1: add toggles for E-mu 1010 optical ports

The optical ports on the E-mu 1010 (and dock) can be configured
for ADAT- or S/PDIF-mode, which is currently hardcoded to ADAT.
Add two mixer elements to expose this setting.
Tested on an E-mu 1010 PCIe with connected Micro Dock.

Signed-off-by: Michael Gernoth <michael@gernoth.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ctl: fill identical information to return value when adding userspace elements
Takashi Sakamoto [Sat, 11 Apr 2015 08:41:04 +0000 (17:41 +0900)]
ALSA: ctl: fill identical information to return value when adding userspace elements

currently some members related identical information are not fiiled
in returned parameter of SNDRV_CTL_IOCTL_ELEM_ADD. This is not better
for userspace application.

This commit copies information to returned value. When failing to copy
into userspace, the added elements are going to be removed. Then, no
applications can lock these elements between adding and removing because
these are already locked.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ctl: fix a bug to return no identical information in info operation for userspa...
Takashi Sakamoto [Sat, 11 Apr 2015 08:41:03 +0000 (17:41 +0900)]
ALSA: ctl: fix a bug to return no identical information in info operation for userspace controls

In operations of SNDRV_CTL_IOCTL_ELEM_INFO, identical information in
returned value is cleared. This is not better to userspace application.

This commit confirms to return full identical information to the
operations.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ctl: confirm to return all identical information in 'activate' event
Takashi Sakamoto [Sat, 11 Apr 2015 08:41:02 +0000 (17:41 +0900)]
ALSA: ctl: confirm to return all identical information in 'activate' event

When event originator doesn't set numerical ID in identical information,
the event data includes no numerical ID, thus userspace applications
cannot identify the control just by unique ID in event data.

This commit fix this bug so as the event data includes all of identical
information.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: emu10k1: handle dock disconnects
Michael Gernoth [Sat, 11 Apr 2015 12:34:44 +0000 (14:34 +0200)]
ALSA: emu10k1: handle dock disconnects

When the dock on an E-mu 1010 card is disconnected, all outputs get
muted by the hardware. Add logic to detect a disconnect and unmute.

Signed-off-by: Michael Gernoth <michael@gernoth.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Add dock support for ThinkPad X250 (17aa:2226)
Yves-Alexis Perez [Sat, 11 Apr 2015 07:31:35 +0000 (09:31 +0200)]
ALSA: hda - Add dock support for ThinkPad X250 (17aa:2226)

This model uses the same dock port as the previous generation.

Signed-off-by: Yves-Alexis Perez <corsac@debian.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: seq: fill client ID in return value of pool operation
Takashi Sakamoto [Sat, 11 Apr 2015 04:24:47 +0000 (13:24 +0900)]
ALSA: seq: fill client ID in return value of pool operation

The returned value of 'get/seq client pool' operation has zeroed value
for its client ID, against requested client ID.

This commit fix the bug by filling it with index value of referred
client object.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: Intel: Use the generic IPC/mailbox APIs in Broadwell
Jin Yao [Tue, 7 Apr 2015 01:33:32 +0000 (09:33 +0800)]
ASoC: Intel: Use the generic IPC/mailbox APIs in Broadwell

Use the generic IPC/mailbox APIs to replace the original processing
code for Broadwell platform.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: Intel: Use the generic IPC/mailbox APIs in Baytrail
Jin Yao [Tue, 7 Apr 2015 01:33:31 +0000 (09:33 +0800)]
ASoC: Intel: Use the generic IPC/mailbox APIs in Baytrail

Use the generic IPC/mailbox APIs to replace the original processing
code for Baytrail platform.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: Intel: Refactor common IPC/mailbox code into generic APIs
Jin Yao [Tue, 7 Apr 2015 01:33:30 +0000 (09:33 +0800)]
ASoC: Intel: Refactor common IPC/mailbox code into generic APIs

Currently in Intel SST driver, some similar IPC/mailbox processing
code are used in different platforms (e.g. in baytrail/broadwell).

This patch extracts the common code and creates new files
(sst-ipc.c/sst-ipc.h) to contain the common code and provide the generic
APIs for IPC/mailbox processing.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: fsl: Add the audio interface acronyms in Kconfig text
Fabio Estevam [Thu, 9 Apr 2015 18:32:09 +0000 (15:32 -0300)]
ASoC: fsl: Add the audio interface acronyms in Kconfig text

To keep consistency with the other Kconfig entries, use the audio
interface acronyms (SSI and SPDIF) in the Kconfig menu text.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: core: call snd_soc_runtime_set_dai_fmt() before soc_new_pcm()
Kuninori Morimoto [Fri, 10 Apr 2015 09:47:00 +0000 (09:47 +0000)]
ASoC: core: call snd_soc_runtime_set_dai_fmt() before soc_new_pcm()

Current snd_soc_runtime_set_dai_fmt() is called after
soc_probe_link_dais(). this means snd_soc_dai_set_fmt() will be
called after soc_new_pcm().

Before appling 1efb53a220b78fdfdbb97b726a2156713e75bdab
(ASoC: simple-card: Remove support for setting differing DAI formats)
simple-card user had (1) snd_soc_dai_set_fmt() -> soc_new_pcm(),
but, after that it is (2) soc_new_pcm() -> snd_soc_dai_set_fmt().
At least rsnd driver is assuming (1) pattern.

This patch move snd_soc_dai_set_fmt() into soc_probe_link_dais()
after the dai_link->init section to solve this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoMerge branch 'topic/dapm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Fri, 10 Apr 2015 15:09:21 +0000 (16:09 +0100)]
Merge branch 'topic/dapm-dt' of git://git./linux/kernel/git/broonie/sound into asoc-core

9 years agoMerge branch 'topic/delay' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Fri, 10 Apr 2015 15:04:46 +0000 (16:04 +0100)]
Merge branch 'topic/delay' of git://git./linux/kernel/git/broonie/sound into asoc-core

9 years agoASoC: fsl_ssi: Use devm_ioremap_resource()
Fabio Estevam [Fri, 10 Apr 2015 10:12:29 +0000 (07:12 -0300)]
ASoC: fsl_ssi: Use devm_ioremap_resource()

Using platform_get_resource() and devm_ioremap_resource() can make the
code a bit simpler.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: emu10k1: don't deadlock in proc-functions
Michael Gernoth [Thu, 9 Apr 2015 21:42:15 +0000 (23:42 +0200)]
ALSA: emu10k1: don't deadlock in proc-functions

The functions snd_emu10k1_proc_spdif_read and snd_emu1010_fpga_read
acquire the emu_lock before accessing the FPGA. The function used
to access the FPGA (snd_emu1010_fpga_read) also tries to take
the emu_lock which causes a deadlock.
Remove the outer locking in the proc-functions (guarding only the
already safe fpga read) to prevent this deadlock.

[removed superfluous flags variables too -- tiwai]

Signed-off-by: Michael Gernoth <michael@gernoth.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: fsl_ssi: Use devm_snd_soc_register_component()
Fabio Estevam [Thu, 9 Apr 2015 17:56:41 +0000 (14:56 -0300)]
ASoC: fsl_ssi: Use devm_snd_soc_register_component()

Using devm_snd_soc_register_component() can make the code shorter and
cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: ak4642: fixup channels_min
Kuninori Morimoto [Fri, 10 Apr 2015 08:46:22 +0000 (08:46 +0000)]
ASoC: ak4642: fixup channels_min

ak4642 doesn't have Mono record, ak4643 have it, but not supported.
This patch fixes channel mismatch

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: hda/realtek - Fix a typo
Takashi Iwai [Fri, 10 Apr 2015 07:53:04 +0000 (09:53 +0200)]
ALSA: hda/realtek - Fix a typo

A comma was used instead of a semicolon, which may lead to a build
error.

Fixes: cffd39668177 ('ALSA: hda/realtek - Fix the regression by widget power-saving')
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ctl: evaluate macro instead of numerical value
Takashi Sakamoto [Thu, 9 Apr 2015 23:43:00 +0000 (08:43 +0900)]
ALSA: ctl: evaluate macro instead of numerical value

SNDRV_CTL_TLV_OP_XXX is defined but not used in core code. Instead,
raw numerical value is evaluated.

This commit replaces these values to these macros for better looking.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support
Dmitry M. Fedin [Thu, 9 Apr 2015 14:37:03 +0000 (17:37 +0300)]
ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support

Adds an entry for Creative USB X-Fi to the rc_config array in
mixer_quirks.c to allow use of volume knob on the device.
Adds support for newer X-Fi Pro card, known as "Model No. SB1095"
with USB ID "041e:3237"

Signed-off-by: Dmitry M. Fedin <dmitry.fedin@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/via - Add missing stream_pm ops setup
Takashi Iwai [Thu, 9 Apr 2015 13:23:59 +0000 (15:23 +0200)]
ALSA: hda/via - Add missing stream_pm ops setup

Similar like the case for Realtek, VIA codec driver needs this ops as
well for making the widget power-save working.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: Don't try to register debugfs entries if the parent does not exist
Lars-Peter Clausen [Thu, 9 Apr 2015 08:52:38 +0000 (10:52 +0200)]
ASoC: Don't try to register debugfs entries if the parent does not exist

If the registration of a debugfs directory fails this is treated as a
non-fatal error in ASoC and operation continues as normal. This means we
need to be careful and check if the parent debugfs directory exists if we
try to register a debugfs file or sub-directory. Otherwise we might end up
passing NULL for the parent and the file or directory will be registered in
the top-level debugfs directory.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: Make soc_dpcm_debugfs_add() non-fatal
Lars-Peter Clausen [Thu, 9 Apr 2015 08:52:37 +0000 (10:52 +0200)]
ASoC: Make soc_dpcm_debugfs_add() non-fatal

Failing to register the debugfs entries is not fatal and will not affect
normal operation of the sound card. Don't abort the card registration if
soc_dpcm_debugfs_add() fails.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: rt286: Restore default in probe
Bard Liao [Thu, 9 Apr 2015 03:20:32 +0000 (11:20 +0800)]
ASoC: rt286: Restore default in probe

RT286 can't do register reset. If the hardware power is still existing
in power off, rt286 will keep the register settings. So, we need to
restore the default register value in probe to make sure the cache value
is the same as the real register value.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: Create card debugfs directory earlier
Lars-Peter Clausen [Thu, 9 Apr 2015 08:52:36 +0000 (10:52 +0200)]
ASoC: Create card debugfs directory earlier

Create the card debugfs directory at the begining of the initilization
rather then the end as various steps in the initilization sequence will try
to register files and sub-directories in the card directory.

Fixes: 4e2576bd36a1 ("ASoC: soc-core: initialize debugfs in snd_soc_instantiate_card()")
Reported-by: Fabio Estevam <festevam@gmail.com>
Reported-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoMerge tag 'v4.0-rc7' into asoc-core
Mark Brown [Thu, 9 Apr 2015 10:23:57 +0000 (11:23 +0100)]
Merge tag 'v4.0-rc7' into asoc-core

Linux 4.0-rc7

9 years agoALSA: hda/realtek - Fix the regression by widget power-saving
Takashi Iwai [Thu, 9 Apr 2015 08:30:25 +0000 (10:30 +0200)]
ALSA: hda/realtek - Fix the regression by widget power-saving

While enabling the widget power-saving for ALC269 & co, the important
setup was forgotten -- stream_pm ops.  Without this setup, the paths
for PCM won't be powered up at all.

Also, the power_filter callbacks used in ALC269 & co need to chain to
the default snd_hda_gen_path_power_filter().

Tested-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: Intel: do cast earlier in sst_cdev_tstamp()
Dan Carpenter [Thu, 9 Apr 2015 09:02:39 +0000 (12:02 +0300)]
ASoC: Intel: do cast earlier in sst_cdev_tstamp()

My static checker complains about these because it looks like the
multiply can overflow and then we cast to a larger data type.  I don't
think this is a problem, but it's also harmless to do the cast earlier
so let's silence the static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: hda/generic - Don't override power_filter when power_save_node is set
Takashi Iwai [Thu, 9 Apr 2015 08:28:15 +0000 (10:28 +0200)]
ALSA: hda/generic - Don't override power_filter when power_save_node is set

Currently the generic parser sets codec->power_filter when
power_save_node flag is set.  But this overrides the existing filter
that has been already set by the codec driver, thus it looses some
features.  Instead, set the default power_filter only when it's not
set yet.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/generic - Make snd_hda_gen_path_power_filter() always applicable
Takashi Iwai [Thu, 9 Apr 2015 08:25:03 +0000 (10:25 +0200)]
ALSA: hda/generic - Make snd_hda_gen_path_power_filter() always applicable

Add the check of power_save_node flag at the beginning of the function
so that it skips the rest if the flag isn't set.  In this way, we can
call this function safely no matter whether the widget power-saving is
really used or not.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/generic - Fix wrong initial power state for fixed pins
Takashi Iwai [Thu, 9 Apr 2015 08:21:30 +0000 (10:21 +0200)]
ALSA: hda/generic - Fix wrong initial power state for fixed pins

When the widget power-saving is enabled, the first automute hook
invocation checks through the whole pins and it also tries to
synchronize the power state.  However, this results in a wrong state
because it calls unconditionally snd_hda_jack_detect_state().
This patch adds a check of jack detectability before the actual jack
detection call.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/generic - Check power state cap at updating the widget power
Takashi Iwai [Thu, 9 Apr 2015 08:18:31 +0000 (10:18 +0200)]
ALSA: hda/generic - Check power state cap at updating the widget power

The new widget power-saving tries to apply the power change no matter
whether the node has a power cap or not.  It's bad (although most of
codecs chip just ignore it).  Check the capability properly
beforehand.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Always allow access for POWER_STATE verbs via regmap
Takashi Iwai [Thu, 9 Apr 2015 05:58:46 +0000 (07:58 +0200)]
ALSA: hda - Always allow access for POWER_STATE verbs via regmap

The hdac regmap code checks whether the codec is powered on while
accessing, but there must be an exception -- the verbs to control the
power state.

Currently HD-audio driver doesn't access them via regmap, so this
patch doesn't fix any current behavior, but it's just for future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: tegra_wm9712: Use card DAPM context to access widgets
Lars-Peter Clausen [Fri, 3 Apr 2015 11:04:08 +0000 (13:04 +0200)]
ASoC: tegra_wm9712: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: tegra_wm8903: Use card DAPM context to access widgets
Lars-Peter Clausen [Fri, 3 Apr 2015 11:04:07 +0000 (13:04 +0200)]
ASoC: tegra_wm8903: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: tegra_rt5677: Use card DAPM context to access widgets
Lars-Peter Clausen [Fri, 3 Apr 2015 11:04:06 +0000 (13:04 +0200)]
ASoC: tegra_rt5677: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: tegra_alc5632: Use card DAPM context to access widgets
Lars-Peter Clausen [Fri, 3 Apr 2015 11:04:05 +0000 (13:04 +0200)]
ASoC: tegra_alc5632: Use card DAPM context to access widgets

The dapm field of the snd_soc_codec struct will eventually be removed
(replaced with the DAPM context from the component embedded inside the
CODEC). Replace its usage with the card's DAPM context. The idea is that
DAPM is hierarchical and with the card at the root it is possible to access
widgets from other contexts through the card context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoMerge branch 'topic/jack' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Mark Brown [Wed, 8 Apr 2015 20:09:54 +0000 (21:09 +0100)]
Merge branch 'topic/jack' of git://git./linux/kernel/git/broonie/sound into asoc-tegra

9 years agoALSA: hda - Fix headphone pin config for Lifebook T731
Takashi Iwai [Wed, 8 Apr 2015 18:47:55 +0000 (20:47 +0200)]
ALSA: hda - Fix headphone pin config for Lifebook T731

Some BIOS version of Fujitsu Lifebook T731 seems to set up the
headphone pin (0x21) without the assoc number 0x0f while it's set only
to the output on the docking port (0x1a).  With the recent commit
[03ad6a8c93b6: ALSA: hda - Fix "PCM" name being used on one DAC when
 there are two DACs], this resulted in the weird mixer element
mapping where the headphone on the laptop is assigned as a shared
volume with the speaker and the docking port is assigned as an
individual headphone.

This patch improves the situation by correcting the headphone pin
config to the more appropriate value.

Reported-and-tested-by: Taylor Smock <smocktaylor@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: wm8804: Enable runtime PM
Charles Keepax [Tue, 7 Apr 2015 11:55:10 +0000 (12:55 +0100)]
ASoC: wm8804: Enable runtime PM

Currently both the oscillator and the PLL are powered up in
set_bias_level. This can be problematic when using output clocks from
the wm8804 for other devices. The snd_soc_codec_set_pll API defines that
a clock should be available once the call returns, however, with all the
clocking controlled in set_bias_level this is not currently the case.

This patch enables pm_runtime for the wm8804, enabling both the
regulators and the oscillator when the chip resumes, and enabling the
PLL in the snd_soc_codec_set_pll call. Naturally the enabling the PLL
will also cause the chip to resume.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: wm8804: Add DAPM widgets for SPDIF/AIF
Sapthagiri Baratam [Tue, 7 Apr 2015 11:55:09 +0000 (12:55 +0100)]
ASoC: wm8804: Add DAPM widgets for SPDIF/AIF

This change converts the driver to use DAPM to control the power for the
various blocks on the chip. As part of this change the existing controls
"TX Playback Switch" (controlled power for the SPDIF TX block) and "AIF
Playback Switch" (controlled power for the AIF block) are both removed,
as they are now redundant since the power state of those blocks is
controlled automatically by DAPM.

There are several benefits of this change, the most important of which
is this change adds support for powering down the SPDIF RX block. The RX
block will automatically assume control of the PLL on the chip when it
is receiving a signal, so leaving this enabled all the time as was
currently done in the driver can be problematic. An incoming SPDIF signal
that is not being used can completely destroy the clocking for an in use
TX signal. But this change ensures that the RX block will only be
powered when the user intends to be receiving data, thus avoiding this
issue.

Additional benefits include the chip being simpler to operate as the
power no longer needs to be manually controlled between use-cases and a
small power saving (although it is acknowledged that this is likely
unimportant in the typical use-cases for this chip).

Signed-off-by: Sapthagiri Baratam <sapthagiri.baratam@incubesol.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: max98090: add shutdown callback for max98090
Caesar Wang [Wed, 8 Apr 2015 11:05:56 +0000 (19:05 +0800)]
ASoC: max98090: add shutdown callback for max98090

To fix pop noise when shutdown,the pop noise during shutdown
is the pmic cutoff power of codec without any notice.

Signed-off-by: jay.xu <xjq@rock-chips.com>
Signed-off-by: zhengxing <zhengxing@rock-chips.com>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoASoC: Intel: remove unused functions
Sudip Mukherjee [Wed, 8 Apr 2015 13:04:25 +0000 (18:34 +0530)]
ASoC: Intel: remove unused functions

these functions were never called by anyone.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: bebob: fix to processing in big-endian machine for sending cue
Takashi Sakamoto [Wed, 8 Apr 2015 16:15:03 +0000 (01:15 +0900)]
ALSA: bebob: fix to processing in big-endian machine for sending cue

Some M-Audio devices require to receive bootup command just after
powering on, while codes in BeBoB driver doesn't work properly in
big-endian machine because the command should be aligned by
little-endian.

This commit fixes this bug. This fix should go to stable kernel.

Cc: Takayuki Shiroma <t.shiroma.oki@gmail.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Work around races of power up/down with runtime PM
Takashi Iwai [Wed, 8 Apr 2015 09:43:14 +0000 (11:43 +0200)]
ALSA: hda - Work around races of power up/down with runtime PM

Currently, snd_hdac_power_up()/down() helpers checks whether the codec
is being in pm (suspend/resume), and skips the call of runtime get/put
during it.  This is needed as there are lots of power up/down
sequences called in the paths that are also used in the PM itself.  An
example is found in hda_codec.c::codec_exec_verb(), where this can
power up the codec while it may be called again in its power up
sequence, too.

The above works in most cases, but sometimes we really want to wait
for the real power up.  For example, the control element get/put may
want explicit power up so that the value change is assured to reach to
the hardware.   Using the current snd_hdac_power_up(), however,
results in a race, e.g. when it's called during the runtime suspend is
being performed.  In the worst case, as found in patch_ca0132.c, it
can even lead to the deadlock because the code assumes the power up
while it was skipped due to the check above.

For dealing with such cases, this patch makes snd_hdac_power_up() and
_down() to two variants: with and without in_pm flag check.  The
version with pm flag check is named as snd_hdac_power_up_pm() while
the version without pm flag check is still kept as
snd_hdac_power_up().  (Just because the usage of the former is fewer.)

Then finally, the patch replaces each call potentially done in PM with
the new _pm() variant.

In theory, we can implement a unified version -- if we can distinguish
the current context whether it's in the pm path.  But such an
implementation is cumbersome, so leave the code like this a bit messy
way for now...

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96271
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: Intel: Fix a buffer overflow issue
Jie Yang [Tue, 7 Apr 2015 12:14:59 +0000 (20:14 +0800)]
ASoC: Intel: Fix a buffer overflow issue

0day robot reported a buffer overflow issue:

...
sound/soc/intel/haswell/sst-haswell-pcm.c:1107 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
sound/soc/intel/haswell/sst-haswell-pcm.c:1109 hsw_pcm_probe() error: buffer\
overflow 'hsw_dais' 4 <= 4
...

Fix it by initializing the index(i) to correct value.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoALSA: hda - Create AFG sysfs node at last
Takashi Iwai [Wed, 8 Apr 2015 09:41:59 +0000 (11:41 +0200)]
ALSA: hda - Create AFG sysfs node at last

... so that user-space can know that the whole nodes have been
created.  Unfortunately, this can't be implemented easily in race-free
way, so it's a kind of compromise.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/realtek - Support Dell headset mode for ALC288
Kailang Yang [Wed, 8 Apr 2015 08:01:22 +0000 (16:01 +0800)]
ALSA: hda/realtek - Support Dell headset mode for ALC288

Dell create new platform with ALC288 codec.
This patch will enable headset mode for Dino platform.

[slight code refactoring and compile fix by tiwai]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/realtek - Support headset mode for ALC286/288
Kailang Yang [Wed, 8 Apr 2015 07:01:17 +0000 (15:01 +0800)]
ALSA: hda/realtek - Support headset mode for ALC286/288

Support headset mode for ALC286 and ALC288 platforms.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Wed, 8 Apr 2015 09:29:56 +0000 (11:29 +0200)]
Merge branch 'for-linus' into for-next

Back merge HD-audio quirks to for-next branch, so that we can apply
a couple of more quirks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/realtek - Make more stable to get pin sense for ALC283
Kailang Yang [Wed, 8 Apr 2015 08:34:00 +0000 (16:34 +0800)]
ALSA: hda/realtek - Make more stable to get pin sense for ALC283

Pin sense will active when power pin is wake up.
Power pin will not wake up immediately during resume state.
Add some delay to wait for power pin activated.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda_intel: add AZX_DCAPS_I915_POWERWELL for SKL and BSW
Libin Yang [Tue, 7 Apr 2015 12:32:20 +0000 (20:32 +0800)]
ALSA: hda_intel: add AZX_DCAPS_I915_POWERWELL for SKL and BSW

HDMI/DP codec on SKL/BSW is in the power well.
The power well must be turned on before probing the
HDMI/DP codec.

This is a temporary patch, which will power on the
powerwell by adding AZX_DCAPS_I915_POWERWELL for SKL
and BSW. After restructuring and new flag is added,
this patch will be reverted.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>