summaryrefslogtreecommitdiffstats
path: root/sound/usb/line6/podhd.c
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: line6: Fix NULL dereference at podhd_disconnect()Takashi Iwai2017-10-091-1/+2
| | | | | | | | | | | | | | When podhd_init() failed with the acquiring a ctrl i/f, the line6 helper still calls the disconnect callback that eventually calls again usb_driver_release_interface() with the NULL intf. Put the proper NULL check before calling it for avoiding an Oops. Fixes: fc90172ba283 ("ALSA: line6: Claim pod x3 usb data interface") Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Fix missing initialization before error pathTakashi Iwai2017-10-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error path in podhd_init() tries to clear the pending timer, while the timer object is initialized at the end of init sequence, thus it may hit the uninitialized object, as spotted by syzkaller: INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 1 PID: 1845 Comm: kworker/1:2 Not tainted 4.14.0-rc2-42613-g1488251d1a98 #238 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:16 dump_stack+0x292/0x395 lib/dump_stack.c:52 register_lock_class+0x6c4/0x1a00 kernel/locking/lockdep.c:769 __lock_acquire+0x27e/0x4550 kernel/locking/lockdep.c:3385 lock_acquire+0x259/0x620 kernel/locking/lockdep.c:4002 del_timer_sync+0x12c/0x280 kernel/time/timer.c:1237 podhd_disconnect+0x8c/0x160 sound/usb/line6/podhd.c:299 line6_probe+0x844/0x1310 sound/usb/line6/driver.c:783 podhd_probe+0x64/0x70 sound/usb/line6/podhd.c:474 .... For addressing it, assure the initializations of timer and work by moving them to the beginning of podhd_init(). Fixes: 790869dacc3d ("ALSA: line6: Add support for POD X3") Reported-by: Andrey Konovalov <andreyknvl@google.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: remove unnecessary initialization to PODHD500XHans P. Möller Ebner2017-06-201-4/+6
| | | | | | | | | | | | | Remove Initialization from POD HD500X because it's not needed. Every time the device is connected dmesg gives the following output: "receive length failed (error -11)". To solve this problem, another flags is introduced (LINE6_CAP_CONTROL_INFO) and it is only used for PODX3 in: sysfs entries, call podhd_startup_finalize(pod) and disconnection. With this patch the error disappear. Signed-off-by: Hans P. Moller <hmoller@uc.cl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: add support for POD HD500XHans P. Möller Ebner2017-06-201-1/+16
| | | | | | | | Add support for the Line6 POD HD500X multi effect processor for playback and capture (in/out audio) through USB. Signed-off-by: Hans P. Moller <hmoller@uc.cl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Claim pod x3 usb data interfaceAndrej Krutak2016-11-291-0/+26
| | | | | | | | | | | | Userspace apps have to claim USB interfaces before using endpoints in them (drivers/usb/core/devio.c:checkintf()). It's a lock mechanism so that two "drivers" don't steal data from each other. Kernel drivers don't have to claim interfaces to work - but they should, to lock out userspace. While there, fix line6_properties struct to match checkpatch.pl. Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Fix POD X3 Live audio inputAndrej Krutak2016-10-101-1/+2
| | | | | | | | | | | The commit c039aaa77a7d1d9375665a8b59ec16dc7d23e259 was incomplete, missing part of the setup for Live. This makes also audio input work, in addition to audio output. Fixes: c039aaa77a7d1d9375665a8b59ec16dc7d23e259 Reported-by: Eddi De Pieri <eddi@depieri.net> Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Cleanup podhd initializationAndrej Krutak2016-09-191-11/+8
| | | | | | | | Only initialize PCM for POD HD devices that support it. No POD HD seems to support MIDI, thus drop the initialization. Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Add support for POD X3 Live (only USB ID differs from POD X3)Andrej Krutak2016-09-191-0/+13
| | | | | Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Add support for POD X3Andrej Krutak2016-09-191-13/+263
| | | | | | | | | This includes audio in/out and basic initialization via control EP (emulates what original driver does). The initialization is done similarly to original POD, firmware and serial IDs are read and exported via sysfs. Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Allow different channel numbers for in/outAndrej Krutak2016-09-191-3/+1
| | | | | | | Changes bytes_per_frame to bytes_per_channel. Signed-off-by: Andrej Krutak <dev@andree.sk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Pass driver name to line6_probe()Chris Rorvick2015-02-081-1/+1
| | | | | | | | | Provide a unique name for each driver instead of using "line6usb" for all of them. This will allow for different configurations based on the driver type. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Remove snd_line6_ prefix of pcm property fieldsTakashi Iwai2015-01-281-3/+3
| | | | | | It's just superfluous and doesn't give any better readability. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Remove struct usb_line6_podhdTakashi Iwai2015-01-281-6/+1
| | | | | | It's identical with struct usb_line6. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Move the contents of usbdefs.h into driver.hTakashi Iwai2015-01-281-1/+0
| | | | | | | Most of them are rather relevant with the definitions in driver.h, and there are only a few lines, so just rip it off. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Tidy up and typo fixes in commentsTakashi Iwai2015-01-281-3/+1
| | | | | | | | | | Just reformatting the comments and typos fixed, no functional changes. Particularly, - avoid the kerneldoc marker "/**", - reduce multiple comment lines into single lines, - corrected wrongly referred function names Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Let snd_card_new() allocate private dataTakashi Iwai2015-01-281-7/+2
| | | | | | | | | Instead of allocating the private data individually in each driver's probe at first, let snd_card_new() allocate the data that is called in line6_probe(). This simplifies the primary probe functions. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Drop interface argument from private_init and disconnect callbacksTakashi Iwai2015-01-281-3/+3
| | | | | | | | | | | The interface argument is used just for retrieving the assigned device, which can be already found in line6->ifcdev. Drop them from the callbacks. Also, pass the usb id to private_init so that the driver can deal with it there. This is a preliminary work for the further cleanup to move the whole allocation into driver.c. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Remove superfluous NULL checks in each driverTakashi Iwai2015-01-281-4/+0
| | | | | | | | | The interface and driver objects are always set when callbacks are called. Drop such superfluous NULL checks in init and disconnect calls of each driver. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Refer to manufacturer as "Line 6"Chris Rorvick2015-01-201-3/+3
| | | | | | | | The correct spelling includes the space. Fix this in strings and comments that refer to the manufacturer. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Reorganize card resource handlingTakashi Iwai2015-01-201-68/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fairly big rewrite regarding the card resource management in line6 drivers: - The card creation is moved into line6_probe(). This adds the global destructor to private_free, so that each driver doesn't have to call it any longer. - The USB disconnect callback handles the card release, thus each driver needs to concentrate on only its own resources. No need to snd_card_*() call in the destructor. - Fix the potential stall in disconnection by removing snd_card_free(). It's replaced with snd_card_free_when_closed() for asynchronous release. - The only remaining operation for the card in each driver is the call of snd_card_register(). All the rest are dealt in the common module by itself. - These ended up with removal of audio.[ch] as a result of a reduction of one layer. Each driver just needs to call line6_probe(). Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Drop invalid SNDRV_PCM_INFO_RESUME flagTakashi Iwai2015-01-201-6/+0
| | | | | | | | | | | | The line6 drivers don't support the full resume although they set SNDRV_PCM_INFO_RESUME. These flags have to be dropped to inform properly to the user-space. Also, drop the CONFIG_PM in trigger callbacks, too, which are rather superfluous. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: line6: Split to each driverTakashi Iwai2015-01-201-2/+122
| | | | | | | | | | | Split to each individual driver for POD, PODHD, TonePort and Variax with a core LINE6 helper module. The new modules follow the standard ALSA naming rule with snd prefix: snd-usb-pod, snd-usb-podhd, snd-usb-toneport and snd-usb-variax, together with the corresponding CONFIG_SND_USB_* Kconfig items. Tested-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: move line6 usb driver into sound/usbTakashi Iwai2015-01-121-0/+156
Promote line6 driver from staging to sound/usb/line6 directory, and maintain through sound subsystem tree. This commit just moves the code and adapts Makefile / Kconfig. The further renames and misc cleanups will follow. Signed-off-by: Takashi Iwai <tiwai@suse.de>