pandora-kernel.git
12 years agoALSA: usb-audio - Avoid flood of frame-active debug messages
Takashi Iwai [Mon, 9 Jan 2012 10:37:20 +0000 (11:37 +0100)]
ALSA: usb-audio - Avoid flood of frame-active debug messages

With some buggy devices, the usb-audio driver may give "frame xxx active"
kernel messages too often.  Better to keep it as debug-only using
snd_printdd(), and also add the rate-limit for avoiding floods.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=738681

Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb-us122l: Delete calls to preempt_disable
Karsten Wiese [Fri, 30 Dec 2011 00:42:01 +0000 (01:42 +0100)]
ALSA: snd-usb-us122l: Delete calls to preempt_disable

They are not needed here.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Refactor serial number to avoid code duplication
Adrian Knoth [Wed, 4 Jan 2012 13:31:16 +0000 (14:31 +0100)]
ALSA: hdspm - Refactor serial number to avoid code duplication

The serial number is used multiple times in hdspm.c. Since it belongs
to the card, let's store it in struct hdspm and refer to it whenever
necessary.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()
Xi Wang [Sun, 8 Jan 2012 14:02:52 +0000 (09:02 -0500)]
ALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()

A malicious USB device may feed in carefully crafted min/max/res values,
so that the inner loop in parse_uac2_sample_rate_range() could run for
a long time or even never terminate, e.g., given max = INT_MAX.

Also nr_rates could be a large integer, which causes an integer overflow
in the subsequent call to kmalloc() in parse_audio_format_rates_v2().
Thus, kmalloc() would allocate a smaller buffer than expected, leading
to a memory corruption.

To exploit the two vulnerabilities, an attacker needs physical access
to the machine to plug in a malicious USB device.

This patch makes two changes.

1) The type of "rate" is changed to unsigned int, so that the loop could
   stop once "rate" is larger than INT_MAX.

2) Limit nr_rates to 1024.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: Au88x0 - Fix channels swapping of 4 channels playback
Raymond Yau [Sat, 7 Jan 2012 06:35:17 +0000 (14:35 +0800)]
ALSA: Au88x0 - Fix channels swapping of 4 channels playback

Fix channels swapping of 4 channels playback by
using vortex_adbdma_stopfifo instead of vortex_adbdma_pausefifo
for SNDRV_PCM_TRIGGER_STOP event

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: Au88x0 - Fix IRQ fifo error and channels swap of 4 channels playback
Raymond Yau [Fri, 6 Jan 2012 01:19:29 +0000 (09:19 +0800)]
ALSA: Au88x0 - Fix IRQ fifo error and channels swap of 4 channels playback

Fix IRQ fifo error when playing stereo by set stereo flag of fifo control.
This also fix the swap of front and rear channels on au8830.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: Au88x0 - Fix Xtalk's constants
Raymond Yau [Wed, 4 Jan 2012 08:16:26 +0000 (16:16 +0800)]
ALSA: Au88x0 - Fix Xtalk's constants

- Fix XtalkGainsDefault, XtalkGains1Chn
- Fix XtalkWideCoefsLeftEQ, XtalkWideCoefsRightEQ
- Fix XtlakWideCoefsLeftXT, XtalkWideCoefsRightXT

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: Au88x0 - Xtalk - fix write/read of eq and xt instates
Raymond Yau [Wed, 4 Jan 2012 07:42:44 +0000 (15:42 +0800)]
ALSA: Au88x0 - Xtalk - fix write/read of eq and xt instates

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ice1724 - External clock item only for cards with SPDIF_IN
Pavel Hofman [Thu, 5 Jan 2012 21:01:56 +0000 (22:01 +0100)]
ALSA: ice1724 - External clock item only for cards with SPDIF_IN

Append the external clock item to the clock list only if
the SPDIF_IN capability is defined in the SPDIF register.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ice1724 - Check for ac97 to avoid kernel oops
Pavel Hofman [Thu, 5 Jan 2012 22:05:18 +0000 (23:05 +0100)]
ALSA: ice1724 - Check for ac97 to avoid kernel oops

Cards with identical PCI ids but no AC97 config in EEPROM do not have
the ac97 field initialized. We must check for this case to avoid kernel oops.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: emu10k1 - add another Audigy 2 ZS ID
Tim Yamin [Thu, 29 Dec 2011 18:50:56 +0000 (18:50 +0000)]
ALSA: emu10k1 - add another Audigy 2 ZS ID

0x20051102 is an Audigy 2 ZS.

Signed-off-by: Tim Yamin <plasm@roo.me.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: export compress headers
Vinod Koul [Thu, 29 Dec 2011 13:12:31 +0000 (18:42 +0530)]
ALSA: export compress headers

Export compress_offload.h and compress_params.h for userland to use

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: add makefile and kconfig file for compress
Vinod Koul [Fri, 23 Dec 2011 05:06:40 +0000 (10:36 +0530)]
ALSA: core: add makefile and kconfig file for compress

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: add support for compress_offload
Vinod Koul [Fri, 23 Dec 2011 05:06:39 +0000 (10:36 +0530)]
ALSA: core: add support for compress_offload

This patch adds core.c, the file which implements the ioctls and
registers the devices

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: add API header and driver header files
Vinod Koul [Fri, 23 Dec 2011 05:06:38 +0000 (10:36 +0530)]
ALSA: core: add API header and driver header files

This patch adds the header files for ioctl definitions and header file for
driver APIs for lower level device drivers to use

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: add compress parameter definations
Vinod Koul [Fri, 23 Dec 2011 05:06:37 +0000 (10:36 +0530)]
ALSA: core: add compress parameter definations

The patch adds the various definations used to define the encoder
and decoder parameters

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: add support for compressed devices
Omair Mohammed Abdullah [Fri, 23 Dec 2011 05:06:36 +0000 (10:36 +0530)]
ALSA: core: add support for compressed devices

Use the minor numbers 2 and 3 for audio compressed offload devices.
Also add support for these devices in core

Signed-off-by: Omair Mohammed Abdullah <omair.m.abdullah@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: compress offload API documentation
Pierre-Louis Bossart [Fri, 23 Dec 2011 05:06:35 +0000 (10:36 +0530)]
ALSA: compress offload API documentation

The patch adds the documentation file explaining the API

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Fix format validity check.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:51 +0000 (13:38 +1300)]
ALSA: asihpi - Fix format validity check.

Sharing and not reinitialising static pcm_hardware struct resulted in
stream format validity flags being incorrectly shared between cards.
Fix and clarify by declaring locally and initialising in the open functions.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Use valid channel count in format enumeration.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:50 +0000 (13:38 +1300)]
ALSA: asihpi - Use valid channel count in format enumeration.

Since introduction of mono and low latency modes, fixed channel count of 2
is not always valid.  Use reported max_channels instead.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Correct headers in cached control responses.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:49 +0000 (13:38 +1300)]
ALSA: asihpi - Correct headers in cached control responses.

Previously, only payload and size were correct, sufficient for reading,
but other fields produced spurious debug output.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Add HPI version to module description.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:48 +0000 (13:38 +1300)]
ALSA: asihpi - Add HPI version to module description.

It is useful to know the HPI version without having to load the module,
in order to determine the matching firmware version.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Distinguish four different emif init errors.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:47 +0000 (13:38 +1300)]
ALSA: asihpi - Distinguish four different emif init errors.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - New defs and comments.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:46 +0000 (13:38 +1300)]
ALSA: asihpi - New defs and comments.

Add new error codes, and adapter properties.
Clean up some comments.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Add autofade query.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:45 +0000 (13:38 +1300)]
ALSA: asihpi - Add autofade query.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Simplify dsp code close.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:44 +0000 (13:38 +1300)]
ALSA: asihpi - Simplify dsp code close.

dsp_code struct is not created if firmware is invalid, so check
and zero of firmware pointer is not necessary

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Remove redundant struct members.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:43 +0000 (13:38 +1300)]
ALSA: asihpi - Remove redundant struct members.

Structs hpi_adapter and snd_card_asihpi had members that
duplicate those in underlying hpi_adapter_obj or whose info
can be retrieved using hpi_adapter_get_info().

Print less info in probe function, it can be retrieved from /proc.

Avoid name redundancy: hpi_adapter_obj.adapter_type renamed to .type

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Increase debug response buffer size.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:42 +0000 (13:38 +1300)]
ALSA: asihpi - Increase debug response buffer size.

Enables retrieving more debug info in fewer transactions.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Add new function codes.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:41 +0000 (13:38 +1300)]
ALSA: asihpi - Add new function codes.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Remove unused structs and defs
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:40 +0000 (13:38 +1300)]
ALSA: asihpi - Remove unused structs and defs

Structs related to network flash update are not required in kernel.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Update node types.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:39 +0000 (13:38 +1300)]
ALSA: asihpi - Update node types.

Add "Internal" node type.
Remove GPI and GPO node types.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Only set sync if card supports hardware stream grouping.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:38 +0000 (13:38 +1300)]
ALSA: asihpi - Only set sync if card supports hardware stream grouping.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Relax drained check for more reliable playback startup.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:37 +0000 (13:38 +1300)]
ALSA: asihpi - Relax drained check for more reliable playback startup.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Correct stray capital letters in identifier.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:36 +0000 (13:38 +1300)]
ALSA: asihpi - Correct stray capital letters in identifier.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Use snd_pcm_debug_name to get substream name.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:35 +0000 (13:38 +1300)]
ALSA: asihpi - Use snd_pcm_debug_name to get substream name.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Volumes and meters may have 1 or 2 channels.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:34 +0000 (13:38 +1300)]
ALSA: asihpi - Volumes and meters may have 1 or 2 channels.

The channel count can be queried to determine which.

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Low latency mode stream has fixed channel count.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:33 +0000 (13:38 +1300)]
ALSA: asihpi - Low latency mode stream has fixed channel count.

Unlike other streams which support 1..max channels,

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Update copyright to 2011
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:32 +0000 (13:38 +1300)]
ALSA: asihpi - Update copyright to 2011

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - Split hpi version info into separate header file.
Eliot Blennerhassett [Thu, 22 Dec 2011 00:38:31 +0000 (13:38 +1300)]
ALSA: asihpi - Split hpi version info into separate header file.

and update HPI version to 4.10

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihpi - fix pcm dma pointer tracking
Eliot Blennerhassett [Wed, 21 Dec 2011 22:54:02 +0000 (11:54 +1300)]
ALSA: asihpi - fix pcm dma pointer tracking

Elapsed counter should only count data committed to snd_pcm_period_elapsed,
rather than all data available

Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: Add missing module parameters for als300 and cs5530 drivers
Takashi Iwai [Mon, 19 Dec 2011 09:32:48 +0000 (10:32 +0100)]
ALSA: Add missing module parameters for als300 and cs5530 drivers

These drviers defined only variables but didn't declare as module
parameters.  Also fix the enable variable to bool type.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: module_param: make bool parameters really bool
Rusty Russell [Thu, 15 Dec 2011 03:19:36 +0000 (13:49 +1030)]
ALSA: module_param: make bool parameters really bool

module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb: added VOX ToneLab ST midi handling
Sergiusz Urbaniak [Mon, 5 Dec 2011 19:27:46 +0000 (20:27 +0100)]
ALSA: snd-usb: added VOX ToneLab ST midi handling

Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@googlemail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: asihp: Use kcalloc instead of kzalloc to allocate array
Thomas Meyer [Tue, 29 Nov 2011 21:08:00 +0000 (22:08 +0100)]
ALSA: asihp: Use kcalloc instead of kzalloc to allocate array

The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ctxf: Use kcalloc instead of kzalloc to allocate array
Thomas Meyer [Tue, 29 Nov 2011 21:08:00 +0000 (22:08 +0100)]
ALSA: ctxf: Use kcalloc instead of kzalloc to allocate array

The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: sis7019 - convert to dev_*() logging
David Dillow [Fri, 2 Dec 2011 04:26:57 +0000 (23:26 -0500)]
ALSA: sis7019 - convert to dev_*() logging

Signed-off-by: David Dillow <dave@thedillows.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Fri, 2 Dec 2011 09:43:52 +0000 (10:43 +0100)]
Merge branch 'fix/misc' into topic/misc

12 years agoALSA: sis7019 - give slow codecs more time to reset
David Dillow [Fri, 2 Dec 2011 04:26:53 +0000 (23:26 -0500)]
ALSA: sis7019 - give slow codecs more time to reset

There are some AC97 codec and board combinations that have been observed
to take a very long time to respond after the cold reset has completed.
In one case, more than 350 ms was required. To allow users to have sound
on those platforms, we'll wait up to 500ms for the codec to become
ready.

As a board may have multiple codecs, with some faster than others to
reset, we add a module parameter to inform the driver which codecs
should be present.

Reported-by: KotCzarny <tjosko@yahoo.com>
Signed-off-by: David Dillow <dave@thedillows.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Thu, 1 Dec 2011 15:32:18 +0000 (16:32 +0100)]
Merge branch 'fix/asoc' into for-linus

12 years agoALSA: hda - Fix S3/S4 problem on machines with VREF-pin mute-LED
Charles Chin [Thu, 1 Dec 2011 10:21:00 +0000 (11:21 +0100)]
ALSA: hda - Fix S3/S4 problem on machines with VREF-pin mute-LED

The verb command in stac92xx_post_suspend caused the audio to stop
working after resuming from S3 mode on HP laptops with the VREF-pin
mute-LED control.  Removing relevant post_suspend registering.

Although removing D3 on AFG is no optimal solution, the impact should
be small in comparison with the broken S3/S4.

Signed-off-by: Charles Chin <Charles.Chin@idt.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda_intel - revert a quirk that affect VIA chipsets
Marc Vertes [Tue, 29 Nov 2011 11:21:17 +0000 (12:21 +0100)]
ALSA: hda_intel - revert a quirk that affect VIA chipsets

This quirk sould be reverted. It has the following probems:

1) The quirk was intended to "ASUS MV2-MX SE" motherboards only, but the
ID used matches a much broader range, potentially all boards containing a
VIA chipset model in the family of vendor VIA 0x1106 and audio device ID
0x3288, which encompasses VIA-VT82xx, VIA-VT1xx and VIA-VT20xx chipsets.

2) VIA chipsets rely on azx_via_get_position() to handle correctly dma
transfers during capture. Using POS_FIX_LPIB instead of POS_FIX_VIACOMBO
leads to partially corrupted input buffers during capture. The effects
of this bug are not immediately visible, it took strong DSP expertise,
some expensive signal generator and a spectrum analyzer to identify it
and verify correct behaviour using original default.

3) It's almost certain that the quirk did not fix the real problem,
if there was one. Refer to original submission:
http://mailman.alsa-project.org/pipermail/alsa-devel/2010-February/025109.html

Signed-of-by: Marc Vertes <mvertes@sigfox.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Avoid touching mute-VREF pin for IDT codecs
Takashi Iwai [Tue, 29 Nov 2011 12:01:30 +0000 (13:01 +0100)]
ALSA: hda - Avoid touching mute-VREF pin for IDT codecs

Some HP laptops use a pin VREF for controlling the mute LED, and such a
pin shouldn't be powered off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agofirmware: Sigma: Fix endianess issues
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:16 +0000 (09:44 +0100)]
firmware: Sigma: Fix endianess issues

Currently the SigmaDSP firmware loader only works correctly on little-endian
systems. Fix this by using the proper endianess conversion functions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agofirmware: Sigma: Skip header during CRC generation
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:15 +0000 (09:44 +0100)]
firmware: Sigma: Skip header during CRC generation

The firmware header is not part of the CRC, so skip it. Otherwise the firmware
will be rejected due to non-matching CRCs.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agofirmware: Sigma: Prevent out of bounds memory access
Lars-Peter Clausen [Mon, 28 Nov 2011 08:44:14 +0000 (09:44 +0100)]
firmware: Sigma: Prevent out of bounds memory access

The SigmaDSP firmware loader currently does not perform enough boundary size
checks when processing the firmware. As a result it is possible that a
malformed firmware can cause an out of bounds memory access.

This patch adds checks which ensure that both the action header and the payload
are completely inside the firmware data boundaries before processing them.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoALSA: usb-audio - Support for Roland GAIA SH-01 Synthesizer
John F Leach [Tue, 29 Nov 2011 00:41:27 +0000 (19:41 -0500)]
ALSA: usb-audio - Support for Roland GAIA SH-01 Synthesizer

Added table quirks entry for Roland GAIA SH-01 Synthesizer based upon
Roland SH-201 table entry as template.  USB MIDI and audio was tested
with Muse and Audacity.

Signed-off-by: John F Leach <jfleach@jfleach.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Supply dcs_codes for newer WM1811 revisions
Mark Brown [Mon, 28 Nov 2011 18:48:46 +0000 (18:48 +0000)]
ASoC: Supply dcs_codes for newer WM1811 revisions

Based on initial data.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Error out if we can't generate a LRCLK at all for WM8994
Mark Brown [Mon, 28 Nov 2011 21:16:56 +0000 (21:16 +0000)]
ASoC: Error out if we can't generate a LRCLK at all for WM8994

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: convert sound/* to use module_platform_driver()
Axel Lin [Sun, 27 Nov 2011 08:36:04 +0000 (16:36 +0800)]
ALSA: convert sound/* to use module_platform_driver()

This patch converts the drivers in sound/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/hda' into for-linus
Takashi Iwai [Sun, 27 Nov 2011 16:59:07 +0000 (17:59 +0100)]
Merge branch 'fix/hda' into for-linus

12 years agoALSA: hda - Fix jack-detection control of VT1708
Takashi Iwai [Thu, 24 Nov 2011 15:33:09 +0000 (16:33 +0100)]
ALSA: hda - Fix jack-detection control of VT1708

VT1708 has no support for unsolicited events per jack-plug, the driver
implements the workq for polling the jack-detection.  The mixer element
"Jack Detect" was supposed to control this behavior on/off, but this
doesn't work properly as is now.  The workq is always started and the
HP automute is always enabled.

This patch fixes the jack-detect control behavior by triggering / stopping
the work appropriately at the state change.  Also the work checks the
internal state to continue scheduling or not.

Cc: <stable@kernel.org> [v3.1]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - cut and paste typo in cs420x_models[]
Dan Carpenter [Thu, 24 Nov 2011 11:48:24 +0000 (14:48 +0300)]
ALSA: hda - cut and paste typo in cs420x_models[]

The CS420X_IMAC27 was copied from the line before but CS420X_APPLE
was clearly intented.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Correct name of Speyside Main Speaker widget
Mark Brown [Sun, 27 Nov 2011 15:54:49 +0000 (15:54 +0000)]
ASoC: Correct name of Speyside Main Speaker widget

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: Convert mips directory to module_platform_driver
Axel Lin [Thu, 24 Nov 2011 10:47:25 +0000 (18:47 +0800)]
ALSA: Convert mips directory to module_platform_driver

Factor out some boilerplate code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Wed, 23 Nov 2011 16:07:16 +0000 (17:07 +0100)]
Merge branch 'fix/asoc' into for-linus

12 years agoASoC: skip resume of soc-audio devices without codecs
Eric Miao [Wed, 23 Nov 2011 14:37:00 +0000 (22:37 +0800)]
ASoC: skip resume of soc-audio devices without codecs

There are cases where there is no working codec on the soc-audio devices,
and snd_soc_suspend() will skip such device when suspending. Yet its
counterpart snd_soc_resume() does not check this, causing complaints
about spinlock lockup:

[  176.726087] BUG: spinlock lockup on CPU#0, kworker/0:2/1067, d8ab82a8
[  176.732539] [<80014a14>] (unwind_backtrace+0x0/0xec) from [<805b3fc8>] (dump_stack+0x20/0x24)
[  176.741082] [<805b3fc8>] (dump_stack+0x20/0x24) from [<80322208>] (do_raw_spin_lock+0x118/0x158)
[  176.749882] [<80322208>] (do_raw_spin_lock+0x118/0x158) from [<805b7874>] (_raw_spin_lock_irqsave+0x5c/0x68)
[  176.759723] [<805b7874>] (_raw_spin_lock_irqsave+0x5c/0x68) from [<8002a020>] (__wake_up+0x2c/0x5c)
[  176.768781] [<8002a020>] (__wake_up+0x2c/0x5c) from [<804a6de8>] (soc_resume_deferred+0x3c/0x2b0)
[  176.777666] [<804a6de8>] (soc_resume_deferred+0x3c/0x2b0) from [<8004ee20>] (process_one_work+0x2e8/0x50c)
[  176.787334] [<8004ee20>] (process_one_work+0x2e8/0x50c) from [<8004fd08>] (worker_thread+0x1c8/0x2e0)
[  176.796566] [<8004fd08>] (worker_thread+0x1c8/0x2e0) from [<80053ec8>] (kthread+0xa4/0xb0)
[  176.804843] [<80053ec8>] (kthread+0xa4/0xb0) from [<8000ea70>] (kernel_thread_exit+0x0/0x8)

Signed-off-by: Eric Miao <eric.miao@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: cs42l51: Fix off-by-one for reg_cache_size
Axel Lin [Wed, 23 Nov 2011 04:46:11 +0000 (12:46 +0800)]
ASoC: cs42l51: Fix off-by-one for reg_cache_size

Just checking the code in cs42l51_fill_cache():
The cache pointer points to codec->reg_cache + 1.
I think it is because CS42L51_FIRSTREG is 0x01,
so codec->reg_cache[0] is not used here.

Then we read CS42L51_NUMREGS bytes to cache.
So we need reg_cache_size to be CS42L51_NUMREGS + 1.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: drop support for PlayPaq with WM8510
Paul Bolle [Wed, 23 Nov 2011 09:39:10 +0000 (10:39 +0100)]
ASoC: drop support for PlayPaq with WM8510

SoC Audio support for PlayPaq with WM8510 got added in commit 9aaca9683b
("[ALSA] Revised AT32 ASoC Patch"). That support depends on
BOARD_PLAYPAQ. That Kconfig symbol didn't exist when that support got
added in v2.6.27. It still doesn't. It has never been possible to even
build this driver. Drop it.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: hda/realtek - Minor cleanup
Takashi Iwai [Wed, 23 Nov 2011 06:52:15 +0000 (07:52 +0100)]
ALSA: hda/realtek - Minor cleanup

Use an inline function for the common pattern for assigning a capsrc.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda/realtek - Fix missing inits of item indices for auto-mic
Takashi Iwai [Wed, 23 Nov 2011 06:38:59 +0000 (07:38 +0100)]
ALSA: hda/realtek - Fix missing inits of item indices for auto-mic

When the imux entries are rebuilt in alc_rebuild_imux_for_auto_mic(),
the initialization of index field is missing.  It may work without it
casually when the original imux was created by the auto-parser, but
it's definitely broken in the case of static configs where no imux was
parsed beforehand.  Because of this, the auto-mic switching doesn't
work properly on some model options.

This patch adds the missing initialization of index field.

Reported-by: Dmitry Nezhevenko <dion@inhex.net>
Cc: <stable@kernel.org> [v3.1]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Fix invalid pin and GPIO for Apple laptops with CS codecs
Takashi Iwai [Tue, 22 Nov 2011 19:00:31 +0000 (20:00 +0100)]
ALSA: hda - Fix invalid pin and GPIO for Apple laptops with CS codecs

The PCI SSID 8086:7270 is commonly used for multiple Apple machines,
thus we can't use it as identifier for a unique model.  Because of this
conflict, some machines show weird behavior.  For example, MacBook Air
shows Front and Surround speakers although only Surround works due to
the wrongly overridden pin-configuration for imac27.

This patch fixes two things:
- Stop the wrong pin-config override of imac27 by removing PCI SSID
  entry for avoiding the wrong mappings,
- Add the generic GPIO setup for Apple machines by checking the codec
  SSID vendor bits

Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Dirk Hohndel <hohndel@infradead.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Check subdevice mask in snd_hda_check_board_codec_sid_config()
Takashi Iwai [Tue, 22 Nov 2011 18:58:56 +0000 (19:58 +0100)]
ALSA: hda - Check subdevice mask in snd_hda_check_board_codec_sid_config()

In snd_hda_check_board_codec_sid_config(), not only comparing with the
exact value but allow the bit-mask comparison for vendor-only, etc.

Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Dirk Hohndel <hohndel@infradead.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: mpc8610: tell the CS4270 codec that it's the master
Timur Tabi [Tue, 22 Nov 2011 20:38:59 +0000 (14:38 -0600)]
ASoC: mpc8610: tell the CS4270 codec that it's the master

Commit ac601555 ("ASoC: Return early with -EINVAL if invalid dai format is
detected") requires the machine driver to tell the CS4270 codec driver
whether the CS4270 should be configured for master or slave operation.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: cs4720: use snd_soc_cache_sync()
Daniel Mack [Tue, 22 Nov 2011 16:17:23 +0000 (17:17 +0100)]
ASoC: cs4720: use snd_soc_cache_sync()

Replace the manual register restore mechanism in cs4270.c and call the
generic snd_soc_cache_sync() handler instead.

This factors code out in favour of core facilities and also fixes a
bus confusion that is most probably caused by intermixing i2c-regmap
functions and i2c_smbus_* accessors.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Sven Neumann <s.neumann@raumfeld.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: SAMSUNG: Fix build error
Boojin Kim [Tue, 22 Nov 2011 02:03:22 +0000 (11:03 +0900)]
ASoC: SAMSUNG: Fix build error

This patch adds <linux/modules.h> to fix following build errors.

sound/soc/codecs/wm8994.c: In function 'wm8994_readable':
sound/soc/codecs/wm8994.c:58: warning: unused variable 'wm8994'
sound/soc/samsung/smdk_wm8994.c:176: error: expected declaration specifiers or '...' before string constant
sound/soc/samsung/smdk_wm8994.c:176: warning: data definition has no type or storage class
sound/soc/samsung/smdk_wm8994.c:176: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
sound/soc/samsung/smdk_wm8994.c:176: warning: function declaration isn't a prototype
sound/soc/samsung/smdk_wm8994.c:177: error: expected declaration specifiers or '...' before string constant

Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: max9877: Update register if either val or val2 is changed
Axel Lin [Tue, 22 Nov 2011 06:47:44 +0000 (14:47 +0800)]
ASoC: max9877: Update register if either val or val2 is changed

In the case of ((max9877_regs[reg] >> shift) & mask) != val
but ((max9877_regs[reg2] >> shift) & mask) == val2,
current code does not update the registers.

Fix the logic to update registers if either val or val2 is changed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Fix wrong define for AD1836_ADC_WORD_OFFSET
Axel Lin [Tue, 22 Nov 2011 01:46:51 +0000 (09:46 +0800)]
ASoC: Fix wrong define for AD1836_ADC_WORD_OFFSET

According to the datasheet:
The BIT[5:4] of ADC Control Register 2 is to control the word width.
        00 = 25 Bits
        01 = 20 Bits
        10 = 16 Bits
        11 = Invalid

Thus, the AD1836_ADC_WORD_OFFSET should be defined as 4.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years agoALSA: hda - fail ELD reading early
Wu Fengguang [Tue, 22 Nov 2011 08:46:23 +0000 (16:46 +0800)]
ALSA: hda - fail ELD reading early

With the ELD repoll mechanism, we can (and should) fail the ELD reading
immediately when find something obviously wrong and let the caller retry
after some delay.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: lx6464es - fix device communication via command bus
Tim Blechmann [Tue, 22 Nov 2011 10:15:45 +0000 (11:15 +0100)]
ALSA: lx6464es - fix device communication via command bus

commit 6175ddf06b6172046a329e3abfd9c901a43efd2e optimized the mem*io
functions that have been used to send commands to the device. these
optimizations somehow corrupted the communication with the lx6464es,
that resulted the device to be unusable with kernels after 2.6.33.

this patch emulates the memcpy_*_io functions via a loop to avoid these
problems.

Signed-off-by: Tim Blechmann <tim@klingt.org>
LKML-Reference: <4ECB5257.4040600@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: lx6464es - command buffer API cleanup
Tim Blechmann [Tue, 22 Nov 2011 10:15:44 +0000 (11:15 +0100)]
ALSA: lx6464es - command buffer API cleanup

the command buffer is only accessed from one file, so we can declare the
specific functions as static in that file

Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - repoll ELD content for multiple times
Wu Fengguang [Fri, 18 Nov 2011 22:59:32 +0000 (16:59 -0600)]
ALSA: hda - repoll ELD content for multiple times

Improve the one-shot ELD repoll to up to 6 retries.

Up to now the 300ms looks sufficient for the test boxes. However
I'm a bit worried about how well it can fit the wider user base.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Fix PCI ID for PCIe RME MADI cards
Adrian Knoth [Mon, 21 Nov 2011 15:15:36 +0000 (16:15 +0100)]
ALSA: hdspm - Fix PCI ID for PCIe RME MADI cards

Commit c09403dcc5698abf214329fbbf3cf8dbb5558bea has introduced a
regression: PCIe versions of RME MADI were no longer detected, because
the MADIface ID (0xd5) was used instead of the correct 0xd2.

This commit fixes the problem.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Ensure WM8731 register cache is synced when resuming from disabled
Mark Brown [Mon, 21 Nov 2011 11:55:41 +0000 (11:55 +0000)]
ASoC: Ensure WM8731 register cache is synced when resuming from disabled

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years agoMerge branch 'DB_RANGE-size-fixes' of git://git.alsa-project.org/alsa-kprivate into...
Mark Brown [Mon, 21 Nov 2011 11:28:11 +0000 (11:28 +0000)]
Merge branch 'DB_RANGE-size-fixes' of git://git.alsa-project.org/alsa-kprivate into for-3.2

12 years agoALSA: cs5535 - Fix an endianness conversion
Dan Carpenter [Sun, 20 Nov 2011 20:57:49 +0000 (23:57 +0300)]
ALSA: cs5535 - Fix an endianness conversion

desc->size is supposed to be a le16 type.  On a big endian system the
current code will set ->size to zero.  We fixed a similar bug
on the next line but missed this one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: cs4271: Fix wrong mask parameter in some snd_soc_update_bits calls
Axel Lin [Sat, 19 Nov 2011 06:41:07 +0000 (14:41 +0800)]
ASoC: cs4271: Fix wrong mask parameter in some snd_soc_update_bits calls

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Alexander Sverdlin <subaparts@yandex.ru>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: wm_hubs: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:15:31 +0000 (15:15 +0100)]
ASoC: wm_hubs: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: wm9090: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:14:55 +0000 (15:14 +0100)]
ASoC: wm9090: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the arrays.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: wm8993: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:14:11 +0000 (15:14 +0100)]
ASoC: wm8993: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: wm8962: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:13:27 +0000 (15:13 +0100)]
ASoC: wm8962: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the arrays.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: sgtl5000: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:12:26 +0000 (15:12 +0100)]
ASoC: sgtl5000: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: rt5631: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:11:54 +0000 (15:11 +0100)]
ASoC: rt5631: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
the last entry from being omitted.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoASoC: adau1373: fix DB_RANGE size
Clemens Ladisch [Sun, 20 Nov 2011 14:10:27 +0000 (15:10 +0100)]
ASoC: adau1373: fix DB_RANGE size

Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
12 years agoALSA: hda - Add pin fix for Alienware M17x R3
Takashi Iwai [Sat, 19 Nov 2011 10:41:30 +0000 (11:41 +0100)]
ALSA: hda - Add pin fix for Alienware M17x R3

Reported-by: Albert Pool <albertpool@solcon.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: wm8753: Skip noop reconfiguration of DAI mode
Timo Juhani Lindfors [Thu, 17 Nov 2011 00:52:50 +0000 (02:52 +0200)]
ASoC: wm8753: Skip noop reconfiguration of DAI mode

This patch makes it possible to set DAI mode to its currently applied
value even if codec is active. This is necessary to allow

aplay -t raw -r 44100 -f S16_LE -c 2 < /dev/urandom &
alsactl store -f backup.state
alsactl restore -f backup.state

to work without returning errors. This patch is based on a patch sent
by Klaus Kurzmann <mok@fluxnetz.de>.

Signed-off-by: Timo Juhani Lindfors <timo.lindfors@iki.fi>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
12 years agoALSA: hda - Fix the connection selection of ADCs on Cirrus codecs
Takashi Iwai [Wed, 16 Nov 2011 17:05:11 +0000 (18:05 +0100)]
ALSA: hda - Fix the connection selection of ADCs on Cirrus codecs

spec->cur_adc isn't set until cs_capture_pcm_prepare() is called although
the driver tries to select the connection at init time and at auto-mic
switch.  This results in the access to the widget NID 0, which is
obviously invalid, also a wrong capture source.

This patch fixes the issue by issuing the connect-select verb conditionally
at appropriate places.

Reported-and-tested-by: Dylan Reid <dgreid@chromium.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Update URLs in document
Takashi Iwai [Wed, 16 Nov 2011 09:52:01 +0000 (10:52 +0100)]
ALSA: hda - Update URLs in document

Some stuff was moved from kernel.org to other places.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - move eld->spk_alloc fixup to hdmi_update_eld()
Wu Fengguang [Wed, 16 Nov 2011 08:29:48 +0000 (16:29 +0800)]
ALSA: hda - move eld->spk_alloc fixup to hdmi_update_eld()

It looks more natural and saves two lines of code.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - delayed ELD repoll
Wu Fengguang [Wed, 16 Nov 2011 08:29:47 +0000 (16:29 +0800)]
ALSA: hda - delayed ELD repoll

The Intel HDMI chips (ironlake at least) are found to have ~250ms delay
between the ELD_Valid=1 hotplug event is send and the ELD buffer becomes
actually readable. During the time the ELD buffer is mysteriously all 0.

Fix it by scheduling a delayed work to re-read ELD buffer after 300ms.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - fix ELD memory leak
Wu Fengguang [Wed, 16 Nov 2011 08:29:46 +0000 (16:29 +0800)]
ALSA: hda - fix ELD memory leak

memset(eld) clears eld->proc_entry which will leak the struct
snd_info_entry when unloading module.

Fix it by
- memset only the fields before eld->eld_buffer
- set eld->eld_valid to true _after_ all eld fields have been filled

Cc: <stable@kernel.org>
Cc: Pierre-louis Bossart <pierre-louis.bossart@intel.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>