Nickolas Lloyd [Mon, 1 Jun 2009 09:12:29 +0000 (11:12 +0200)]
ALSA: hda - Jack Mode changes for Sigmatel boards
This patch changes Line In as Out Switch and Mic In as Out Switch to
enums for consistency, and causes all mic and line in ports to be probed
and controls to be added appropriately.
Takashi Iwai [Sun, 31 May 2009 07:28:12 +0000 (09:28 +0200)]
ALSA: hda - Fix a typo in the previous patch
ICH6_GCTL_RESET was wrongly set to another bit by the commit b21fadb9c1852c91622ca1dccfeb144bc535e36e. This caused a problem when
the codec needs really a reset (e.g. recovering from the communication
error at probe).
Takashi Iwai [Thu, 28 May 2009 09:59:12 +0000 (11:59 +0200)]
ALSA: hda - Always sync writes in single_cmd mode
In the single_cmd mode, the hardware cannot store the multiple replies
like on RIRB, thus each verb has to sync and wait for the response no
matter whether the return value is needed or not. Otherwise it may
result in a wrong return value from the previous verb.
Tony Vroon [Wed, 27 May 2009 20:00:41 +0000 (21:00 +0100)]
ALSA: hda - Compaq Presario CQ60 patching for Conexant
A docking mic control is shown by default. The Compaq Presario
CQ60 laptop has no docking connector, so designate it as a
CXT5051_HP model.
This makes the phantom mixer slider disappear.
Signed-off-by: Tony Vroon <tony@linx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 26 May 2009 14:07:57 +0000 (16:07 +0200)]
ALSA: hda - Support sync after writing a verb
This patch adds a debug mode to make the codec communication
synchronous. Define SND_HDA_SUPPORT_SYNC_WRITE in hda_codec.c,
and the call of snd_hda_codec_write*() will become synchronous,
i.e. wait for the reply from the codec at each time issuing a verb.
Takashi Iwai [Tue, 26 May 2009 13:22:00 +0000 (15:22 +0200)]
ALSA: hda - Allow concurrent RIRB access in single_cmd mode
In the single_cmd mode, the current driver code doesn't do any update
for RIRB just for any safety reason. But, actually the RIRB and
single_cmd mode don't conflict. Unsolicited events can be delivered
even while using the single_cmd mode.
This patch allows the handling of unsolicited events with single_cmd
mode, just always checking RIRB independent from single_cmd flag.
Takashi Iwai [Mon, 25 May 2009 16:34:52 +0000 (18:34 +0200)]
ALSA: hda - Reset CORB/RIRB at retrying the verb communication
When a codec communication error occurs, the CORB/RIRB counters should
be reset first before re-issuing the verb. Simply call azx_free_cmd_io()
and azx_init_cmd_io() to achieve that.
Takashi Iwai [Mon, 25 May 2009 06:06:02 +0000 (08:06 +0200)]
ALSA: hda - Add missing check of pin vref 50 and others in Realtek codecs
Some Realtek codecs like ALC861 seem to support only VREF50 while the
current driver assumes it's only VREF80. Check other VREF bits to set
the correct value.
Takashi Iwai [Sun, 24 May 2009 17:00:08 +0000 (19:00 +0200)]
ALSA: hda - Add 5stack-no-fp model for STAC927x
The recent fix for the headphone volume control on IDT/STAC codecs
resulted in the removal of invalid "Side" volume eventually. But,
if the front panel doesn't exist, this setup could be regarded as a
sort of regression, as reported in kernel bug #13250.
Now as a workaround, a new model 5stack-no-fp is added so that the user
without the front panel can choose this one explicitly.
Takashi Iwai [Tue, 19 May 2009 10:50:04 +0000 (12:50 +0200)]
ALSA: hda - Fix digital beep tone calculation
The digital beep tone is calculated in two different ways depending
on the codec chip. The standard one is using a divider, and another
one is a linear tone for IDT/STAC codecs. Currently, only the
latter type is used for all codecs, which resulted in a wrong tone
pitch.
This patch adds the calculation of the standard HD-audio type.
Also clean-up the fields in hda_beep struct.
Takashi Iwai [Tue, 19 May 2009 10:16:46 +0000 (12:16 +0200)]
ALSA: hda - Add prefix to kernel messages
Add proper prefix to each kernel message in hda_intel.c.
Also, avoid the unneeded prefix when CONFIG_SND_VERBOSE_PRINTK is used
together with snd_print*().
Torben Schulz [Mon, 18 May 2009 13:02:35 +0000 (15:02 +0200)]
ALSA: hda - Improved MacBook 3,1 support
This patch adds support for MacBook 3,1 sound by adding a model new
"mb31" with the appropriate init verbs, mixers and channel modes to
the ALC883 configuration. patch_alc882() and patch_alc883() are
modified to handle the MacBook 3,1 sound-chip (Realtek ALC889A)
correctly.
Takashi Iwai [Mon, 18 May 2009 10:40:52 +0000 (12:40 +0200)]
ALSA: hda - Avoid conflicts with snd-ctxfi driver
The PCI entries of Creative with HD-audio class can be the devices
with emu20k1/emu20k2 chips. These are supported better by snd-ctxfi
driver. With that driver, the device will mutate from HD-audio to
its native class.
This patch adds a simple ifdef to avoid the conflict of device probe
between snd-hda-intel and snd-ctxfi drivers. 1102:0009 seems still
OK to be added as it has no emu20kx chip, and is a pure HD-audio
device.
Takashi Iwai [Sat, 16 May 2009 08:00:49 +0000 (10:00 +0200)]
ALSA: hda - Split codec->name to vendor and chip name strings
Split the name string in hda_codec struct to vendor_name and chip_name
strings to be stored directly from the preset name.
Since mostly only the chip name is referred in many patch_*.c, this
results in the reduction of many codes in the end.
Nickolas Lloyd [Fri, 15 May 2009 13:33:30 +0000 (15:33 +0200)]
ALSA: hda - add controls to toggle DC bias on mic ports
This patch adds a mixer control for the STAC92XX boards to control the
DC bias of mic ports, allowing recording from both powered and
non-powered sources. It replaces the "Mic Output Switch" with "Mic Jack
Mode" to switch between Mic, Line In, and Line Out.
Takashi Iwai [Thu, 14 May 2009 16:20:33 +0000 (18:20 +0200)]
ALSA: hda - Add a quirk entry for Macbook Pro 5,1
Added the codec SSID for MacBook Pro 5,1 as compatible as MP51.
However, the headphone auto-muting function doesn't work. So,
this is just a tentative solution.
Takashi Iwai [Wed, 13 May 2009 09:32:52 +0000 (11:32 +0200)]
ALSA: hda - Disable fallback to model=acer for Acer laptops
The model=acer for ALC883/889 doesn't work well for the recent Acer
Aspire laptops. Since model=auto works better nowadays, it's safer
to use the default fallback instead of the Acer specific one.
Chris Pockelé [Tue, 12 May 2009 06:08:53 +0000 (08:08 +0200)]
ALSA: hda - Add support of Samsung NC10 mini notebook
Add specific configuration for Samsung NC10 mini notebook. Internal
mic/speakers will be correctly muted when plugging in external ones.
Mixer controls are added for speakers, headphones and PC beep.
"Boost" is added for the microphones.
Signed-off-by: Chris Pockelé <chris.pockele.f1@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 8 May 2009 13:57:59 +0000 (15:57 +0200)]
ALSA: hda - Clean up Realtek auto-mute unsol routines
Most of unsol handlers defined in patch_realtek.c can be classified to
two types, mute via amp of pins and mute via ctl bits of pins.
Thus there are a big room to generalize each implementation.
This patch creates two generic functions, alc_automute_amp() and
alc_automute_pin(). The latter is actually changed from the previous
alc_sku_automute(). Each caller needs to initialize hp_pins and
speaker_pins properly at own init_hook.
Takashi Iwai [Fri, 8 May 2009 12:11:43 +0000 (14:11 +0200)]
ALSA: hda - Fix and clean up hippo-compat HP auto-muting
The speaker auto-muting per HP plugging for ALC262 HIPPO and compatible
devices is slightly buggy as the "Master" or "Front" mixer control can
still toggle the speaker output even if the headphone is plugged.
This patch fixes the issue, and clean up the hippo-related codes
together with fixes of some inconsistent mixer names.
Takashi Iwai [Thu, 7 May 2009 14:31:14 +0000 (16:31 +0200)]
ALSA: hda - Fix secondary SPDIF on VT1708S and VT1702 codecs
VIA VT1708S and VT1702 codecs can have two SPDIF outputs. One of them
should have been handled as the extra digital out, but it's not
properly accessed.
This patch fixes the handling of the secondary SPDIF on these codecs
with the slave dig-out as found in patch_sigmatel.c. This makes the
use of such a device easier (for normal users).
Takashi Iwai [Thu, 7 May 2009 14:22:53 +0000 (16:22 +0200)]
ALSA: hda - Fix line-in on Mac Mini Core2 Duo
BIOS on Mac Mini Core2 Duo sets both INPUT and OUTPUT pinctl bits to
the line-in jack, and it confuses the driver as if it's a valid input.
This patch adds the check of OUTPUT bit so that the driver fixes the
invalid pin setup.
ALSA: hda - Add amp initialization for realtek auto mode
In the realtek auto-probing mode, the initialization of amp with
some magic COEF or EAPD verbs is applied only when the codec SSID
has valid values to satisfy the realtek's definition.
However, many devices don't provide in that way, thus the device
doesn't work as is.
This patch allows the same initialization code even if the SSID
doesn't pass the bit test. Also, alc_subsystem_id() is changed
just to check and define the type, so that it's called in the
parser, instead of the initializer.
ALSA: hda - Fix init verbs of AD1884A mobile model
The current ad1884a-mobile model has a problem that the speaker output
doesn't work sometimes after boot or power-saving on some HP laptops.
It seems that the verbs accessing to the non-functional widgets cause
this problem.
This patch simplifies the init verbs for mobile model not to touch
unnecessary setups so that it avoids the speaker-mute problem.
Takashi Iwai [Tue, 24 Mar 2009 06:36:09 +0000 (07:36 +0100)]
ALSA: hda - Retry codec-verbs at errors
The current error-recovery scheme for the codec communication errors
doesn't work always well. Especially falling back to the
single-command mode causes the fatal problem on many systems.
In this patch, the problematic verb is re-issued again after the error
(even with polling mode) instead of the single-cmd mode. The
single-cmd mode will be used only when specified via the command
option explicitly, mainly just for testing.
Takashi Iwai [Tue, 24 Mar 2009 06:32:14 +0000 (07:32 +0100)]
ALSA: hda - Cache PCM and STREAM parameters queries
Cache quries for PCM and STREAM parameters as well as ampcap and
pincap sharing the hash table. This will reduce the superfluous
access of the same codec verbs.
Kailang Yang [Tue, 21 Apr 2009 05:39:04 +0000 (07:39 +0200)]
ALSA: hda - Add quirks for Realtek codecs
- Support ASUS F81Se F5Q P80 U20A U80 U50 UX50 for ALC269
- Support ASUS F70SL UX20 X58LE F50Z N80Vc N81Te N505Tp Vx3V N5051A
for ALC663
- Support DELL ZM1 for ALC272
Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix headphone-detection on some machines with STAC/IDT codecs
When the headphone can have no unique DAC, the current code doesn't
check the HP-detection although it should. Put the hp-detection check
before the DAC check to fix this bug.
Added the support for Creative SB X-Fi boards with UAA (HD-audio) mode.
In the HD-audio mode, no multiple streams are supported by just it
behaves like a normal HD-audio device.
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 - Fix the cmd cache keys for amp verbs
ALSA: add missing definitions(letters) to HD-Audio.txt
ALSA: hda - Add quirk mask for Fujitsu Amilo laptops with ALC883
[ALSA] intel8x0: add one retry to the ac97_clock measurement routine
[ALSA] intel8x0: fix wrong conditions in ac97_clock measure routine
ALSA: hda - Avoid call of snd_jack_report at release
ALSA: add private_data to struct snd_jack
ALSA: snd-usb-caiaq: rename files to remove redundant information in file pathes
ALSA: snd-usb-caiaq: clean up header includes
ALSA: sound/pci: use memdup_user()
ALSA: sound/usb: use memdup_user()
ALSA: sound/isa: use memdup_user()
ALSA: sound/core: use memdup_user()
[ALSA] intel8x0: do not use zero value from PICB register
[ALSA] intel8x0: an attempt to make ac97_clock measurement more reliable
[ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffies
[ALSA] hda_intel: fix unexpected ring buffer positions
ASoC: Disable S3C64xx support in Kconfig
ASoC: magician: remove un-necessary #include of pxa-regs.h and hardware.h
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: (28 commits)
cfq-iosched: add close cooperator code
cfq-iosched: log responsible 'cfqq' in idle timer arm
cfq-iosched: tweak kick logic a bit more
cfq-iosched: no need to save interrupts in cfq_kick_queue()
brd: fix cacheflushing
brd: support barriers
swap: Remove code handling bio_alloc failure with __GFP_WAIT
gfs2: Remove code handling bio_alloc failure with __GFP_WAIT
ext4: Remove code handling bio_alloc failure with __GFP_WAIT
dio: Remove code handling bio_alloc failure with __GFP_WAIT
block: Remove code handling bio_alloc failure with __GFP_WAIT
bio: add documentation to bio_alloc()
splice: add helpers for locking pipe inode
splice: remove generic_file_splice_write_nolock()
ocfs2: fix i_mutex locking in ocfs2_splice_to_file()
splice: fix i_mutex locking in generic_splice_write()
splice: remove i_mutex locking in splice_from_pipe()
splice: split up __splice_from_pipe()
block: fix SG_IO to return a proper error value
cfq-iosched: don't delay queue kick for a merged request
...
Fix the key value generation for get/set amp verbs. The upper bits of
the parameter have to be combined with the verb value to be unique for
each direction/index of amp access.
This fixes the resume problem on some hardwares like Macbook after
the channel mode is changed.
Tested-by: Johannes Berg <johannes@sipsolutions.net> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: pseries/dtl.c should include asm/firmware.h
powerpc: Fix data-corrupting bug in __futex_atomic_op
powerpc/pseries: Set error_state to pci_channel_io_normal in eeh_report_reset()
powerpc: Allow 256kB pages with SHMEM
powerpc: Document new FSL I2C bindings and cleanup
powerpc/mm: Fix compile warning
powerpc/85xx: TQM8548: update defconfig
powerpc/85xx: TQM8548: use proper phy-handles for enet2 and enet3
powerpc/85xx: TQM85xx: correct address of LM75 I2C device nodes
powerpc: Add support for early tlbilx opcode
powerpc: Fix tlbilx opcode
It turns out that 'smp_call_function_many()' doesn't work at all like
'smp_call_function_single()', and my change to Andrew's patch to use it
rather than a loop over all CPU's acpi-cpufreq doesn't work.
My bad.
'smp_call_function_many()' has two "features" (aka "documented bugs"):
(a) it needs to be called with preemption disabled, because it uses
smp_processor_id() without guarding the CPU lookup with 'get_cpu()'
and 'put_cpu()' like the 'single' variant does.
(b) even if the current CPU is part of the CPU mask, it won't do the
call on that CPU.
Still, we're better off trying to use 'smp_call_function_many()' than
looping over CPU's, since it at least in theory allows us to use a
broadcast IPI and do it all in parallel. So let's just work around the
silly semantic bugs in that function.
Reported-and-tested-by: Ali Gholami Rudi <ali@rudi.ir> Cc: Ingo Molnar <mingo@elte.hu> Cc: Andrew Morton <akpm@linux-foundation.org>, Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
If we have processes that are working in close proximity to each
other on disk, we don't want to idle wait. Instead allow the close
process to issue a request, getting better aggregate bandwidth.
The anticipatory scheduler has similar checks, noop and deadline do
not need it since they don't care about process <-> io mappings.
The code for CFQ is a little more involved though, since we split
request queues into per-process contexts.
This fixes a performance problem with eg dump(8), since it uses
several processes in some silly attempt to speed IO up. Even if
dump(8) isn't really a valid case (it should be fixed by using
CLONE_IO), there are other cases where we see close processes
and where idling ends up hurting performance.
Credit goes to Jeff Moyer <jmoyer@redhat.com> for writing the
initial implementation.
We only kick the dispatch for an idling queue, if we think it's a
(somewhat) fully merged request. Also allow a kick if we have other
busy queues in the system, since we don't want to risk waiting for
a potential merge in that case. It's better to get some work done and
proceed.
Nick Piggin [Wed, 15 Apr 2009 08:32:07 +0000 (10:32 +0200)]
brd: fix cacheflushing
brd is missing a flush_dcache_page. On 2nd thoughts, perhaps it is the
pagecache's responsibility to flush user virtual aliases (the driver of
course should flush kernel virtual mappings)... but anyway, there
already exists cache flushing for one direction of transfer, so we
should add the other.
Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Nick Piggin [Wed, 15 Apr 2009 08:27:07 +0000 (10:27 +0200)]
brd: support barriers
brd is always ordered (not that it matters, as it is defined not to
survive when the system goes down). So tell the block layer it is
ordered, which might be of help with testing filesystems.
Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
There are lots of sequences like this, especially in splice code:
if (pipe->inode)
mutex_lock(&pipe->inode->i_mutex);
/* do something */
if (pipe->inode)
mutex_unlock(&pipe->inode->i_mutex);
so introduce helpers which do the conditional locking and unlocking.
Also replace the inode_double_lock() call with a pipe_double_lock()
helper to avoid spreading the use of this functionality beyond the
pipe code.
This patch is just a cleanup, and should cause no behavioral changes.
Remove the now unused generic_file_splice_write_nolock() function.
It's conceptually broken anyway, because splice may need to wait for
pipe events so holding locks across the whole operation is wrong.
ocfs2: fix i_mutex locking in ocfs2_splice_to_file()
Rearrange locking of i_mutex on destination and call to
ocfs2_rw_lock() so locks are only held while buffers are copied with
the pipe_to_file() actor, and not while waiting for more data on the
pipe.
splice: fix i_mutex locking in generic_splice_write()
Rearrange locking of i_mutex on destination so it's only held while
buffers are copied with the pipe_to_file() actor, and not while
waiting for more data on the pipe.
splice_from_pipe_next() will wait (if necessary) for more buffers to
be added to the pipe. splice_from_pipe_feed() will feed the buffers
to the supplied actor and return when there's no more data available
(or if all of the requested data has been copied).
This is necessary so that implementations can do locking around the
non-waiting splice_from_pipe_feed().
This patch should not cause any change in behavior.
blk_rq_unmap_user() returns -EFAULT if a program passes an invalid
address to kernel. SG_IO path needs to pass the returned value to user
space instead of ignoring it.
* topic/memdup_user:
ALSA: sound/pci: use memdup_user()
ALSA: sound/usb: use memdup_user()
ALSA: sound/isa: use memdup_user()
ALSA: sound/core: use memdup_user()
Merge branch 'master' of git://git.alsa-project.org/alsa-kernel into for-linus
* 'master' of git://git.alsa-project.org/alsa-kernel:
[ALSA] intel8x0: add one retry to the ac97_clock measurement routine
[ALSA] intel8x0: fix wrong conditions in ac97_clock measure routine
[ALSA] intel8x0: do not use zero value from PICB register
[ALSA] intel8x0: an attempt to make ac97_clock measurement more reliable
[ALSA] pcm-midlevel: Add more strict buffer position checks based on jiffies
[ALSA] hda_intel: fix unexpected ring buffer positions
In certain cases symlinks can appear to have zero size if a lookup
on the inode occurs within a certain (very short) time after the
symlink has been created. The symlink is correctly created on disk
but appears to have zero size when stat()ed. This patch closes the
race and prevents incorrect sizes appearing.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>