aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/firewire/tascam/tascam-hwdep.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-01-08ALSA: Convert strlcpy to strscpy when return value is unusedJoe Perches1-1/+1
strlcpy is deprecated. see: Documentation/process/deprecated.rst Change the calls that do not use the strlcpy return value to the preferred strscpy. Done with cocci script: @@ expression e1, e2, e3; @@ - strlcpy( + strscpy( e1, e2, e3); This cocci script leaves the instances where the return value is used unchanged. After this patch, sound/ has 3 uses of strlcpy() that need to be manually inspected for conversion and changed one day. $ git grep -w strlcpy sound/ sound/usb/card.c: len = strlcpy(card->longname, s, sizeof(card->longname)); sound/usb/mixer.c: return strlcpy(buf, p->name, buflen); sound/usb/mixer.c: return strlcpy(buf, p->names[index], buflen); Miscellenea: o Remove trailing whitespace in conversion of sound/core/hwdep.c Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-03-11ALSA: firewire-tascam: Add missing annotation for tscm_hwdep_read_locked()Jules Irenge1-0/+1
Sparse reports a warning at tscm_hwdep_read_locked() warning: context imbalance in tscm_hwdep_read_locked() - unexpected unlock The root cause is the missing annotation at tscm_hwdep_read_locked() Add the missing __releases(&tscm->lock) annotation Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20200311010908.42366-9-jbi.octave@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-03-11ALSA: firewire-tascam: Add missing annotation for tscm_hwdep_read_queue()Jules Irenge1-0/+1
Sparse reports a warning at tscm_hwdep_read_queue() warning: context imbalance in tscm_hwdep_read_queue() - unexpected unlock The root cause is the missing annotation at tscm_hwdep_read_queue() Add the missing __releases(&tscm->lock) annotation Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20200311010908.42366-8-jbi.octave@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 345Thomas Gleixner1-2/+1
Based on 1 normalized pattern(s): licensed under the terms of the gnu general public license version 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 88 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000437.521539229@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-23ALSA: firewire-tascam: notify events of change of state for userspace applicationsTakashi Sakamoto1-2/+63
In former commits, ALSA firewire-tascam driver queues events to notify change of state of control surface to userspace via ALSA hwdep interface. This commit implements actual notification of the events. The events are not governed by real time, thus no need to care underrun. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-23ALSA: firewire-tascam: apply small refactoring to handle several type of event for hwdep interfaceTakashi Sakamoto1-12/+26
In later commits, ALSA firewire-tascam driver will allow userspace applications to receive notifications about changes of device state, transferred in tx isochronous packet. At present, all of drivers in ALSA firewire stack have mechanism to notify change of status of packet streaming, thus it needs to distinguish these two types of notification. This commit is a preparation for the above. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-23ALSA: firewire-tascam: queue events for change of control surfaceTakashi Sakamoto1-0/+2
Units of TASCAM FireWire series transfer image of states of the unit in tx isochronous packets. Demultiplexing of the states from the packets is done in software interrupt context regardless of any process context. In a view of userspace applications, it needs to have notification mechanism to catch change of the states. This commit implements a queue to store events for the notification. The image of states includes fluctuating data such as level of gain/volume for physical input/output and position of knobs. Therefore the events are queued corresponding to some control features only. Furthermore, the queued events are planned to be consumed by userspace applications via ALSA hwdep interface. This commit suppresses event queueing when no applications open the hwdep interface. However, the queue is maintained in an optimistic scenario, thus without any care against overrrun. This is reasonable because target events are useless just to handle PCM frames. It starts queueing when an usespace application opens hwdep interface, thus it's expected to read the queued events steadily. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-11-23ALSA: firewire-tascam: add new hwdep ioctl command to get state imageTakashi Sakamoto1-0/+10
In a previous commit, ALSA firewire-tascam driver stores state image from tx isochronous packets. This image includes states of knob, fader, button of control surface, level of gain/volume of each physical inputs/outputs, and so on. It's useful for userspace applications to read whole of the image. This commit adds a unique ioctl command for ALSA hwdep interface for the purpose. For actual meaning of each bits in this image, please refer to discussion in alsa-devel[1]. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2018-October/140785.html Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds1-1/+1
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-27sound: annotate ->poll() instancesAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-01-05ALSA: firewire-tascam: enclose identifiers referred by single functionTakashi Sakamoto1-9/+8
Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-08-31ALSA: firewire-tascam: accessing to user space outside spinlockTakashi Sakamoto1-22/+11
In hwdep interface of firewire-tascam driver, accessing to user space is in a critical section with disabled local interrupt. Depending on architecture, accessing to user space can cause page fault exception. Then local processor stores machine status and handle the synchronous event. A handler corresponding to the event can call task scheduler to wait for preparing pages. In a case of usage of single core processor, the state to disable local interrupt is worse because it doesn't handle usual interrupts from hardware. This commit fixes this bug, by performing the accessing outside spinlock. Reported-by: Vaishali Thakkar <vaishali.thakkar@oracle.com> Cc: stable@vger.kernel.org Fixes: e5e0c3dd257b('ALSA: firewire-tascam: add hwdep interface') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-10-02ALSA: firewire-tascam: add hwdep interfaceTakashi Sakamoto1-0/+201
This commit adds hwdep interface so as the other IEEE 1394 sound devices has. This interface is designed for mixer/control applications. By using this interface, an application can get information about firewire node, can lock/unlock kernel streaming and can get notification at starting/stopping kernel streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>