Commit graph

229 commits

Author SHA1 Message Date
David Henningsson c40bd914a8 ALSA: hda - avoid non-standard "Docking" name in mixers
The standard name (and what PulseAudio picks up) is "Dock Mic",
not "Docking Mic" or "Docking-Station".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 12:26:10 +02:00
Takashi Iwai 83012a7ccb ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVE
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its
behavior can be well controlled via the default value and module
parameter.  Let's just replace it with the standard CONFIG_PM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30 07:50:13 -07:00
Takashi Iwai 1c86845268 ALSA: hda - Add 3stack-automute model to AD1882 codec
Added a simple support of automute for the front HP jack to AD1882
stack model.  Such an addition is basically an exception -- we really
want to avoid the static quirk codes, but AD1882 parser isn't still
ready for moving to the BIOS auto-parser yet.  So, as a quick fix, I
merged it for now.

In near future, we really need the big clean up of patch_analog.c to
move on to the auto-parser...

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-15 11:50:05 +02:00
Takashi Iwai 68cb2b5592 ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.

Since we change vx222, vx_core and vxpocket have to be converted,
too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-03 08:23:03 +02:00
Takashi Iwai 128bc4ba8c ALSA: hda - Move BIOS pin-parser code to hda_auto_parser.c
Just code shuffles.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-08 18:01:33 +02:00
Takashi Iwai 4740860b53 ALSA: hda - Add snd_hda_get_default_vref() helper function
Add a new helper function to guess the default VREF pin control bits
for mic in.  This can be used to set the pin control value safely
matching with the actual pin capabilities.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-20 13:06:53 +02:00
Takashi Iwai cdd03cedc5 ALSA: hda - Introduce snd_hda_set_pin_ctl*() helper functions
For setting the pin-control values more safely to match with the
actual pin capability bits, a copule of new helper functions,
snd_hda_set_pin_ctl() and snd_hda_set_pin_ctl_cache(), are
introduced.  These are simple replacement of the codec verb write with
AC_VERB_SET_PIN_WIDGET but do more sanity checks and filter out
superfluous pin-control bits if they don't fit with the corresponding
pin capabilities.

Some codecs are screwed up or ignore the command when such a wrong bit
is set.  These helpers will avoid such secret errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-20 12:38:48 +02:00
Takashi Iwai 29e5853d61 ALSA: hda - Return the created kcontrol in __snd_hda_add_vmaster()
It'll be used for adding hooks in later patches.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-12 14:52:28 +01:00
Takashi Iwai 18478e8b62 ALSA: hda - Initialize vmaster slave volumes
When the driver is changed to use vmaster or a new slave element is
added by the improvement of the parser code, user may face often the
silent output because of the muted slave mixer although Master volume
is properly set.  And they complain.  And I get upset.

Although such a mixer element should be initialized via "alsactl init",
it'd be more user-friendly if the known output slaves are unmuted and
set to 0dB so that user can control the volume only with Master as
default.  Since Master is still set muted as default even with this
change, no risk of the speaker blow up, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-03-09 17:55:30 +01:00
Takashi Iwai 9322ca5497 ALSA: hda - Add suffix argument to snd_hda_add_vmaster()
In most cases, the slave strings for vmaster are identical between
volumes and switches except for "xxx Volume" and "xxx Switch" suffix.
Now snd_hda_add_vmaster() takes the optional suffix argument so that
each string can be composed with the given suffix, and we can share the
slave name strings in both volume and switch calls nicely.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-03 14:28:01 +01:00
Takashi Iwai 1835a0f9a2 ALSA: hda - Cache the jack-detection value
Introduce a table containing the pins and their jack-detection states
for avoiding the unnecessary verbs to check the pin status at each time.

When the unsol event is enabled via snd_hda_jack_detect_enable(), it
automatically adds the given NID to the table.  Then the driver supposes
that the codec driver will set the dirty flag appropariately when an
unsolicited event is invoked for that pin.

The behavior for reading other pins that aren't registered in the table
doesn't change.  Only the pins assigned to the table are cached, so far.

In near futre, this table can be extended to use the central place for
the unsolicited events of all pins, etc, and eventually include the
jack-detect kcontrols that replace the current input-jack stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-11-16 11:11:15 +01:00
Paul Gortmaker da155d5b40 sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence
of it in <linux/device.h> but we are going to clean that up.  So
fix up those users now.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:21 -04:00
Raymond Yau 34588709af ALSA: HDA - Add Independent Headphone for all models of ad1988/ad1989
- Add "AD198x Headphone" playback device for independent headphone playback
  while playing 7.1 surround using rear panel audio jacks.

- Remove "6stack-dig-fp" model since "Headphone Playback Volume" control using
  DAC0 instead of DAC1 (HDA_FRONT) was already added to all models.

- Add "Independent HP" switch to enable/disable this playback device.
  When the switch is OFF, headphone use "copy front" mode to get the front
  channel as the green jack.
  When the switch is ON, you can play stereo sound through "AD198x Headphone"
  device to headphone while playing 7.1 surround sound through "AD198x Analog"
  device.
  The switch cannot be changed when either "AD198x Headphone" or "AD198X Analog"
  is open.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-23 15:21:29 +02:00
Raymond Yau 356aab7d41 ALSA: hda - Add Headphone Playback Volume control for ad1988/ad1989
- use DAC0 instead of DAC1 for Port-A Headphone
- assign 0x03 to spec->multiout.hp_nid except model="6stack-dig-fp"

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-12 10:34:48 +02:00
Takashi Iwai 2a43952a99 ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM
It makes little sense to enable power-saving without PM.
This removes SND_HDA_NEEDS_RESUME define so that we can use CONFIG_PM
in all places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-26 17:21:18 +02:00
Takashi Iwai 695cd4a34e ALSA: hda - Disable SPDIF only when no pin config set for HP with AD1981
Some HP laptops with AD1981 have SPDIF connections, but currently the
driver disables it statically.  Better to check the pin default config
to judge whether to enable or disable the SPDIF.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-10 14:37:04 +02:00
Stephen Warren 74b654c957 ALSA: hda: Virtualize SPDIF out controls
The SPDIF output controls apply to converter widgets. A future change
will create a PCM device per pin widget, and hence a set of SPDIF output
controls per pin widget, for certain HDMI codecs. To support this, we
need the ability to virtualize the SPDIF output controls. Specifically:

* Controls can be "unassigned" from real hardware when a converter is
  not used for the PCM the control was created for.
* Control puts only write to hardware when they are assigned.
* Controls can be "assigned" to real hardware when a converter is picked
  to support output for a particular PCM.
* When a converter is assigned, the hardware is updated to the cached
  configuration.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-06 12:51:59 +02:00
Raymond Yau a01ef051d5 ALSA: hda - Check pin support EAPD in ad198x_power_eapd_write
Check whether the pin supports EAPD in ad198x_power_eapd_write.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 10:08:46 +02:00
Takashi Iwai 4dffbe03d1 ALSA: hda - Fix HP and Front pins of ad1988/ad1989 in ad198x_power_eapd()
In ad198x_power_eapd(), wrong pin NIDs are used for controlling EAPD for
HP and Front outputs of AD1988/AD1989.  These are actually same with the
ones for AD1984 & co, port-A is 0x11 and port-D 0x12.

Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-06-03 10:05:02 +02:00
Tony Vroon 4e60b4f830 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.

Signed-off-by: Tony Vroon <tony@linx.net>
Tested-by: Doug Redlich <pbrigade@nxltech.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-25 07:30:39 +02:00
Adrian Wilkins 5a2d227fdc ALSA: hda - Fix input-src parse in patch_analog.c
Compare pin type enum to the pin type and not the array index.
Fixes bug#0005368.

Signed-off-by: Adrian Wilkins <adrian.wilkins@nhs.net>
Cc: <stable@kernel.org> (2.6.37 and later)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-20 09:01:28 +02:00
Takashi Iwai 498f5b175b ALSA: hda - Constify fixup and other array data in patch_analog.c
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02 12:20:27 +02:00
Takashi Iwai dda144103c ALSA: hda - Constify some API function arguments
Also fixed the assignment of multiout.dac_nids to satisfy const.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-02 12:07:48 +02:00
Takashi Iwai 0da2692256 ALSA: hda - Move EAPD power-down into shutup callback for AD codecs
EAPD power-down should be called also for normal shutup cases.
Let's move to there.   This also fixes the compile warnings when
CONFIG_PM isn't set automatically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-26 15:18:33 +02:00
David Henningsson 677cd904ab ALSA: HDA: New AD1984A model for Dell Precision R5500
For codec AD1984A, add a new model to support Dell Precision R5500
or the microphone jack won't work correctly.

BugLink: http://bugs.launchpad.net/bugs/741516
Tested-by: Kent Baxley <kent.baxley@canonical.com>
Cc: stable@kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-25 11:31:54 +01:00
Raymond Yau 2822084607 ALSA: hda - simplify multistreaming playback model of ad1988
Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-14 17:14:35 +01:00
Takashi Iwai ea73496324 ALSA: hda - consitify string arrays
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-18 07:43:17 +01:00
Raymond Yau c66ddf32dd ALSA: hda - Add add multi-streaming playback for AD1988
Attached a patch which add a new model to support multi-streaming
playback for ad1988.

playback another stereo stream through the front panel headphone on
device 2 while playback through the speakers connected to rear panel
on device 0 at the same time.

Tested with ad1988a rev2 codec on asus P5B-V motherboard.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-18 07:43:05 +01:00
David Henningsson 5f99f86a80 ALSA: HDA: Rename "Mic Boost" to "Mic Boost Volume"
BugLink: http://bugs.launchpad.net/bugs/697240

If the "Volume" suffix is not given, alsa-lib gets confused and
loses the dB information at the simple element level.

Boosts generally affects both playback and capture, as they are
applied early in the chain. Hence no "Playback" or "Capture" in
the suffix.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10 10:53:34 +01:00
Takashi Iwai 0e7adbe263 ALSA: hda - Disable sticky PCM stream assignment for AD codecs
The sticky PCM stream assignment introduced in 2.6.36 kernel seems
causing problems on AD codecs.  At some time later, the streaming no
longer works by unknown reason.  A simple workaround is to disable
sticky-assignment for these codecs.

Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-25 10:39:23 +02:00
Takashi Iwai 5e09416f36 Merge branch 'fix/hda' into topic/hda 2010-09-21 17:40:48 +02:00
Luke Yelavich 0f9f1ee9d1 ALSA: hda - Add Dell Latitude E6400 model quirk
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/643891

Set the Dell Latitude E6400 (1028:0233) SSID to use AD1984_DELL_DESKTOP

Cc: stable@kernel.org
Signed-off-by: Luke Yelavich <luke.yelavich@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-21 10:07:45 +02:00
Takashi Iwai 10a20af7c9 ALSA: hda - Improve the input source name labels
This patch improves the input-source label strings to be generated from
the pin information instead of fixed strings per AUTO_PIN_* type.
This gives more suitable labels, especially for mic and line-in pins.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09 16:46:03 +02:00
Takashi Iwai 86e2959a10 ALSA: hda - Remove AUTO_PIN_FRONT_{MIC|LINE}
We can assign multiple pins to a single role now, let's reduce the
redundant FRONT_MIC and FRONT_LINE.  Also, autocfg->input_pins[] is
no longer used, so this is removed as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09 16:46:01 +02:00
Takashi Iwai b5786e85cb ALSA: hda - Keep char arrays in input_mux items
Keep char array in the input_mux item itself instead of pointing to
an external string.  This is a preliminary work for improving the
input-mux name based on the pin role.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09 16:45:58 +02:00
Takashi Iwai 9e042e7132 ALSA: hda - Use new inputs[] field to parse input-pins for AD codecs
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-30 13:04:44 +02:00
Jerone Young 68c1869791 ALSA: hda - Fix Thinkpad X300 so SPDIF is not exposed
Just as with the X301. The X300 does not have a way to do SPDIF either.
It does not have a dock connector, nor does it have the SPDIF through
the headphone jack.

This patch fixes it so X300 does not show SPDIF, since it cannot do it.

To add all Lenovo Thinkpads had different codec subsytem IDs:

X300:
http://launchpadlibrarian.net/34862838/Card0.Codecs.codec.0.txt

Signed-off-by: Jerone Young <jerone.young@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-03 08:57:47 +02:00
Takashi Iwai 20d157aef2 Merge branch 'fix/hda' into topic/hda 2010-05-06 08:39:43 +02:00
Takashi Iwai b7d2526f5c ALSA: hda - Fix resume from StR of HP 2510p with docking-station
When HP laptop with AD1981 codec is suspended and the docking-station
is connected before the resume, the outputs get confused, and wrongly
routed still to the speaker.  This is because of a change in 2.6.34-rc1
ea52bf260e
    ALSA: hda: Add powerdown for Analog Devices HDA codecs

The problem was the added resume callback that doesn't consider the
modified init hook.  The fix is simply remove the resume callback here
and make the resume normally.  This doesn't change any behavior intended
in the commit above (for shutting down the sound at suspend) but only
fixes the resume.

Reported-and-tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-19 18:11:29 +02:00
Takashi Iwai 7a2e38a555 Merge branch 'fix/hda' into topic/hda 2010-04-01 16:04:13 +02:00
Daniel T Chen b8e80cf386 ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
BugLink: https://launchpad.net/bugs/551606

The OR's hardware distorts at PCM 100% because it does not correspond to
0 dB. Fix this in patch_ad1981() for all models using the Thinkpad
quirk.

Reported-by: Jane Silber
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-31 11:47:14 +02:00
Jaroslav Kysela 0bf0e5a6f3 ALSA: hda-intel - AD1984 thinkpad - add analog beep input control
For Lenovo Thinkpad T61/X61, the analog beep input is connected
to node 0x20, index 3. Move the digital beep mute/volume controls
as "Digital Beep" and create analog beep controls for mentioned node.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-26 10:37:43 +01:00
Takashi Iwai a91a4aa1ee Merge branch 'topic/hda' into for-linus 2010-03-01 12:38:54 +01:00
Daniel T Chen ba579eb7b3 ALSA: hda: Use 3stack quirk for Toshiba Satellite L40-10Q
BugLink: https://bugs.launchpad.net/bugs/524948

The OR has verified that the existing model=laptop-eapd quirk does not
function correctly but instead needs model=3stack.  Make this change
so that manual corrections to module-init-tools file(s) are not
required.

Reported-by: Lasse Havelund <lasse@havelund.org>
CC: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 08:15:21 +01:00
Jaroslav Kysela ba9341dfef Merge branch 'fixes' into devel 2010-02-16 11:19:18 +01:00
Jaroslav Kysela fd0b092a7b ALSA: hda - AD1988 codec - fix SPDIF-input mixer initialization (unmute)
The SPDIF-input pin 0x1c is muted by default in hardware. Unmute appropriate
pin to get captured samples instead zeros. Tested on Lenovo Thinkstation.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-01-21 14:54:38 +01:00
Takashi Iwai 9e4c84967e Merge branch 'fix/hda' into topic/hda
Conflicts:
	sound/pci/hda/patch_realtek.c
2010-01-19 15:53:43 +01:00
Daniel T Chen ea52bf260e ALSA: hda: Add powerdown for Analog Devices HDA codecs
This patch ports powerdown fixes to AD198x. Currently we only turn off
Front and HP for suspend, but this is easily extended for additional
nids.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-28 12:15:17 +01:00
Takashi Iwai 729d55ba97 ALSA: hda - Disable tigger at pin-sensing on AD codecs
Analog Device codecs seem to have problems with the triggering of
pin-sensing although their pincaps give the trigger requirements.
Some reported that constant CPU load on HP laptops with AD codecs.

For avoiding this regression, add a flag to codec struct to notify
explicitly that the codec doesn't suppot the trigger at pin-sensing.

Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25 22:49:01 +01:00
Takashi Iwai 21949f00a0 ALSA: hda - Fix NID association for capture mixers
Fix the wrong implementation of NID <-> kctl mapping for capture mixers
introduced by the ocmmit 5b0cb1d850.
So far, the driver returns an error at probe.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-23 08:38:28 +01:00