Stephen Warren [Thu, 26 May 2011 15:57:33 +0000 (09:57 -0600)]
ASoC: Fix dapm_is_shared_kcontrol so everything isn't shared
Commit af46800 ("ASoC: Implement mux control sharing") introduced
function dapm_is_shared_kcontrol.
When this function returns true, the naming of DAPM controls is derived
from the kcontrol_new. Otherwise, the name comes from the widget (and
possibly a widget's naming prefix).
A bug in the implementation of dapm_is_shared_kcontrol made it return 1
in all cases. Hence, that commit caused a change in control naming for
all controls instead of just shared controls.
Specifically, a control is always considered shared because it is always
compared against itself. Solve this by never comparing against the widget
containing the control being created.
Equally, controls should never be shared between DAPM contexts; when the
same codec is instantiated multiple times, the same kcontrol_new will be
used. However, the control should no be shared between the multiple
instances.
I tested that with the Tegra WM8903 driver:
* Shared is now mostly 0 as expected, and sometimes 1.
* The expected controls are still generated after this change.
However, I don't have any systems that have a widget/control naming
prefix, so I can't test that aspect.
Thanks for Jarkko Nikula for pointing out how to fix this.
Reported-by: Liam Girdwood <lrg@ti.com> Tested-by: Jarkko Nikula <jhnikula@gmail.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Jarkko Nikula [Thu, 26 May 2011 13:32:18 +0000 (16:32 +0300)]
ASoC: Fix power down for widgetless per-card DAPM context case
Commit 52ba67b ("ASoC: Force all DAPM contexts into the same bias state")
powers up all the DAPM contexts in a card if any DAPM context becomes
active. Unfortunately power down newer happens if per-card DAPM context
doesn't have any widgets.
Reason for this is that power state of per-card DAPM context without
widgets is never cleared and thus all the DAPM contexts remain permanently
active. Test for widgetless calling DAPM context in dapm_power_widgets()
doesn't work for per-card DAPM context since power change is never
originating from widgetless per-card DAPM context.
Fix this by pre-clearing power state flag of non-codec DAPM context at the
beginning of power sequence.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Nicolas Ferre [Tue, 24 May 2011 09:51:16 +0000 (11:51 +0200)]
ASoC: sam9g20_wm8731: use the proper SYSCKL value
at91sam9g20 is providing master clock to wm8731: not using a crystal but an
external MCLK. We can avoid conflict and save power using WM8731_SYSCLK_MCLK as
we do not need oscillator to be powered.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The crystal oscillator is only enabled if the WM8731_SYSCLK_XTAL master clock
is specified. Fix the connected() struct snd_soc_dapm_route function to take
this into account. Oscillator is not enabled on machine that need it otherwise.
Machine drivers have to make sure that they use the proper SYSCLK value.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi Iwai [Wed, 25 May 2011 07:11:37 +0000 (09:11 +0200)]
ALSA: hda - Reorganize controller quriks with bit flags
Introduce bit-flags indicating the necessary controller quirks, and
set them in pci driver_data field. This simplifies the checks in the
driver code and avoids the pci-id lookup in different places.
Also, this patch adds the PCI ID entry for AMD Hudson. AMD Hudson
requires a similar workaround like ATI SB while other generic ATI and
AMD controllers don't need but some ATI-HDMI quirks. So, we need a
different entry for Hudson.
Stephen Warren [Wed, 25 May 2011 18:42:13 +0000 (12:42 -0600)]
ALSA: HDA: Increase MAX_HDMI_PINS
The recently introduced NVIDIA GeForce GT 520 has 4 pins within a single
codec. Bump MAX_HDMI_PINS to accomodate this. Also bump MAX_HDMI_CVTS
to match it; this might be needed later too.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 26 May 2011 06:09:38 +0000 (08:09 +0200)]
ALSA: PCM - Don't check DMA time-out too shortly
When the PCM period size is set larger than 10 seconds, currently the
PCM core may abort the operation with DMA-error due to the fixed timeout
for 10 seconds. A similar problem is seen in the drain operation that
has a fixed timeout of 10 seconds, too.
This patch fixes the timeout length depending on the period size and
rate, also including the consideration of no_period_wakeup flag.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel Mack [Wed, 25 May 2011 07:09:03 +0000 (09:09 +0200)]
ALSA: usb-audio: more control quirks for M-Audio FastTrack devices
Make use of the freshly introduced methods to re-use standard mixer
handling and add some controls that are hidden but implemented in a
standard conform way on M-Audio's FastTrack devices.
Signed-off-by: Daniel Mack <zonque@gmail.com> Original-code-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel Mack [Wed, 25 May 2011 07:09:02 +0000 (09:09 +0200)]
ALSA: usb-audio: add new quirk type QUIRK_AUDIO_STANDARD_MIXER
This quirk type will let the driver assume that there is a standard
mixer on a given interface, or that a specific mixer quirks will handle
the device.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel Mack [Wed, 25 May 2011 07:09:01 +0000 (09:09 +0200)]
ALSA: usb-audio: export snd_usb_feature_unit_ctl
In order to allow quirks functions to hook up to the standard feature
unit op tables, this patch exports a pointer to the struct that is used
internally.
That way, all the code handling the control can be kept private, and
external code can reference the symbol to re-use it.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stephen Warren [Tue, 24 May 2011 23:11:17 +0000 (17:11 -0600)]
ALSA: HDA: Unify HDMI hotplug handling.
This change unifies the initial handling of a pin's state with the code to
update a pin's state after a hotplug (unsolicited response) event. The
initial probing, and all updates, are now routed through hdmi_present_sense.
The stored PD and ELDV status is now always derived from GetPinSense verb
execution, and not from the data in the unsolicited response. This means:
a) The WAR for NVIDIA codec's UR.PD values ("old_pin_detect") can be
removed, since this only affected the no-longer-used unsolicited
response payload.
b) In turn, this means that most NVIDIA codecs can simply use
patch_generic_hdmi instead of having a custom variant just to set
old_pin_detect.
c) When PD && ELDV becomes true, no extra verbs are executed, because the
GetPinSense that was previously executed by snd_hdmi_get_eld (really,
hdmi_eld_valid) has simply moved into hdmi_present_sense.
d) When PD && ELDV becomes false, there is a single extra GetPinSense verb
executed for codecs where old_pin_detect wasn't set, i.e. some NVIDIA,
and all ATI/AMD and Intel codecs. I doubt this will be a performance
issue.
The new unified code in hdmi_present_sense also ensures that eld->eld_valid
is not set unless eld->monitor_present is also set. This protects against
potential invalid combinations of PD and ELDV received from HW, and
transitively from a graphics driver.
Also, print the derived PD/ELDV bits from hdmi_present_sense so the kernel
log always displays the actual state stored, which will differ from the
values in the unsolicited response for NVIDIA HW where old_pin_detect was
previously set.
Finally, a couple of small tweaks originally by Takashi:
* Clear the ELD content to zero before reading it, so that if it's not
read (i.e. when !(PD && ELDV)) it's in a known state.
* Don't show ELD fields in /proc ELD files when the ELD isn't valid.
The only possibility I can see for regression here is a codec where the
GetPinSense verb returns incorrect data. However, we're already exposed
to that, since that data is used (a) from hdmi_add_pin to set up the
initial pin state, and (b) within snd_hda_input_jack_report to query
a pin's presence value. As such, I don't believe any HW has bugs here.
Tony Vroon [Tue, 24 May 2011 21:16:15 +0000 (22:16 +0100)]
ALSA: hda - Force AD1988_6STACK_DIG for Asus M3N-HT Deluxe
The microphone input on the back panel (pink connector)
stopped operating correctly after an upgrade from
2.6.35 to 2.6.38; the actual problem manifests itself
as a lack of microphone bias voltage (VREF_HIZ) on
node 0x17.
With AD1988_6STACK_DIG the maximum bias voltage (VREF_80)
is applied and the headset operates correctly.
Liam Girdwood [Tue, 24 May 2011 12:57:43 +0000 (13:57 +0100)]
ASoC: core - fix module reference counting for CPU DAIs
Currently CODEC and platform drivers have their module reference count
incremented soc_probe_dai_link() whilst CPU DAI drivers have their reference
count incremented in soc_bind_dai_link().
CPU DAIs should have their reference count incremented in soc_probe_dai_link()
just like the CODEC and platform drivers.
Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Daniel Mack [Tue, 24 May 2011 12:10:32 +0000 (14:10 +0200)]
ASoC: fix raumfeld platform
Commit f0fba2ad (ASoC: multi-component - ASoC Multi-Component Support)
broke support for Raumfeld platforms as it didn't take into account the
different hardware features on individual devices.
In particular, Raumfeld speakers have no S/PDIF output, so the members
of the snd_soc_card struct must be set dynamically.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Jarkko Nikula [Fri, 20 May 2011 12:47:40 +0000 (15:47 +0300)]
ASoC: core: Don't set "(null)" as a driver name
Commit 22de71b ("ASoC: core - allow ASoC more flexible machine name")
writes "(null)" to driver name string in struct snd_card if card->driver_name
is NULL. This causes segmentation faults with some user space ALSA utilities
like aplay and arecord.
Fix this by using the card->name if no driver name is specified.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi Iwai [Fri, 20 May 2011 14:29:09 +0000 (16:29 +0200)]
ALSA: hda - Use LPIB for ATI/AMD chipsets as default
ATI and AMD chipsets seem not providing the proper position-buffer
information, and it also doesn't provide FIFO register required by
VIACOMBO fix. It's better to use LPIB for these.
Reported-by: David Henningsson <david.henningsson@canonical.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stephen Warren [Mon, 16 May 2011 20:19:27 +0000 (14:19 -0600)]
ASoC: Tegra: Fix compile when debugfs not enabled
The prototype of the inline dummy version of tegra_i2s_debug_add
was not consistent with the real version.
Reported-by: Rhyland-Klein <rklein@nvidia.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Stephen Warren [Thu, 19 May 2011 23:44:46 +0000 (17:44 -0600)]
ASoC: spdif-dit: Add missing MODULE_*
MODULE_ALIAS is required so that the module will auto-load based on a
platform_device registration in the board file.
While we're at it, add some other MODULE_*.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Raymond Yau [Fri, 20 May 2011 06:32:04 +0000 (14:32 +0800)]
ALSA: emu10k1 - Add dB range to Bass and Treble for SB Live!
As the "Wave", "Wave Surround" or "Front" Playback Volume must be
changed to 70% (i.e. -12 dB) so that distortion won't occur when
increase Bass and Treble from 50% to 100%, so the maximum gain in
Bass and Treble are +12 dB.
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
The davinci-i2s driver copies the platform data for playback and capture
sram sizes which is in turn used by davinci-pcm to allocate ping-pong
buffers.
Copy also the platform data in davinci-mcasp probe.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Dmitry Artamonow [Wed, 18 May 2011 15:25:09 +0000 (19:25 +0400)]
ASoC: Asahi Kasei AK4641 codec driver
A driver for the AK4641 codec used in iPAQ hx4700 and Glofiish M800
among others.
Signed-off-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This fixes the input layer beep not working on some EeePC 1000 models by
adding the subsystem id into whitelist. Otherwise the corresponding ALSA
mixer is not enabled and stays muted, resulting in no console beep.
Signed-off-by: Madis Janson <madis@cyber.ee> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Taylor Hutt [Wed, 18 May 2011 01:03:54 +0000 (18:03 -0700)]
ASoC: Max98095: Move existing NULL check before pointer dereference.
Visual inspection shows that max98095_put_eq_enum() and
max98095_put_bq_enum() each have a possible NULL deref of 'pdata'.
This change moves the NULL check above the use.
Signed-off-by: Taylor Hutt <thutt@chromium.org> Acked-by: Peter Hsiang <Peter.Hsiang@maxim-ic.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ben Gardiner [Wed, 18 May 2011 14:03:34 +0000 (10:03 -0400)]
ALSA: sound, core, pcm_lib: xrun_log: log also in_interrupt
When debugging pcm drivers I found the "period" or "hw" prefix printed
by either XRUN_DEBUG_PERIODUPDATE or XRUN_DEBUG_PERIODUPDATE events,
respectively to be very useful is observing the interplay between
interrupt-context updates and syscall-context updates.
Similarly, when debugging overruns with XRUN_DEBUG_LOG it is useful to
see the context of the last 10 positions.
Add an in_interrupt member to hwptr_log_entry which stores the value of
the in_interrupt parameter of snd_pcm_update_hw_ptr0 when the log entry
is created. Print a "[Q]" prefix when dumping the log entries if
in_interrupt was true.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel Mack [Wed, 18 May 2011 09:28:39 +0000 (11:28 +0200)]
ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set
Just defining it to nothing is dangerous as it can alter the code
execution flow, for example when used in as only function in a
conditional code block.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 17 May 2011 16:41:25 +0000 (18:41 +0200)]
ALSA: hda - Enable snoop bit for AMD controllers
AMD Hudson controllers give noisy outputs when the buffer data is
rewritten on the fly as PulseAudio does. This seems fixed by the
snoop bit enabled just like ATI chipset.
Also, disable 64bit DMA as now, to be sure.
We can revisit this later.
Takashi Iwai [Tue, 17 May 2011 10:29:09 +0000 (12:29 +0200)]
ALSA: hda - Handle dock line-in as auto-detectable for IDT codecs
When a docking-station has a line-in jack, we can handle it also as
a detectable jack just like mic-in. This will improve the usability
of HP laptops with a docking-station.