summaryrefslogtreecommitdiff
path: root/drivers/staging/line6/pod.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-11staging: line6: pod.c: fix checkpatch warningLaurent Navet1-2/+1
- WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-20staging: line6: clean up line6_pod_process_message()Stefan Hajnoczi1-77/+19
Previous versions of the line6 driver snooped MIDI traffic in order to make device state accessible via sysfs attributes. This involved a lot of logic in line6_pod_process_message() that has since been removed. Drop unused conditionals in line6_pod_process_message() and reduce the levels of indentation. Only two MIDI messages are still tracked: the POD version message on startup and monitor level changes originating from the device. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11staging: line6: avoid CamelCase POD_* enums in pod.cStefan Hajnoczi1-5/+5
Fix the following checkpatch.pl warnings: WARNING: Avoid CamelCase: <POD_monitor_level> #4512: FILE: staging/line6/pod.c:41: + POD_monitor_level = 0x04, WARNING: Avoid CamelCase: <POD_system_invalid> #4513: FILE: staging/line6/pod.c:42: + POD_system_invalid = 0x10000 Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11staging: line6: wrap lines to 80 chars in pod.cStefan Hajnoczi1-2/+5
Fix the following checkpatch.pl warnings: WARNING: line over 80 characters #4508: FILE: staging/line6/pod.c:37: + /* POD_SYSEX_DUMPMEM2 = 0x76 */ /* dumps entire internal memory of PODxt Pro */ WARNING: line over 80 characters #4630: FILE: staging/line6/pod.c:159: + if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop dump requests from pod startupStefan Hajnoczi1-40/+4
The pod startup procedure dumps model data. This is no longer useful since the sysfs attrs which expose this information to userspace have been removed. The dump request wasn't been processed anymore. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop unused pod atomic_flags fieldStefan Hajnoczi1-11/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop pod prog_data buffersStefan Hajnoczi1-43/+3
The driver no longer keeps state of MIDI-accessible device parameters. Drop the buffers but be careful to keep the device startup procedure working even though we no longer store the contents of the dump request. The startup procedure will be simplified in a later patch. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop MIDI parameter sysfs attrsStefan Hajnoczi1-9/+0
Both pod.c and variax.c expose the device's MIDI parameters as sysfs attrs. Knowledge of MIDI constants should be in userspace, not in the driver. Drop the sysfs attrs and let userspace interpret parameters it cares about instead. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop amp/effects dump request triggersStefan Hajnoczi1-9/+0
Since the driver no longer needs to keep state of device parameters it is no longer necessary to refresh state when messages that affect other parameters are sent. Drop the code to trigger a dump when amp/effects are changed. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop tuner param filteringStefan Hajnoczi1-21/+0
The pod_set_system_param_int() helper function is only used to set the monitor level. Previously it was also used to control the tuner and has special checks. These checks can now be dropped, along with the tuner constants. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop pod.c raw sysfs attrStefan Hajnoczi1-13/+0
The raw sysfs attr transmits MIDI messages with less filtering. This was a useful debugging tool while the staging driver still had a lot of state and filtering. It is not useful anymore since the filtering is being dropped. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop midi_postprocess flagStefan Hajnoczi1-34/+0
It is no longer necessary to trigger on MIDI transmit messages that will change the state of the device since: 1. We've dropped the midi_postprocess sysfs attr in a previous commit so it is not possible to activate this feature anymore. 2. The other sysfs attrs that could inspect the state after a dump request have been dropped. Therefore we can safely remove this dead code. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop midi_postprocess sysfs attrStefan Hajnoczi1-36/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop finish sysfs attrStefan Hajnoczi1-21/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop tuner_pitch sysfs attrStefan Hajnoczi1-101/+1
Dropping this final tuner sysfs attr also leaves the POD_GET_SYSTEM_PARAM() macro, pod_get_system_param_string(), and pod_get_system_param_int() unused. Remove them immediately to avoid compiler warnings. POD_monitor_level is now the only SYSEX value that needs to be watched by the driver since the ALSA volume control should reflect the current monitor volume level used by the device. Therefore, drop the switch statement entirely and just check for POD_monitor_level, ignoring unknown system parameter changes. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop tuner_mute sysfs attrStefan Hajnoczi1-34/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop tuner_note sysfs attrStefan Hajnoczi1-7/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop tuner_freq sysfs attrStefan Hajnoczi1-8/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop routing sysfs attrStefan Hajnoczi1-8/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop store_effects_setup sysfs attrStefan Hajnoczi1-68/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop store_channel sysfs attrStefan Hajnoczi1-14/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop store_amp_setup sysfs attrStefan Hajnoczi1-14/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop retrieve_effects_setup sysfs attrStefan Hajnoczi1-48/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop retrieve_channel sysfs attrStefan Hajnoczi1-14/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop retrieve_amp_setup sysfs attrStefan Hajnoczi1-14/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop name_buf sysfs attrStefan Hajnoczi1-43/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop name sysfs attrStefan Hajnoczi1-15/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: change monitor_level type ValueWait -> intStefan Hajnoczi1-5/+5
The monitor_level sysfs attr has been dropped and we never need to wait on the monitor_level value to change. Switch to a plain int and drop the wait queue. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop monitor_level sysfs attrStefan Hajnoczi1-8/+4
The monitor level can be adjusted using an ALSA volume control. Therefore the sysfs attribute is unnecessary. Note that we leave the monitor_level driver variable so that the ALSA volume control still works. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop dump_buf sysfs attrStefan Hajnoczi1-40/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop dump sysfs attrStefan Hajnoczi1-57/+3
Once further sysfs attrs have been removed it will also be possible to drop prog_data and other pieces which we keep for now. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop dirty sysfs attrStefan Hajnoczi1-20/+1
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop unused param_dirty bitmapStefan Hajnoczi1-16/+0
The param_dirty bitmap tracks which parameters have been modified since saving a preset. The bitmap is never used though so we can drop this deadcode. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop clip sysfs attrStefan Hajnoczi1-23/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-26staging: line6: drop channel sysfs attrStefan Hajnoczi1-51/+0
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13staging: line6: replace DEBUG_MESSAGES() with dev_dbg()Stefan Hajnoczi1-36/+21
The dyndbg feature allows dev_dbg() calls to be enabled/disabled at runtime and is therefore more convenient than static debug log messages. Use dev_dbg() instead of the line6-specific DEBUG_MESSAGES() macro. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: line6: Changed strict_strtoul() to kstrtou8() in ↵Johannes Thumshirn1-2/+2
pod_set_midi_postprocess() Changed a call to strict_strtoul() into kstrtou8() in pod_set_midi_postprocess(). Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: line6: Changed strict_strtoul() to kstrtou8() in pod_set_channel()Johannes Thumshirn1-2/+2
Changed strict_strtoul() to kstrtou() in pod_set_channel() to take changes in pod_send_channel() into account. Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: line6: Exchanged strict_strtoul with kstrtou8() in pod.c:pod_resolve()Johannes Thumshirn1-2/+2
Exchanged call to strict_strtoul() with kstrtou8() in pod_resolve(). Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: line6: changed interface of pod_send_channel()Johannes Thumshirn1-1/+1
Adjusted interface of pod_send_channel() in order to take changes of line6_send_program() into account. Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: line6: changed interface of line6_pod_transmit_parameter()Johannes Thumshirn1-1/+1
Adjusted interface of line6_pod_transmit_parameter() to take changes of line6_transmit_parameter() into account Signed-off-by: Johannes Thumshirn <morbidrsa@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-12-09staging: line6: eliminate useless NULL checksStefan Hajnoczi1-5/+1
The line6 driver checks struct field addresses for NULL where it does not make sense to do so. The struct has already been checked for NULL and there is no value in checking the first field's address too. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Markus Grabner <grabner@icg.tugraz.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-18Staging: line6: fix up my fixup for some sysfs attribute permissionsGreg Kroah-Hartman1-16/+16
They should be writable by root, not readable. Doh, stupid me with the wrong flags. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Markus Grabner <grabner@icg.tugraz.at> Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16Staging: line6: fix up some sysfs attribute permissionsGreg Kroah-Hartman1-16/+16
They should not be writable by any user Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Markus Grabner <grabner@icg.tugraz.at> Cc: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-21Staging: line6: minor coding style cleanupsGreg Kroah-Hartman1-17/+9
This fixes up all of the remaining coding style issues that make any sense to make in the line6 driver. Cc: Markus Grabner <grabner@icg.tugraz.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31Staging: line6: another upstream syncMarkus Grabner1-155/+261
Everything should be in sync now. Signed-off-by: Markus Grabner <grabner@icg.tugraz.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31staging: line6: sync with upstreamMarkus Grabner1-202/+270
Big upstream sync. Signed-off-by: Markus Grabner <grabner@icg.tugraz.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-17Staging: Use kmemdupJulia Lawall1-4/+2
Use kmemdup when some other buffer is immediately copied into the allocated region. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc\)(size,flag); + to = kmemdup(from,size,flag); if (to==NULL || ...) S - memcpy(to, from, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+2
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-11staging: line6: Convert simple_strtoul to strict_strtoul in pod.cShawn Bohrer1-9/+47
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>