]> rtime.felk.cvut.cz Git - linux-imx.git/log
linux-imx.git
12 years agoALSA: control: add support for ENUMERATED user space controls
Clemens Ladisch [Fri, 7 Oct 2011 20:38:59 +0000 (22:38 +0200)]
ALSA: control: add support for ENUMERATED user space controls

Handling of user control elements was implemented for all types except
ENUMERATED.  This type will be needed for the device-specific mixers of
upcoming FireWire drivers.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: oss-mixer - use strlcpy() instead strcpy()
Dan Carpenter [Tue, 4 Oct 2011 06:29:39 +0000 (09:29 +0300)]
ALSA: oss-mixer - use strlcpy() instead strcpy()

This is mostly a static checker fix more than anything else.  We're
copying from a 64 char buffer into a 44 char buffer.

The 64 character buffer is str[] in snd_mixer_oss_build_test_all().
The call tree is:
snd_mixer_oss_build_test_all()
-> snd_mixer_oss_build_test()
   -> snd_mixer_oss_build_test().

We never actually do fill str[] buffer all the way to 64 characters.
The longest string is:
sprintf(str, "%s Playback Switch", ptr->name);
ptr->name is a 32 character buffer so 32 plus 16 characters for
" Playback Switch" still puts us over the 44 limit from "id.name".

Most likely ptr->name never gets filled to the limit, but we can't
really change the size of that buffer so lets just use strlcpy() here
and be safe.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: firewire-speakers: fix locking
Stefan Richter [Sat, 27 Aug 2011 14:45:28 +0000 (16:45 +0200)]
ALSA: firewire-speakers: fix locking

There is a lock inversion between fwspk->mutex and pcm->open_mutex
reported by lockdep when fwspk_hw_free is called.

Fixed by copying the fix from the same former issue in the isight
sound driver (commit f3f7c1837f6bcae3601fc535b339426868bf1549
"ALSA: isight: fix locking").

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agosound: oss: use strlcpy() in sound_timer_init()
Dan Carpenter [Thu, 29 Sep 2011 06:10:48 +0000 (09:10 +0300)]
sound: oss: use strlcpy() in sound_timer_init()

sound_timer.info.name is a 32 character buffer.  This function only
has one caller (in sound/oss/ad1848.c) and it passes as 128 character
buffer as "name".  I don't know if this is a problem in real life,
and I doubt we're going to add more OSS drivers so it's unlikely to
become an issue.  But we may as well take care of it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: usb-audio: increase control transfer timeout
Clemens Ladisch [Mon, 26 Sep 2011 19:15:27 +0000 (21:15 +0200)]
ALSA: usb-audio: increase control transfer timeout

There are certain devices that are reportedly so slow that they need
more than 100 ms to handle control transfers.  Therefore, increase the
timeout in mixer(_quirks).c to 1000 ms.

The timeout parameter of snd_usb_ctl_msg() is now constant, so we can
drop it.

Reported-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: aloop - Use vmalloc buffer
Takashi Iwai [Sat, 24 Sep 2011 10:16:29 +0000 (12:16 +0200)]
ALSA: aloop - Use vmalloc buffer

snd-aloop driver is virtual and has no need for allocating contiguous
pages.  It'll be more system-friendly to use vmalloc buffers.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: 6fire: don't use custom hex_to_bin()
Andy Shevchenko [Fri, 23 Sep 2011 11:32:11 +0000 (14:32 +0300)]
ALSA: 6fire: don't use custom hex_to_bin()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - cleanup __user tags in ioctl()
Dan Carpenter [Fri, 23 Sep 2011 06:25:05 +0000 (09:25 +0300)]
ALSA: hdspm - cleanup __user tags in ioctl()

This makes the code cleaner and silences a Sparse complaint:
sound/pci/rme9652/hdspm.c:6341:23: warning: incorrect type in assignment (incompatible argument 4 (different address spaces))
sound/pci/rme9652/hdspm.c:6341:23:    expected int ( *ioctl )( ... )
sound/pci/rme9652/hdspm.c:6341:23:    got int ( static [toplevel] *<noident> )( ... )
sound/pci/rme9652/hdspm.c:6102:44: warning: dereference of noderef expression
sound/pci/rme9652/hdspm.c:6225:50: warning: dereference of noderef expression
sound/pci/rme9652/hdspm.c:6264:50: warning: dereference of noderef expression
sound/pci/rme9652/hdspm.c:6283:50: warning: dereference of noderef expression
sound/pci/rme9652/hdspm.c:6289:59: warning: dereference of noderef expression

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - potential info leak in snd_hdspm_hwdep_ioctl()
Dan Carpenter [Fri, 23 Sep 2011 06:24:21 +0000 (09:24 +0300)]
ALSA: hdspm - potential info leak in snd_hdspm_hwdep_ioctl()

Smatch has a new check for Rosenberg type information leaks where
structs are copied to the user with uninitialized stack data in them.

The status struct has a hole in it, and on some paths not all the
members were initialized.

struct hdspm_status {
        unsigned char              card_type;            /*     0     1 */
        /* XXX 3 bytes hole, try to pack */
        enum hdspm_syncsource      autosync_source;      /*     4     4 */
        long long unsigned int     card_clock;           /*     8     8 */

The hdspm_version struct had holes in it as well.

struct hdspm_version {
        unsigned char              card_type;            /*     0     1 */
        char                       cardname[20];         /*     1    20 */
        /* XXX 3 bytes hole, try to pack */
        unsigned int               serial;               /*    24     4 */
        short unsigned int         firmware_rev;         /*    28     2 */
        /* XXX 2 bytes hole, try to pack */
        int                        addons;               /*    32     4 */

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: fm801 - Clean up redundant reference to snd_fm801_tea575x_gpios[]
Takashi Iwai [Thu, 22 Sep 2011 14:54:23 +0000 (16:54 +0200)]
ALSA: fm801 - Clean up redundant reference to snd_fm801_tea575x_gpios[]

Use macro to improve readability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Thu, 22 Sep 2011 14:41:52 +0000 (16:41 +0200)]
Merge branch 'fix/misc' into topic/misc

12 years agoALSA: fm801: Gracefully handle failure of tuner auto-detect
Ben Hutchings [Thu, 22 Sep 2011 13:39:52 +0000 (14:39 +0100)]
ALSA: fm801: Gracefully handle failure of tuner auto-detect

Commit 9676001559fce06e37c7dc230ab275f605556176
("ALSA: fm801: add error handling if auto-detect fails") seems to
break systems that were previously working without a tuner.

As a bonus, this should fix init and cleanup for the case where the
tuner is explicitly disabled.

Reported-and-tested-by: Hor Jiun Shyong <jiunshyong@gmail.com>
References: http://bugs.debian.org/641946
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org [v3.0+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: fm801: Fix double free in case of error in tuner detection
Ben Hutchings [Thu, 22 Sep 2011 13:38:58 +0000 (14:38 +0100)]
ALSA: fm801: Fix double free in case of error in tuner detection

Commit 9676001559fce06e37c7dc230ab275f605556176
("ALSA: fm801: add error handling if auto-detect fails") added
incorrect error handling.

Once we have successfully called snd_device_new(), the cleanup
function fm801_free() will automatically be called by snd_card_free()
and we must *not* also call fm801_free() directly.

Reported-by: Hor Jiun Shyong <jiunshyong@gmail.com>
References: http://bugs.debian.org/641946
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@kernel.org [v3.0+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: HDA: Add support for IDT 92HD93
David Henningsson [Tue, 20 Sep 2011 07:02:22 +0000 (09:02 +0200)]
ALSA: HDA: Add support for IDT 92HD93

Cc: stable@kernel.org
BugLink: http://bugs.launchpad.net/bugs/854468
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: via82xx: allow to disable the SRC
Clemens Ladisch [Fri, 16 Sep 2011 21:16:05 +0000 (23:16 +0200)]
ALSA: via82xx: allow to disable the SRC

Add the PCM rule to allow disabling the PCM playback SRC.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: emu10k1: allow to disable the SRC
Clemens Ladisch [Fri, 16 Sep 2011 21:13:38 +0000 (23:13 +0200)]
ALSA: emu10k1: allow to disable the SRC

Add the PCM rule to allow disabling the PCM playback SRC.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ymfpci: allow to disable the SRC
Clemens Ladisch [Fri, 16 Sep 2011 21:08:28 +0000 (23:08 +0200)]
ALSA: ymfpci: allow to disable the SRC

Add the PCM rules to allow disabling the PCM playback and capture SRCs.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: pcm: add snd_pcm_hw_rule_noresample()
Clemens Ladisch [Fri, 16 Sep 2011 21:03:02 +0000 (23:03 +0200)]
ALSA: pcm: add snd_pcm_hw_rule_noresample()

Add a helper function to allow drivers to disable hardware resampling
when the application has specified the SNDRV_PCM_HW_PARAMS_NORESAMPLE
flag.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ymfpci: fix PCM open error handling
Clemens Ladisch [Fri, 16 Sep 2011 20:52:48 +0000 (22:52 +0200)]
ALSA: ymfpci: fix PCM open error handling

The installation of the minimum period size constraint in the PCM open
callbacks was not checked for errors.  Add this check, and move the call
to the beginning of the function to avoid having to do any cleanups in
the error case.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda/realtek - Fix auto-mute with HP+LO configuration
Takashi Iwai [Mon, 19 Sep 2011 09:31:34 +0000 (11:31 +0200)]
ALSA: hda/realtek - Fix auto-mute with HP+LO configuration

When the system has only the headphone and the line-out jacks without
speakers, the current auto-mute code doesn't work.  It's because the
spec->automute_lines flag is wrongly referred in update_speakers().
This flag must be meaningless when spec->automute_hp_lo isn't set, thus
they should be always coupled.

The patch fixes the problem and add a comment to indicate the
relationship briefly.

BugLink: http://bugs.launchpad.net/bugs/851697
Reported-by: David Henningsson <david.henningsson@canonical.com>
Tested-By: Jayne Han <jayne.han@canonical.com>
Cc: stable@kernel.org (3.0)
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: usb-audio: Added support for Roland UM-ONE midi-usb interface
Daniele Guerrieri [Fri, 16 Sep 2011 06:31:45 +0000 (08:31 +0200)]
ALSA: usb-audio: Added support for Roland UM-ONE midi-usb interface

Roland UM-ONE midi usb interface differs from Roland UM-1.

Signed-off-by: Daniele Guerrieri <d.guerrieri@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Fri, 16 Sep 2011 06:29:04 +0000 (08:29 +0200)]
Merge branch 'fix/misc' into topic/misc

12 years agoALSA: pcm - fix race condition in wait_for_avail()
Arjan van de Ven [Thu, 15 Sep 2011 06:49:25 +0000 (08:49 +0200)]
ALSA: pcm - fix race condition in wait_for_avail()

wait_for_avail() in pcm_lib.c has a race in it (observed in practice by an
Intel validation group).

The function is supposed to return once space in the buffer has become
available, or if some timeout happens.  The entity that creates space (irq
handler of sound driver and some such) will do a wake up on a waitqueue
that this function registers for.

However there are two races in the existing code

1) If space became available between the caller noticing there was no
   space and this function actually sleeping, the wakeup is missed and the
   timeout condition will happen instead

2) If a wakeup happened but not sufficient space became available, the
   code will loop again and wait for more space.  However, if the second
   wake comes in prior to hitting the schedule_timeout_interruptible(), it
   will be missed, and potentially you'll wait out until the timeout
   happens.

The fix consists of using more careful setting of the current state (so
that if a wakeup happens in the main loop window, the schedule_timeout()
falls through) and by checking for available space prior to going into the
schedule_timeout() loop, but after being on the waitqueue and having the
state set to interruptible.

[tiwai: the following changes have been added to Arjan's original patch:
 - merged akpm's fix for waitqueue adding order into a single patch
 - reduction of duplicated code of avail check
]

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Wed, 14 Sep 2011 17:11:13 +0000 (19:11 +0200)]
Merge branch 'fix/asoc' into for-linus

12 years agoALSA: snd-usb: move code from urb.c to endpoint.c
Daniel Mack [Wed, 14 Sep 2011 10:46:57 +0000 (12:46 +0200)]
ALSA: snd-usb: move code from urb.c to endpoint.c

No code altered at this point, simply preparing for upcoming
refactorizations.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb: re-order code
Daniel Mack [Mon, 12 Sep 2011 16:54:12 +0000 (18:54 +0200)]
ALSA: snd-usb: re-order code

Move code from endpoint.c into a new file called stream.c and rename
functions so that their names actually reflect what they're doing.

This way, endpoint.c will be available to functions that hold all the
endpoint logic.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd-usb: re-order the Makefile
Daniel Mack [Mon, 12 Sep 2011 16:54:11 +0000 (18:54 +0200)]
ALSA: snd-usb: re-order the Makefile

Sort its entries in alphabetical order.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoUSB: Add endpoint usage definitions to ch9.h
Daniel Mack [Mon, 12 Sep 2011 16:54:10 +0000 (18:54 +0200)]
USB: Add endpoint usage definitions to ch9.h

The endpoint usage field is described in the USB 2.0 specification,
chapter 9.6.6.

Also, move the sync type fields block down by some lines to reflect the
fact that these are also stuffed in bmAttributes.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: HDA: Cirrus - fix "Surround Speaker" volume control name
David Henningsson [Wed, 14 Sep 2011 11:22:54 +0000 (13:22 +0200)]
ALSA: HDA: Cirrus - fix "Surround Speaker" volume control name

This patch fixes "Surround Speaker Playback Volume" being cut off.
(Commit b4dabfc452a10 was probably meant to fix this, but it fixed
only the "Switch" name, not the "Volume" name.)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: mpu401: clean up interrupt specification
Clemens Ladisch [Tue, 13 Sep 2011 09:24:41 +0000 (11:24 +0200)]
ALSA: mpu401: clean up interrupt specification

The semantics of snd_mpu401_uart_new()'s interrupt parameters are
somewhat counterintuitive:  To prevent the function from allocating its
own interrupt, either the irq number must be invalid, or the irq_flags
parameter must be zero.  At the same time, the irq parameter being
invalid specifies that the mpu401 code has to work without an interrupt
allocated by the caller.  This implies that, if there is an interrupt
and it is allocated by the caller, the irq parameter must be set to
a valid-looking number which then isn't actually used.

With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
which forces us to handle the parameters differently.

This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
device interrupt is handled by the caller, and makes the allocation of
the interrupt to depend only on the irq parameter.  As suggested by
Takashi, the irq_flags parameter was dropped because, when used, it had
the constant value IRQF_DISABLED.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Terminate the recursive connection search properly
Takashi Iwai [Tue, 13 Sep 2011 08:33:16 +0000 (10:33 +0200)]
ALSA: hda - Terminate the recursive connection search properly

The recursive search of widget connections in snd_hda_get_conn_index()
must be terminated at the pin and the audio-out widgets.  Otherwise
you'll get "too deep connection" warnings unnecessarily.

Reported-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Fix trivial build regression in Kirkwood I2S
Arnd Bergmann [Sun, 11 Sep 2011 18:07:30 +0000 (20:07 +0200)]
ASoC: Fix trivial build regression in Kirkwood I2S

A fix merged in 3.1-rc2 introduced a small regression, this should get it
to build again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: keywest: Remove obsolete cleanup for clientdata
Axel Lin [Fri, 9 Sep 2011 09:50:52 +0000 (17:50 +0800)]
ALSA: keywest: Remove obsolete cleanup for clientdata

The i2c core will clear the clientdata pointer automatically.
We don't have to set the `data' field to NULL in remove() or
if probe() failed anymore.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: aoa: Remove obsolete cleanup for clientdata
Axel Lin [Fri, 9 Sep 2011 11:04:45 +0000 (19:04 +0800)]
ALSA: aoa: Remove obsolete cleanup for clientdata

The i2c core will clear the clientdata pointer automatically.
We don't have to set the `data' field to NULL in remove() or
if probe() failed anymore.

Also remove a unneeded NULL checking for kfree.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ymfpci: add "Playback" to FM Legacy Volume control
Raymond Yau [Fri, 9 Sep 2011 11:15:01 +0000 (19:15 +0800)]
ALSA: ymfpci: add "Playback" to FM Legacy Volume control

YDSXGR_LEGACYOUTVOL is a Playback Volume control for OPL3 FM Synth.

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: usb: refine delay information with USB frame counter
Pierre-Louis Bossart [Wed, 7 Sep 2011 00:15:34 +0000 (19:15 -0500)]
ALSA: usb: refine delay information with USB frame counter

Existing code only updates the audio delay when URBs were
submitted/retired. This can introduce an uncertainty of 8ms
on the number of samples played out with the default settings,
and a lot more when URBs convey more packets to reduce the
interrupt rate and power consumption.

This patch relies on the USB frame counter to reduce the
uncertainty to less than 2ms worst-case. The delay information
essentially becomes independent of the URB size and number of
packets. This should help applications like PulseAudio which
require accurate audio timing. Clemens Ladisch reported
a decrease of mplayer's A-V difference from nrpacks down to at
most 1ms.

Thanks to Clemens for also pointing out that the implementation
of frame counters varies between different HCDs. Only the
8 lowest-bits are used to estimate the delay.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
[clemens: changed debug code]
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Blackfin: bf5xx-ad193x: Fix codec device name
Lars-Peter Clausen [Mon, 5 Sep 2011 11:49:57 +0000 (13:49 +0200)]
ASoC: Blackfin: bf5xx-ad193x: Fix codec device name

Fix the codec_name field of the dai_link to match the actual device name
of the codec. Otherwise the card won't be instantiated.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoASoC: Fix reporting of partial jack updates
Mark Brown [Sun, 4 Sep 2011 15:18:18 +0000 (08:18 -0700)]
ASoC: Fix reporting of partial jack updates

We need to report the entire jack state to the core jack code, not just
the bits that were being updated by the caller, otherwise the status
reported by other detection methods will be omitted from the state seen
by userspace.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Cc: stable@kernel.org
12 years agoASoC: imx: Fix build warning of unused 'card' variable
Fabio Estevam [Tue, 30 Aug 2011 03:28:42 +0000 (00:28 -0300)]
ASoC: imx: Fix build warning of unused 'card' variable

Fixes the following warning:

  CC      sound/soc/imx/imx-pcm-fiq.o
sound/soc/imx/imx-pcm-fiq.c: In function 'imx_pcm_fiq_new':
sound/soc/imx/imx-pcm-fiq.c:243: warning: unused variable 'card'
  CC      sound/soc/imx/imx-pcm-dma-mx2.o

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Fix register cache sync register_writable WARN_ONs
Lars-Peter Clausen [Sat, 27 Aug 2011 16:24:13 +0000 (18:24 +0200)]
ASoC: Fix register cache sync register_writable WARN_ONs

Currently the condition for these WARN_ONs is reversed and they are placed
before the actual check whether we are going to write to that register. So if
the codec implements the register_writable callback we'll get a warning for each
writable register when syncing the register cache.

While we are at it change the check to use snd_soc_codec_writable_register
instead of open-coding it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: snd_soc_codec_{readable,writable}_register change default to true
Lars-Peter Clausen [Sat, 27 Aug 2011 16:24:12 +0000 (18:24 +0200)]
ASoC: snd_soc_codec_{readable,writable}_register change default to true

Change the default return value of snd_soc_codec_{readable,writable}_register to
true when no codec specific callback for this function is given. Otherwise all
registers of that codec will neither be readable nor writable, which is most
certainly not what we want.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: soc-dapm: Fix parameter comment for snd_soc_dapm_free
Peter Ujfalusi [Fri, 26 Aug 2011 13:33:52 +0000 (16:33 +0300)]
ASoC: soc-dapm: Fix parameter comment for snd_soc_dapm_free

We have dapm_context instead of codec parameter.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoMAINTAINERS: Add some missed Wolfson files
Mark Brown [Fri, 19 Aug 2011 08:53:12 +0000 (17:53 +0900)]
MAINTAINERS: Add some missed Wolfson files

Mostly input related.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: usb-audio: add Starr Labs USB MIDI support
Kristian Amlie [Fri, 26 Aug 2011 11:19:49 +0000 (13:19 +0200)]
ALSA: usb-audio: add Starr Labs USB MIDI support

Add support for Starr Labs USB MIDI devices such as the Z7S, which are
based on an FTDI serial UART chip.

Based on a patch by Daniel Mack.

Signed-off-by: Kristian Amlie <kristian@amlie.name>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/asoc' into for-linus
Takashi Iwai [Fri, 26 Aug 2011 07:29:43 +0000 (09:29 +0200)]
Merge branch 'fix/asoc' into for-linus

12 years agoALSA: hda: Conexant: Allow different output types to share DAC
David Henningsson [Thu, 25 Aug 2011 11:16:02 +0000 (13:16 +0200)]
ALSA: hda: Conexant: Allow different output types to share DAC

Headphones has stopped working for the original reported (a regression
compared to 2.6.38). This is because Speaker and Headphones share the
same DAC, in which case no Headphones volume control was created.
This patch fixes so that both Speaker and Headphones volume
controls are created in such scenario.

BugLink: http://bugs.launchpad.net/bugs/817943
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: MPC5200: replace of_device with platform_device
Timur Tabi [Tue, 23 Aug 2011 21:48:26 +0000 (16:48 -0500)]
ASoC: MPC5200: replace of_device with platform_device

'struct of_device' no longer exists, and its functionality has been merged
into platform_device.  Update the MPC5200 audio DMA driver (mpc5200_dma)
accordingly.  This fixes a build break.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoASoC: Correct element count for WM8996 sidetone HPF
Mark Brown [Wed, 24 Aug 2011 15:35:32 +0000 (16:35 +0100)]
ASoC: Correct element count for WM8996 sidetone HPF

I can count. Honest.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoASoC: Tegra: wm8903 machine driver: Drop Ventana support
Stephen Warren [Tue, 23 Aug 2011 17:16:28 +0000 (11:16 -0600)]
ASoC: Tegra: wm8903 machine driver: Drop Ventana support

Board file support for Ventana is not yet mainlined, and probably won't
ever be given the move to Device-Tree. Consequently, the Ventana entry
is being removed from arch/arm/tools/mach-types in the next merge window,
since it was registered over a year ago.

This will also remove function machine_is_ventana(), which is used by
the ASoC Tegra WM8903 machine driver. This will cause compilation
failures. Drop Ventana support to resolve this.

Hopefully, in the not-too-distant future, tegra_wm8903.c will be able to
configure itself from Device-Tree, and hence we'll be able to re-instate
Ventana support just by creating a .dts file for the board.

Also note that Aebl support is in a similar boat. However, that board
isn't scheduled for deprecation for at least another 5 months, and
perhaps we will have completely removed non-Device-Tree support from
tegra_wm8903.c by then and/or adjusted mach-types policy.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Add samsung maintainer
Sangbeom Kim [Tue, 23 Aug 2011 10:36:59 +0000 (19:36 +0900)]
ASoC: Add samsung maintainer

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Add Springbank I/O card to Speyside Kconfig
Joseph Pentland [Tue, 23 Aug 2011 09:41:50 +0000 (10:41 +0100)]
ASoC: Add Springbank I/O card to Speyside Kconfig

Signed-off-by: Joseph Pentland <jp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: hda/conexant - Enable ADC-switching for auto-mic mode, too
Takashi Iwai [Wed, 24 Aug 2011 08:53:10 +0000 (10:53 +0200)]
ALSA: hda/conexant - Enable ADC-switching for auto-mic mode, too

The ADC-switching can work also in the auto-mic mode, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ctxfi: Bump playback substreams to 256
Maarten Lankhorst [Tue, 23 Aug 2011 22:48:59 +0000 (00:48 +0200)]
ALSA: ctxfi: Bump playback substreams to 256

There are references in the code to 256 sources, so I tested it with 256 aplays,
of which the first and last with real data and the rest playing /dev/zero .

Also increase amount of page tables, so the default aplay size works.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: release the constraint check for replace ops
Lu Guanqun [Wed, 24 Aug 2011 06:45:10 +0000 (14:45 +0800)]
ALSA: core: release the constraint check for replace ops

Suppose the ALSA card already has a number of MAX_USER_CONTROLS controls, and
the user wants to replace one, it should not fail at this condition check.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: core: trivial code style fix
Lu Guanqun [Wed, 24 Aug 2011 03:12:34 +0000 (11:12 +0800)]
ALSA: core: trivial code style fix

remove trailing tab on the line.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Fix double-headphone/speaker paths for Cxt auto-parser
Takashi Iwai [Tue, 23 Aug 2011 12:57:08 +0000 (14:57 +0200)]
ALSA: hda - Fix double-headphone/speaker paths for Cxt auto-parser

When multiple headphones or speakers are assigned but no individual
DACs are available, the driver should take the first HP/SPK DAC instead
of another primary output.  The patch adds a bit-flag to dac field of
struct pin_dac_pair indicating that it's a slave DAC.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Update jack-sense info even when no automute is set
Takashi Iwai [Tue, 23 Aug 2011 10:41:09 +0000 (12:41 +0200)]
ALSA: hda - Update jack-sense info even when no automute is set

The internal states, jack_present and line_jack_present should be
updated upon unsolicited events even if no automute is set.
Otherwise the wrong state is referred when the automute behavior is
changed by the mixer control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Fix output-path initialization for Realtek auto-parser
Takashi Iwai [Tue, 23 Aug 2011 10:36:28 +0000 (12:36 +0200)]
ALSA: hda - Fix output-path initialization for Realtek auto-parser

When the headphone or speaker output has no own DAC, initialize the path
using the primary DAC.  Otherwise the path won't be set properly and
can result in the silence.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agosound/soc/fsl/mpc8610_hpcd.c: add missing of_node_put
Julia Lawall [Sat, 20 Aug 2011 07:02:01 +0000 (09:02 +0200)]
sound/soc/fsl/mpc8610_hpcd.c: add missing of_node_put

The first change is to add an of_node_put, since codec_np has previously
been allocated.  The rest of the patch reorganizes the error handling code
so the only code executed is that which is needed.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != of_node_put(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 of_node_put(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agosound/soc/fsl/p1022_ds.c: add missing of_node_put
Julia Lawall [Sat, 20 Aug 2011 07:02:00 +0000 (09:02 +0200)]
sound/soc/fsl/p1022_ds.c: add missing of_node_put

dma_channel_np has been accessed at this point, so decrease its reference
count before leaving the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != of_node_put(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 of_node_put(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agosound/soc/ep93xx/ep93xx-i2s.c: add missing kfree
Julia Lawall [Sat, 20 Aug 2011 06:12:39 +0000 (08:12 +0200)]
sound/soc/ep93xx/ep93xx-i2s.c: add missing kfree

Introduce a new label that includes kfree and jump to that one.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != kfree(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Alexander Sverdlin <subaparts@yandex.ru>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agosound/soc/kirkwood/kirkwood-i2s.c: add missing kfree
Julia Lawall [Sat, 20 Aug 2011 06:12:38 +0000 (08:12 +0200)]
sound/soc/kirkwood/kirkwood-i2s.c: add missing kfree

Adjust the goto to jump to the error handling code that includes kfree.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != kfree(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: soc-core: use GFP_KERNEL flag for kmalloc in snd_soc_cnew
Axel Lin [Sat, 20 Aug 2011 03:03:44 +0000 (11:03 +0800)]
ASoC: soc-core: use GFP_KERNEL flag for kmalloc in snd_soc_cnew

GFP_ATOMIC is not needed here, use GFP_KERNEL instead.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agosound/soc/fsl/fsl_dma.c: add missing of_node_put
Timur Tabi [Mon, 22 Aug 2011 14:22:41 +0000 (09:22 -0500)]
sound/soc/fsl/fsl_dma.c: add missing of_node_put

of_parse_phandle increments the reference count of np, so this should be
decremented before trying the next possibility.

Since we don't actually use np, we can decrement the reference count
immediately.

Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Clear completions from late WM8996 FLL lock IRQs
Mark Brown [Tue, 16 Aug 2011 07:57:58 +0000 (16:57 +0900)]
ASoC: Clear completions from late WM8996 FLL lock IRQs

In case we have a pending completion, for example due to a problem with
the input clock which got corrected after we timed out.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoASoC: Clear any outstanding WM8962 FLL lock completions before waiting
Mark Brown [Sun, 21 Aug 2011 16:18:52 +0000 (17:18 +0100)]
ASoC: Clear any outstanding WM8962 FLL lock completions before waiting

Ensure that we don't spuriously trigger early.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoASoC: Ensure we only run Speyside WM8962 bias level callbacks once
Mark Brown [Sun, 21 Aug 2011 11:20:00 +0000 (12:20 +0100)]
ASoC: Ensure we only run Speyside WM8962 bias level callbacks once

We get called once per DAPM context but only need to run once. When DAPM
was serialized this was a series of noops but now it can run in parallel
we need to take proper care.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoASoC: Fix configuration of WM8996 input enables
Mark Brown [Sat, 20 Aug 2011 15:59:27 +0000 (16:59 +0100)]
ASoC: Fix configuration of WM8996 input enables

There's no need for separate widgets for the enables (as the map already
shows).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoASoC: WM8996 record paths need AIFCLK
Mark Brown [Sat, 20 Aug 2011 09:23:38 +0000 (10:23 +0100)]
ASoC: WM8996 record paths need AIFCLK

Make AIFCLK supply the record paths otherwise record will not work unless
there is a simultaneous playback.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
12 years agoALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree
Julia Lawall [Sat, 20 Aug 2011 06:12:41 +0000 (08:12 +0200)]
ALSA: sound/aoa/fabrics/layout.c: remove unneeded kfree

The label outnodev is only used when kzalloc has not yet taken place or has
failed, so there is no need for the call for kfree under this label.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier x;
expression E1!=0,E2,E3,E4;
statement S;
iterator I;
@@

(
if (...) { ... when != kfree(x)
               when != x = E3
               when != E3 = x
*  return ...;
 }
... when != x = E2
    when != I(...,x,...) S
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c
Takashi Iwai [Sat, 20 Aug 2011 07:19:59 +0000 (09:19 +0200)]
ALSA: hda - Fix error check from snd_hda_get_conn_index() in patch_cirrus.c

snd_hda_get_conn_index() returns a negative value while the current code
stores it in an unsigned int.  It must be stored in a signed integer.

Reported-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hda - Don't spew too many ELD errors
Takashi Iwai [Sat, 20 Aug 2011 07:14:45 +0000 (09:14 +0200)]
ALSA: hda - Don't spew too many ELD errors

Currently HD-audio driver shows the all error ELD byte as an error
in the kernel message.  This is annoying when the video driver doesn't
set the correct ELD from the beginning. e.g. radeon sends a zero-byte
data, but we still check ELD with the fixed 128 byte as a workaround
for some broken devices, it spews 128-times errors.

For avoiding this, the driver aborts reading when the first byte is
invalid.  In such a case, the whole data is certainly invalid.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: usb-audio - Check the dB-range validity in the later read, too
Takashi Iwai [Fri, 19 Aug 2011 06:30:53 +0000 (08:30 +0200)]
ALSA: usb-audio - Check the dB-range validity in the later read, too

When the initial check of dB-range failed due to the read error, try to
check again at the later read, too.  When an invalid dB range is found,
remove TLV flags and notify the mixer info change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'fix/misc' into topic/misc
Takashi Iwai [Fri, 19 Aug 2011 06:30:38 +0000 (08:30 +0200)]
Merge branch 'fix/misc' into topic/misc

12 years agoALSA: usb-audio - Fix missing mixer dB information
Takashi Iwai [Fri, 19 Aug 2011 05:55:10 +0000 (07:55 +0200)]
ALSA: usb-audio - Fix missing mixer dB information

The recent fix for testing dB range at the mixer creation time seems
to cause regressions in some devices.  In such devices, reading the dB
info at probing time gives an error, thus both dBmin and dBmax are still
zero, and TLV flag isn't set although the later read of dB info succeeds.

This patch adds a workaround for such a case by assuming that the later
read will succeed.  In future, a similar test should be performed in a
case where a wrong dB range is seen even in the later read.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
12 years agoASoC: omap: Fix build errors in ams-delta
Jarkko Nikula [Thu, 18 Aug 2011 12:02:47 +0000 (15:02 +0300)]
ASoC: omap: Fix build errors in ams-delta

Fix "error: too few arguments to function 'ams_delta_set_bias_level'"
build errors in ams-delta.c that were introduced after commit d4c6005 ("ASoC:
Add context parameter to card DAPM callbacks") by adding dapm context
to ams_delta_set_bias_level calls.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: hda - Add "PCM" volume to vmaster slave list
Takashi Iwai [Thu, 18 Aug 2011 13:13:17 +0000 (15:13 +0200)]
ALSA: hda - Add "PCM" volume to vmaster slave list

The new parser may use "PCM" volume, but it was missing the vmaster
slave list, thus "Master" volume didn't control it.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=41342

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: Fix check for symmetric rate enforcement
Sascha Hauer [Wed, 17 Aug 2011 07:20:01 +0000 (09:20 +0200)]
ASoC: Fix check for symmetric rate enforcement

The ASoC core tries to not enforce symmetric rates when
two streams open simultaneously. It does so by checking
rtd->rate being zero. This works exactly once after booting
because it is not set to zero again when the streams close.
Fix this by setting rtd->rate when no active stream is left.

[This leads to lots of warnings about not enforcing the symmetry in some
situations as there's a race in the userspace API where we know we've
got two applications but don't know what rates they want to set.
-- broonie ]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoALSA: hda - Fix duplicated capture-volume creation for ALC268 models
Takashi Iwai [Tue, 16 Aug 2011 12:23:20 +0000 (14:23 +0200)]
ALSA: hda - Fix duplicated capture-volume creation for ALC268 models

Fix the duplicated creation of capture-mixer elements for some static
ALC268 configurations.  The capture mixers must be put to cap_mixer field
instead of mixers array.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: ad193x: remove cache support
Scott Jiang [Fri, 12 Aug 2011 22:04:14 +0000 (18:04 -0400)]
ASoC: ad193x: remove cache support

asoc cache layer can't support this kind of spi registers well.
remove cache support and read/write registers directly

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: Add spi hw read function for 16 addr 8 data mode for ad193x fix
Scott Jiang [Fri, 12 Aug 2011 22:04:13 +0000 (18:04 -0400)]
ASoC: Add spi hw read function for 16 addr 8 data mode for ad193x fix

[This will be used by the ad193x driver to fix the fact that the
original author of the driver put a bodge for their particular chip into
a the generic ASoC register I/O abstraction layer which looked like an
obvious bug which ended up getting fixed in 3.0.  Sadly there were no
comments documenting what was going on.  A minimally invasive correction
to the driver is to remove the register cache support and go direct to
the hardware all the time so we're adding a new feature -- broonie]

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: ad193x: fix system clock
Scott Jiang [Fri, 12 Aug 2011 22:04:12 +0000 (18:04 -0400)]
ASoC: ad193x: fix system clock

system clock is 24.576MHz instead of 12.288MHz

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: ad193x: fix dac word len setting
Scott Jiang [Fri, 12 Aug 2011 22:04:11 +0000 (18:04 -0400)]
ASoC: ad193x: fix dac word len setting

dac word len value should left shift before setting

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Acked-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoASoC: ad193x: fix registers definition
Scott Jiang [Fri, 12 Aug 2011 22:04:10 +0000 (18:04 -0400)]
ASoC: ad193x: fix registers definition

fix dac word len mask and adc tdm fmt shift value

Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
12 years agoASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails
Axel Lin [Sat, 13 Aug 2011 03:33:08 +0000 (11:33 +0800)]
ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: soc-jack: Fix checking return value of request_any_context_irq
Axel Lin [Sat, 13 Aug 2011 11:15:01 +0000 (19:15 +0800)]
ASoC: soc-jack: Fix checking return value of request_any_context_irq

request_any_context_irq() returns a negative value on failure.
On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.orG
12 years agoALSA: hdspm - Simplify with snd_pcm_hw_constraint_pow2()
Takashi Iwai [Mon, 15 Aug 2011 08:45:42 +0000 (10:45 +0200)]
ALSA: hdspm - Simplify with snd_pcm_hw_constraint_pow2()

Refactoring the code using snd_pcm_hw_constraint_pow2() helper function.

Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Add missing KNOT flag for AES32 rate restriction
Takashi Iwai [Mon, 15 Aug 2011 08:42:23 +0000 (10:42 +0200)]
ALSA: hdspm - Add missing KNOT flag for AES32 rate restriction

AES32 supports the non-standard 128kHZ, and this is enabled only when
SNDRV_PCM_RATE_KNOT is set in hw.rates field.

Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Correct max buffer size limit
Takashi Iwai [Mon, 15 Aug 2011 08:40:59 +0000 (10:40 +0200)]
ALSA: hdspm - Correct max buffer size limit

Some modesl can support up to 8192 frames per period.

Tested-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: virtuoso: fix Essence ST(X) S/PDIF input
Clemens Ladisch [Sat, 18 Jun 2011 21:05:00 +0000 (23:05 +0200)]
ALSA: virtuoso: fix Essence ST(X) S/PDIF input

On the Xonar Essence ST/STX, the connector J14 has been confirmed to be
a digital input, so enable it in the driver.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: isight: remove superfluous field
Clemens Ladisch [Sun, 19 Jun 2011 10:10:43 +0000 (12:10 +0200)]
ALSA: isight: remove superfluous field

Remove a field that is not used at all.  This remained from
earlier tests, but the current driver has decided not to handle
iris notifications.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: ac97: Add HP Compaq dc5100 SFF(PT003AW) to Headphone Jack Sense whitelist
Daniel T Chen [Mon, 15 Aug 2011 02:43:01 +0000 (22:43 -0400)]
ALSA: ac97: Add HP Compaq dc5100 SFF(PT003AW) to Headphone Jack Sense whitelist

BugLink: https://bugs.launchpad.net/bugs/826081
The original reporter needs 'Headphone Jack Sense' enabled to have
audible audio, so add his PCI SSID to the whitelist.

Reported-and-tested-by: Muhammad Khurram Khan
Cc: <stable@kernel.org>
Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Enable 32 samples/period on RME RayDAT/AIO
Adrian Knoth [Sun, 14 Aug 2011 22:22:54 +0000 (00:22 +0200)]
ALSA: hdspm - Enable 32 samples/period on RME RayDAT/AIO

Newer RME cards like RayDAT and AIO support 32 samples per period. This
value is encoded as {1,1,1} in the HDSP_LatencyMask bits in the control
register.

Since {1,1,1} is also the representation for 8192 samples/period on
older RME cards, we have to special case 32 samples and 32768 bytes
according to the actual card.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Introduce hdspm_get_latency() to harmonize latency calculation
Adrian Knoth [Sun, 14 Aug 2011 22:22:53 +0000 (00:22 +0200)]
ALSA: hdspm - Introduce hdspm_get_latency() to harmonize latency calculation

Currently, hdspm_decode_latency is called several times, violating the
DRY principle. Given that we need to distinguish between old and new
cards when decoding the latency bits in the control register, introduce
hdspm_get_latency() to provide the required functionality.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Reorder period sizes according to their bit representation
Adrian Knoth [Sun, 14 Aug 2011 22:22:52 +0000 (00:22 +0200)]
ALSA: hdspm - Reorder period sizes according to their bit representation

On newer RME cards like RayDAT and AIO, the 8192 samples per period size
are no longer supported. Instead, setting all three bits of
HDSP_LatencyMask to one ({1,1,1}) now corresponds to 32 samples per
period.

To make this more obvious to future developers, let's reorder the array
according to their bit representation, starting at 64 ({0,0,0}) up to
4096 ({1,1,0}) and finally 32 ({1,1,1}).

Note that this patch doesn't change semantics.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Set period_bytes_min to 32 * 4 for new RME cards
Adrian Knoth [Sun, 14 Aug 2011 22:22:51 +0000 (00:22 +0200)]
ALSA: hdspm - Set period_bytes_min to 32 * 4 for new RME cards

On newer RME cards like RayDAT and AIO, the lower bound is 32 samples
per period in contrast to 64 samples as seen on older cards.

We hence lower period_bytes_min to 32 * 4. Four bytes per sample.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: hdspm - Allow for 8192 period size on RME MADI and AES cards
Adrian Knoth [Sun, 14 Aug 2011 22:22:50 +0000 (00:22 +0200)]
ALSA: hdspm - Allow for 8192 period size on RME MADI and AES cards

Older RME cards like MADI and AES support period sizes of 8192 samples.
The original hdspm driver already featured this value, apparently, it
was lost during the rewrite.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoALSA: snd_usb_caiaq: track submitted output urbs
Daniel Mack [Sun, 14 Aug 2011 09:31:16 +0000 (11:31 +0200)]
ALSA: snd_usb_caiaq: track submitted output urbs

The snd_usb_caiaq driver currently assumes that output urbs are serviced
in time and doesn't track when and whether they are given back by the
USB core. That usually works fine, but due to temporary limitations of
the XHCI stack, we faced that urbs were submitted more than once with
this approach.

As it's no good practice to fire and forget urbs anyway, this patch
introduces a proper bit mask to track which requests have been submitted
and given back.

That alone however doesn't make the driver work in case the host
controller is broken and doesn't give back urbs at all, and the output
stream will stop once all pre-allocated output urbs are consumed. But
it does prevent crashes of the controller stack in such cases.

See http://bugzilla.kernel.org/show_bug.cgi?id=40702 for more details.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Reported-and-tested-by: Matej Laitl <matej@laitl.cz>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoASoC: rx1950: Fix compilation error due to missing header
Vasily Khoruzhick [Fri, 12 Aug 2011 14:53:00 +0000 (17:53 +0300)]
ASoC: rx1950: Fix compilation error due to missing header

Add linux/types.h to fix this compilation error:

In file included from arch/arm/mach-s3c2410/include/mach/gpio-fns.h:27:0,
                 from arch/arm/mach-s3c2410/include/mach/gpio.h:27,
                 from /home/anarsoul/work/pda-linux/linux-next/arch/arm/include/asm/gpio.h:5,
                 from include/linux/gpio.h:18,
                 from sound/soc/samsung/rx1950_uda1380.c:20:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:29:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:30:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s5p_gpio_drvstr_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:57:2: error: expected specifier-qualifier-list before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:148:47: error: expected declaration specifiers or ‘...’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:156:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s3c_gpio_getpull’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:175:24: error: expected declaration specifiers or ‘...’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h: In function ‘s3c_gpio_cfgrange_nopull’:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: ‘s3c_gpio_pull_t’ undeclared (first use in this function)
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: expected ‘)’ before numeric constant
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: too many arguments to function ‘s3c_gpio_cfgall_range’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:174:12: note: declared here
arch/arm/plat-samsung/include/plat/gpio-cfg.h: At top level:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:199:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s5p_gpio_get_drvstr’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:210:50: error: expected declaration specifiers or ‘...’ before ‘s5p_gpio_drvstr_t’

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agoASoC: h1940: Fix compilation error due to missing header
Vasily Khoruzhick [Fri, 12 Aug 2011 14:52:59 +0000 (17:52 +0300)]
ASoC: h1940: Fix compilation error due to missing header

Add linux/types.h to fix this compilation error:

In file included from arch/arm/mach-s3c2410/include/mach/gpio-fns.h:27:0,
                 from arch/arm/mach-s3c2410/include/mach/gpio.h:27,
                 from /home/anarsoul/work/pda-linux/linux-next/arch/arm/include/asm/gpio.h:5,
                 from include/linux/gpio.h:18,
                 from sound/soc/samsung/rx1950_uda1380.c:20:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:29:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:30:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s5p_gpio_drvstr_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:57:2: error: expected specifier-qualifier-list before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:148:47: error: expected declaration specifiers or ‘...’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:156:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s3c_gpio_getpull’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:175:24: error: expected declaration specifiers or ‘...’ before ‘s3c_gpio_pull_t’
arch/arm/plat-samsung/include/plat/gpio-cfg.h: In function ‘s3c_gpio_cfgrange_nopull’:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: ‘s3c_gpio_pull_t’ undeclared (first use in this function)
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: expected ‘)’ before numeric constant
arch/arm/plat-samsung/include/plat/gpio-cfg.h:180:47: error: too many arguments to function ‘s3c_gpio_cfgall_range’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:174:12: note: declared here
arch/arm/plat-samsung/include/plat/gpio-cfg.h: At top level:
arch/arm/plat-samsung/include/plat/gpio-cfg.h:199:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘s5p_gpio_get_drvstr’
arch/arm/plat-samsung/include/plat/gpio-cfg.h:210:50: error: expected declaration specifiers or ‘...’ before ‘s5p_gpio_drvstr_t’

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>