summaryrefslogtreecommitdiff
path: root/sound/usb/mixer_quirks.c
AgeCommit message (Collapse)Author
2015-04-09ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob supportDmitry M. Fedin
Adds an entry for Creative USB X-Fi to the rc_config array in mixer_quirks.c to allow use of volume knob on the device. Adds support for newer X-Fi Pro card, known as "Model No. SB1095" with USB ID "041e:3237" Signed-off-by: Dmitry M. Fedin <dmitry.fedin@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-21ALSA: usb-audio: Add resume support for MicroII SPDIF ctlsTakashi Iwai
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-21ALSA: usb-audio: Add resume support for FTU controlsTakashi Iwai
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-21ALSA: usb-audio: Add resume support for Native Instruments controlsTakashi Iwai
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-21ALSA: usb-audio: Add Digidesign Mbox 1 resume supportTakashi Iwai
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-21ALSA: usb-audio: Add Xonar U1 resume supportTakashi Iwai
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-21ALSA: usb-audio: Add Emu0204 channel switch resume supportTakashi Iwai
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-21ALSA: usb-audio: Add audigy2nx resume supportTakashi Iwai
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-21ALSA: usb-audio: Allow quirks to handle own resume and proc dumpTakashi Iwai
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-20Merge branch 'for-linus' into test/usb-resumeTakashi Iwai
2014-11-20ALSA: usb-audio: Use snd_usb_ctl_msg() for Native Instruments quirkTakashi Iwai
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-13ALSA: usb-audio: Scarlett mixer interface for 6i6, 18i6, 18i8 and 18i20Chris J Arges
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-13ALSA: usb-audio: make set_*_mix_values functions publicChris J Arges
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-11ALSA: usb-audio: Fix memory leak in FTU quirkTakashi Iwai
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-11ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock sourceDamien Zammit
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-10-21ALSA: usb-audio: Use snd_ctl_enum_info()Takashi Iwai
... and reduce the open codes. Also add missing const to text arrays. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-02-26ALSA: usb-audio: Use standard printk helpersTakashi Iwai
Convert with dev_err() and co from snd_printk(), etc. As there are too deep indirections (e.g. ep->chip->dev->dev), a few new local macros, usb_audio_err() & co, are introduced. Also, the device numbers in some messages are dropped, as they are shown in the prefix automatically. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-12-05ALSA: usb-audio: fix uninitialized variable compile warningMikulas Patocka
Fix the following warning when optimizing for size with gcc-4.6.4: sound/usb/mixer_quirks.c:1514:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-11-13ALSA: usb-audio: add front jack channel selector for EMU0204Vasily Khoruzhick
Add support for front jack channel selector which is present on EMU0204. It allows to get 4 channels out of this soundcard. Tested-by: Yury Bushmelev <jay@jay-tech.ru> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-06-28ALSA: usb-audio: Add Audio Advantage Micro IIPrzemek Rudy
This patch is adding extensive support (beside standard usb audio class) for Audio Advantage Micro II usb sound card. Features included: - Access to AES bits (so now sending the IEC61937 compliant stream is possible). - Mixer SPDIF control added to turn on/off the optical transmitter. Signed-off-by: Przemek Rudy <prudy1@o2.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-07ALSA: usb-audio: fix endianness bug in snd_nativeinstruments_*Eldad Zack
The usb_control_msg() function expects __u16 types and performs the endianness conversions by itself. However, in three places, a conversion is performed before it is handed over to usb_control_msg(), which leads to a double conversion (= no conversion): * snd_usb_nativeinstruments_boot_quirk() * snd_nativeinstruments_control_get() * snd_nativeinstruments_control_put() Caught by sparse: sound/usb/mixer_quirks.c:512:38: warning: incorrect type in argument 6 (different base types) sound/usb/mixer_quirks.c:512:38: expected unsigned short [unsigned] [usertype] index sound/usb/mixer_quirks.c:512:38: got restricted __le16 [usertype] <noident> sound/usb/mixer_quirks.c:543:35: warning: incorrect type in argument 5 (different base types) sound/usb/mixer_quirks.c:543:35: expected unsigned short [unsigned] [usertype] value sound/usb/mixer_quirks.c:543:35: got restricted __le16 [usertype] <noident> sound/usb/mixer_quirks.c:543:56: warning: incorrect type in argument 6 (different base types) sound/usb/mixer_quirks.c:543:56: expected unsigned short [unsigned] [usertype] index sound/usb/mixer_quirks.c:543:56: got restricted __le16 [usertype] <noident> sound/usb/quirks.c:502:35: warning: incorrect type in argument 5 (different base types) sound/usb/quirks.c:502:35: expected unsigned short [unsigned] [usertype] value sound/usb/quirks.c:502:35: got restricted __le16 [usertype] <noident> Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Acked-by: Daniel Mack <zonque@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-11ALSA: usb-audio: add support for M-Audio FT C600Matt Gruskin
Adds quirks and mixer support for the M-Audio Fast Track C600 USB audio interface. This device is very similar to the C400 - the C600 simply has some more inputs and outputs, so the existing C400 support is extended to support this device as well. Signed-off-by: Matt Gruskin <matthew.gruskin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-01-10ALSA: usb-audio: Make ebox44_table staticSachin Kamat
Fixes the following sparse warning: sound/usb/mixer_quirks.c:1209:23: warning: symbol 'ebox44_table' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-12-12ALSA: usb-audio: Enable S/PDIF on the ASUS Xonar U3Denis Washington
The only required change is to extend the existing Xonar U1 mixer quirks to the U3, which seems to be controlled the same way. Signed-off-by: Denis Washington <denisw@online.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-29ALSA: usb-audio: Fast Track C400 mixer controlsEldad Zack
Add a mixer quirks for the M-Audio Fast Track C400 and create the following: * Volume controls * Effect Type (reusing FTU controls) * Effect Volume * Effect Send/Return * Effect Program * Effect Feedback Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-29ALSA: usb-audio: parameterize FTU effect unit controlEldad Zack
Adds the unit ID and the control as parameters to the creation of the effect unit control for the M-Audio Fast Track Ultra. This allows the code to be shared with other devices that use different unit ID and control, such as the M-Audio Fast Track C400. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-29ALSA: usb-audio: add control index offsetEldad Zack
Currently, channel IDs exceeding 31 (0x1f) cannot be used. The channel ID is derived from the cmask. Extending cmask to a 64-bit type would only allow it to go up to 63 (0x3f). Some devices have channel IDs exceeding that as well. To address that, add an offset to the mixer element which is then accounted for in the UAC set/get functions. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-30ALSA: usb-audio: Fix races at disconnection in mixer_quirks.cTakashi Iwai
Similar like the previous commit, cover with chip->shutdown_rwsem and chip->shutdown checks. Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11ALSA: usb-audio: Convert table to preferred C99 formatMark Hills
Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11ALSA: usb-audio: Use a table of mixer controlsMark Hills
Allow mixer controls to be provided clearly in a table, to avoid quantity of error checking at each use. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-05-11ALSA: usb-audio: Fix commentMark Hills
Explained by Takashi in <s5hfwbtmz0q.wl%tiwai@suse.de> > The reason is because get_min_max*() isn't called in the place you > created these controls, and get_min_max() would be called only for > integer volumes later even if uninitialized. A short cut for booleans. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: Add missing error checks in snd_ebox44_create_mixer()Takashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: M-Audio Fast Track Ultra: Add effect controlsFelix Homann
This adds controls for the effects section on the FTU devices. Some of these controls need volume quirks. They are added to mixer.c. [fixed missing break by tiwai] Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: Rename Fast Track Ultra mixer quirk functionsFelix Homann
This is in preparation for more FTU controls to come. Should help keeping names a bit shorter. Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: Add TLV to M-Audio Fast Track Ultra controlsFelix Homann
This adds db gain information to M-Audio Fast Track Ultra (8R) devices. Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks.Felix Homann
Merge snd_maudio_ftu_create_ctl() and snd_ebox44_create_ctl() into snd_create_std_mono_ctl(). As opposed to the ftu and ebox-44 specific functions, a TLV callback can be specified for controls created by snd_create_std_mono_ctl(). [fixed minor checkpatch.pl warnings by tiwai] Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-15ALSA: snd-usb-audio: Replace mixer for Electrix Ebox-44Mark Hills
The mixer units from the firmware are corrupt, and even where they are valid they presents mono controls as L and R channels of stereo. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-09-27ALSA: usb-audio: increase control transfer timeoutClemens Ladisch
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>
2011-05-25ALSA: usb-audio: more control quirks for M-Audio FastTrack devicesDaniel Mack
Make use of the freshly introduced methods to re-use standard mixer handling and add some controls that are hidden but implemented in a standard conform way on M-Audio's FastTrack devices. Signed-off-by: Daniel Mack <zonque@gmail.com> Original-code-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-18ALSA: usb-audio - Add support for USB X-Fi S51 ProMathieu Bouffard
USB X-Fi S51 Pro volume and mute from the volume knob on the unit. Compiled and tested with 2.6.39-rc7-git12 Signed-off-by: Mathieu Bouffard <mbouffard@strangequarks.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-05-18ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6Daniel Mack
This was a flaw in the reading of the spec tables - Native Instrument's "Komplete Audio 6" device has no such extra controls. This patch also fixes the device name in two comments. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-14ALSA: usb-audio: Add quirks for Audio Kontrol 6Daniel Mack
This new device by Native Instruments is also compliant to the USB standard v2.0, but hides this detail at when connected. It needs the same boot quirks than other models, and also has two non-class-compliant mixer controls. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-14ALSA: usb-audio: reconstruct some dispatcher functions to use switch-caseDaniel Mack
The number of cases has increased so use switch-case rather than if-statements. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-14ALSA: usb-audio: add support for Native Instruments MK2 devicesDaniel Mack
The MK2 generation of Native Instruments' sound cards are in fact compliant to the USB audio standard of version 2 and other approved USB standards. However, they come up as vendor-specific device when first connected but can be told to come up with a new set of descriptors upon their next enumeration. The interfaces announced by the new descriptors will be handled by the kernel's class drivers. This is done by issuing a vendor specific device request and sending the device to reset. There are also some vendor-specific USB requests for some mixer elements that can't be exported in a standard compliant way. The driver now supports them with quirks handling mechanisms. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-02ALSA: usb-audio - Support for Power/Status LED on Creative USB X-Fi S51Mandar Joshi
This patch adds support for Power/Status LED on Creative USB X-Fi S51. There is just one LED on the device. The LED can either be On or it can be set to Blink. There doesn't seem to be a way to switch it off. The control message to change LED status is similar to that of audigy2nx except that the index is to be set to 0 and value is 1 for Blink and 0 for On. The 'Power LED' control in alsamixer when muted will cause the LED to Blink continuously. When unmuted the LED will stay On. The Creative driver under Windows sets the LED to blink whenever audio is muted. This LED can be treated as the CMSS LED but I figured since there is just one LED, it should be treated as the Power LED. Is that alright? I've also changed the comment "Usb X-Fi" to "Usb X-Fi S51" as there are other external X-Fi devices from Creative like Usb X-Fi Go and Xmod. The volume knob and LED support patch doesn't apply to them. Signed-off-by: Mandar Joshi <emailmandar@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-24ALSA: usb - Creative USB X-Fi volume knob supportMandar Joshi
Adds an entry for Creative USB X-Fi to the rc_config array in mixer_quirks.c to allow use of volume knob on the device. The action of the volume knob is received by lirc when its using the alsa_usb driver. Signed-off-by: Mandar Joshi <emailmandar@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-29ALSA: usb - use of kmalloc/kfree requires the include of slab.hStephen Rothwell
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12ALSA: usbmixer: rename usbmixer.[ch] -> mixer.[ch]Daniel Mack
For clearer namespace, also rename usbmixer_maps.c -> mixer_maps.c Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12ALSA: usb-mixer: factor out quirksDaniel Mack
Move all non-standard mixer controls and vendor-specific extensions to a separate file. Some structs need to be exported now. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>