1
0
Fork 0
Commit Graph

944 Commits (506b62c33a7444b91a93bf2da772f4c7e6656410)

Author SHA1 Message Date
Chris J Arges c99b9e853d ALSA: usb-audio: Fix Scarlett 6i6 initialization typo
The num_controls field was incorrectly set to 0 causing 6i6 to not be
initialized. Set this to 9.

Reported-and-tested-by: Mark Roberts <sunifiram@gmail.com>
Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-18 08:39:17 +01:00
Jurgen Kramer 38f74d5b82 ALSA: usb-audio: add native DSD support for Matrix Audio DACs
This patch adds native DSD support for two XMOS based DACs from Matrix Audio:
- X-Sabre
- Mini-i Pro

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-17 17:55:20 +01:00
Takashi Iwai 77de61c397 Merge branch 'for-next' into for-linus 2014-12-08 11:33:24 +01:00
Takashi Iwai 66139a48ce ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery
In snd_usbmidi_error_timer(), the driver tries to resubmit MIDI input
URBs to reactivate the MIDI stream, but this causes the error when
some of URBs are still pending like:

 WARNING: CPU: 0 PID: 0 at ../drivers/usb/core/urb.c:339 usb_submit_urb+0x5f/0x70()
 URB ef705c40 submitted while active
 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.6-2-desktop #1
 Hardware name: FOXCONN TPS01/TPS01, BIOS 080015  03/23/2010
  c0984bfa f4009ed4 c078deaf f4009ee4 c024c884 c09a135c f4009f00 00000000
  c0984bfa 00000153 c061ac4f c061ac4f 00000009 00000001 ef705c40 e854d1c0
  f4009eec c024c8d3 00000009 f4009ee4 c09a135c f4009f00 f4009f04 c061ac4f
 Call Trace:
  [<c0205df6>] try_stack_unwind+0x156/0x170
  [<c020482a>] dump_trace+0x5a/0x1b0
  [<c0205e56>] show_trace_log_lvl+0x46/0x50
  [<c02049d1>] show_stack_log_lvl+0x51/0xe0
  [<c0205eb7>] show_stack+0x27/0x50
  [<c078deaf>] dump_stack+0x45/0x65
  [<c024c884>] warn_slowpath_common+0x84/0xa0
  [<c024c8d3>] warn_slowpath_fmt+0x33/0x40
  [<c061ac4f>] usb_submit_urb+0x5f/0x70
  [<f7974104>] snd_usbmidi_submit_urb+0x14/0x60 [snd_usbmidi_lib]
  [<f797483a>] snd_usbmidi_error_timer+0x6a/0xa0 [snd_usbmidi_lib]
  [<c02570c0>] call_timer_fn+0x30/0x130
  [<c0257442>] run_timer_softirq+0x1c2/0x260
  [<c0251493>] __do_softirq+0xc3/0x270
  [<c0204732>] do_softirq_own_stack+0x22/0x30
  [<c025186d>] irq_exit+0x8d/0xa0
  [<c0795228>] smp_apic_timer_interrupt+0x38/0x50
  [<c0794a3c>] apic_timer_interrupt+0x34/0x3c
  [<c0673d9e>] cpuidle_enter_state+0x3e/0xd0
  [<c028bb8d>] cpu_idle_loop+0x29d/0x3e0
  [<c028bd23>] cpu_startup_entry+0x53/0x60
  [<c0bfac1e>] start_kernel+0x415/0x41a

For avoiding these errors, check the pending URBs and skip
resubmitting such ones.

Reported-and-tested-by: Stefan Seyfried <stefan.seyfried@googlemail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-06 21:35:38 +01:00
Panu Matilainen dacacb0aa0 ALSA: usb-audio: Add support for Zoom R16/24 capture and midi interfaces
This makes the midi interface and capture work out of the box with
R16 (and presumably R24 too but untested). Playback stream would also
seem to function fine except for one caveat: no sound is produced,
so it is disabled for now. Mixer descriptors are garbage and will
require further quirks to enable functionality, also disabled here.

Signed-off-by: Panu Matilainen <pmatilai@laiskiainen.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-12-01 17:38:03 +01:00
Takashi Iwai 5031466387 Merge branch 'for-linus' into for-next
The commit [7a2e9ddc: ALSA: usb-audio: Add native DSD support for
Denon/Marantz DACs] requires the new format definition that has
landed only in for-next branch.
2014-11-28 18:30:19 +01:00
Jurgen Kramer 6874daad4b ALSA: usb-audio: Add mode select quirk for Denon/Marantz DACs
Denon/Marantz USB DACs need a specific vendor command to switch between PCM and
DSD mode. This patch adds a new quirk function to switch between the two modes
using the specific USB vendor command.

This patch applies to the following devices:
- Marantz SA-14S1
- Marantz HD-DAC1

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-28 18:02:35 +01:00
Jurgen Kramer 7a2e9ddc90 ALSA: usb-audio: Add native DSD support for Denon/Marantz DACs
This patch adds native DSD support for the following devices:
- Marantz SA-14S1
- Marants HD-DAC1

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-28 18:00:50 +01:00
Jussi Laako d42472ecff ALSA: pcm: Add big-endian DSD sample formats and fix XMOS DSD sample format
This patch fixes XMOS DSD sample format to DSD_U32_BE and also adds
DSD_U16_BE and DSD_U32_BE sample formats.

Signed-off-by: Jussi Laako <jussi@sonarnerd.net>
Acked-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 15:13:28 +01:00
Takashi Iwai b61f90eac1 ALSA: usb-audio: Add resume support for Scarlett mixers
Scarlett driver uses almost compatible usb_mixer_elem_info struct, so
we just need to add a couple of simple resume callbacks to handle them
accordingly.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:59:17 +01:00
Takashi Iwai 288673beae ALSA: usb-audio: Add resume support for MicroII SPDIF ctls
Like the previous fixes, the mixer accessors are converted to use
usb_mixer_elem_list objects.  In addition, the proper shutdown check
are put in get and put callbacks.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:58:52 +01:00
Takashi Iwai 0b4e9cfcef ALSA: usb-audio: Add resume support for FTU controls
A few FTU mixer controls have the own value handling, so they have to
be rewritten to follow the support for resume callbacks.  This ended
up in a fair amount of refactoring.  Its own struct is now removed,
instead the values are embedded in kctl private_value totally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:58:19 +01:00
Takashi Iwai da6d276957 ALSA: usb-audio: Add resume support for Native Instruments controls
The changes at this time are a bit more wider than previous ones.
Firstly, the NI controls didn't cache the values, so I had to
implement the caching.  It's stored in bit 24 of private_value.
In addition to that, the initial values have to be read from
registers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:58:14 +01:00
Takashi Iwai 25a9a4f91b ALSA: usb-audio: Add Digidesign Mbox 1 resume support
Again another quirk fix, just convert to usb_mixer_elem_list with the
resume callback for Mbox 1 stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:58:08 +01:00
Takashi Iwai 2bfb14c3b8 ALSA: usb-audio: Add Xonar U1 resume support
This time it's about Xonar U1: add the proper resume support for
"Digital Playback Switch" element.

Also, the status is moved into kcontrol private_value from
usb_mixer_interface struct field.  One more cut.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:58:01 +01:00
Takashi Iwai 5f503ee9e2 ALSA: usb-audio: Add Emu0204 channel switch resume support
Similar as the previous fix, this adds the proper resume support to
Emu0202 "Front Jack Channels" enum mixer element.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:57:55 +01:00
Takashi Iwai 9cf3689bfe ALSA: usb-audio: Add audigy2nx resume support
Rewrite the code to handle LEDs on audigy2nx and co for supporting the
proper resume.  A new internal helper function
add_single_ctl_with_resume() is introduced to manage the
usb_mixer_elem_list more easily.

Also while we're at it, move audigy2nx_leds[] in usb_mixer_interface
struct into the private_value of each kctl, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:57:46 +01:00
Takashi Iwai 3360b84b8e ALSA: usb-audio: Allow quirks to handle own resume and proc dump
So far, we blindly assumed that the all usb-audio mixer elements
follow the standard and apply the standard resume method for the
registered elements in the id_elems[] list.  However, some quirks
really need the own resume and it's incomplete for now.

This patch enhances the resume handling in two folds:
- split some fields in struct usb_mixer_elem_info into a smaller
  header struct (usb_mixer_elem_list) for keeping the minimal
  information in the linked-list; the usb_mixer_elem_info embeds this
  header struct instead
- add resume and dump callbacks to usb_mixer_elem_list struct to allow
  quirks providing the own methods

For the standard mixer elements, these new callbacks are set to the
standard ones as default, thus there is no functional change by this
patch yet.

The dump and resume callbacks are typedef'ed for ease of later patches
using arrays of such function pointers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21 11:56:58 +01:00
Takashi Iwai 5aeee3424f ALSA: usb-audio: Refactor ignore_ctl_error checks
Introduce an internal helper macro for avoiding many open codes.

The only slight behavior change is in a couple of get ballcks where
the value is reset at error no matter whether ignore_ctl_error is set
or not.  Actually this is even safer than before.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-20 21:46:32 +01:00
Takashi Iwai a69862d8d0 Merge branch 'for-linus' into test/usb-resume 2014-11-20 21:46:04 +01:00
Takashi Iwai 01cb156edb ALSA: usb-audio: Use snd_usb_ctl_msg() for Native Instruments quirk
snd_nativeinstruments_control_get() uses a stack as a buffer for
usb_control_msg(), but it's basically not allowed.  Replace the call
with a safer helper, snd_usb_ctl_msg(), instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-20 21:44:49 +01:00
Johan Rastén a358a0ef86 ALSA: usb-audio: Set the Control Selector to SU_SELECTOR_CONTROL for UAC2
Specified in section 5.2.5.6.1 of the USB Audio Class 2.0 definition.

Solves the following error for C-Media 6632A (Asus Xonar U7):
[ 8219.676164] cannot get ctl value: req = 0x81, wValue = 0x0, wIndex = 0x1400, type = 3

Signed-off-by: Johan Rastén <johan@oljud.se>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-17 14:01:24 +01:00
Jurgen Kramer 6e84a8d7ac ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices
This patch adds a USB control message delay quirk for a few specific Marantz/Denon
devices. Without the delay the DACs will not work properly and produces the
following type of messages:

Nov 15 10:09:21 orwell kernel: [   91.342880] usb 3-13: clock source 41 is not valid, cannot use
Nov 15 10:09:21 orwell kernel: [   91.343775] usb 3-13: clock source 41 is not valid, cannot use

There are likely other Marantz/Denon devices using the same USB module which exhibit the
same problems. But as this cannot be verified I limited the patch to the devices
I could test.

The following two devices are covered by this path:
- Marantz SA-14S1
- Marantz HD-DAC1

Signed-off-by: Jurgen Kramer <gtmkramer@xs4all.nl>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-16 09:48:34 +01:00
Joe Perches 9547c0999e ALSA: 6fire: Convert byte_rev_table uses to bitrev8
Use the inline function instead of directly indexing the array.

This allows some architectures with hardware instructions
for bit reversals to eliminate the array.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-14 08:01:53 +01:00
Chris J Arges 76b188c4b3 ALSA: usb-audio: Scarlett mixer interface for 6i6, 18i6, 18i8 and 18i20
This code contains the Scarlett mixer interface code that was originally
written by Tobias Hoffman and Robin Gareus. Because the device doesn't
properly implement UAC2 this code adds a mixer quirk for the device.

Changes from the original code include removing the metering code along with
dead code and comments. Compiler warnings were fixed. The code to initialize
the sampling rate was causing a crash this was fixed as discussed on the
mailing list. Error, and info messages were convered to dev_err and dev_info
interfaces. The custom scarlett_mixer_elem_info struct was replaced with the
more generic usb_mixer_elem_info to be able to recycle more code from mixer.c.

This patch also makes additional modifications based on upstream comments.
Individual control creation functions are removed and a generic
function is no used. Macros for function calls are removed to improve
readability. Hardcoded control initialization is removed. Save to HW
functionality has been removed. Strings for enums are created dynamically for
the mixer. Strings used for controls are now SNDRV_CTL_ELEM_ID_NAME_MAXLEN
length.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-13 07:32:39 +01:00
Chris J Arges eef9045160 ALSA: usb-audio: make set_*_mix_values functions public
Make the functions set_cur_mix_value and get_cur_mix_value accessible by files
that include mixer.h. In addition make usb_mixer_elem_free accessible.
This allows reuse of these functions by mixers that may require quirks.

The following summarizes the renamed functions:
  - set_cur_mix_value -> snd_usb_set_cur_mix_value
  - get_cur_mix_value -> snd_usb_get_cur_mix_value
  - usb_mixer_elem_free -> snd_usb_mixer_elem_free

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-13 07:32:02 +01:00
Chris J Arges f41d6049d1 ALSA: usb-audio: Add private_data pointer to usb_mixer_elem_info
Add a private_data pointer to usb_mixer_elem_info to allow other mixer
implementations to extend the structure as necessary.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-13 07:31:52 +01:00
Chris J Arges ef9566a3a1 Revert "ALSA: usb-audio: Add quirk for Focusrite Scarlett
This reverts commit 1762a59d8e.

This quirk is not needed because support for the Scarlett mixers will be added.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-13 07:31:41 +01:00
Takashi Iwai 1a290581de ALSA: usb-audio: Fix memory leak in FTU quirk
M-audio FastTrack Ultra quirk doesn't release the kzalloc'ed memory.
This patch adds the private_free callback to release it properly.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-11 18:04:41 +01:00
Damien Zammit c63fcb9b67 ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer
This patch provides duplex support for the Digidesign Mbox 1 sound
card and has been a work in progress for about a year.
Users have confirmed on my website that previous versions of this patch
have worked on the hardware and I have been testing extensively.

It also enables the mixer control for providing clock source
selector based on the previous patch.
The sample rate has been hardcoded to 48kHz because it works better with
the S/PDIF sync mode when the sample rate is locked.  This is the
highest rate that the device supports and no loss of functionality
is observed by restricting the sample rate apart from the inability to selec
a lower rate.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-11 15:13:00 +01:00
Damien Zammit d497a82fb1 ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source
This patch provides the infrastructure for the Digidesign Mbox 1
to have a mixer control for selecting the clock source.
Valid options are Internal and S/PDIF external sync.
A non-documented command is sent to the device to enable this feature
found by reverse engineering and bus snooping.

Signed-off-by: Damien Zammit <damien@zamaudio.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-11 15:12:35 +01:00
Takashi Iwai 85a8181329 ALSA: usb-audio: Fix Oops by composite quirk enhancement
The quirk argument itself was used as iterator, so it cannot be taken
back to the original value, obviously.

Fixes: d4b8fc66f7 ('ALSA: usb-audio: Allow multiple entries for the same iface in composite quirk')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-10 07:44:47 +01:00
Takashi Iwai d4b8fc66f7 ALSA: usb-audio: Allow multiple entries for the same iface in composite quirk
Currently the composite quirk doesn't work when multiple entries are
assigned to the same interface because it marks the interface as
claimed then checks whether the interface has been already claimed for
the secondary entry.  But, if you look at the code, you'll notice that
multiple entries are allowed if the entry is the current interface;
i.e. the current behavior is anyway inconsistent, and this is an
unintended shortcoming.

This patch fixes the problem by marking the relevant interfaces as
claimed after applying the all composite entries.  This fix will be
needed for the upcoming enhancements for Digidesign Mbox 1 quirks.

Reviewed-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-09 18:21:23 +01:00
Takashi Iwai 1fb8510cdb ALSA: pcm: Add snd_pcm_stop_xrun() helper
Add a new helper function snd_pcm_stop_xrun() to the standard sequnce
lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the
existing open codes with this helper.

The function checks the PCM running state to prevent setting the wrong
state, too, for more safety.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-09 18:20:40 +01:00
Takashi Iwai 67e225009b ALSA: usb-audio: Trigger PCM XRUN at XRUN
The usb-audio driver detects XRUN at its complete callback, but the
actual code to trigger PCM XRUN is commented out because it caused
deadlock in the past.  This patch revives the PCM trigger properly.
It resulted in more than just enabling snd_pcm_stop(), but it had to
deduce the PCM substream with proper NULL checks and holds the stream
lock around the call.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-06 13:04:49 +01:00
Takashi Iwai 19566b0bd9 Merge branch 'for-linus' into for-next
This merges the USB-audio disconnect fix and resolves the conflicts
so that we can continue working on development of usb-audio stuff.

Conflicts:
	sound/usb/card.c
2014-11-05 15:37:22 +01:00
Takashi Iwai 0725dda207 ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect
Some USB-audio devices show weird sysfs warnings at disconnecting the
devices, e.g.
 usb 1-3: USB disconnect, device number 3
 ------------[ cut here ]------------
 WARNING: CPU: 0 PID: 973 at fs/sysfs/group.c:216 device_del+0x39/0x180()
 sysfs group ffffffff8183df40 not found for kobject 'midiC1D0'
 Call Trace:
  [<ffffffff814a3e38>] ? dump_stack+0x49/0x71
  [<ffffffff8103cb72>] ? warn_slowpath_common+0x82/0xb0
  [<ffffffff8103cc55>] ? warn_slowpath_fmt+0x45/0x50
  [<ffffffff813521e9>] ? device_del+0x39/0x180
  [<ffffffff81352339>] ? device_unregister+0x9/0x20
  [<ffffffff81352384>] ? device_destroy+0x34/0x40
  [<ffffffffa00ba29f>] ? snd_unregister_device+0x7f/0xd0 [snd]
  [<ffffffffa025124e>] ? snd_rawmidi_dev_disconnect+0xce/0x100 [snd_rawmidi]
  [<ffffffffa00c0192>] ? snd_device_disconnect+0x62/0x90 [snd]
  [<ffffffffa00c025c>] ? snd_device_disconnect_all+0x3c/0x60 [snd]
  [<ffffffffa00bb574>] ? snd_card_disconnect+0x124/0x1a0 [snd]
  [<ffffffffa02e54e8>] ? usb_audio_disconnect+0x88/0x1c0 [snd_usb_audio]
  [<ffffffffa015260e>] ? usb_unbind_interface+0x5e/0x1b0 [usbcore]
  [<ffffffff813553e9>] ? __device_release_driver+0x79/0xf0
  [<ffffffff81355485>] ? device_release_driver+0x25/0x40
  [<ffffffff81354e11>] ? bus_remove_device+0xf1/0x130
  [<ffffffff813522b9>] ? device_del+0x109/0x180
  [<ffffffffa01501d5>] ? usb_disable_device+0x95/0x1f0 [usbcore]
  [<ffffffffa014634f>] ? usb_disconnect+0x8f/0x190 [usbcore]
  [<ffffffffa0149179>] ? hub_thread+0x539/0x13a0 [usbcore]
  [<ffffffff810669f5>] ? sched_clock_local+0x15/0x80
  [<ffffffff81066c98>] ? sched_clock_cpu+0xb8/0xd0
  [<ffffffff81070730>] ? bit_waitqueue+0xb0/0xb0
  [<ffffffffa0148c40>] ? usb_port_resume+0x430/0x430 [usbcore]
  [<ffffffffa0148c40>] ? usb_port_resume+0x430/0x430 [usbcore]
  [<ffffffff8105973e>] ? kthread+0xce/0xf0
  [<ffffffff81059670>] ? kthread_create_on_node+0x1c0/0x1c0
  [<ffffffff814a8b7c>] ? ret_from_fork+0x7c/0xb0
  [<ffffffff81059670>] ? kthread_create_on_node+0x1c0/0x1c0
 ---[ end trace 40b1928d1136b91e ]---

This comes from the fact that usb-audio driver may receive the
disconnect callback multiple times, per each usb interface.  When a
device has both audio and midi interfaces, it gets called twice, and
currently the driver tries to release resources at the last call.
At this point, the first parent interface has been already deleted,
thus deleting a child of the first parent hits such a warning.

For fixing this problem, we need to call snd_card_disconnect() and
cancel pending operations at the very first disconnect while the
release of the whole objects waits until the last disconnect call.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80931
Reported-and-tested-by: Tomas Gayoso <tgayoso@gmail.com>
Reported-and-tested-by: Chris J Arges <chris.j.arges@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-05 15:36:25 +01:00
Takashi Iwai ae366c2049 ALSA: usb-audio: Use strim() instead of open code
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-04 15:09:13 +01:00
Takashi Iwai a6cece9d81 ALSA: usb-audio: Pass direct struct pointer instead of list_head
Some functions in mixer.c and endpoint.c receive list_head instead of
the object itself.  This is not obvious and rather error-prone.  Let's
pass the proper object directly instead.

The functions in midi.c still receive list_head and this can't be
changed since the object definition isn't exposed to the outside of
midi.c, so left as is.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-04 15:09:10 +01:00
Takashi Iwai 4c8c3a4fcc ALSA: usb-audio: Flatten probe and disconnect functions
The usb-audio probe and disconnect functions have been split just for
adapting the (new!) API at 2.5 kernel time.  We left them until now,
partly because we wanted to build with the pretty old kernels in the
external alsa-driver tree.  But the support of such old kernels has
been longly stopped, so it's good time to clean up this mess.

One good point by this cleanup is that now the probe function returns
a proper error code instead of only -EIO.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-04 15:09:08 +01:00
Linus Torvalds c6d13403a1 sound fixes for 3.18-rc2
Here are a chunk of small fixes since rc1: two PCM core fixes, one is
 a long-standing annoyance about lockdep and another is an ARM64 mmap
 fix.  The rest are a HD-audio HDMI hotplug notification fix, a fix for
 missing NULL termination in Realtek codec quirks and a few new
 device/codec-specific quirks as usual.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUSgjCAAoJEGwxgFQ9KSmklGAP/iPygJ0Pm6j2osKxBAxUXTu4
 daLgoRJAC5+eHi2U4PLpNI6EzB6rhIAmbvm4CVMs3XmYKIptabVfTtsUpOshQsU+
 WYkZQ8WFHZf4ZtM8OgSbC3NVTmdJe5N98NBM+XY9ow6h9RXM3ZV1m1TAgVYMARn0
 Ue4wtWiD3fsJcm50nV11n8hjKF+BfwB94K/b5dAstFxUwe20FRvYpphptDWsPP4u
 NoMi10L7DLLujF3qNyY12+6XGv1ECL6jUX0jEdx76bG3jS/JOxrLyavA0+rx8dcm
 iOa4EgfTq3eYM9smdVdVTCJ+suG6pBuDg24xLn5dwCR8S/rUYU6EXfaPDKYqVYTa
 /O3lKtYIFbWONEnGhULEX1lV87ZbzZHaQP4Cr/QlH3D4AwLdpLqdv9/jDs3i/+S9
 GVozlbl/IffhxCuLPriNGdDZFZmo4eRPBzywOLiooVgR5LHdUSSufgDvzU858BTL
 L08BOs2DjeWFVb4cuBnzsWGS4QSCX/01EM0ftEAgX2SdseibtHNBze9ntHR/c1be
 ieijRu0jQMa4VNWSjmIOzR9fFKy7Bw1mN7EEl0a2t43IXc7gpog5jezMZEhMs2bA
 NW3j65d+Vd3UUWAzfwMuNJ776lCg30r0hzpnGr54frhfjYbe0Rrs5hHOQkW9kcJv
 E+LzcPoWfoT61wpH39dz
 =VrJV
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Here are a chunk of small fixes since rc1: two PCM core fixes, one is
  a long-standing annoyance about lockdep and another is an ARM64 mmap
  fix.

  The rest are a HD-audio HDMI hotplug notification fix, a fix for
  missing NULL termination in Realtek codec quirks and a few new
  device/codec-specific quirks as usual"

* tag 'sound-3.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Add missing terminating entry to SND_HDA_PIN_QUIRK macro
  ALSA: pcm: Fix false lockdep warnings
  ALSA: hda - Fix inverted LED gpio setup for Lenovo Ideapad
  ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug
  ALSA: usb-audio: Add support for Steinberg UR22 USB interface
  ALSA: ALC283 codec - Avoid pop noise on headphones during suspend/resume
  ALSA: pcm: use the same dma mmap codepath both for arm and arm64
2014-10-24 12:35:48 -07:00
Takashi Iwai 930352862e Merge branch 'topic/enum-info-cleanup' into for-next
this is a series of patches to just convert the plain info callback
for enum ctl elements to snd_ctl_elem_info().  Also, it includes the
extension of snd_ctl_elem_info(), for catching the unexpected string
cut-off and handling the zero items.
2014-10-22 12:19:57 +02:00
Takashi Iwai 7bbd03e014 ALSA: usb-audio: Use snd_ctl_enum_info()
... and reduce the open codes.  Also add missing const to text arrays.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21 09:19:05 +02:00
Takashi Iwai c8dd33fc80 ALSA: 6fire: Use snd_ctl_enum_info()
... and reduce the open codes.  Also add missing const to text arrays.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-21 09:17:47 +02:00
Takashi Iwai e200953673 Merge branch 'topic/cleanup' into for-next 2014-10-20 08:44:25 +02:00
Vlad Catoi f0b127fbfd ALSA: usb-audio: Add support for Steinberg UR22 USB interface
Adding support for Steinberg UR22 USB interface via quirks table patch

See Ubuntu bug report:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1317244
Also see threads:
http://linux-audio.4202.n7.nabble.com/Support-for-Steinberg-UR22-Yamaha-USB-chipset-0499-1509-tc82888.html#a82917
http://www.steinberg.net/forums/viewtopic.php?t=62290

Tested by at least 4 people judging by the threads.
Did not test MIDI interface, but audio output and capture both are
functional. Built 3.17 kernel with this driver on Ubuntu 14.04 & tested with mpg123
Patch applied to 3.13 Ubuntu kernel works well enough for daily use.

Signed-off-by: Vlad Catoi <vladcatoi@gmail.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-20 07:54:42 +02:00
Daniel Mack 49fd46d2ff ALSA: snd-usb: drop unused varible assigments
Don't assign 'len' in cases where we don't make use of the returned value.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-19 11:36:25 +02:00
Linus Torvalds a2ce35273c sound updates for 3.18-rc1
This time it's a relatively calm update batch, but the amount isn't
 too small in the end.  Here we go over some highlights:
 
 - ALSA core
   - One major change is the support of nonatomic PCM operations.
     This allows the trigger and other callbacks to call schedule(),
     which would be useful for mailbox type communications.  Already
     some drivers (Digigram ones) have been converted to use together
     with threaded irqs as an example.
   - Improvement / fixes of DSD PCM format support
 
 - HD-audio
   - Large volume of rewrites are found in Realtek codec driver for
     converting Dell and HP quirks to generic forms.
   - Inverted dmic code cleanup from David.
   - Realtek COEF access has been optimized.
   - Now HD-audio jack infrastructure allows multiple callbacks, which
     fixes / simplifies the jack-dependent power controls on STAC/IDT
     and VIA codecs.
   - Many additional device-specific fixups as usual
   - A few deadcode cleanups, CA0132 code cleanup, etc.
 
 - ASoC
   - More componentization work from Lars-Peter, this time mainly
     cleaning up the suspend and bias level transition callbacks.
   - Real system support for the Intel drivers and a bunch of fixes
     and enhancements for the associated CODEC drivers, this is going
     to need a lot quirks over time due to the lack of any firmware
     description of the boards.
   - Jack detect support for simple card from Dylan Reid.
   - A bunch of small fixes and enhancements for the Freescale
     drivers.
   - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32,
     Everest Semiconductor ES8328 and Freescale cards using the ASRC
     in newer i.MX processors.
   - A few simple-card fixes, mostly cleanups but also a fix for
   - interaction between GPIO 0 and simple-card.
 
 - Misc
   - Virtuoso / Oxygen updates by Clemens
   - USB-audio: Yamaha MOTIF XF MIDI port name fixes
   - Conversion of kernel messages to standard dev_*() in ctxfi
     driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUNrU8AAoJEGwxgFQ9KSmkxZYQAI7DgkrCx2S1dIHij99jtJGz
 FjhFSO/x8Jj0lgXkoCLRHXFgtq3iYjbyS9s0aokIpvAewD9SreVE977DsMqqZVJz
 9FPOkv4keuxyJZ46mxJpYswDeazCjEYNFVbkYHhwsCiiyce8HyWMpe38tWrQfwSV
 loJYbnEfjpTxFc4JPaQK3pIICRofQCZJonWv20K25pm7L8yG29jtqFsMQWjDCONb
 ZVNwnvW61gl6ouuHincGGqVtj8pmkgKlU0l0bMgRNflRqRusrpQdobW56OEoM13H
 Tq7xMp5Yxzg7j9sM/QzL+VAksHc1u1aBzg8XZKXjk9PsmH26h1gq98W2BDKQkMzF
 U7MQaUks4x+apJcVVDoi5+15AOsyGoxNq9ahc0fe4ADTMSe94or78GaKptWMR+NK
 pA2pX2zwvool4TYj+AtcK8SNwfVeBjSua9eNnNpaNTKuwPIX6Vch0O6jaEbQZSaC
 92JYhqiC6HsW5tbhN3afTmeHxelBCpQfWPLVtgEl/eIhY3B72/1ZXWCCqwY+Ur8E
 D3OCtuAjFnzvzr/gdHZWEnMu3HGt/xqOMVE0EHTQWokQpX2E3IF724YcttAzQakw
 wS1ppeWSO5l+TkplqcqurEA7Bq1mN6bO/q9UK+iduIiYmvtNI3fDPTlXXy2SxRUz
 QuIEpsIKuZFFumFksQd9
 =S4IQ
 -----END PGP SIGNATURE-----

Merge tag 'sound-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This time it's a relatively calm update batch, but the amount isn't
  too small in the end.  Here we go over some highlights:

  ALSA core:
   - One major change is the support of nonatomic PCM operations.  This
     allows the trigger and other callbacks to call schedule(), which
     would be useful for mailbox type communications.  Already some
     drivers (Digigram ones) have been converted to use together with
     threaded irqs as an example.
   - Improvement / fixes of DSD PCM format support

  HD-audio:
   - Large volume of rewrites are found in Realtek codec driver for
     converting Dell and HP quirks to generic forms.
   - Inverted dmic code cleanup from David.
   - Realtek COEF access has been optimized.
   - Now HD-audio jack infrastructure allows multiple callbacks, which
     fixes / simplifies the jack-dependent power controls on STAC/IDT
     and VIA codecs.
   - Many additional device-specific fixups as usual
   - A few deadcode cleanups, CA0132 code cleanup, etc.

  ASoC:
   - More componentization work from Lars-Peter, this time mainly
     cleaning up the suspend and bias level transition callbacks.
   - Real system support for the Intel drivers and a bunch of fixes and
     enhancements for the associated CODEC drivers, this is going to
     need a lot quirks over time due to the lack of any firmware
     description of the boards.
   - Jack detect support for simple card from Dylan Reid.
   - A bunch of small fixes and enhancements for the Freescale drivers.
   - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32,
     Everest Semiconductor ES8328 and Freescale cards using the ASRC in
     newer i.MX processors.
   - A few simple-card fixes, mostly cleanups but also a fix for
     interaction between GPIO 0 and simple-card.

  Misc:
   - Virtuoso / Oxygen updates by Clemens
   - USB-audio: Yamaha MOTIF XF MIDI port name fixes
   - Conversion of kernel messages to standard dev_*() in ctxfi driver"

* tag 'sound-3.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (251 commits)
  ASoC: mc13783: Ensure we only try to dereference valid of_nodes
  ASoC: rockchip-i2s: fix infinite loop in rockchip_snd_txctrl
  ALSA: hda - Add dock port support to Thinkpad L440 (71aa:501e)
  ALSA: Allow pass NULL dev for snd_pci_quirk_lookup()
  ASoC: imx-es8328: Fix of_node_put() call with uninitialized object
  ASoC: soc-pcm: fix sig_bits determination in soc_pcm_apply_msb()
  ASoC: simple-card: Initialize headphone and mic GPIO numbers
  ASoC: imx-es8328: Fix missing return code in imx_es8328_probe()
  ALSA: hda - Add dock support for Thinkpad T440 (17aa:2212)
  ALSA: usb: caiaq: check for cdev->n_streams > 1
  ASoC: 88pm860x-codec: Fix possibly missing string termination
  ASoC: core: fix use after free in snd_soc_remove_platform()
  ASoC: soc-dapm: fix use after free
  ALSA: hda - Make the inv dmic handling for Realtek use generic parser
  ALSA: hda - Add Inverted Internal mic for Samsung Ativ book 9 (NP900X3G)
  ALSA: hda - Add inverted internal mic for Asus Aspire 4830T
  ASoC: Intel: byt-rt5640: fix coccinelle warnings
  ASoC: fsl_esai doc: Add "fsl,vf610-esai" as compatible string
  ASoC: da732x: Remove unnecessary KERN_ERR in pr_err()
  ASoC: simple-card: Fix detect gpio documentation.
  ...
2014-10-10 22:13:25 -04:00
Daniel Mack 897c329bcb ALSA: usb: caiaq: check for cdev->n_streams > 1
Coverity spotted a possible DIV0 condition when cdev->n_streams is 0.

Fix this by making sure the value is > 1 in snd_usb_caiaq_audio_init().

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-07 14:34:25 +02:00
Takashi Iwai 8df22a4d6f ASoC: Updates for v3.18
- More componentisation work from Lars-Peter, this time mainly
    cleaning up the suspend and bias level transition callbacks.
  - Real system support for the Intel drivers and a bunch of fixes and
    enhancements for the associated CODEC drivers, this is going to need
    a lot quirks over time due to the lack of any firmware description of
    the boards.
  - Jack detect support for simple card from Dylan Reid.
  - A bunch of small fixes and enhancements for the Freescale drivers.
  - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32, Everest
    Semiconductor ES8328 and Freescale cards using the ASRC in newer i.MX
    processors.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJUMoHRAAoJECTWi3JdVIfQGXUH/RWQ6/Ey70SPgUdWWQ42PFey
 sBq/Hl69F8/JNxW6EDA4GEg6ue880Gek0oGqioxtN6Ku0Vm/WSqDWnKcTAGl4dDO
 AefC4FwekZWCYQi3VTNIvMEqfUWkcofTLVwjdh/PUZxniahkiGA81UJ1mQNXBxLF
 UusrK0fIAxQgiNsCcPZ94knJiqZVBWgbRv/mCXY9K1/jqITNKd/ZVEMkOPk/p00q
 cH9LIx8EknRV3HyJNZQ0xpmhpuMzLy6Agf7Oeq/m5kDqq1stmClvibPYkdqkdkto
 jYwKaPh18dNHlUmm1w/G7X20kCidhbiwRjS/iIzx3cfIrWkiz90/BSRFKs8pqSo=
 =7PPg
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v3.18

 - More componentisation work from Lars-Peter, this time mainly
   cleaning up the suspend and bias level transition callbacks.
 - Real system support for the Intel drivers and a bunch of fixes and
   enhancements for the associated CODEC drivers, this is going to need
   a lot quirks over time due to the lack of any firmware description of
   the boards.
 - Jack detect support for simple card from Dylan Reid.
 - A bunch of small fixes and enhancements for the Freescale drivers.
 - New drivers for Analog Devices SSM4567, Cirrus Logic CS35L32, Everest
   Semiconductor ES8328 and Freescale cards using the ASRC in newer i.MX
   processors.
2014-10-06 14:01:11 +02:00