Ondrej Zary [Mon, 9 May 2011 21:39:26 +0000 (23:39 +0200)]
ALSA: tea575x: unify read/write functions
Implement generic read/write functions to access TEA575x tuners. They're now
implemented 4 times (once in es1968 and 3 times in fm801).
This also allows mute to work on all cards.
Also improve tuner detection/initialization.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
The SSM2604 is basically a lightweight variant of the SSM2602 with a compatible
register layout. Thus we can easily support both devices by the same driver,
by providing a slightly set of controls, widgets and routes.
Compared to the SSM2602 the SSM2604 has no microphone input and no headphone
output.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
It is not required to have the codec powered at this stage and DAPM will power
the ADC and DAC down again after probe has run anyway.
Thus we avoid some unnecessary writes by this change.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Define POWER_OFF_ON_STANDBY cause trobles when trying to get some
sound from codec because code for bias setup was not compiled
(define wasn't defined). This define was removed in commit: cc3202f5 but again introduced by commit: f0fba2ad1 which then
completely break codec functionality so remove it again.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
There are currently two controls which allow selecting the capture source, one
as a normal control, the other as part of a DAPM_MUX widget.
Remove the normal control.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Create codec DAPM widgets before calling the codecs probe function
This allows to create DAPM routes depending on those widgets in the
codecs probe function. This is helpful when supporting similar codecs
with minor differences in the DAPM routing with the same driver.
Something similar has already been done for cards in commit a841ebb9 (ASoC: Create card DAPM widgets early so they can be used in
callbacks).
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi Iwai [Wed, 4 May 2011 16:28:50 +0000 (18:28 +0200)]
ALSA: hda - Use position_fix=3 as default for AMD chipsets
AMD chipsets often behave pretty badly regarding the DMA position
reporting. It results in the bad quality audio recording.
Using position_fix=3 works well in general for them, so let's enable
it as default for AMD.
Mark Brown [Tue, 3 May 2011 17:25:34 +0000 (18:25 +0100)]
ASoC: Don't crash on PM operations
The move over to exposing snd_soc_register_card() let the initialisation
of the driver data we use to find the card in PM operations go AWOL. Fix
this by setting the driver data when we register the card.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
This is useful when a single register bit or field affects multiple
muxes at once. The common case is to have separate control bits or
fields for each mux (channel). An alternative way of looking at this
is that the mux is a stereo (or even n-channel) mux, rather than
independant mono muxes.
Without this change, a separate kcontrol will be created for each
DAPM_MUX. This has the following disadvantages:
* Confuses the user/programmer with redundant controls that don't
map to separate hardware.
* When one of the controls is changed, ASoC fails to update the DAPM
logic for paths solely affected by the other controls impacted by
the same register bits. This causes some paths not to be correctly
powered up or down. Prior to this change, to work around this, the
user or programmer had to manually toggle all duplicate controls away
from the intended setting, and then back to it.
Control sharing implies that the control is named based on the
kcontrol_new itself, not any of the widgets that are affected by it.
Control sharing is implemented by: When creating kcontrols, if a
kcontrol does not yet exist for a particular kcontrol_new, then a new
kcontrol is created with a list of widgets containing just a single
entry. This is the normal case. However, if a kcontrol does already
exists for the given kcontrol_new, the current widget is simply added
to that kcontrol's list of affected widgets.
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, 28 Apr 2011 23:38:00 +0000 (17:38 -0600)]
ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol
A future change will allow multiple widgets to be affected by the same
control. For example, a single register bit that controls separate muxes
in both the L and R audio paths.
This change updates the code that handles relevant controls to be able
to iterate over a list of affected widgets. Note that only the put
functions need significant modification to implement the iteration; the
get functions do not need to iterate, nor unify the results, since all
affected widgets reference the same kcontrol.
When creating the list of widgets, always create a 1-sized list, since
the control sharing is not implemented in this change.
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, 28 Apr 2011 23:37:59 +0000 (17:37 -0600)]
ASoC: Add w->kcontrols, and populate it
Future changes will need reference to the kcontrol created for a given
kcontrol_new. Store the created kcontrol values now.
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, 28 Apr 2011 23:37:58 +0000 (17:37 -0600)]
ASoC: s/w->kcontrols/w->kcontrol_news/g
A future change will modify struct snd_soc_dapm_widget to store the
actual kcontrol pointers for each kcontrol_new in a field named
kcontrols. Rename the existing kcontrols field to enable this.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The i2s shutdown callback has the check whether it should be disabled reversed.
Currently it is disabled if another stream is still active, but kept enabled if
the last stream is closed. This patch fixes it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Move DAPM widget debugfs entry creation to snd_soc_dapm_new_widgets
Currently debugfs entries for a DAPM widgets are only added in
snd_soc_dapm_debugfs_init. If a widget is added later (for example in the
dai_link's probe callback) it will not show up in debugfs.
This patch moves the creation of the widget debugfs entry to
snd_soc_dapm_new_widgets where it will be added after the widget has been
properly instantiated.
As a side-effect this will also reduce the number of times the DAPM widget list
is iterated during a card's instantiation.
Since it is possible that snd_soc_dapm_new_widgets is invoked form the codecs or
cards probe callbacks, the creation of the debugfs dapm directory has to be
moved before these are called.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Move DAPM debugfs directory creation to snd_soc_dapm_debugfs_init
Move the creation of the DAPM debugfs directory to snd_soc_dapm_debugfs_init
instead of having the same duplicated code in both codec and card DAPM setup.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mike Rapoport [Tue, 26 Apr 2011 08:52:42 +0000 (11:52 +0300)]
ASoC: tegra: TrimSlice machine support
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Acked-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Takashi Iwai [Tue, 3 May 2011 14:32:48 +0000 (16:32 +0200)]
ALSA: lola - Changes in proc file
The codec proc file becomes a read only that shows the codec widgets
in a text form. A new proc file, codec_rw, is introduced instead for
accessing the Lola verb directly by reading and writing to it.
Also, regs proc file shows the contents of DSD, too.
Takashi Iwai [Tue, 3 May 2011 14:14:46 +0000 (16:14 +0200)]
ALSA: Add the driver for Digigram Lola PCI-e boards
Added a new driver for supporting Digigram Lola PCI-e boards.
Lola has a similar h/w design like HD-audio but with extended verbs.
Thus the driver is written similarly like HD-audio driver in the bus
part. The codec part is rather written in a fixed way specific to the
Lola board because of the verb incompatibility.
The driver provides basic PCM, supporting multi-streams and mixing.
Takashi Iwai [Tue, 3 May 2011 10:50:29 +0000 (12:50 +0200)]
ASoC: Declare const properly for enum texts
The enum texts are supposed to be const char * const []. Without the
second const, it gets compile warnings like
sound/soc/codecs/max98095.c:607:2: warning: initialization discards qualifiers from pointer target type
Raymond Yau [Tue, 3 May 2011 05:33:53 +0000 (13:33 +0800)]
ALSA: hda - fix NULL-dereference in patch_realtek
Fix NULL-dereference when try to use alt_playback since those codecs
which support multistreaming playback usually have more than 1 adc but
the driver should create alt_capture when spec->stream_analog_alt_capture
is also defined.
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
It turned out that there are different pin configurations for this
PCI SSID, including multi-channel modes. And more proper fix for
allowing line-out mutes will come up in 2.6.40 tree, so we won't need
this fixup any more there.
The PCI SSID is 1025:031c and the codec SSID is 1025:031d,
so the driver mistakes this for a SKU value, but looking at
the numbers, this is obviously wrong.
ALSA: hda - Add Auto-Mute Mode enum for two-output cases
The Auto-Mute Mode control is useful even when only two outputs
(e.g. HP and speaker) are available. Then user can enable/disable
the auto-mute behavior on the fly.
ALSA: hda - More line-out auto-mute support for Realtek
Not only supporting the line-out automute as additional feature
to the existing headphone automute, now the headphone jack can
mute the line-out alone even without the speaker outs.
ALSA: hda - Add support for Line-Out automute to Realtek auto-parser
By popular demands, I add the functionality to mute / unmute the
line-out jacks per the headphone plug / unplug. For achieving this
and keeping the compatibility with the old behavior, the new mixer
enum "Auto-Mute Mode" is added. With this, user can control the
auto-mute behavior either disabled, speaker-only or lineout+speaker.
ALSA: hda - Consolidate auto-mute with master-switch for Realtek
Yet another consolidation of auto-mute functions for the devices
controlling the output muts together with the master mixer switch,
typically found for ALC262 machines.