The ATI/AMD video/audio latencies are specified in apparent HDMI VSDB
format. In this format values above 251 are not valid (or stream
component is not supported - 255), but no checking is performed since
this was not mentioned in the AMD HDA verbs specification.
Check that the latencies are valid before using them, and add a comment
describing the formats.
Anssi Hannula [Sun, 10 Nov 2013 18:56:10 +0000 (20:56 +0200)]
ALSA: hda - hdmi: Add error-checking to some codec reads
Add error checks to HBR status reads (both generic and ATI/AMD) and
ATI/AMD codec reads for ELD generation.
Unchecked errors in these just caused more errors later on (invalid
codec writes for the HBR ones and ELD parsing errors for the ATI/AMD ELD
ones), but it is better to catch them earlier.
Anssi Hannula [Sun, 10 Nov 2013 19:24:05 +0000 (21:24 +0200)]
ALSA: usb: Fix wrong mapping of RLC and RRC channels
According to USB Audio spec v2 bits 25 and 26 of bmChannelConfig are
"Back Left of Center - BLC" and "Back Right of Center - BRC",
respectively.
They are currently assigned to ALSA channels BLC/BRC. However, the ALSA
BLC/BRC are actually the rather nonsensical "bottom left center" and
"bottom right center", so the channels will be assigned wrongly. The
comments in the USB code are also similarly wrong, so this is not
readily apparent without looking at the actual specification.
Fix the channel mapping by mapping bits 25 and 26 to RLC (Rear Left
Center) and RRC (Rear Right Center), respectively, instead.
Anssi Hannula [Sun, 10 Nov 2013 19:24:04 +0000 (21:24 +0200)]
ALSA: hda - hdmi: Use TFx channel positions instead of FxH
Channel map positions FLH, FCH, FRH duplicate positions TFL, TFC, TFR.
Both are the speakers above the front speakers (CEA uses "high" and USB
audio uses "top" nomenclature).
Since the USB audio code has used the TFx positions since v3.8
(04324ccc75f96, "ALSA: usb-audio: add channel map support") but the HDMI
code only just started using FxH in a5b7d510b2220cccb ("ALSA: hda -
hdmi: Fix channel maps with less common speakers") which is not yet in
any released kernel, standardize on TFx instead.
Takashi Iwai [Fri, 8 Nov 2013 12:03:57 +0000 (13:03 +0100)]
ALSA: hda - Control SPDIF out pin on MacBookPro 11,2
The SPDIF output MBP11,2 requires the pin control to be set/cleared
for turning on/off the optical SPDIF. The red light turns off only
when the corresponding pin control is cleared (or powered to D3).
Takashi Iwai [Fri, 8 Nov 2013 11:50:31 +0000 (12:50 +0100)]
ALSA: hda - Apply MacBook fixups for CS4208 correctly
The commit [8fe7b65ab465: ALSA: hda - Apply GPIO setup for MacBooks
with CS4208] added a fixup entry matching with the vendor id 0x106b.
This broke the fixups for previous MBA6,1 and 6,2, since the PCI SSID
vendor id matches before evaluating the codec SSIDs.
We had a similar issue on Mac with Sigmatel codecs, and solve this
problem again similarly, by introducing a skeleton entry matching with
the all MacBooks, then remap to the right one.
Kailang Yang [Fri, 1 Nov 2013 07:57:35 +0000 (15:57 +0800)]
ALSA: hda/realtek - Make fixup regs persist after resume
Upon suspend / resume, the fixup register settings are lost because
sending HDA_FIXUP_ACT_PRE_PROBE is not part of the resume path. Instead,
write our registers in response to the HDA_FIXUP_ACT_INIT, which happens
after initial probe and upon resume.
Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Nicolin Chen [Thu, 7 Nov 2013 06:45:16 +0000 (14:45 +0800)]
ASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as default
When allocating memory space for DMA buffer, use on-chip internal SRAM
as default choice to save power. Since the core would allocate memory
from traditional external memory if iram allocation failed, we don't
need to worry about any side effect.
Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 7 Nov 2013 17:38:47 +0000 (18:38 +0100)]
ASoC: dapm: Use WARN_ON() instead of BUG_ON()
Leaving BUG_ON() in a core layer like dapm is rather inappropriate as
it leads to panic(), even though sanity checks might be still useful
for debugging.
Instead, Use WARN_ON(), and handle the error cases accordingly.
Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Tue, 5 Nov 2013 17:40:00 +0000 (18:40 +0100)]
ASoC: wm_adsp: Fix BUG_ON() and WARN_ON() usages
This patch does:
- Move the sanity check with WARN_ON() in wm_adsp_region_to_reg() and
remove the checks in the callers,
- Fix wrong WARN_ON() usages, replaced with WARN(),
- Fix unreachable or wrong BUG_ON() usages and replace with WARN_ON().
Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:19 +0000 (11:07 +0100)]
ASoC: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:18 +0000 (11:07 +0100)]
ASoC: wm_hubs: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:17 +0000 (11:07 +0100)]
ASoC: wm8996: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:16 +0000 (11:07 +0100)]
ASoC: wm8962: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:15 +0000 (11:07 +0100)]
ASoC: wm8958: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:14 +0000 (11:07 +0100)]
ASoC: wm8904: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:13 +0000 (11:07 +0100)]
ASoC: wm8900: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Wed, 6 Nov 2013 10:07:12 +0000 (11:07 +0100)]
ASoC: wm8350: Replace BUG() with WARN()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use WARN() instead with more
error information.
Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Takashi Iwai [Thu, 7 Nov 2013 12:38:23 +0000 (13:38 +0100)]
ALSA: hda - Delay HDMI presence reports while waiting for ELD information
There is a small gap between the jack detection unsolicited event and
the time the ELD is updated. When user-space queries the HDMI ELD
immediately after receiving the notification, it might fail because of
this gap.
For avoiding such a problem, this patch tries to delay the HDMI jack
detect notification until ELD information is fully updated. The
workaround is imperfect, but good enough as a starting point.
We currently assume that the DMA Slave Config will be fully populated
by the platform, however some DMA Engines make decisions based on zero
(default) flags such as DMA_SLAVE_BUSWIDTH_UNDEFINED and as this is a
static declaration we need to memset it to clear the data area.
Signed-off-by: Lee Jones <lee.jones@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Chen Gang [Thu, 7 Nov 2013 03:14:29 +0000 (11:14 +0800)]
ALSA: include/uapi/sound/firewire.h: use "_UAPI" instead of "UAPI"
When installing, "scripts/headers_install.sh" will strip guard macro'
"_UAPI" to prevent from appearing it to users. And also, all another
files which need uapi prefix always use "_UAPI", not "UAPI".
So use "_UAPI" instead of "UAPI" on the guard macro, and also give a
comment for "#endif".
Signed-off-by: Chen Gang <gang.chen@asianux.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Vinod Koul [Thu, 7 Nov 2013 09:08:22 +0000 (10:08 +0100)]
ALSA: compress: fix drain calls blocking other compress functions (v6)
The drain and drain_notify callback were blocked by low level driver
until the draining was complete. Due to this being invoked with big
fat mutex held, others ops like reading timestamp, calling pause, drop
were blocked.
So to fix this we add a new snd_compr_drain_notify() API. This would
be required to be invoked by low level driver when drain or partial
drain has been completed by the DSP. Thus we make the drain and
partial_drain callback as non blocking and driver returns immediately
after notifying DSP. The waiting is done while releasing the lock so
that other ops can go ahead.
[ The commit 917f4b5cba78 was wrongly applied from the preliminary
patch. This commit corrects to the final version.
Sorry for inconvenience! -- tiwai ]
Takashi Iwai [Wed, 6 Nov 2013 16:54:55 +0000 (17:54 +0100)]
ALSA: lx6464es: Fix pointer cast compile warnings
The warnings are really harmless but annoying. Since they are only
about debug prints, and it's at most 32bit DMA, let's just cast to
unsigned long.
sound/pci/lx6464es/lx6464es.c:457:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
sound/pci/lx6464es/lx_core.c:1195:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]