Takashi Iwai [Wed, 18 Nov 2009 13:23:37 +0000 (14:23 +0100)]
ALSA: hda - Fix detection of dual headphones
The dual-headphone mode with STAC/IDT codecs is useful only for machines
that have two (or more) built-in headphones.
But, some HP laptops give multiple headphone pin configs, one for the
built-in and another for the separate (likely a docking station) one.
This results in a missing speaker volume control.
This patch adds more check for the dual-headphone mode to avoid this
problem.
Dan Carpenter [Wed, 18 Nov 2009 08:31:57 +0000 (10:31 +0200)]
ALSA: remove unnecessary null check
This function is only called from snd_ctl_ioctl() and the file parameter
can never be null so there is no need to check it here.
We dereference file at the start of the function:
struct snd_card *card = file->card;
and it confuses static checkers to dereference a pointer before
checking it.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Wu Fengguang [Wed, 18 Nov 2009 04:38:06 +0000 (12:38 +0800)]
ALSA: intelhdmi - sticky stream id and format
We tracked down the first-0.5s-hdmi-audio-samples-lost problem to the
AC_VERB_SET_CHANNEL_STREAMID command. It is suspected that many HDMI
sinks need some time to adapt to the new state.
The workaround is to avoid changing stream id/format whenever possible.
Proposed by David.
Krzysztof Helt [Tue, 17 Nov 2009 17:35:41 +0000 (18:35 +0100)]
ALSA: opti-miro: use variables directly in the probe function
Use the fm_port and mpu_port variables directly in a probe function.
This completely eliminates a need to copy the fm_port value to
the snd_miro structure.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Krzysztof Helt [Tue, 17 Nov 2009 17:34:54 +0000 (18:34 +0100)]
ALSA: cs4236: update control names
Update control names to be more closer to their meaning.
Change the "Mono" name to the "Beep" as this line is usually
used to forward the PC beeper signal to sound card's output.
Update names for both cs423x and wss.
Clean up cs4235 controls according to the cs4235 doc. Rename
some of the cs4235 controls to be consistent with the cs4236's
ones.
Also, delete one misnamed cs4231 register define.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 17 Nov 2009 15:01:58 +0000 (16:01 +0100)]
ALSA: hda - Disable default quirk for Sony VAIO with ALC262 codec
The ALC262 has a quirk entry matching with all Sony Vaio laptops
to use model=sony-assamd as default. But, model=auto works much better
for new models in the recent driver versions, thus it's safer to disable
that default quirk entry.
Javier Kohen [Tue, 17 Nov 2009 14:36:13 +0000 (15:36 +0100)]
ALSA: usb - Quirk to disable master volume control in PCM2702
Disable the master volume control in the PCM2702 chipset.
The datasheet documents two independent channel volume controls, one
master mute control and one master volume control. All controls are
fully functional except for the master volume control, which returns
USB stalls on all GET requests.
Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Fri, 13 Nov 2009 17:41:52 +0000 (18:41 +0100)]
ALSA: hda - add beep_mode module parameter
The beep_mode parameter for snd-hda-intel module allows to choose among
different digital beep device registation to the input layer.
0 = do not register to the input layer
1 = register to the input layer all time
2 = use "Beep Switch" control exported to user space mixer applications
Also, introduce CONFIG_SND_HDA_INPUT_BEEP_MODE for default value.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Jaroslav Kysela [Wed, 21 Oct 2009 12:48:23 +0000 (14:48 +0200)]
ALSA: hda_intel: Digital PC Beep - change behaviour for input layer
Original implementation was keeping registered input device for SND_BEEP
and SND_TONE events all time. This patch changes this behaviour:
If digital PC Beep is turned off using universal control switch,
the input device is unregistered.
Explanation: The kd_mksound() send SND_BEEP and SND_TONE only to last
registered device acceping those events. It means that the HDA Intel
audio driver blocks also the internal PC Speaker device (pcspkr.c
driver) even if the HDA Beep is muted. The user can easy disable
all beeps using 'setterm -blength 0' or 'xset b off' command.
Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Dan Carpenter [Mon, 16 Nov 2009 09:07:17 +0000 (11:07 +0200)]
ALSA: ice1724 - make some bitfields unsigned
This is a clean up and doesn't change the behavior.
Bit fields should always be unsigned. Otherwise pm_suspend_enabled will
be -1 when you want it to be 1. The other bad thing is that the sparse
checker will complain 36 times if they aren't unsigned.
The other bitfields in that struct are unsigned already.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: ice1724 - Patch for suspend/resume for ESI Juli@
Add proper suspend/resume code for Juli@ cards. Based on ice1724
suspend/resume work of Igor Chernyshev.
Fixes bug https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4413
Tested on linux-2.6.31.6
sound/pci/hda/patch_via.c: work around gcc-4.0.2 ICE
sound/pci/hda/patch_via.c: In function 'via_hp_bind_automute':
sound/pci/hda/patch_via.c:2074: internal compiler error: in do_SUBST, at combine.c:462
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[added a comment by tiwai]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Joonyoung Shim [Thu, 12 Nov 2009 08:14:04 +0000 (17:14 +0900)]
ASoC: Add jack_status_check callback function for GPIO jacks
The jack_status_check callback function is the interface to check the
status of the jack. Some target provides the method to distinguish what
is the jack inserted - headphone jack, microphone jack, tvout jack, etc,
so we can implement it using the jack_status_check function.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Barry Song [Thu, 12 Nov 2009 04:01:47 +0000 (12:01 +0800)]
ASoC: move setting ac97 platformdata earlier than ac97 read/write
While probing, AC97 codec drivers and soc-core generically execute the
following sequence:
snd_soc_new_ac97_codec -> snd_soc_new_pcms -> reset ac-link/read AC97 ID
to detect ->... -> set platform_data to ac97 by soc-core
commit 474828a40f6ddab6e2a3475a19c5c84aa3ec7d60 adds platform_data to
snd_ac97 instance. But ac97 platform data hasn't given to snd_ac97
before actual ac97 operations. Then while ac97_read access platform_data
of snd_ac97 for detecting, NULL pointer oops will fire. That means old
platform_data patch doesn't work in real-life cases.
This patch moves the operation of setting ac97 platform_data earlier
than ac97 reading/writing operations. Then it makes platform_data of
AC97 become practically useful.
Signed-off-by: Barry Song <21cnbao@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 10 Nov 2009 16:08:04 +0000 (16:08 +0000)]
ASoC: Add bit clock rate calculator utility functions
Many devices need to calculate the bit clock rate desired to
work out the clock configuration required for the device.
Provide utility functions to do this using both hw_params
structures and raw numbers.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Takashi Iwai [Thu, 12 Nov 2009 08:50:28 +0000 (09:50 +0100)]
ALSA: hda - Don't access invalid substream in proc file
The commit e3303235209c0496b490e10ab131e72a9568c153
"ALSA: hda - proc - show which I/O NID is associated to PCM device"
introduces the access to substream pointer. But, PCMs may have no
substreams in one or both directions, and this results in NULL
dereference. Also, print the first substream number doesn't make
sense.
This patch removes the access to the substream pointer, and reformat
to fit to the standard coding style.
Daniel T Chen [Wed, 11 Nov 2009 19:32:10 +0000 (14:32 -0500)]
ALSA: hda: Use model=mb5 for MacBookPro 5,2
BugLink: https://bugs.launchpad.net/bugs/462098
Until we can look closer at the verbs, let's use ALC885_MB5 for
codec SSID 0x106b4600 to enable playback and capture for MacBookPro
5,2s.
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 11 Nov 2009 08:34:25 +0000 (09:34 +0100)]
ALSA: hda - Add power on/off counter
Added the power on/off counter and expose via sysfs files.
The sysfs files, power_on_acct and power_off_acct, are created under
each codec hwdep sysfs directory (e.g. /sys/class/sound/hwC0D0).
The files show the msec length of the codec power-on and power-off,
respectively.
Roel Kluin [Tue, 10 Nov 2009 19:11:55 +0000 (20:11 +0100)]
ALSA: hda - possible read past array alc88[02]_parse_auto_config()
The test of index `i' is after the read - too late - and
unsafe: if snd_hda_get_connections() fails in the last
iteration a read beyond the array is possible.
Clemens Ladisch [Tue, 10 Nov 2009 09:13:30 +0000 (10:13 +0100)]
sound: pcm: record a substream's owner process
Record the pid of the task that opened a PCM substream. For sound
cards with hardware mixing, this allows determining which process
is associated with a specific substream's volume control.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Wed, 21 Oct 2009 07:12:26 +0000 (09:12 +0200)]
sound: rawmidi: fix opened substreams count
The substream_opened field is to count the number of opened substreams,
not the number of times that any substreams have been opened.
Furthermore, all substreams being opened does not imply that the next
open would fail, due to the possibility of O_APPEND. With this wrong
check, opening a substream multiple times would succeed only if the
device had more unopened substreams.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
If only the output substream of a RawMIDI device has been opened and
if this device is then opened with O_RDWR | O_APPEND and if the
initialization of the input substream fails (either because of low
memory or because the device driver's open callback fails), then the
runtime structure of the already open output substream will be freed
and all following writes through the first handle will cause
snd_rawmidi_write() to use the NULL runtime pointer.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Wed, 21 Oct 2009 07:10:16 +0000 (09:10 +0200)]
sound: rawmidi: fix checking of O_APPEND when opening MIDI device
Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 dropped the
check that a substream must already have been opened with O_APPEND to be
able to open it a second time.
This would make it possible for a substream to be switched to append
mode, which would mean that non-atomic writes would fail unexpectedly.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Wed, 21 Oct 2009 07:09:38 +0000 (09:09 +0200)]
sound: rawmidi: fix double init when opening MIDI device with O_APPEND
Commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a in 2.6.30 moved the
substream initialization code to where it would be executed every time
the substream is opened.
This had the consequence that any further opening would drop and leak
the data in the existing buffer, and that the device driver's open
callback would be called multiple times, unexpectedly.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 10 Nov 2009 15:08:45 +0000 (16:08 +0100)]
ALSA: hda - Avoid quirk for HP dc5750
The present quirk for HP dc5750 seems broken and maps the pins wrongly.
Since the auto-parser works well for this device, set the default entry
to use model=auto.