Stelian Pop [Thu, 30 Jul 2009 12:44:27 +0000 (14:44 +0200)]
ALSA: hda - Enable HP output with Macbook Pro 5, 5
The patch below, to be applied on the latest sound-unstable-2.6.git,
enables headphones output on my MacBookPro 5,5, together with the
automuting feature.
Here is the exact soundcard id:
Vendor Id: 0x10134206
Subsystem Id: 0x106b4d00
Revision Id: 0x100301
ALSA: hda - Remove static connection in IDT 92HD71bxx
We don't need any more static connection to the port F (which is often
used for docking stations) since its connection is done dynamically via
DAC assignment now.
ALSA: hda - Support auto-mic switching with IDT/STAC codec
Support the automatic mic-switching with some devices with IDT/STAC
codecs. The condition is that the device has only two inputs, one
for an external mic and one for an internal mic.
ALSA: hda - Avoid overwrite of jack events with STAC/IDT
Since only one event can be associated to a (pin) widget, it's safer
to avoid the multiple mapping. This patch fixes the behavior of the
STAC/IDT codec driver.
Now stac_get_event() doesn't take the type argument but simply returns
the first hit element. Then enable_pin_detect() checks the validity
of the type, and returns non-zero only if a valid entry. The caller
can call stac_issue_unsol_event() after checking the return value.
Instead of static snd_kcontrol_new arrays, create "Capture Volume"
and "Capture Switch" controls dynamically based on the mixer attr
values (made via HDA_COMPOSE_AMP_VAL()).
This reduces the code size and gives more flexibility to change
the number of controls later.
ALSA: hda - Don't create unneeded digital input source for IDT 92HD71x
The current driver creates always the digital input source mixer
elements for IDT 92HD71x codecs no matter whether digital mics are
present. This patch adds the proper check to avoid the creation of
these controls if unnecessary.
ALSA: hda - Reword information messages for BIOS auto-probing mode
The sentense "Unknown model for xxx, ..." makes people too nervous
and drives them to a direction to a wrong "fix" by giving any
mismatching model option.
Let's rephrase the messages to be more nice and easy (at least that
won't make people suspect conspiracies).
Jaroslav Kysela [Thu, 23 Jul 2009 08:58:29 +0000 (10:58 +0200)]
ALSA: hda - Add better Intel IbexPeak platform support
Here are the new sound enabling patches for IbexPeak.
Summary of tested features:
- playback
- Front Headphone: OK
- 8 channel audio: Front/Rear/CLFE/Side all OK
- recording
- Front Mic/Rear Mic: both OK
(front/rear/line mics are selectable in the "Input source" alsamixer control)
- Line In: not working
(in 6ch mode, its amp/mute, direction and route all looks fine,
so I'm a little puzzled)
(hopefully no one will care this feature)
- digital SPDIF input/output: not tested (no equipment)
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
The commit 099db17e66294b02814dee01c81d9abbbeece93e introduced a
regression at suspend/resume where the GPIO1 bit isn't properly
restored, thus the speaker output gets muted initially after resume.
The fix is simple, use the cached write for storing GPIO data.
Jaroslav Kysela [Wed, 22 Jul 2009 14:20:40 +0000 (16:20 +0200)]
ALSA: hda-intel: Cleanups for widget connection list handling
This patch adds a check to snd_hda_get_connections() routine for
presence of AC_WCAP_CONN_LIST. Also, make sure that negative error
codes from noted route are handled on all places as errors.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add some tricks to reduce the click noise at powering down to D3
in the power saving mode on STAC/IDT codecs.
The key seems to be to reset PINs before the power-down, and some
delay before entering D3. The needed delay is significantly long,
but I don't know why.
ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
The recent rewrite of the codec parser for STAC9872 caused a regression
for some Sony VAIO models that don't give proper pin default configs
by BIOS. Even using model=vaio doesn't work because the pin definitions
are set after the pin overrides.
This patch fixes the pin definitions in patch_stac9872() to be put
in the right place before the pin overrides. Also the patch adds the
new quirk entry for VAIO F/S to have the correct pin default configs.
Hao Song [Mon, 20 Jul 2009 07:01:16 +0000 (15:01 +0800)]
ALSA: hda - Add quirk for Gateway T6834c laptop
Gateway T6834c laptops need EAPD always on while the default behavior
for the STAC9205 reference board is to turn it off upon every HP plug.
By using the special "eapd" model, which is first introduced for Gateway
T1616 laptops for this same reason, this peculiarity can be properly
handled.
Signed-off-by: Hao Song <baritono.tux@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Sat, 18 Jul 2009 09:48:19 +0000 (11:48 +0200)]
ALSA: hda_codec: Check for invalid zero connections
To prevent "Too many connections" message and the error path for some HDMI
codecs (which makes onboard audio unusable), check for invalid zero
connections for CONNECT_LIST verb.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
- Parse the mono output pin 0x16 correctly even as the primary output
- Create "Speaker" volume control if the primary output is a speaker
- Fix the wrong direction of (optional) "Mono" switch
ALSA: hda - add bounds checking for the codec command fields
A recent bug involves passing auto detected >0x7f NID to codec command,
creating an invalid codec addr field, and finally lead to cmd timeout
and fall back into single command mode. Jaroslav fixed that bug in
alc880_parse_auto_config().
It would be safer to further check the bounds of all cmd fields.
Daniel Drake [Thu, 16 Jul 2009 13:46:57 +0000 (14:46 +0100)]
ALSA: hda - Add CX20582 and OLPC XO-1.5 support
This adds support for the Conexant CX20582 codec, based on code from
http://www.linuxant.com/alsa-driver/alsa-driver-linuxant-1.0.19ppch12-1.noarch.rpm.zip
This is the codec to be shipped in the OLPC XO-1.5, so this patch also
includes an XO-specific profile. Resultant configuration:
http://dev.laptop.org/~dsd/20090713/codec0.txt
http://dev.laptop.org/~dsd/20090713/codec0.svg
As the Linuxant code is structured differently to the other codecs,
I was unable to cleanly reimplement everything in the generic and Dell
profiles as more info is needed (e.g. codec graphs). I simplified those
profiles so that hopefully it will not break anyone's audio. If it does,
it may be worth returning -ENODEV from patch_cx5066 on non-OLPC systems,
and then fixing snd_hda_codec_configure() to fall back on the generic
parser, at least until support for other systems is figured out.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Check codec errors in snd_hda_get_connections()
The codec read errors in snd_hda_get_connections() are ignored so far,
and it causes a problem like the bug in the commit 9d30937accf2c01e8b0bd59787409a7348cbbcb7
ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
Better to check errors in the function and returns a proper error code
rather than passing bogus NID values.
Jaroslav Kysela [Fri, 10 Jul 2009 10:27:31 +0000 (12:27 +0200)]
ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
On some IbexPeak systems with ALC889A errors like "azx_get_response
timeout, switching to polling mode: last cmd=0xaf9f000b" are produced,
because non-existent codec #10 is wrongly accessed.
The problem is that snd_hda_get_connections() returns out-of-range result
for NID 0x1c (something like 0xf8f9 or 0xffff).
This patch adds a check to alc880_parse_auto_config() to avoid using
of this out-of-range NIDs. A better fix maybe to improve
snd_hda_get_connections() routine to check for valid NID ranges if
NIDs are expected as result.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Simplify ALC882_TARGA and return gpio3 to ALC883_TARGA_DIG and
ALC883_TARGA_2ch_DIG, which I accidentally removed in commit id 64a8be74357477558183b43156c5536b642de134
Signed-off-by: David Heidelberger <d.okias@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Paul Vojta [Thu, 9 Jul 2009 06:57:46 +0000 (23:57 -0700)]
ALSA: hda - fix beep tone calculation for IDT/STAC codecs
In the beep tone calculation for IDT/STAC codecs, lower numbers correspond
to higher frequencies and vice versa. The current code has this backwards,
resulting in beep frequencies which are way too high (and sound bad on
tinny laptop speakers, resulting in complaints).
[Also added hz <= 0 check by tiwai]
Signed-off-by: Paul Vojta <vojta@math.berkeley.edu> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Darren Salt [Wed, 8 Jul 2009 14:29:49 +0000 (15:29 +0100)]
ALSA: hda - Missing volume controls for Intel HDA (ALC269/EeePC)
There is a regression, introduced in aa202455eec51699e44f658530728162cefa1307
(in alsa-kernel) which I noticed when trying to use the headphone socket on
my EeeCPC 901: the output was *very* quiet, practically silent.
This patch corrects the control types to that which was obviously intended in
the referenced commit.
Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Disable AMD SB600 64bit address support only
HDA driver disabled HD audio 64bit address support for all AMD
SB600/SB700/SB800 platforms with commit 09240cf429505891d6123ce14a29f58f2a60121e due to one SB600 issue
reported by community, but we do not see the similar issue on
SB700/SB800 platforms.
This patch is to refine the workaround for SB600 only.
ALSA: hda - Add missing EAPD initialization for VIA codecs
If the output pin is used and EAPD capability is present, turn on
the EAPD bit. This fixes the silent output problem on ASUS laptops
with VT1708S codec.
The parser wasn't called in the proper order.
Split now the parser to be called in patch_cirrus(), and the rest
are just for building PCMs and controls.
ALSA: hda - Don't override maxbps for FLOAT sharing with linear formats
When FLOAT PCM format is available but together with other linear
PCM formats, don't override maxbps value. For FLOAT format, it's always
32, thus it can be better checked in snd_hda_calc_stream_format().
Otherwise the maxbps 32 might be used wrongly even if the linear PCM
doesn't support it.
Add some sanity checks of struct snd_pcm_hardware fields in the PCM
open callback of hda driver. This makes a bit easier to debug any PCM
setup errors in the codec side.
ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback
The PCM rates bit field may have been changed by the codec open callback.
In that case, we need to reset rate_min and rate_max. So, simply call
snd_pcm_lib_hw_rates() again after the codec open callback.
ALSA: hda - Avoid invalid formats and rates with shared SPDIF
Check whether formats and rates don't result in zero due to the
restriction of SPDIF sharing. If any of them can be zero, disable
the SPDIF sharing mode instead. Otherwise it will lead to a PCM
configuration error.
The mixer elements created for ASUS eeePC 1000 with ALC269 aren't
standard but strange words like "LineOut". Rename the element names
to follow the standard one like "Headphone" and "Speaker".
Also, split the volumes to each so that the virtual master can control
them.
The alc269_fujitsu_mixer is removed because it's now identical with
the new eeepc mixer.
ALSA: hda - Add GPIO1 control at muting with HP laptops
HP laptops with AD1984A codecs (at least mobile models) need to set
GPIO1 appropriately to indicate the mute state. The BIOS checks this
bit to judge whether the mute on or off is sent via F8 key.
Without changing this bit, the BIOS can be confused and may toggle
the mute wrongly.
Instead of expanding alc882_init_verbs to two elements via a macro,
manually expand to each entry. This makes clear that some have already
the full slot for init_verbs array (currently 5).
ALSA: hda - Add missing mixer amp initialization for ALC882
After merting patch_alc882() and patch_alc883(), the initialization of
mixer amp 0x0b was missing in alc882_base_init_verbs[].
This is usually no critical problem, but it can disable the power-saving
as the default state, so better to put to mute these channels.
Takashi Iwai [Mon, 29 Jun 2009 09:33:53 +0000 (11:33 +0200)]
ALSA: hda - Add missing initializations for ALC268 and ALC269
During the changes to clean up / fix the realtek codec initialization
routines in commit 4a79ba34cada6a5a4ee86ed53aa8a73ba1e6fc51,
I forgot to add the check for ALC268 and ALC269.
This resulted in the missing EAPD and COEF setup for these codecs.
This patch adds the missing checks for these codecs.
Tony Vroon [Fri, 26 Jun 2009 08:27:50 +0000 (09:27 +0100)]
ALSA: hda - Line In for Acer Inspire 6530G model
The Line In connector is set up as PIN_IN by default, using
VREF_HIZ. It is connected to both ADCs, so add it to both
input selectors.
Also add the ability to use the input mix (on a SoundBlaster
one would call this "What You Hear").
Signed-off-by: Tony Vroon <tony@linx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Linus Torvalds [Wed, 24 Jun 2009 21:35:57 +0000 (14:35 -0700)]
Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
da9030_battery: Fix race between event handler and monitor
Add MAX17040 Fuel Gauge driver
w1: ds2760_battery: add support for sleep mode feature
w1: ds2760: add support for EEPROM read and write
ds2760_battery: cleanups in ds2760_battery_probe()
Linus Torvalds [Wed, 24 Jun 2009 21:17:14 +0000 (14:17 -0700)]
Merge branches 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/{vfs-2.6,audit-current}
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
another race fix in jfs_check_acl()
Get "no acls for this inode" right, fix shmem breakage
inline functions left without protection of ifdef (acl)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
audit: inode watches depend on CONFIG_AUDIT not CONFIG_AUDIT_SYSCALL
Eric Paris [Wed, 24 Jun 2009 20:09:01 +0000 (16:09 -0400)]
audit: inode watches depend on CONFIG_AUDIT not CONFIG_AUDIT_SYSCALL
Even though one cannot make use of the audit watch code without
CONFIG_AUDIT_SYSCALL the spaghetti nature of the audit code means that
the audit rule filtering requires that it at least be compiled.