Changes to both I2S and PCM code:
- Rates list extended up to 96kHz, it's tested on EDB9302 and works for both capture and
playback.
Signed-off-by: Alexander Sverdlin <subaparts@yandex.ru> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: fix deemphasis control in wm8904/55/60 codecs
Deemphasis control's .get callback should update control's value instead
of returning it - return value of callback function is used for indicating
error or success of operation.
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Brian Bloniarz [Wed, 8 Dec 2010 20:45:20 +0000 (12:45 -0800)]
ALSA: ice1712 - working M-Audio Delta 66E support
Rev. E of the M-Audio Delta 66 is partially supported (commit ef2cd2ccad66b4aba518eca7514eface267ee0f3), but the layout of the GPIO
pins was still unclear. This patch adds the GPIO definitions so that
communication to the CS8247 & 2x AK4524 works correctly.
ALSA bug#3327 has more details; users cap & jhunt report there that the
GPIO wiring is similar to the Digigram VX442 (chip select: pin 4 =
CS8427, pin 5 = AK4524 #0, pin 6 = AK4524 #1). There has been a lot of
conflicting information in the bug, but given these definitions, my
Delta 66E works; I tested analog in&out at 44.1kHz & 96kHz, analog gain
settings, S/PDIF clock sync, and S/PDIF in&out at 44.1kHz.
Signed-off-by: Brian Bloniarz <brian.bloniarz@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Uk Kim [Tue, 7 Dec 2010 13:58:40 +0000 (13:58 +0000)]
ASoC: Add ADC high pass filter support to WM8994
Signed-off-by: Uk Kim <w0806.kim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 7 Dec 2010 17:14:56 +0000 (17:14 +0000)]
ASoC: Support WM8994 mono AIF configurations
The WM8994 supports mono signals - enable this in the driver. With DSP
mode an automatic data channel selector is available, activate this
when in mono mode.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
In case the codec driver did not provide a read/write function,
codec->driver->read|write will be NULL. Ensure that we use the one
specified in codec->read|write to avoid oopsing when we access
the debugfs entries. This is achieved by using snd_soc_read() and
snd_soc_write().
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ALSA: HDA: Remove unconnected PCM devices for Intel HDMI
Some newer chips have more than one HDMI output, but usually not
all of them are exposed as physical jacks. Removing the unused
PCM devices (as indicated by BIOS in the pin config default) will
reduce user confusion as they currently have to choose between
several HDMI devices, some of them not working anyway.
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Anssi Hannula [Tue, 7 Dec 2010 19:19:23 +0000 (21:19 +0200)]
ALSA: hda - Reset sample sizes and max bitrates when reading ELD
When a new HDMI/DP device is plugged in, hdmi_update_short_audio_desc()
is called for every SAD (Short Audio Descriptor) in the ELD data. For
LPCM coding type SAD defines the supported sample sizes. For several
other coding types (such as AC-3), a maximum bitrate is defined.
The maximum bitrate and sample size fields are not always cleared.
Therefore, if a device is unplugged and a different one is plugged in,
and the coding types of some SAD positions differ between the devices,
the old max_bitrate or sample_bits values will persist if the new SADs
do not define those values.
The leftover max_bitrate and sample_bits do not cause any issues other
than wrongly showing up in eld#X.Y procfs file and kernel log.
Fix that by always clearing sample_bits and max_bitrate when reading
SADs.
Anssi Hannula [Tue, 7 Dec 2010 18:56:19 +0000 (20:56 +0200)]
ALSA: hda - Always allow basic audio irrespective of ELD info
Commit bbbe33900d1f3c added functionality to restrict PCM parameters
based on ELD info (derived from EDID data) of the audio sink.
However, according to CEA-861-D no SAD is needed for basic audio
(32/44.1/48kHz stereo 16-bit audio), which is instead indicated with a
basic audio flag in the CEA EDID Extension.
The flag is not present in ELD. However, as all audio capable sinks are
required to support basic audio, we can assume it to be always
available.
Fix allowed audio formats with sinks that have SADs (Short Audio
Descriptors) which do not completely overlap with the basic audio
formats (there are no reports of affected devices so far) by always
assuming that basic audio is supported.
Anssi Hannula [Tue, 7 Dec 2010 16:41:35 +0000 (18:41 +0200)]
ALSA: hda - Do not wrongly restrict min_channels based on ELD
Commit bbbe33900d1f3c added functionality to restrict PCM parameters
based on ELD info (derived from EDID data) of the audio sink.
However, it wrongly assumes that the bits 0-2 of the first byte of
CEA Short Audio Descriptors mean a supported number of channels. In
reality, they mean the maximum number of channels (as per CEA-861-D
7.5.2). This means that the channel count can only be used to restrict
max_channels, not min_channels.
Restricting min_channels causes us to deny opening the device in stereo
mode if the sink only has SADs that declare larger numbers of channels
(like Primare SP32 AV Processor does).
Fix that by not restricting min_channels based on ELD information.
Jassi Brar [Tue, 7 Dec 2010 10:23:07 +0000 (19:23 +0900)]
ASoC: WM8580: Debug BCLK and sample size
In case of SNDRV_PCM_FORMAT_S32_LE, we need to set WM8580_AIF_LENGTH_32,
rather than WM8580_AIF_LENGTH_24.
Also, the BCLK has to be 64fs, for sample size of 20, 24 and 32 bits.
Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Tue, 7 Dec 2010 12:56:30 +0000 (20:56 +0800)]
ASoC: Fix resource leak if soc_register_ac97_dai_link failed
Properly free the resources in the case of soc_register_ac97_dai_link failure.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: soc-core: Remove useless inline function construct
There is no need to mark this function as inline. Inline functions
usually are small and concise functions that benefit from not needing
to set up a stack frame and undergo a call/ret sequence upon each
invocation.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: soc-core: Replace use of strncpy() with strlcpy()
By using strncpy() if the source string does not have a null byte in the
first n bytes, then the destination string is not null-terminated.
This can be fixed in a two-step process by manually null-terminating the
array after the use of strncpy() or by using strlcpy().
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Jarkko Nikula [Mon, 6 Dec 2010 14:27:07 +0000 (16:27 +0200)]
ASoC: Merge common code in DAI link and auxiliary codec probing/removal
Commit 2eea392 "ASoC: Add support for optional auxiliary dailess codecs"
added much of code that can be shared with DAI link codec probing/removal.
Merge now this common code into new soc_probe_codec, soc_remove_codec and
soc_post_component_init functions.
Error prints in these functions are converted to use dev_err and to print
the error code.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Sun, 5 Dec 2010 12:22:46 +0000 (12:22 +0000)]
ASoC: Add trace events for jack detection
As jack detection can trigger DAPM and the latency in debouncing can create
confusing windows in operation provide some trace events which will hopefully
help in diagnostics. The soc-jack core traces all reports that it gets and
the resulting notifications to upper layers. An event for jack IRQs is also
provided for instrumentation of debounce, and used in the GPIO jack code.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Clemens Ladisch [Thu, 2 Dec 2010 10:39:34 +0000 (11:39 +0100)]
ALSA: virtuoso: fix front panel routing for D1/DX/ST(X)
The "Front Panel" switch on the Xonar D1/DX actually switches only the
output direction, so mark it appropriately.
The front panel microphone is controlled by the FMIC2MIC bit of the
CM9780. It was unconditionally enabled on the D1/DX and never set on
the ST(X); add a control for it. Selecting the front panel microphone
as source does not actually disable the microphone jack, but this is
bug-compatible with the Windows driver, and users rely on it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Thu, 2 Dec 2010 10:38:06 +0000 (11:38 +0100)]
ALSA: virtuoso: add HDMI enable switch for HDAV1.3
The GPIO bit that enables analog output on the Xonar HDAV1.3 also
disables the HDMI audio output, so we better add a switch for it.
Hopefully, this is sufficient to make the HDMI output work.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Thu, 2 Dec 2010 10:36:51 +0000 (11:36 +0100)]
ALSA: virtuoso: initialize unknown GPIO bits
Initialize the configuration of some unknown GPIO output bits (that
might not be used at all) to be the same as in the Windows driver, just
to be sure.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Uk Kim [Sun, 5 Dec 2010 08:26:07 +0000 (17:26 +0900)]
ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain
SPKOUTL_BOOST start from third bit, SPKOUTLR_BOOST start from 0 bit.
Signed-off-by: Uk Kim <w0806.kim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Uk Kim [Sun, 5 Dec 2010 08:32:16 +0000 (17:32 +0900)]
ASoC: Fix off by one error in WM8994 EQ register bank size
Signed-off-by: Uk Kim <w0806.kim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Mark Brown [Sat, 4 Dec 2010 12:41:04 +0000 (12:41 +0000)]
ASoC: Add post-CODEC bias level callback for machine driver
Currently the machine driver can only do bias level configuration before
the CODEC bias level is brought up. This means that the machine cannot do
any configuration which depends on the CODEC bias level being maintained.
Provide a post-CODEC callback which allows the machine driver to do things
like enable the FLL on a CODEC which is brought down to BIAS_OFF when idle.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Daniel T Chen [Sun, 5 Dec 2010 13:43:14 +0000 (08:43 -0500)]
ALSA: hda: Use position_fix=1 for Acer Aspire 5538 to enable capture on internal mic
BugLink: https://launchpad.net/bugs/685161
The reporter of the bug states that he must use position_fix=1 to enable
capture for the internal microphone, so set it for his machine's PCI
SSID. Verified using 2.6.35 and the 2010-12-04 alsa-driver build.
Reported-and-tested-by: Ralph Wabel <rwabel@gmx.net> Cc: <stable@kernel.org> Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Anssi Hannula [Sun, 5 Dec 2010 00:34:15 +0000 (02:34 +0200)]
ALSA: hda - use generic hdmi parser for ATI R6xx codec
Switch to the generic hdmi parser for codec id 1002:aa01 (ATI R6xx
HDMI), as the codec appears to work fine with it.
Note that the codec is still limited to stereo output only, despite it
reportedly being multichannel capable. Some as of yet unknown quirks
will be needed to get that working.
Mark Brown [Fri, 3 Dec 2010 16:02:10 +0000 (16:02 +0000)]
ASoC: When disabling WM8994 FLL force a source selection
When we disable the WM8994 FLL code path sharing means that we end up
writing out a configuration. Currently this is the currently active
input and output frequency (which causes snd_soc_update_bits() to
suppress actual writes both immediately and in the common case where
we reenable the same configuration later) but we allow machine drivers
to pass through a source of zero. Since the register values written
are one less than the source constants this causes corruption of other
bitfields in the register.
Fix this by using the most recently configured FLL source when none is
provided.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Cc: stable@kernel.org
ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default
Make sure to use codec->reg_def_copy instead of codec_drv->reg_cache_default
wherever necessary. This change is necessary because in the next patch we
move the cache initialization code outside snd_soc_register_codec() and by that
time any data marked as __devinitconst such as the original reg_cache_default
array might have already been freed by the kernel.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: soc-core: Generalize snd_soc_prefix_map and rename to snd_soc_codec_conf
The snd_soc_codec_conf struct now holds codec specific configuration
information.
A new configuration option has been added to allow machine drivers to
override the compression type set by the codec driver.
In the absence of providing an snd_soc_codec_conf struct or when providing
one but not setting the compress_type member to anything, the one supplied
by the codec driver will be used instead. In all other cases the one
set in the snd_soc_codec_conf struct takes effect.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ensure that the base value of compress_type starts at 1 so that
we know whether the machine driver has provided a compress_type
for overriding the codec supplied one.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Add compress_type as a member to snd_soc_codec
We need to keep a copy of the compress_type supplied by the codec driver
so that we can override it if necessary with whatever the machine driver
has provided us with. The reason for not modifying the codec->driver
struct directly is that ideally we'd like to keep it const.
Adjust the code in soc-cache and soc-core to make use of the compress_type
member in the snd_soc_codec struct.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Jarkko Nikula [Fri, 3 Dec 2010 07:18:22 +0000 (09:18 +0200)]
ASoC: Don't oops in soc_probe_aux_dev in case of missing codec
Blind copy of codec finding algorithm from soc_bind_dai_link does not work
in soc_probe_aux_dev if matching codec name is not found. In that case the
code falls through and tries to start the probing procedure with invalid
codec pointer.
Fix this and add an error print showing the codec name that cannot be found.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Fri, 3 Dec 2010 09:25:57 +0000 (17:25 +0800)]
ASoC: Fix inconsistent meaning of default case while checking alc5623->id
In alc5623_i2c_probe(),
the default case for checking alc5623->id behaves the same as case 0x23.
However, In alc5623_probe() the default case for checking alc5623->id
becomes to be the same as case 0x21.
This makes the meaning of default case inconsistent.
Since we have checked codec id in alc5623_i2c_probe() by comparing
vid2 with id->driver_data, it is not possible to run into the default case now.
In case we may add more supported devices to alc5623_i2c_table in the future,
this patch changes the default case return -EINVAL to let people know that
they should not run into this case. They should also add a new case accordingly
for the new id.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: sh: fsi: remove runtime register check from fsi_master_xxx
Current FSI driver was checking register range on fsi_master_xxx function.
This runtime check was added to avoid an illegal access
from wrong/mistake implementation.
But it is useless check under the correct implementation.
This patch escape runtime check by using macro technique.
If there is wrong implementation, it will be compile error.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: sh: fsi: remove runtime register check from fsi_reg_xxx
Current FSI driver was checking register range on fsi_reg_xxx function.
This runtime check was added to avoid an illegal access
from wrong/mistake implementation.
But it is useless check under the correct implementation.
This patch escape runtime check by using macro technique.
If there is wrong implementation, it will be compile error.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Thu, 2 Dec 2010 16:15:29 +0000 (16:15 +0000)]
ASoC: Move active copy of CODEC read and write into runtime structure
We shouldn't be assigning to the driver structure (which really ought
to be const, further patch to follow) though there's unlikely to be any
actual problem except in the unlikely case that two devices with the
same driver but different bus types appear in the same system.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Takashi Iwai [Fri, 3 Dec 2010 11:29:14 +0000 (12:29 +0100)]
ALSA: hda - Clean up cxt5066 port-D handling & co
Instead of hard-coded magic numbers, properly define and use macros
for improve the readability. Also, dell_automute is handled samely
as thinkpad, since it also sets port_d_mode, too.
John Baboval [Thu, 2 Dec 2010 16:21:31 +0000 (11:21 -0500)]
ALSA: hda - Fix ThinkPad T410[s] docking station line-out
On the docking station for the Lenovo T410 and T410s, the line-out
doesn't work. The trouble seems to be that it generates a plug event,
but then doesn't report that the jack is connected. So automute mutes
the jack when you plug something into it. The following patch (next
message) fixes it.
Signed-off-by: John Baboval <john.baboval at virtualcomputer.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Daniel T Chen [Fri, 3 Dec 2010 03:45:45 +0000 (22:45 -0500)]
ALSA: hda: Use model=lg quirk for LG P1 Express to enable playback and capture
BugLink: https://launchpad.net/bugs/595482
The original reporter states that audible playback from the internal
speaker is inaudible despite the hardware being properly detected. To
work around this symptom, he uses the model=lg quirk to properly enable
both playback, capture, and jack sense. Another user corroborates this
workaround on separate hardware. Add this PCI SSID to the quirk table
to enable it for further LG P1 Expresses.
Reported-and-tested-by: Philip Peitsch <philip.peitsch@gmail.com> Tested-by: nikhov Cc: <stable@kernel.org> [2.6.32+] Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jarkko Nikula [Wed, 1 Dec 2010 09:01:20 +0000 (11:01 +0200)]
ASoC: omap: N810: Don't select CONFIG_OMAP_MUX but make it as dependency
Not all omap boards use kernel based pin multiplexing so
CONFIG_SND_OMAP_SOC_N810 should not select it by default as it can make
harm to other boards in multi-board kernels.
Therefore put CONFIG_OMAP_MUX as a dependency to N810 ASoC machine driver.
Thanks to Tony Lindgren <tony@atomide.com> for noticing.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Daniel T Chen [Thu, 2 Dec 2010 00:16:07 +0000 (19:16 -0500)]
ALSA: hda: Use "alienware" model quirk for another SSID
BugLink: https://launchpad.net/bugs/683695
The original reporter states that headphone jacks do not appear to
work. Upon inspecting his codec dump, and upon further testing, it is
confirmed that the "alienware" model quirk is correct.
Reported-and-tested-by: Cody Thierauf Cc: <stable@kernel.org> [2.6.32+] Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Axel Lin [Wed, 1 Dec 2010 09:22:34 +0000 (17:22 +0800)]
ASoC: ak4535: Improve readability for setting mute
The mute/unmute is controled by SMUTE (Soft Mute Control bit):
0: Normal Operation (Default)
1: DAC outputs soft-muted
I think this change improves readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>