Commit Graph

400 Commits

Author SHA1 Message Date
Takashi Iwai
5b56eec774 Merge branch 'topic/jack' into for-linus 2009-03-24 00:35:43 +01:00
Takashi Iwai
c2f43981e5 Merge branch 'topic/hwdep-cleanup' into for-linus 2009-03-24 00:35:41 +01:00
Takashi Iwai
dec14f8c0e Merge branch 'topic/snd_card_new-err' into for-linus 2009-03-24 00:35:35 +01:00
Takashi Iwai
6af845e4eb ALSA: Fix vunmap and free order in snd_free_sgbuf_pages()
In snd_free_sgbuf_pags(), vunmap() is called after releasing the SG
pages, and it causes errors on Xen as Xen manages the pages
differently.  Although no significant errors have been reported on
the actual hardware, this order should be fixed other way round,
first vunmap() then free pages.

Cc: Jan Beulich <jbeulich@novell.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-18 08:04:01 +01:00
Jiri Slaby
91054598f7 ALSA: pcm_oss, fix locking typo
s/mutex_lock/mutex_unlock/ on 2 fail paths in snd_pcm_oss_proc_write.
Probably a typo, lock should be unlocked when leaving the function.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-18 08:03:33 +01:00
Viral Mehta
36c7b833e5 ALSA: oss-mixer - Fixes recording gain control
At the time of initialization, SNDRV_MIXER_OSS_PRESENT_PVOLUME bit is not
set for MIC (slot 7).
So, the same should not be checked when an application tries to do gain
control for audio recording devices.

Just check slot->present for SNDRV_MIXER_OSS_PRESENT_CVOLUME independently.
Verified with a simple application which opens /dev/dsp for recording and
/dev/mixer for volume control.

Have tested two usb audio mic devices.

Signed-off-by: Viral Mehta <viral.mehta@einfochips.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-03-18 07:52:28 +01:00
Steve Chen
5370d96f85 ALSA: fix excessive background noise introduced by OSS emulation rate shrink
Incorrect variable was used to get the next sample which caused S2
to be stuck with the same value resulting in loud background noise.

Signed-off-by: Steve Chen <schen at mvista.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-23 07:49:04 +01:00
Takashi Iwai
2678f60d2b ALSA: jack - Use card->shortname for input name
Currently the jack layer refers to card->longname as a part of
its input device name string.  However, longname is often really long
and way too ugly as an identifier, such as,
"HDA Intel at 0xf8400000 irq 21".

This patch changes the code to use card->shortname instead.
The shortname string contains usually the h/w vendor and product
names but without messy I/O port or IRQ numbers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-18 16:46:27 +01:00
Takashi Iwai
345d0b1964 ALSA: hwdep - Make open callback optional
Don't require the open callback as mandatory.
Now all hwdeps ops can be optional.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-05 09:10:20 +01:00
Roel Kluin
7924f0cadc ALSA: pcm_oss: AFMT_S24_LE is set twice in return value
AFMT_S24_LE is set twice in return value

vi sound/core/oss/pcm_oss.c +640
#define AFMT_S24_LE      0x00008000
#define AFMT_S24_BE      0x00010000

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-04 18:18:03 +01:00
Takashi Iwai
53fb1e6359 ALSA: Introduce snd_card_create()
Introduced snd_card_create() function as a replacement of snd_card_new().
The new function returns a negative error code so that the probe callback
can return the proper error code, while snd_card_new() can give only NULL
check.

The old snd_card_new() is still provided as an inline function but with
__deprecated attribute.  It'll be removed soon later.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-01-12 14:56:41 +01:00
Jani Nikula
d506fc322e ALSA: Add support for video out to the jack reporting API
Add support for reporting new jack types SND_JACK_VIDEOOUT and
SND_JACK_AVOUT (a combination of LINEOUT and VIDEOOUT) to the jack
reporting API.

Also add the corresponding SW_VIDEOOUT_INSERT switch to the input system
header.

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-07 10:55:18 +00:00
Laurent Pinchart
f41ced8f10 Check fops_get() return value
Several subsystem open handlers dereference the fops_get() return value
without checking it for nullness.  This opens a race condition between the
open handler and module unloading.

A module can be marked as being unloaded (MODULE_STATE_GOING) before its
exit function is called and gets the chance to unregister the driver.
During that window open handlers can still be called, and fops_get() will
fail in try_module_get() and return a NULL pointer.

This change checks the fops_get() return value and returns -ENODEV if NULL.

Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Acked-by: Takashi Iwai <tiwai@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dave Airlie <airlied@linux.ie>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:11 -08:00
Mark Brown
bd8a71a7b0 ALSA: Reduce boilerplate for new jack types
Use a lookup table rather than explicit code to map input subsystem jack
types into ASoC ones, implemented as suggested by Takashi Iwai.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-03 17:02:21 +00:00
Linus Torvalds
bb758e9637 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimers: fix warning in kernel/hrtimer.c
  x86: make sure we really have an hpet mapping before using it
  x86: enable HPET on Fujitsu u9200
  linux/timex.h: cleanup for userspace
  posix-timers: simplify de_thread()->exit_itimers() path
  posix-timers: check ->it_signal instead of ->it_pid to validate the timer
  posix-timers: use "struct pid*" instead of "struct task_struct*"
  nohz: suppress needless timer reprogramming
  clocksource, acpi_pm.c: put acpi_pm_read_slow() under CONFIG_PCI
  nohz: no softirq pending warnings for offline cpus
  hrtimer: removing all ur callback modes, fix
  hrtimer: removing all ur callback modes, fix hotplug
  hrtimer: removing all ur callback modes
  x86: correct link to HPET timer specification
  rtc-cmos: export second NVRAM bank

Fixed up conflicts in sound/drivers/pcsp/pcsp.c and sound/core/hrtimer.c
manually.
2008-12-30 16:16:21 -08:00
Takashi Iwai
5ce442fe2c Merge branch 'topic/udev-id-rename' into to-push 2008-12-25 11:40:34 +01:00
Takashi Iwai
9649745c86 Merge branch 'topic/snd-hrtimer' into to-push 2008-12-25 11:40:32 +01:00
Takashi Iwai
a802269781 Merge branch 'topic/jack-mechanical' into to-push 2008-12-25 11:40:29 +01:00
Takashi Iwai
a65056205c Merge branch 'topic/hda' into to-push 2008-12-25 11:40:28 +01:00
Takashi Iwai
8afabfa74b Merge branch 'topic/convert-tasklet' into to-push 2008-12-25 11:40:27 +01:00
Takashi Iwai
0ff555192a Merge branch 'fix/hda' into topic/hda 2008-12-19 08:22:57 +01:00
Takashi Iwai
1f04128a3d ALSA: hda - Convert from takslet_hi_schedule() to tasklet_schedule()
Replace all tasklet_hi_schedule() callers with the normal
tasklet_schedule().  The former often causes troubles with
RT-kernels, and has actually no merit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-18 12:17:55 +01:00
Mark Brown
cdc6936432 ALSA: Add support for mechanical jack insertion
Some systems support both mechanical and electrical jack detection,
allowing them to report that a jack is physically present but does
not have any functioning connections. Add a new jack type for these,
allowing user space to report faulty connections.

Thanks to Guillem Jover for the suggestion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-10 15:10:44 +01:00
Takashi Iwai
5e03c54eeb ALSA: hrtimer - Use hard-irq callback
Use the hard-irq mode for the callback (for possible removal of
soft-irq mode in future).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-08 12:40:56 +01:00
Takashi Iwai
647808a6b9 ALSA: timer - Add comments and use ns_to_ktime()
Add the license and misc comments at the beginning of the code.
Also, use ns_to_ktime() for simplification.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-08 12:16:58 +01:00
Takashi Iwai
e7dd8c1bda Merge branch 'topic/misc' into topic/pcsp-fix
Conflicts:
	sound/drivers/pcsp/pcsp_lib.c
2008-11-26 14:12:42 +01:00
Hannes Eder
2af752936b sound: Fix warnings relating to ignored return value in snd_card_register
Do not ignore the return of 'device_create_file' in
'snd_card_register' and thereby fixing the following warnings:

sound/core/init.c: In function 'snd_card_register':
sound/core/init.c:640: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result
sound/core/init.c:641: warning: ignoring return value of
'device_create_file', declared with attribute warn_unused_result

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-18 18:27:58 +01:00
Jaroslav Kysela
c2eb9c4ea3 ALSA: when card identification is changed, change also /proc/asound symlink
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-12 17:07:37 +01:00
Jaroslav Kysela
9fb6198e8c ALSA: add /sys/class/sound/card#/id (r/w) and card#/number (r/o) files
For udev, we need a way to rename soundcard names. The soundcard numbers
(indexes) are hardwired but we have a text identification which can be
changed at run-time. The ALSA user space tools already allow using of
this text identification.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-12 15:55:44 +01:00
Takashi Iwai
63cf123bf5 Merge branch 'topic/fix/misc' into topic/misc 2008-11-07 09:06:05 +01:00
Linus Torvalds
20ebc0073b Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda: make a STAC_DELL_EQ option
  ALSA: emu10k1 - Add more invert_shared_spdif flag to Audigy models
  ALSA: hda - Add a quirk for another Acer Aspire (1025:0090)
  ALSA: remove direct access of dev->bus_id in sound/isa/*
  sound: struct device - replace bus_id with dev_name(), dev_set_name()
  ALSA: Fix PIT lockup on some chipsets when using the PC-Speaker
  ALSA: rawmidi - Add open check in rawmidi callbacks
  ALSA: hda - Add digital-mic for ALC269 auto-probe mode
  ALSA: hda - Disable broken mic auto-muting in Realtek codes
2008-11-03 10:14:59 -08:00
Takashi Iwai
7aeb6d7d20 Merge branches 'topic/fix/misc' and 'topic/fix/hda' into for-linus 2008-11-03 16:28:24 +01:00
Takashi Iwai
219df32fae ALSA: rawmidi - Add open check in rawmidi callbacks
The drivers (e.g. mtpav) may call rawmidi functions in irq handlers
even though the streams are not opened.  This results in Oops or panic.

This patch adds the rawmidi state check before actually operating the
rawmidi buffers.

Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-03 08:57:12 +01:00
Al Viro
233e70f422 saner FASYNC handling on file close
As it is, all instances of ->release() for files that have ->fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.

So let's keep our lives simple - let __fput() check FASYNC in
file->f_flags and call ->fasync() there if it's been set.  And lose that
crap in ->release() instances - leaving it there is still valid, but we
don't have to bother anymore.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-01 09:49:46 -07:00
Linus Torvalds
4ac08d36aa Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ASoC: Fix WM9713 ALC Decay Time name
  ALSA: ASoC: Fix some minor errors in mpc5200 psc i2s driver
  ALSA: ASoC: Fix mono controls after conversion to support full int masks
  ALSA: sound/ice1712: indentation & braces disagree - add braces
  ALSA: usb - Add quirk for Edirol UA-25EX advanced modes
  sound: struct device - replace bus_id with dev_name(), dev_set_name()
  ALSA: hda - Add reboot notifier
  ALSA: Warn when control names are truncated
  ALSA: intel8x0 - add Dell Optiplex GX620 (AD1981B) to AC97 clock whitelist
  ALSA: hda - Fix SPDIF mute on IDT/STAC codecs
  ALSA: hda: Add HDA vendor ID for Wolfson Microelectronics
  ALSA: hda - Add another HP model for AD1884A
2008-10-30 11:44:35 -07:00
Takashi Iwai
0552f29795 Merge branches 'topic/fix/hda' and 'topic/fix/misc' into for-linus 2008-10-29 16:40:00 +01:00
Takashi Iwai
e78a37bc77 ALSA: Fix a typo in Kconfig
The previous commit bbaf5e9733 has
an obvious typo.  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-29 16:08:01 +01:00
Mark Brown
366840d7e1 ALSA: Warn when control names are truncated
This is likely to confuse user interfaces since the end of the control
name is interpreted (eg, "Volume", "Switch").

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-29 15:44:04 +01:00
Takashi Iwai
4fc85e451f Merge branch 'topic/misc-next' into topic/misc 2008-10-27 08:50:43 +01:00
Matthew Ranostay
a53ccab3cc ALSA: jack: lineout support to jack abstraction layer
This patch introduces support for reporting SW_LINEOUT_INSERT detection events
via the jack abstraction layer.

Also adds a SND_JACK_LINEOUT define to the input system header.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-27 08:15:14 +01:00
Matthew Ranostay
282cd76ffc ALSA: hda: dynamic jack id
This patch duplicates the jack->id pointer with kstrdup() to prevent
scoping issues from calling autoprobing functions from the HDA section.

Signed-off-by: Matthew Ranostay <mranostay@embeddedalley.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-27 08:15:14 +01:00
Takashi Iwai
bbaf5e9733 ALSA: Add hrtimer backend for ALSA timer interface
Added the hrtimer backend for ALSA timer interface.
It can be used for the sequencer timer source.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-24 18:16:50 +02:00
Al Viro
aeb5d72706 [PATCH] introduce fmode_t, do annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-21 07:47:06 -04:00
Takashi Iwai
975f6b0c1b Merge branches 'topic/asoc', 'topic/misc-fixes', 'topic/ps3-csbits' and 'topic/staging-fixes' into for-linus 2008-10-20 17:06:00 +02:00
Randy Dunlap
a66547f3a1 sound: add missing pcm kernel-doc
Fix alsa kernel-doc warning in linux-next:

Warning(linux-next-20081016//sound/core/pcm_misc.c:327): No description found for parameter 'samples'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-18 11:05:36 +02:00
Linus Torvalds
8eb88c80d4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: Fix debugfs_create_dir's error checking method for sound/soc/
  ALSA: ASoC: Convert playpaq_wm8510 to bulk route registration API
  ALSA: kernel docs: fix sound/core/ kernel-doc
  ALSA: Handle NULL jacks in snd_jack_report()
  ALSA: hda - Fix PCM type of Nvidia HDMI devices
2008-10-17 09:30:35 -07:00
Greg Kroah-Hartman
abe9ab8f62 device create: sound: convert device_create_drvdata to device_create
Now that device_create() has been audited, rename things back to the
original call to be sane.

Cc: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-16 09:24:44 -07:00
Takashi Iwai
76a4d10e52 ALSA: Print function symbol in the error messages
Use the new %pF for error messages in snd_device_*() functions
to give more understandable results.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-16 16:17:30 +02:00
Randy Dunlap
1c85cc6445 ALSA: kernel docs: fix sound/core/ kernel-doc
Add kernel-doc function short descriptions to sound/core functions that
are missing this short description.  Mostly this involves moving some of
the function description onto the @funcname line.

Also correct a few variable names and fix other kernel-doc notation.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-16 08:44:20 +02:00
Mark Brown
9a3f371e99 ALSA: Handle NULL jacks in snd_jack_report()
Facilitate drivers that wish to carry on if they can't create a jack
input device by handling attempts to report the state of a NULL jack,
removing the need to check for initialisation before use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-16 08:40:03 +02:00