line6linux-devel Mailing List for Line6 Linux software (Page 5)
Status: Pre-Alpha
Brought to you by:
mgrabner
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(31) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(133) |
Dec
(11) |
2013 |
Jan
(22) |
Feb
|
Mar
|
Apr
(2) |
May
(10) |
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(18) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: L. A. G. <agi...@sy...> - 2012-11-26 20:39:13
|
On Sat, Nov 24, 2012 at 06:06:13PM +0100, Stefan Hajnoczi wrote: > On Sat, Nov 24, 2012 at 4:40 PM, L. Alberto Giménez > <agi...@sy...> wrote: > > On Thu, Nov 22, 2012 at 09:05:31PM +0100, Stefan Hajnoczi wrote: > > > >> If you'd like to help clean up the staging driver, I suggest starting > >> with my line6-drop-sysfs-attrs branch (saves you from applying the > >> patch emails yourself): > >> https://github.com/stefanha/linux/tree/line6-drop-sysfs-attrs > > > > Aaah, that's what I meant in my older messages regarding to a public git repo to ease > > contribution :-) > > The URL is a convenient way to share this long patch series. It will > not receive additional commits because the "drop sysfs attrs" series > is finished. Ok, got it. > > It is not an ongoing "line6-cleanup" tree. Patches should be sent > directly to the mailing lists - they will be merged into > linux-next.git and the svn repo. Understood. > Were we thinking about the same thing? :) It seems not :) I was thinking about a public cleanup branch to 'coordinate' the patches (or the development). I'm currently compiling the drop-sysfs branch. I have an HD 500 device, so I will give feedback about if it works 'out of the box' or not. Thanks for your great work! Regards, -- L. Alberto Giménez JabberID agi...@ja... GnuPG key ID 0x3BAABDE1 |
From: Stefan H. <ste...@gm...> - 2012-11-24 17:06:21
|
On Sat, Nov 24, 2012 at 4:40 PM, L. Alberto Giménez <agi...@sy...> wrote: > On Thu, Nov 22, 2012 at 09:05:31PM +0100, Stefan Hajnoczi wrote: > >> If you'd like to help clean up the staging driver, I suggest starting >> with my line6-drop-sysfs-attrs branch (saves you from applying the >> patch emails yourself): >> https://github.com/stefanha/linux/tree/line6-drop-sysfs-attrs > > Aaah, that's what I meant in my older messages regarding to a public git repo to ease > contribution :-) The URL is a convenient way to share this long patch series. It will not receive additional commits because the "drop sysfs attrs" series is finished. It is not an ongoing "line6-cleanup" tree. Patches should be sent directly to the mailing lists - they will be merged into linux-next.git and the svn repo. Were we thinking about the same thing? :) Stefan |
From: L. A. G. <agi...@sy...> - 2012-11-24 16:06:59
|
On Thu, Nov 22, 2012 at 09:05:31PM +0100, Stefan Hajnoczi wrote: > If you'd like to help clean up the staging driver, I suggest starting > with my line6-drop-sysfs-attrs branch (saves you from applying the > patch emails yourself): > https://github.com/stefanha/linux/tree/line6-drop-sysfs-attrs Aaah, that's what I meant in my older messages regarding to a public git repo to ease contribution :-) Thanks and regards, -- L. Alberto Giménez JabberID agi...@ja... GnuPG key ID 0x3BAABDE1 |
From: Markus G. <gr...@ic...> - 2012-11-24 00:14:22
|
Am Donnerstag, 22. November 2012, 21:08:55 schrieb Stefan Hajnoczi: > On Thu, Nov 22, 2012 at 8:58 PM, Greg Kroah-Hartman > > <gr...@li...> wrote: > > On Thu, Nov 22, 2012 at 08:48:39PM +0100, Stefan Hajnoczi wrote: > >> Markus and I have discussed the MIDI processing that currently happens in > >> the line6 driver. This stuff really belongs in userspace where a > >> library or utility can use ALSA MIDI APIs to control the device. Moving > >> MIDI processing to userspace has several benefits: > >> > >> 1. The driver only handles PCM and MIDI I/O. This means less kernel > >> code. > >> > >> 2. A large number of sysfs attributes can be removed. These attributes > >> exposed>> > >> MIDI state and driver code was necessary to sync and manage this > >> state. > >> > >> 3. It's easier for userspace to control the device, try out new MIDI > >> commands,>> > >> etc when the driver acts as a dumb transport. > >> > >> This patch series removes the sysfs attributes and then removes the state > >> behind those attributes. I have tried to make small incremental changes > >> that can be reviewed easily. > > > > Very nice, I'll queue these up on Monday, very good work, thanks so much > > for doing this. > > Thanks! I hope Markus has a chance to review and/or test these > changes first - he knows generally what I'm up too but should have the > final word on details. I just applied all patches and did a quick check with the PODxt Live. The following features are still working: *) the user space code which receives and interprets (at least some) MIDI messages from the device *) ALSA playback *) ALSA volume and monitor controls I will have a look at the Variax and TonePort later. Kind regards, Markus |
From: Laurent N. <lau...@gm...> - 2012-11-22 20:28:25
|
>>> Let me know if there's some easy and boring tasks you don't want to >>> waste >>> time on. Like fix CodingStyle or so. >>> I'm not a kernel guru but can fix minor issues. > > I had some time to prepare the patch series and have sent them out > earlier than expected. > > If you'd like to help clean up the staging driver, I suggest starting > with my line6-drop-sysfs-attrs branch (saves you from applying the > patch emails yourself): > https://github.com/stefanha/linux/tree/line6-drop-sysfs-attrs Ok, I'll do that I can test with a PodXT, and will work on checkpatch issues. I can't work on it this week-end, I'm going to Paris mini DebConf [1]. So don't except an answer before 5-7 days. Also, I've switched to gmail since it's this adress I use for my Open Source activities. Regards, [1] http://fr2012.mini.debconf.org/#schedule -- « On ne résout pas un problème avec les modes de pensée qui l’ont engendré. » « You cannot solve current problems with current thinking. Current problems are the result of current thinking » |
From: Stefan H. <ste...@gm...> - 2012-11-22 20:09:02
|
On Thu, Nov 22, 2012 at 8:58 PM, Greg Kroah-Hartman <gr...@li...> wrote: > On Thu, Nov 22, 2012 at 08:48:39PM +0100, Stefan Hajnoczi wrote: >> Markus and I have discussed the MIDI processing that currently happens in the >> line6 driver. This stuff really belongs in userspace where a library or >> utility can use ALSA MIDI APIs to control the device. Moving MIDI processing >> to userspace has several benefits: >> >> 1. The driver only handles PCM and MIDI I/O. This means less kernel code. >> >> 2. A large number of sysfs attributes can be removed. These attributes exposed >> MIDI state and driver code was necessary to sync and manage this state. >> >> 3. It's easier for userspace to control the device, try out new MIDI commands, >> etc when the driver acts as a dumb transport. >> >> This patch series removes the sysfs attributes and then removes the state >> behind those attributes. I have tried to make small incremental changes that >> can be reviewed easily. > > Very nice, I'll queue these up on Monday, very good work, thanks so much > for doing this. Thanks! I hope Markus has a chance to review and/or test these changes first - he knows generally what I'm up too but should have the final word on details. Stefan |
From: Stefan H. <ste...@gm...> - 2012-11-22 20:05:39
|
On Thu, Nov 22, 2012 at 10:49 AM, Stefan Hajnoczi <ste...@gm...> wrote: > On Thu, Nov 22, 2012 at 8:57 AM, Laurent Navet <lau...@ya...> wrote: >> Let me know if there's some easy and boring tasks you don't want to waste >> time on. Like fix CodingStyle or so. >> I'm not a kernel guru but can fix minor issues. > > I will send out a patch series this weekend that drops a lot of code > (that functionality moves to userspace). This means coding style > cleanups right now might be wasted on code that gets deleted. > > Once I've sent the series I'll also send an email to line6linux-devel > with the todo list that remains. Maybe you'll find something that you > want to tackle. I had some time to prepare the patch series and have sent them out earlier than expected. If you'd like to help clean up the staging driver, I suggest starting with my line6-drop-sysfs-attrs branch (saves you from applying the patch emails yourself): https://github.com/stefanha/linux/tree/line6-drop-sysfs-attrs By using the patches I just sent out as a starting point you avoid cleaning up code that is going to be removed anyway. Here are the remaining checkpatch.pl warnings, we should eventually address them all: WARNING: line over 80 characters #64: FILE: staging/line6/driver.c:61: + { LINE6_BIT_BASSPODXT, "BassPODxt", "BassPODxt", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #65: FILE: staging/line6/driver.c:62: + { LINE6_BIT_BASSPODXTLIVE, "BassPODxtLive", "BassPODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #66: FILE: staging/line6/driver.c:63: + { LINE6_BIT_BASSPODXTPRO, "BassPODxtPro", "BassPODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #67: FILE: staging/line6/driver.c:64: + { LINE6_BIT_GUITARPORT, "GuitarPort", "GuitarPort", LINE6_BIT_PCM }, WARNING: line over 80 characters #68: FILE: staging/line6/driver.c:65: + { LINE6_BIT_POCKETPOD, "PocketPOD", "Pocket POD", LINE6_BIT_CONTROL }, WARNING: line over 80 characters #69: FILE: staging/line6/driver.c:66: + { LINE6_BIT_PODHD300, "PODHD300", "POD HD300", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #70: FILE: staging/line6/driver.c:67: + { LINE6_BIT_PODHD500, "PODHD500", "POD HD500", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #71: FILE: staging/line6/driver.c:68: + { LINE6_BIT_PODSTUDIO_GX, "PODStudioGX", "POD Studio GX", LINE6_BIT_PCM }, WARNING: line over 80 characters #72: FILE: staging/line6/driver.c:69: + { LINE6_BIT_PODSTUDIO_UX1, "PODStudioUX1", "POD Studio UX1", LINE6_BIT_PCM }, WARNING: line over 80 characters #73: FILE: staging/line6/driver.c:70: + { LINE6_BIT_PODSTUDIO_UX2, "PODStudioUX2", "POD Studio UX2", LINE6_BIT_PCM }, WARNING: line over 80 characters #74: FILE: staging/line6/driver.c:71: + { LINE6_BIT_PODX3, "PODX3", "POD X3", LINE6_BIT_PCM }, WARNING: line over 80 characters #75: FILE: staging/line6/driver.c:72: + { LINE6_BIT_PODX3LIVE, "PODX3Live", "POD X3 Live", LINE6_BIT_PCM }, WARNING: line over 80 characters #76: FILE: staging/line6/driver.c:73: + { LINE6_BIT_PODXT, "PODxt", "PODxt", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #77: FILE: staging/line6/driver.c:74: + { LINE6_BIT_PODXTLIVE, "PODxtLive", "PODxt Live", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #78: FILE: staging/line6/driver.c:75: + { LINE6_BIT_PODXTPRO, "PODxtPro", "PODxt Pro", LINE6_BIT_CONTROL_PCM_HWMON }, WARNING: line over 80 characters #79: FILE: staging/line6/driver.c:76: + { LINE6_BIT_TONEPORT_GX, "TonePortGX", "TonePort GX", LINE6_BIT_PCM }, WARNING: line over 80 characters #80: FILE: staging/line6/driver.c:77: + { LINE6_BIT_TONEPORT_UX1, "TonePortUX1", "TonePort UX1", LINE6_BIT_PCM }, WARNING: line over 80 characters #81: FILE: staging/line6/driver.c:78: + { LINE6_BIT_TONEPORT_UX2, "TonePortUX2", "TonePort UX2", LINE6_BIT_PCM }, WARNING: line over 80 characters #82: FILE: staging/line6/driver.c:79: + { LINE6_BIT_VARIAX, "Variax", "Variax Workbench", LINE6_BIT_CONTROL }, WARNING: line over 80 characters #218: FILE: staging/line6/driver.c:215: + line6->ep_control_write), WARNING: line over 80 characters #577: FILE: staging/line6/driver.c:574: + /* Wait for data length. We'll get a couple of 0xff until length arrives. */ WARNING: line over 80 characters #26: FILE: staging/line6/driver.h:23: +#if defined(CONFIG_LINE6_USB_DUMP_CTRL) || defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM) WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... #59: FILE: staging/line6/driver.h:56: + printk(KERN_ERR "line6usb driver bug: missing case in %s:%d\n", \ WARNING: simple_strtoul is obsolete, use kstrtoul instead #87: FILE: staging/line6/pcm.c:84: + dev2pcm(dev)->impulse_period = simple_strtoul(buf, NULL, 10); ERROR: switch and case should be at the same indent #426: FILE: staging/line6/pcm.c:423: + switch (line6->product) { [...] + case LINE6_DEVID_TONEPORT_UX2: + case LINE6_DEVID_PODSTUDIO_UX2: WARNING: line over 80 characters #248: FILE: staging/line6/playback.c:245: + if (line6pcm->flags & LINE6_BIT_PCM_ALSA_CAPTURE_STREAM) { WARNING: line over 80 characters #254: FILE: staging/line6/playback.c:251: + urb_out->transfer_buffer_length); WARNING: line over 80 characters #40: FILE: staging/line6/pod.c:37: + /* POD_SYSEX_DUMPMEM2 = 0x76 */ /* dumps entire internal memory of PODxt Pro */ WARNING: line over 80 characters #162: FILE: staging/line6/pod.c:159: + if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { ERROR: Macros with complex values should be enclosed in parenthesis #45: FILE: staging/line6/usbdefs.h:42: +#define LINE6_BIT(x) LINE6_BIT_ ## x = 1 << LINE6_INDEX_ ## x |
From: Greg Kroah-H. <gr...@li...> - 2012-11-22 20:04:23
|
On Thu, Nov 22, 2012 at 08:48:39PM +0100, Stefan Hajnoczi wrote: > Let's put the line6 staging driver on a diet for Thanksgiving! :) Yeah! > Markus and I have discussed the MIDI processing that currently happens in the > line6 driver. This stuff really belongs in userspace where a library or > utility can use ALSA MIDI APIs to control the device. Moving MIDI processing > to userspace has several benefits: > > 1. The driver only handles PCM and MIDI I/O. This means less kernel code. > > 2. A large number of sysfs attributes can be removed. These attributes exposed > MIDI state and driver code was necessary to sync and manage this state. > > 3. It's easier for userspace to control the device, try out new MIDI commands, > etc when the driver acts as a dumb transport. > > This patch series removes the sysfs attributes and then removes the state > behind those attributes. I have tried to make small incremental changes that > can be reviewed easily. Very nice, I'll queue these up on Monday, very good work, thanks so much for doing this. > drivers/staging/line6/Kconfig | 11 - > drivers/staging/line6/Makefile | 2 - > drivers/staging/line6/control.c | 995 ------------------------------------ > drivers/staging/line6/control.h | 195 ------- > drivers/staging/line6/driver.c | 20 - > drivers/staging/line6/dumprequest.c | 135 ----- > drivers/staging/line6/dumprequest.h | 76 --- > drivers/staging/line6/midi.c | 120 ----- > drivers/staging/line6/midi.h | 10 - > drivers/staging/line6/pod.c | 846 +----------------------------- > drivers/staging/line6/pod.h | 105 +--- > drivers/staging/line6/variax.c | 480 +---------------- > drivers/staging/line6/variax.h | 60 --- > 13 files changed, 16 insertions(+), 3039 deletions(-) > delete mode 100644 drivers/staging/line6/control.c > delete mode 100644 drivers/staging/line6/control.h > delete mode 100644 drivers/staging/line6/dumprequest.c > delete mode 100644 drivers/staging/line6/dumprequest.h I like seeing diffstats like that :) greg k-h |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:52:07
|
The line6 drive no longer requests MIDI dumps from the device so dumprequest.c is not needed. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/Makefile | 1 - drivers/staging/line6/dumprequest.c | 135 ------------------------------------ drivers/staging/line6/dumprequest.h | 76 -------------------- 3 files changed, 212 deletions(-) delete mode 100644 drivers/staging/line6/dumprequest.c delete mode 100644 drivers/staging/line6/dumprequest.h diff --git a/drivers/staging/line6/Makefile b/drivers/staging/line6/Makefile index 44ee5ae..ae5c374 100644 --- a/drivers/staging/line6/Makefile +++ b/drivers/staging/line6/Makefile @@ -4,7 +4,6 @@ line6usb-y := \ audio.o \ capture.o \ driver.o \ - dumprequest.o \ midi.o \ midibuf.o \ pcm.o \ diff --git a/drivers/staging/line6/dumprequest.c b/drivers/staging/line6/dumprequest.c deleted file mode 100644 index 60c7bae..0000000 --- a/drivers/staging/line6/dumprequest.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (gr...@ic...) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#include <linux/slab.h> - -#include "driver.h" -#include "dumprequest.h" - -/* - Set "dump in progress" flag. -*/ -void line6_dump_started(struct line6_dump_request *l6dr, int dest) -{ - l6dr->in_progress = dest; -} - -/* - Invalidate current channel, i.e., set "dump in progress" flag. - Reading from the "dump" special file blocks until dump is completed. -*/ -void line6_invalidate_current(struct line6_dump_request *l6dr) -{ - line6_dump_started(l6dr, LINE6_DUMP_CURRENT); -} - -/* - Clear "dump in progress" flag and notify waiting processes. -*/ -void line6_dump_finished(struct line6_dump_request *l6dr) -{ - l6dr->in_progress = LINE6_DUMP_NONE; - wake_up(&l6dr->wait); -} - -/* - Send an asynchronous channel dump request. -*/ -int line6_dump_request_async(struct line6_dump_request *l6dr, - struct usb_line6 *line6, int num, int dest) -{ - int ret; - line6_dump_started(l6dr, dest); - ret = line6_send_raw_message_async(line6, l6dr->reqbufs[num].buffer, - l6dr->reqbufs[num].length); - - if (ret < 0) - line6_dump_finished(l6dr); - - return ret; -} - -/* - Wait for completion (interruptible). -*/ -int line6_dump_wait_interruptible(struct line6_dump_request *l6dr) -{ - return wait_event_interruptible(l6dr->wait, - l6dr->in_progress == LINE6_DUMP_NONE); -} - -/* - Wait for completion. -*/ -void line6_dump_wait(struct line6_dump_request *l6dr) -{ - wait_event(l6dr->wait, l6dr->in_progress == LINE6_DUMP_NONE); -} - -/* - Wait for completion (with timeout). -*/ -int line6_dump_wait_timeout(struct line6_dump_request *l6dr, long timeout) -{ - return wait_event_timeout(l6dr->wait, - l6dr->in_progress == LINE6_DUMP_NONE, - timeout); -} - -/* - Initialize dump request buffer. -*/ -int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, const void *buf, - size_t len, int num) -{ - l6dr->reqbufs[num].buffer = kmemdup(buf, len, GFP_KERNEL); - if (l6dr->reqbufs[num].buffer == NULL) - return -ENOMEM; - l6dr->reqbufs[num].length = len; - return 0; -} - -/* - Initialize dump request data structure (including one buffer). -*/ -int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf, - size_t len) -{ - int ret; - ret = line6_dumpreq_initbuf(l6dr, buf, len, 0); - if (ret < 0) - return ret; - init_waitqueue_head(&l6dr->wait); - return 0; -} - -/* - Destruct dump request data structure. -*/ -void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num) -{ - if (l6dr == NULL) - return; - if (l6dr->reqbufs[num].buffer == NULL) - return; - kfree(l6dr->reqbufs[num].buffer); - l6dr->reqbufs[num].buffer = NULL; -} - -/* - Destruct dump request data structure. -*/ -void line6_dumpreq_destruct(struct line6_dump_request *l6dr) -{ - if (l6dr->reqbufs[0].buffer == NULL) - return; - line6_dumpreq_destructbuf(l6dr, 0); -} diff --git a/drivers/staging/line6/dumprequest.h b/drivers/staging/line6/dumprequest.h deleted file mode 100644 index c17a262..0000000 --- a/drivers/staging/line6/dumprequest.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (gr...@ic...) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#ifndef DUMPREQUEST_H -#define DUMPREQUEST_H - -#include <linux/usb.h> -#include <linux/wait.h> -#include <sound/core.h> - -enum { - LINE6_DUMP_NONE, - LINE6_DUMP_CURRENT -}; - -struct line6_dump_reqbuf { - /** - Buffer for dump requests. - */ - unsigned char *buffer; - - /** - Size of dump request. - */ - size_t length; -}; - -/** - Provides the functionality to request channel/model/... dump data from a - Line6 device. -*/ -struct line6_dump_request { - /** - Wait queue for access to program dump data. - */ - wait_queue_head_t wait; - - /** - Indicates an unfinished program dump request. - 0: no dump - 1: dump current settings - Other device-specific values are also allowed. - */ - int in_progress; - - /** - Dump request buffers - */ - struct line6_dump_reqbuf reqbufs[1]; -}; - -extern void line6_dump_finished(struct line6_dump_request *l6dr); -extern int line6_dump_request_async(struct line6_dump_request *l6dr, - struct usb_line6 *line6, int num, int dest); -extern void line6_dump_started(struct line6_dump_request *l6dr, int dest); -extern void line6_dumpreq_destruct(struct line6_dump_request *l6dr); -extern void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num); -extern int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf, - size_t len); -extern int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, - const void *buf, size_t len, int num); -extern void line6_invalidate_current(struct line6_dump_request *l6dr); -extern void line6_dump_wait(struct line6_dump_request *l6dr); -extern int line6_dump_wait_interruptible(struct line6_dump_request *l6dr); -extern int line6_dump_wait_timeout(struct line6_dump_request *l6dr, - long timeout); - -#endif -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:52:02
|
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 <ste...@gm...> --- drivers/staging/line6/pod.c | 44 ++++---------------------------------------- drivers/staging/line6/pod.h | 7 ------- 2 files changed, 4 insertions(+), 47 deletions(-) diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index f8257be..e542540 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -111,10 +111,6 @@ static struct line6_pcm_properties pod_pcm_properties = { .bytes_per_frame = POD_BYTES_PER_FRAME }; -static const char pod_request_channel[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x03, 0x75, 0xf7 -}; - static const char pod_version_header[] = { 0xf2, 0x7e, 0x7f, 0x06, 0x02 }; @@ -122,7 +118,6 @@ static const char pod_version_header[] = { /* forward declarations: */ static void pod_startup2(unsigned long data); static void pod_startup3(struct usb_line6_pod *pod); -static void pod_startup4(struct usb_line6_pod *pod); static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, int size) @@ -157,8 +152,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); break; case LINE6_SYSEX_BEGIN | LINE6_CHANNEL_DEVICE: @@ -166,8 +159,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { switch (buf[5]) { case POD_SYSEX_DUMP: - line6_dump_finished(&pod->dumpreq); - pod_startup3(pod); break; case POD_SYSEX_SYSTEM:{ @@ -208,7 +199,7 @@ void line6_pod_process_message(struct usb_line6_pod *pod) pod->device_id = ((int)buf[8] << 16) | ((int)buf[9] << 8) | (int) buf[10]; - pod_startup4(pod); + pod_startup3(pod); } else dev_dbg(pod->line6.ifcdev, "unknown sysex header\n"); @@ -308,22 +299,6 @@ static void pod_startup1(struct usb_line6_pod *pod) static void pod_startup2(unsigned long data) { struct usb_line6_pod *pod = (struct usb_line6_pod *)data; - - /* schedule another startup procedure until startup is complete: */ - if (pod->startup_progress >= POD_STARTUP_LAST) - return; - - pod->startup_progress = POD_STARTUP_DUMPREQ; - line6_start_timer(&pod->startup_timer, POD_STARTUP_DELAY, pod_startup2, - (unsigned long)pod); - - /* current channel dump: */ - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); -} - -static void pod_startup3(struct usb_line6_pod *pod) -{ struct usb_line6 *line6 = &pod->line6; CHECK_STARTUP_PROGRESS(pod->startup_progress, POD_STARTUP_VERSIONREQ); @@ -331,7 +306,7 @@ static void pod_startup3(struct usb_line6_pod *pod) line6_version_request_async(line6); } -static void pod_startup4(struct usb_line6_pod *pod) +static void pod_startup3(struct usb_line6_pod *pod) { CHECK_STARTUP_PROGRESS(pod->startup_progress, POD_STARTUP_WORKQUEUE); @@ -339,7 +314,7 @@ static void pod_startup4(struct usb_line6_pod *pod) schedule_work(&pod->startup_work); } -static void pod_startup5(struct work_struct *work) +static void pod_startup4(struct work_struct *work) { struct usb_line6_pod *pod = container_of(work, struct usb_line6_pod, startup_work); @@ -422,9 +397,6 @@ static void pod_destruct(struct usb_interface *interface) del_timer(&pod->startup_timer); cancel_work_sync(&pod->startup_work); - - /* free dump request data: */ - line6_dumpreq_destruct(&pod->dumpreq); } /* @@ -450,19 +422,11 @@ static int pod_try_init(struct usb_interface *interface, struct usb_line6 *line6 = &pod->line6; init_timer(&pod->startup_timer); - INIT_WORK(&pod->startup_work, pod_startup5); + INIT_WORK(&pod->startup_work, pod_startup4); if ((interface == NULL) || (pod == NULL)) return -ENODEV; - /* initialize USB buffers: */ - err = line6_dumpreq_init(&pod->dumpreq, pod_request_channel, - sizeof(pod_request_channel)); - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return -ENOMEM; - } - /* create sysfs entries: */ err = pod_create_files2(&interface->dev); if (err < 0) diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h index 843eb4e..3e3f167 100644 --- a/drivers/staging/line6/pod.h +++ b/drivers/staging/line6/pod.h @@ -19,7 +19,6 @@ #include <sound/core.h> #include "driver.h" -#include "dumprequest.h" /* PODxt Live interfaces @@ -45,7 +44,6 @@ */ enum { POD_STARTUP_INIT = 1, - POD_STARTUP_DUMPREQ, POD_STARTUP_VERSIONREQ, POD_STARTUP_WORKQUEUE, POD_STARTUP_SETUP, @@ -59,11 +57,6 @@ struct usb_line6_pod { struct usb_line6 line6; /** - Dump request structure. - */ - struct line6_dump_request dumpreq; - - /** Instrument monitor level. */ int monitor_level; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:52:00
|
The variax 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 <ste...@gm...> --- drivers/staging/line6/variax.c | 106 ++--------------------------------------- drivers/staging/line6/variax.h | 15 ------ 2 files changed, 4 insertions(+), 117 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 0262d7d..4fca58f 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -15,21 +15,10 @@ #include "driver.h" #include "variax.h" -#define VARIAX_MODEL_HEADER_LENGTH 7 -#define VARIAX_MODEL_MESSAGE_LENGTH 199 #define VARIAX_OFFSET_ACTIVATE 7 /* This message is sent by the device during initialization and identifies - the connected guitar model. -*/ -static const char variax_init_model[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x69, 0x02, - 0x00 -}; - -/* - This message is sent by the device during initialization and identifies the connected guitar version. */ static const char variax_init_version[] = { @@ -49,22 +38,6 @@ static const char variax_activate[] = { 0xf7 }; -static const char variax_request_bank[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x6d, 0xf7 -}; - -static const char variax_request_model1[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x3c, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x05, 0x03, - 0x00, 0x00, 0x00, 0xf7 -}; - -static const char variax_request_model2[] = { - 0xf0, 0x00, 0x01, 0x0c, 0x07, 0x00, 0x3c, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x03, - 0x00, 0x00, 0x00, 0xf7 -}; - /* forward declarations: */ static void variax_startup2(unsigned long data); static void variax_startup4(unsigned long data); @@ -135,26 +108,13 @@ static void variax_startup5(unsigned long data) { struct usb_line6_variax *variax = (struct usb_line6_variax *)data; CHECK_STARTUP_PROGRESS(variax->startup_progress, - VARIAX_STARTUP_DUMPREQ); - - /* current model dump: */ - line6_dump_request_async(&variax->dumpreq, &variax->line6, 0, - VARIAX_DUMP_PASS1); - /* passes 2 and 3 are performed implicitly before entering - * variax_startup6. - */ -} - -static void variax_startup6(struct usb_line6_variax *variax) -{ - CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_WORKQUEUE); /* schedule work for global work queue: */ schedule_work(&variax->startup_work); } -static void variax_startup7(struct work_struct *work) +static void variax_startup6(struct work_struct *work) { struct usb_line6_variax *variax = container_of(work, struct usb_line6_variax, startup_work); @@ -178,8 +138,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - line6_dump_request_async(&variax->dumpreq, &variax->line6, 0, - VARIAX_DUMP_PASS1); break; case LINE6_RESET: @@ -187,41 +145,14 @@ void line6_variax_process_message(struct usb_line6_variax *variax) break; case LINE6_SYSEX_BEGIN: - if (memcmp(buf + 1, variax_request_model1 + 1, - VARIAX_MODEL_HEADER_LENGTH - 1) == 0) { - if (variax->line6.message_length == - VARIAX_MODEL_MESSAGE_LENGTH) { - switch (variax->dumpreq.in_progress) { - case VARIAX_DUMP_PASS1: - line6_dump_request_async - (&variax->dumpreq, &variax->line6, - 1, VARIAX_DUMP_PASS2); - break; - - case VARIAX_DUMP_PASS2: - line6_dump_request_async - (&variax->dumpreq, &variax->line6, - 2, VARIAX_DUMP_PASS3); - } - } else { - dev_dbg(variax->line6.ifcdev, - "illegal length %d of model data\n", - variax->line6.message_length); - line6_dump_finished(&variax->dumpreq); - } - } else if (memcmp(buf + 1, variax_request_bank + 1, - sizeof(variax_request_bank) - 2) == 0) { - line6_dump_finished(&variax->dumpreq); - variax_startup6(variax); - } else if (memcmp(buf + 1, variax_init_version + 1, - sizeof(variax_init_version) - 1) == 0) { + if (memcmp(buf + 1, variax_init_version + 1, + sizeof(variax_init_version) - 1) == 0) { variax_startup3(variax); } else if (memcmp(buf + 1, variax_init_done + 1, sizeof(variax_init_done) - 1) == 0) { /* notify of complete initialization: */ variax_startup4((unsigned long)variax); } - break; case LINE6_SYSEX_END: @@ -248,11 +179,6 @@ static void variax_destruct(struct usb_interface *interface) del_timer(&variax->startup_timer2); cancel_work_sync(&variax->startup_work); - /* free dump request data: */ - line6_dumpreq_destructbuf(&variax->dumpreq, 2); - line6_dumpreq_destructbuf(&variax->dumpreq, 1); - line6_dumpreq_destruct(&variax->dumpreq); - kfree(variax->buffer_activate); } @@ -266,36 +192,12 @@ static int variax_try_init(struct usb_interface *interface, init_timer(&variax->startup_timer1); init_timer(&variax->startup_timer2); - INIT_WORK(&variax->startup_work, variax_startup7); + INIT_WORK(&variax->startup_work, variax_startup6); if ((interface == NULL) || (variax == NULL)) return -ENODEV; /* initialize USB buffers: */ - err = line6_dumpreq_init(&variax->dumpreq, variax_request_model1, - sizeof(variax_request_model1)); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - - err = line6_dumpreq_initbuf(&variax->dumpreq, variax_request_model2, - sizeof(variax_request_model2), 1); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - - err = line6_dumpreq_initbuf(&variax->dumpreq, variax_request_bank, - sizeof(variax_request_bank), 2); - - if (err < 0) { - dev_err(&interface->dev, "Out of memory\n"); - return err; - } - variax->buffer_activate = kmemdup(variax_activate, sizeof(variax_activate), GFP_KERNEL); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index 13d5680..24de796 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -18,7 +18,6 @@ #include <sound/core.h> #include "driver.h" -#include "dumprequest.h" #define VARIAX_STARTUP_DELAY1 1000 #define VARIAX_STARTUP_DELAY3 100 @@ -32,18 +31,11 @@ enum { VARIAX_STARTUP_VERSIONREQ, VARIAX_STARTUP_WAIT, VARIAX_STARTUP_ACTIVATE, - VARIAX_STARTUP_DUMPREQ, VARIAX_STARTUP_WORKQUEUE, VARIAX_STARTUP_SETUP, VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1 }; -enum { - VARIAX_DUMP_PASS1 = LINE6_DUMP_CURRENT, - VARIAX_DUMP_PASS2, - VARIAX_DUMP_PASS3 -}; - struct usb_line6_variax { /** Generic Line6 USB data. @@ -51,13 +43,6 @@ struct usb_line6_variax { struct usb_line6 line6; /** - Dump request structure. - Append two extra buffers for 3-pass data query. - */ - struct line6_dump_request dumpreq; - struct line6_dump_reqbuf extrabuf[2]; - - /** Buffer for activation code. */ unsigned char *buffer_activate; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:58
|
The sysfs attrs to access the model dump have been removed so it's safe to drop the model_data field. The next step will be to simplify the startup process since we no longer need to fetch this data via dump requests, but that will be done in a later patch. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 27 --------------------------- drivers/staging/line6/variax.h | 20 -------------------- 2 files changed, 47 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 0adba32..0262d7d 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -70,21 +70,6 @@ static void variax_startup2(unsigned long data); static void variax_startup4(unsigned long data); static void variax_startup5(unsigned long data); -/* - Decode data transmitted by workbench. -*/ -static void variax_decode(const unsigned char *raw_data, unsigned char *data, - int raw_size) -{ - for (; raw_size > 0; raw_size -= 6) { - data[2] = raw_data[0] | (raw_data[1] << 4); - data[1] = raw_data[2] | (raw_data[3] << 4); - data[0] = raw_data[4] | (raw_data[5] << 4); - raw_data += 6; - data += 3; - } -} - static void variax_activate_async(struct usb_line6_variax *variax, int a) { variax->buffer_activate[VARIAX_OFFSET_ACTIVATE] = a; @@ -214,18 +199,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) break; case VARIAX_DUMP_PASS2: - /* model name is transmitted twice, so skip it here: */ - variax_decode(buf + - VARIAX_MODEL_HEADER_LENGTH, - (unsigned char *) - &variax-> - model_data.control + - sizeof(variax->model_data. - control) - / 2, - sizeof(variax->model_data. - control) - / 2 * 2); line6_dump_request_async (&variax->dumpreq, &variax->line6, 2, VARIAX_DUMP_PASS3); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index f3d95fa..13d5680 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -44,21 +44,6 @@ enum { VARIAX_DUMP_PASS3 }; -/** - Binary Variax model dump -*/ -struct variax_model { - /** - Header information (including program name). - */ - unsigned char name[18]; - - /** - Model parameters. - */ - unsigned char control[78 * 2]; -}; - struct usb_line6_variax { /** Generic Line6 USB data. @@ -78,11 +63,6 @@ struct usb_line6_variax { unsigned char *buffer_activate; /** - Current model settings. - */ - struct variax_model model_data; - - /** Handler for device initializaton. */ struct work_struct startup_work; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:57
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/pod.c | 11 ----------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 16 deletions(-) diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index e892b4a..f8257be 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -132,15 +132,6 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, } /* - Handle SAVE button. -*/ -static void pod_save_button_pressed(struct usb_line6_pod *pod, int type, - int index) -{ - set_bit(POD_SAVE_PRESSED, &pod->atomic_flags); -} - -/* Process a completely received message. */ void line6_pod_process_message(struct usb_line6_pod *pod) @@ -166,7 +157,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST: - set_bit(POD_CHANNEL_DIRTY, &pod->atomic_flags); line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, LINE6_DUMP_CURRENT); break; @@ -196,7 +186,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) break; case POD_SYSEX_SAVE: - pod_save_button_pressed(pod, buf[6], buf[7]); break; case POD_SYSEX_STORE: diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h index 52534ca..843eb4e 100644 --- a/drivers/staging/line6/pod.h +++ b/drivers/staging/line6/pod.h @@ -84,11 +84,6 @@ struct usb_line6_pod { int startup_progress; /** - Some atomic flags. - */ - unsigned long atomic_flags; - - /** Serial number of device. */ int serial_number; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:55
|
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 <ste...@gm...> --- drivers/staging/line6/Makefile | 1 - drivers/staging/line6/control.c | 995 ---------------------------------------- drivers/staging/line6/control.h | 195 -------- drivers/staging/line6/driver.c | 1 - drivers/staging/line6/pod.c | 9 - drivers/staging/line6/variax.c | 13 - 6 files changed, 1214 deletions(-) delete mode 100644 drivers/staging/line6/control.c delete mode 100644 drivers/staging/line6/control.h diff --git a/drivers/staging/line6/Makefile b/drivers/staging/line6/Makefile index 34a2dda..44ee5ae 100644 --- a/drivers/staging/line6/Makefile +++ b/drivers/staging/line6/Makefile @@ -3,7 +3,6 @@ obj-$(CONFIG_LINE6_USB) += line6usb.o line6usb-y := \ audio.o \ capture.o \ - control.o \ driver.o \ dumprequest.o \ midi.o \ diff --git a/drivers/staging/line6/control.c b/drivers/staging/line6/control.c deleted file mode 100644 index f8326f5..0000000 --- a/drivers/staging/line6/control.c +++ /dev/null @@ -1,995 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (gr...@ic...) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#include <linux/usb.h> - -#include "control.h" -#include "driver.h" -#include "pod.h" -#include "usbdefs.h" -#include "variax.h" - -#define DEVICE_ATTR2(_name1, _name2, _mode, _show, _store) \ -struct device_attribute dev_attr_##_name1 = __ATTR(_name2, _mode, _show, _store) - -#define LINE6_PARAM_R(PREFIX, prefix, type, param) \ -static ssize_t prefix##_get_##param(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - return prefix##_get_param_##type(dev, buf, PREFIX##_##param); \ -} - -#define LINE6_PARAM_RW(PREFIX, prefix, type, param) \ -LINE6_PARAM_R(PREFIX, prefix, type, param); \ -static ssize_t prefix##_set_##param(struct device *dev, \ - struct device_attribute *attr, const char *buf, size_t count) \ -{ \ - return prefix##_set_param_##type(dev, buf, count, PREFIX##_##param); \ -} - -#define POD_PARAM_R(type, param) LINE6_PARAM_R(POD, pod, type, param) -#define POD_PARAM_RW(type, param) LINE6_PARAM_RW(POD, pod, type, param) -#define VARIAX_PARAM_R(type, param) LINE6_PARAM_R(VARIAX, variax, type, param) -#define VARIAX_PARAM_RW(type, param) LINE6_PARAM_RW(VARIAX, variax, type, param) - -static ssize_t pod_get_param_int(struct device *dev, char *buf, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&pod->dumpreq); - if (retval < 0) - return retval; - return sprintf(buf, "%d\n", pod->prog_data.control[param]); -} - -static ssize_t pod_set_param_int(struct device *dev, const char *buf, - size_t count, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_pod *pod = usb_get_intfdata(interface); - u8 value; - int retval; - - retval = kstrtou8(buf, 10, &value); - if (retval) - return retval; - - line6_pod_transmit_parameter(pod, param, value); - return count; -} - -static ssize_t variax_get_param_int(struct device *dev, char *buf, int param) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_variax *variax = usb_get_intfdata(interface); - int retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - return sprintf(buf, "%d\n", variax->model_data.control[param]); -} - -static ssize_t variax_get_param_float(struct device *dev, char *buf, int param) -{ - /* - We do our own floating point handling here since at the time - this code was written (Jan 2006) it was highly discouraged to - use floating point arithmetic in the kernel. If you think that - this no longer applies, feel free to replace this by generic - floating point code. - */ - - static const int BIAS = 0x7f; - static const int OFFSET = 0xf; - static const int PRECISION = 1000; - - int len = 0; - unsigned part_int, part_frac; - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6_variax *variax = usb_get_intfdata(interface); - const unsigned char *p = variax->model_data.control + param; - int retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - - if ((p[0] == 0) && (p[1] == 0) && (p[2] == 0)) - part_int = part_frac = 0; - else { - int exponent = (((p[0] & 0x7f) << 1) | (p[1] >> 7)) - BIAS; - unsigned mantissa = (p[1] << 8) | p[2] | 0x8000; - exponent -= OFFSET; - - if (exponent >= 0) { - part_int = mantissa << exponent; - part_frac = 0; - } else { - part_int = mantissa >> -exponent; - part_frac = (mantissa << (32 + exponent)) & 0xffffffff; - } - - part_frac = - (part_frac / ((1UL << 31) / (PRECISION / 2 * 10)) + 5) / 10; - } - - len += - sprintf(buf + len, "%s%d.%03d\n", ((p[0] & 0x80) ? "-" : ""), - part_int, part_frac); - return len; -} - -POD_PARAM_RW(int, tweak); -POD_PARAM_RW(int, wah_position); -POD_PARAM_RW(int, compression_gain); -POD_PARAM_RW(int, vol_pedal_position); -POD_PARAM_RW(int, compression_threshold); -POD_PARAM_RW(int, pan); -POD_PARAM_RW(int, amp_model_setup); -POD_PARAM_RW(int, amp_model); -POD_PARAM_RW(int, drive); -POD_PARAM_RW(int, bass); -POD_PARAM_RW(int, mid); -POD_PARAM_RW(int, lowmid); -POD_PARAM_RW(int, treble); -POD_PARAM_RW(int, highmid); -POD_PARAM_RW(int, chan_vol); -POD_PARAM_RW(int, reverb_mix); -POD_PARAM_RW(int, effect_setup); -POD_PARAM_RW(int, band_1_frequency); -POD_PARAM_RW(int, presence); -POD_PARAM_RW(int, treble__bass); -POD_PARAM_RW(int, noise_gate_enable); -POD_PARAM_RW(int, gate_threshold); -POD_PARAM_RW(int, gate_decay_time); -POD_PARAM_RW(int, stomp_enable); -POD_PARAM_RW(int, comp_enable); -POD_PARAM_RW(int, stomp_time); -POD_PARAM_RW(int, delay_enable); -POD_PARAM_RW(int, mod_param_1); -POD_PARAM_RW(int, delay_param_1); -POD_PARAM_RW(int, delay_param_1_note_value); -POD_PARAM_RW(int, band_2_frequency__bass); -POD_PARAM_RW(int, delay_param_2); -POD_PARAM_RW(int, delay_volume_mix); -POD_PARAM_RW(int, delay_param_3); -POD_PARAM_RW(int, reverb_enable); -POD_PARAM_RW(int, reverb_type); -POD_PARAM_RW(int, reverb_decay); -POD_PARAM_RW(int, reverb_tone); -POD_PARAM_RW(int, reverb_pre_delay); -POD_PARAM_RW(int, reverb_pre_post); -POD_PARAM_RW(int, band_2_frequency); -POD_PARAM_RW(int, band_3_frequency__bass); -POD_PARAM_RW(int, wah_enable); -POD_PARAM_RW(int, modulation_lo_cut); -POD_PARAM_RW(int, delay_reverb_lo_cut); -POD_PARAM_RW(int, volume_pedal_minimum); -POD_PARAM_RW(int, eq_pre_post); -POD_PARAM_RW(int, volume_pre_post); -POD_PARAM_RW(int, di_model); -POD_PARAM_RW(int, di_delay); -POD_PARAM_RW(int, mod_enable); -POD_PARAM_RW(int, mod_param_1_note_value); -POD_PARAM_RW(int, mod_param_2); -POD_PARAM_RW(int, mod_param_3); -POD_PARAM_RW(int, mod_param_4); -POD_PARAM_RW(int, mod_param_5); -POD_PARAM_RW(int, mod_volume_mix); -POD_PARAM_RW(int, mod_pre_post); -POD_PARAM_RW(int, modulation_model); -POD_PARAM_RW(int, band_3_frequency); -POD_PARAM_RW(int, band_4_frequency__bass); -POD_PARAM_RW(int, mod_param_1_double_precision); -POD_PARAM_RW(int, delay_param_1_double_precision); -POD_PARAM_RW(int, eq_enable); -POD_PARAM_RW(int, tap); -POD_PARAM_RW(int, volume_tweak_pedal_assign); -POD_PARAM_RW(int, band_5_frequency); -POD_PARAM_RW(int, tuner); -POD_PARAM_RW(int, mic_selection); -POD_PARAM_RW(int, cabinet_model); -POD_PARAM_RW(int, stomp_model); -POD_PARAM_RW(int, roomlevel); -POD_PARAM_RW(int, band_4_frequency); -POD_PARAM_RW(int, band_6_frequency); -POD_PARAM_RW(int, stomp_param_1_note_value); -POD_PARAM_RW(int, stomp_param_2); -POD_PARAM_RW(int, stomp_param_3); -POD_PARAM_RW(int, stomp_param_4); -POD_PARAM_RW(int, stomp_param_5); -POD_PARAM_RW(int, stomp_param_6); -POD_PARAM_RW(int, amp_switch_select); -POD_PARAM_RW(int, delay_param_4); -POD_PARAM_RW(int, delay_param_5); -POD_PARAM_RW(int, delay_pre_post); -POD_PARAM_RW(int, delay_model); -POD_PARAM_RW(int, delay_verb_model); -POD_PARAM_RW(int, tempo_msb); -POD_PARAM_RW(int, tempo_lsb); -POD_PARAM_RW(int, wah_model); -POD_PARAM_RW(int, bypass_volume); -POD_PARAM_RW(int, fx_loop_on_off); -POD_PARAM_RW(int, tweak_param_select); -POD_PARAM_RW(int, amp1_engage); -POD_PARAM_RW(int, band_1_gain); -POD_PARAM_RW(int, band_2_gain__bass); -POD_PARAM_RW(int, band_2_gain); -POD_PARAM_RW(int, band_3_gain__bass); -POD_PARAM_RW(int, band_3_gain); -POD_PARAM_RW(int, band_4_gain__bass); -POD_PARAM_RW(int, band_5_gain__bass); -POD_PARAM_RW(int, band_4_gain); -POD_PARAM_RW(int, band_6_gain__bass); -VARIAX_PARAM_R(int, body); -VARIAX_PARAM_R(int, pickup1_enable); -VARIAX_PARAM_R(int, pickup1_type); -VARIAX_PARAM_R(float, pickup1_position); -VARIAX_PARAM_R(float, pickup1_angle); -VARIAX_PARAM_R(float, pickup1_level); -VARIAX_PARAM_R(int, pickup2_enable); -VARIAX_PARAM_R(int, pickup2_type); -VARIAX_PARAM_R(float, pickup2_position); -VARIAX_PARAM_R(float, pickup2_angle); -VARIAX_PARAM_R(float, pickup2_level); -VARIAX_PARAM_R(int, pickup_phase); -VARIAX_PARAM_R(float, capacitance); -VARIAX_PARAM_R(float, tone_resistance); -VARIAX_PARAM_R(float, volume_resistance); -VARIAX_PARAM_R(int, taper); -VARIAX_PARAM_R(float, tone_dump); -VARIAX_PARAM_R(int, save_tone); -VARIAX_PARAM_R(float, volume_dump); -VARIAX_PARAM_R(int, tuning_enable); -VARIAX_PARAM_R(int, tuning6); -VARIAX_PARAM_R(int, tuning5); -VARIAX_PARAM_R(int, tuning4); -VARIAX_PARAM_R(int, tuning3); -VARIAX_PARAM_R(int, tuning2); -VARIAX_PARAM_R(int, tuning1); -VARIAX_PARAM_R(float, detune6); -VARIAX_PARAM_R(float, detune5); -VARIAX_PARAM_R(float, detune4); -VARIAX_PARAM_R(float, detune3); -VARIAX_PARAM_R(float, detune2); -VARIAX_PARAM_R(float, detune1); -VARIAX_PARAM_R(float, mix6); -VARIAX_PARAM_R(float, mix5); -VARIAX_PARAM_R(float, mix4); -VARIAX_PARAM_R(float, mix3); -VARIAX_PARAM_R(float, mix2); -VARIAX_PARAM_R(float, mix1); -VARIAX_PARAM_R(int, pickup_wiring); - -static DEVICE_ATTR(tweak, S_IWUSR | S_IRUGO, pod_get_tweak, pod_set_tweak); -static DEVICE_ATTR(wah_position, S_IWUSR | S_IRUGO, pod_get_wah_position, - pod_set_wah_position); -static DEVICE_ATTR(compression_gain, S_IWUSR | S_IRUGO, - pod_get_compression_gain, pod_set_compression_gain); -static DEVICE_ATTR(vol_pedal_position, S_IWUSR | S_IRUGO, - pod_get_vol_pedal_position, pod_set_vol_pedal_position); -static DEVICE_ATTR(compression_threshold, S_IWUSR | S_IRUGO, - pod_get_compression_threshold, - pod_set_compression_threshold); -static DEVICE_ATTR(pan, S_IWUSR | S_IRUGO, pod_get_pan, pod_set_pan); -static DEVICE_ATTR(amp_model_setup, S_IWUSR | S_IRUGO, pod_get_amp_model_setup, - pod_set_amp_model_setup); -static DEVICE_ATTR(amp_model, S_IWUSR | S_IRUGO, pod_get_amp_model, - pod_set_amp_model); -static DEVICE_ATTR(drive, S_IWUSR | S_IRUGO, pod_get_drive, pod_set_drive); -static DEVICE_ATTR(bass, S_IWUSR | S_IRUGO, pod_get_bass, pod_set_bass); -static DEVICE_ATTR(mid, S_IWUSR | S_IRUGO, pod_get_mid, pod_set_mid); -static DEVICE_ATTR(lowmid, S_IWUSR | S_IRUGO, pod_get_lowmid, pod_set_lowmid); -static DEVICE_ATTR(treble, S_IWUSR | S_IRUGO, pod_get_treble, pod_set_treble); -static DEVICE_ATTR(highmid, S_IWUSR | S_IRUGO, pod_get_highmid, - pod_set_highmid); -static DEVICE_ATTR(chan_vol, S_IWUSR | S_IRUGO, pod_get_chan_vol, - pod_set_chan_vol); -static DEVICE_ATTR(reverb_mix, S_IWUSR | S_IRUGO, pod_get_reverb_mix, - pod_set_reverb_mix); -static DEVICE_ATTR(effect_setup, S_IWUSR | S_IRUGO, pod_get_effect_setup, - pod_set_effect_setup); -static DEVICE_ATTR(band_1_frequency, S_IWUSR | S_IRUGO, - pod_get_band_1_frequency, pod_set_band_1_frequency); -static DEVICE_ATTR(presence, S_IWUSR | S_IRUGO, pod_get_presence, - pod_set_presence); -static DEVICE_ATTR2(treble__bass, treble, S_IWUSR | S_IRUGO, - pod_get_treble__bass, pod_set_treble__bass); -static DEVICE_ATTR(noise_gate_enable, S_IWUSR | S_IRUGO, - pod_get_noise_gate_enable, pod_set_noise_gate_enable); -static DEVICE_ATTR(gate_threshold, S_IWUSR | S_IRUGO, pod_get_gate_threshold, - pod_set_gate_threshold); -static DEVICE_ATTR(gate_decay_time, S_IWUSR | S_IRUGO, pod_get_gate_decay_time, - pod_set_gate_decay_time); -static DEVICE_ATTR(stomp_enable, S_IWUSR | S_IRUGO, pod_get_stomp_enable, - pod_set_stomp_enable); -static DEVICE_ATTR(comp_enable, S_IWUSR | S_IRUGO, pod_get_comp_enable, - pod_set_comp_enable); -static DEVICE_ATTR(stomp_time, S_IWUSR | S_IRUGO, pod_get_stomp_time, - pod_set_stomp_time); -static DEVICE_ATTR(delay_enable, S_IWUSR | S_IRUGO, pod_get_delay_enable, - pod_set_delay_enable); -static DEVICE_ATTR(mod_param_1, S_IWUSR | S_IRUGO, pod_get_mod_param_1, - pod_set_mod_param_1); -static DEVICE_ATTR(delay_param_1, S_IWUSR | S_IRUGO, pod_get_delay_param_1, - pod_set_delay_param_1); -static DEVICE_ATTR(delay_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_delay_param_1_note_value, - pod_set_delay_param_1_note_value); -static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUSR | S_IRUGO, - pod_get_band_2_frequency__bass, - pod_set_band_2_frequency__bass); -static DEVICE_ATTR(delay_param_2, S_IWUSR | S_IRUGO, pod_get_delay_param_2, - pod_set_delay_param_2); -static DEVICE_ATTR(delay_volume_mix, S_IWUSR | S_IRUGO, - pod_get_delay_volume_mix, pod_set_delay_volume_mix); -static DEVICE_ATTR(delay_param_3, S_IWUSR | S_IRUGO, pod_get_delay_param_3, - pod_set_delay_param_3); -static DEVICE_ATTR(reverb_enable, S_IWUSR | S_IRUGO, pod_get_reverb_enable, - pod_set_reverb_enable); -static DEVICE_ATTR(reverb_type, S_IWUSR | S_IRUGO, pod_get_reverb_type, - pod_set_reverb_type); -static DEVICE_ATTR(reverb_decay, S_IWUSR | S_IRUGO, pod_get_reverb_decay, - pod_set_reverb_decay); -static DEVICE_ATTR(reverb_tone, S_IWUSR | S_IRUGO, pod_get_reverb_tone, - pod_set_reverb_tone); -static DEVICE_ATTR(reverb_pre_delay, S_IWUSR | S_IRUGO, - pod_get_reverb_pre_delay, pod_set_reverb_pre_delay); -static DEVICE_ATTR(reverb_pre_post, S_IWUSR | S_IRUGO, pod_get_reverb_pre_post, - pod_set_reverb_pre_post); -static DEVICE_ATTR(band_2_frequency, S_IWUSR | S_IRUGO, - pod_get_band_2_frequency, pod_set_band_2_frequency); -static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUSR | S_IRUGO, - pod_get_band_3_frequency__bass, - pod_set_band_3_frequency__bass); -static DEVICE_ATTR(wah_enable, S_IWUSR | S_IRUGO, pod_get_wah_enable, - pod_set_wah_enable); -static DEVICE_ATTR(modulation_lo_cut, S_IWUSR | S_IRUGO, - pod_get_modulation_lo_cut, pod_set_modulation_lo_cut); -static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUSR | S_IRUGO, - pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut); -static DEVICE_ATTR(volume_pedal_minimum, S_IWUSR | S_IRUGO, - pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum); -static DEVICE_ATTR(eq_pre_post, S_IWUSR | S_IRUGO, pod_get_eq_pre_post, - pod_set_eq_pre_post); -static DEVICE_ATTR(volume_pre_post, S_IWUSR | S_IRUGO, pod_get_volume_pre_post, - pod_set_volume_pre_post); -static DEVICE_ATTR(di_model, S_IWUSR | S_IRUGO, pod_get_di_model, - pod_set_di_model); -static DEVICE_ATTR(di_delay, S_IWUSR | S_IRUGO, pod_get_di_delay, - pod_set_di_delay); -static DEVICE_ATTR(mod_enable, S_IWUSR | S_IRUGO, pod_get_mod_enable, - pod_set_mod_enable); -static DEVICE_ATTR(mod_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_mod_param_1_note_value, - pod_set_mod_param_1_note_value); -static DEVICE_ATTR(mod_param_2, S_IWUSR | S_IRUGO, pod_get_mod_param_2, - pod_set_mod_param_2); -static DEVICE_ATTR(mod_param_3, S_IWUSR | S_IRUGO, pod_get_mod_param_3, - pod_set_mod_param_3); -static DEVICE_ATTR(mod_param_4, S_IWUSR | S_IRUGO, pod_get_mod_param_4, - pod_set_mod_param_4); -static DEVICE_ATTR(mod_param_5, S_IWUSR | S_IRUGO, pod_get_mod_param_5, - pod_set_mod_param_5); -static DEVICE_ATTR(mod_volume_mix, S_IWUSR | S_IRUGO, pod_get_mod_volume_mix, - pod_set_mod_volume_mix); -static DEVICE_ATTR(mod_pre_post, S_IWUSR | S_IRUGO, pod_get_mod_pre_post, - pod_set_mod_pre_post); -static DEVICE_ATTR(modulation_model, S_IWUSR | S_IRUGO, - pod_get_modulation_model, pod_set_modulation_model); -static DEVICE_ATTR(band_3_frequency, S_IWUSR | S_IRUGO, - pod_get_band_3_frequency, pod_set_band_3_frequency); -static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUSR | S_IRUGO, - pod_get_band_4_frequency__bass, - pod_set_band_4_frequency__bass); -static DEVICE_ATTR(mod_param_1_double_precision, S_IWUSR | S_IRUGO, - pod_get_mod_param_1_double_precision, - pod_set_mod_param_1_double_precision); -static DEVICE_ATTR(delay_param_1_double_precision, S_IWUSR | S_IRUGO, - pod_get_delay_param_1_double_precision, - pod_set_delay_param_1_double_precision); -static DEVICE_ATTR(eq_enable, S_IWUSR | S_IRUGO, pod_get_eq_enable, - pod_set_eq_enable); -static DEVICE_ATTR(tap, S_IWUSR | S_IRUGO, pod_get_tap, pod_set_tap); -static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUSR | S_IRUGO, - pod_get_volume_tweak_pedal_assign, - pod_set_volume_tweak_pedal_assign); -static DEVICE_ATTR(band_5_frequency, S_IWUSR | S_IRUGO, - pod_get_band_5_frequency, pod_set_band_5_frequency); -static DEVICE_ATTR(tuner, S_IWUSR | S_IRUGO, pod_get_tuner, pod_set_tuner); -static DEVICE_ATTR(mic_selection, S_IWUSR | S_IRUGO, pod_get_mic_selection, - pod_set_mic_selection); -static DEVICE_ATTR(cabinet_model, S_IWUSR | S_IRUGO, pod_get_cabinet_model, - pod_set_cabinet_model); -static DEVICE_ATTR(stomp_model, S_IWUSR | S_IRUGO, pod_get_stomp_model, - pod_set_stomp_model); -static DEVICE_ATTR(roomlevel, S_IWUSR | S_IRUGO, pod_get_roomlevel, - pod_set_roomlevel); -static DEVICE_ATTR(band_4_frequency, S_IWUSR | S_IRUGO, - pod_get_band_4_frequency, pod_set_band_4_frequency); -static DEVICE_ATTR(band_6_frequency, S_IWUSR | S_IRUGO, - pod_get_band_6_frequency, pod_set_band_6_frequency); -static DEVICE_ATTR(stomp_param_1_note_value, S_IWUSR | S_IRUGO, - pod_get_stomp_param_1_note_value, - pod_set_stomp_param_1_note_value); -static DEVICE_ATTR(stomp_param_2, S_IWUSR | S_IRUGO, pod_get_stomp_param_2, - pod_set_stomp_param_2); -static DEVICE_ATTR(stomp_param_3, S_IWUSR | S_IRUGO, pod_get_stomp_param_3, - pod_set_stomp_param_3); -static DEVICE_ATTR(stomp_param_4, S_IWUSR | S_IRUGO, pod_get_stomp_param_4, - pod_set_stomp_param_4); -static DEVICE_ATTR(stomp_param_5, S_IWUSR | S_IRUGO, pod_get_stomp_param_5, - pod_set_stomp_param_5); -static DEVICE_ATTR(stomp_param_6, S_IWUSR | S_IRUGO, pod_get_stomp_param_6, - pod_set_stomp_param_6); -static DEVICE_ATTR(amp_switch_select, S_IWUSR | S_IRUGO, - pod_get_amp_switch_select, pod_set_amp_switch_select); -static DEVICE_ATTR(delay_param_4, S_IWUSR | S_IRUGO, pod_get_delay_param_4, - pod_set_delay_param_4); -static DEVICE_ATTR(delay_param_5, S_IWUSR | S_IRUGO, pod_get_delay_param_5, - pod_set_delay_param_5); -static DEVICE_ATTR(delay_pre_post, S_IWUSR | S_IRUGO, pod_get_delay_pre_post, - pod_set_delay_pre_post); -static DEVICE_ATTR(delay_model, S_IWUSR | S_IRUGO, pod_get_delay_model, - pod_set_delay_model); -static DEVICE_ATTR(delay_verb_model, S_IWUSR | S_IRUGO, - pod_get_delay_verb_model, pod_set_delay_verb_model); -static DEVICE_ATTR(tempo_msb, S_IWUSR | S_IRUGO, pod_get_tempo_msb, - pod_set_tempo_msb); -static DEVICE_ATTR(tempo_lsb, S_IWUSR | S_IRUGO, pod_get_tempo_lsb, - pod_set_tempo_lsb); -static DEVICE_ATTR(wah_model, S_IWUSR | S_IRUGO, pod_get_wah_model, - pod_set_wah_model); -static DEVICE_ATTR(bypass_volume, S_IWUSR | S_IRUGO, pod_get_bypass_volume, - pod_set_bypass_volume); -static DEVICE_ATTR(fx_loop_on_off, S_IWUSR | S_IRUGO, pod_get_fx_loop_on_off, - pod_set_fx_loop_on_off); -static DEVICE_ATTR(tweak_param_select, S_IWUSR | S_IRUGO, - pod_get_tweak_param_select, pod_set_tweak_param_select); -static DEVICE_ATTR(amp1_engage, S_IWUSR | S_IRUGO, pod_get_amp1_engage, - pod_set_amp1_engage); -static DEVICE_ATTR(band_1_gain, S_IWUSR | S_IRUGO, pod_get_band_1_gain, - pod_set_band_1_gain); -static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUSR | S_IRUGO, - pod_get_band_2_gain__bass, pod_set_band_2_gain__bass); -static DEVICE_ATTR(band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain, - pod_set_band_2_gain); -static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUSR | S_IRUGO, - pod_get_band_3_gain__bass, pod_set_band_3_gain__bass); -static DEVICE_ATTR(band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain, - pod_set_band_3_gain); -static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUSR | S_IRUGO, - pod_get_band_4_gain__bass, pod_set_band_4_gain__bass); -static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUSR | S_IRUGO, - pod_get_band_5_gain__bass, pod_set_band_5_gain__bass); -static DEVICE_ATTR(band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain, - pod_set_band_4_gain); -static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUSR | S_IRUGO, - pod_get_band_6_gain__bass, pod_set_band_6_gain__bass); -static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write); -static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable, - line6_nop_write); -static DEVICE_ATTR(pickup1_type, S_IRUGO, variax_get_pickup1_type, - line6_nop_write); -static DEVICE_ATTR(pickup1_position, S_IRUGO, variax_get_pickup1_position, - line6_nop_write); -static DEVICE_ATTR(pickup1_angle, S_IRUGO, variax_get_pickup1_angle, - line6_nop_write); -static DEVICE_ATTR(pickup1_level, S_IRUGO, variax_get_pickup1_level, - line6_nop_write); -static DEVICE_ATTR(pickup2_enable, S_IRUGO, variax_get_pickup2_enable, - line6_nop_write); -static DEVICE_ATTR(pickup2_type, S_IRUGO, variax_get_pickup2_type, - line6_nop_write); -static DEVICE_ATTR(pickup2_position, S_IRUGO, variax_get_pickup2_position, - line6_nop_write); -static DEVICE_ATTR(pickup2_angle, S_IRUGO, variax_get_pickup2_angle, - line6_nop_write); -static DEVICE_ATTR(pickup2_level, S_IRUGO, variax_get_pickup2_level, - line6_nop_write); -static DEVICE_ATTR(pickup_phase, S_IRUGO, variax_get_pickup_phase, - line6_nop_write); -static DEVICE_ATTR(capacitance, S_IRUGO, variax_get_capacitance, - line6_nop_write); -static DEVICE_ATTR(tone_resistance, S_IRUGO, variax_get_tone_resistance, - line6_nop_write); -static DEVICE_ATTR(volume_resistance, S_IRUGO, variax_get_volume_resistance, - line6_nop_write); -static DEVICE_ATTR(taper, S_IRUGO, variax_get_taper, line6_nop_write); -static DEVICE_ATTR(tone_dump, S_IRUGO, variax_get_tone_dump, line6_nop_write); -static DEVICE_ATTR(save_tone, S_IRUGO, variax_get_save_tone, line6_nop_write); -static DEVICE_ATTR(volume_dump, S_IRUGO, variax_get_volume_dump, - line6_nop_write); -static DEVICE_ATTR(tuning_enable, S_IRUGO, variax_get_tuning_enable, - line6_nop_write); -static DEVICE_ATTR(tuning6, S_IRUGO, variax_get_tuning6, line6_nop_write); -static DEVICE_ATTR(tuning5, S_IRUGO, variax_get_tuning5, line6_nop_write); -static DEVICE_ATTR(tuning4, S_IRUGO, variax_get_tuning4, line6_nop_write); -static DEVICE_ATTR(tuning3, S_IRUGO, variax_get_tuning3, line6_nop_write); -static DEVICE_ATTR(tuning2, S_IRUGO, variax_get_tuning2, line6_nop_write); -static DEVICE_ATTR(tuning1, S_IRUGO, variax_get_tuning1, line6_nop_write); -static DEVICE_ATTR(detune6, S_IRUGO, variax_get_detune6, line6_nop_write); -static DEVICE_ATTR(detune5, S_IRUGO, variax_get_detune5, line6_nop_write); -static DEVICE_ATTR(detune4, S_IRUGO, variax_get_detune4, line6_nop_write); -static DEVICE_ATTR(detune3, S_IRUGO, variax_get_detune3, line6_nop_write); -static DEVICE_ATTR(detune2, S_IRUGO, variax_get_detune2, line6_nop_write); -static DEVICE_ATTR(detune1, S_IRUGO, variax_get_detune1, line6_nop_write); -static DEVICE_ATTR(mix6, S_IRUGO, variax_get_mix6, line6_nop_write); -static DEVICE_ATTR(mix5, S_IRUGO, variax_get_mix5, line6_nop_write); -static DEVICE_ATTR(mix4, S_IRUGO, variax_get_mix4, line6_nop_write); -static DEVICE_ATTR(mix3, S_IRUGO, variax_get_mix3, line6_nop_write); -static DEVICE_ATTR(mix2, S_IRUGO, variax_get_mix2, line6_nop_write); -static DEVICE_ATTR(mix1, S_IRUGO, variax_get_mix1, line6_nop_write); -static DEVICE_ATTR(pickup_wiring, S_IRUGO, variax_get_pickup_wiring, - line6_nop_write); - -int line6_pod_create_files(int firmware, int type, struct device *dev) -{ - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_tweak)); - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_position)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_compression_gain)); - CHECK_RETURN(device_create_file(dev, &dev_attr_vol_pedal_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_compression_threshold)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pan)); - CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model_setup)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_amp_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_drive)); - CHECK_RETURN(device_create_file(dev, &dev_attr_bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_mid)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_lowmid)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_treble)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_highmid)); - CHECK_RETURN(device_create_file(dev, &dev_attr_chan_vol)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_effect_setup)); - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_1_frequency)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_presence)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_treble__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_noise_gate_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_gate_threshold)); - CHECK_RETURN(device_create_file(dev, &dev_attr_gate_decay_time)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_comp_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_time)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_1)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_param_1_note_value)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_frequency__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_volume_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_3)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_enable)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_type)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_decay)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_reverb_tone)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_reverb_pre_delay)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_reverb_pre_post)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_frequency__bass)); - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_enable)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_modulation_lo_cut)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_reverb_lo_cut)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_volume_pedal_minimum)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_eq_pre_post)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_pre_post)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_di_model)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_di_delay)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_1_note_value)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_4)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_volume_mix)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mod_pre_post)); - CHECK_RETURN(device_create_file(dev, &dev_attr_modulation_model)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_frequency__bass)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_mod_param_1_double_precision)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_param_1_double_precision)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_eq_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tap)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_volume_tweak_pedal_assign)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_5_frequency)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuner)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mic_selection)); - CHECK_RETURN(device_create_file(dev, &dev_attr_cabinet_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_roomlevel)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_frequency)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_6_frequency)); - CHECK_RETURN(device_create_file - (dev, &dev_attr_stomp_param_1_note_value)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_stomp_param_6)); - if ((type & (LINE6_BITS_LIVE)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_amp_switch_select)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_param_5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_pre_post)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_delay_model)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - CHECK_RETURN(device_create_file - (dev, &dev_attr_delay_verb_model)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_msb)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tempo_lsb)); - if (firmware >= 300) - CHECK_RETURN(device_create_file(dev, &dev_attr_wah_model)); - if (firmware >= 214) - CHECK_RETURN(device_create_file(dev, &dev_attr_bypass_volume)); - if ((type & (LINE6_BITS_PRO)) != 0) - CHECK_RETURN(device_create_file(dev, &dev_attr_fx_loop_on_off)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tweak_param_select)); - CHECK_RETURN(device_create_file(dev, &dev_attr_amp1_engage)); - if (firmware >= 200) - CHECK_RETURN(device_create_file(dev, &dev_attr_band_1_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_2_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_3_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_gain__bass)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_5_gain__bass)); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_4_gain)); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - CHECK_RETURN(device_create_file - (dev, &dev_attr_band_6_gain__bass)); - return 0; -} - -void line6_pod_remove_files(int firmware, int type, struct device *dev) -{ - device_remove_file(dev, &dev_attr_tweak); - device_remove_file(dev, &dev_attr_wah_position); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_compression_gain); - device_remove_file(dev, &dev_attr_vol_pedal_position); - device_remove_file(dev, &dev_attr_compression_threshold); - device_remove_file(dev, &dev_attr_pan); - device_remove_file(dev, &dev_attr_amp_model_setup); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_amp_model); - device_remove_file(dev, &dev_attr_drive); - device_remove_file(dev, &dev_attr_bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_mid); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_lowmid); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_treble); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_highmid); - device_remove_file(dev, &dev_attr_chan_vol); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_mix); - device_remove_file(dev, &dev_attr_effect_setup); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_1_frequency); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_presence); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_treble__bass); - device_remove_file(dev, &dev_attr_noise_gate_enable); - device_remove_file(dev, &dev_attr_gate_threshold); - device_remove_file(dev, &dev_attr_gate_decay_time); - device_remove_file(dev, &dev_attr_stomp_enable); - device_remove_file(dev, &dev_attr_comp_enable); - device_remove_file(dev, &dev_attr_stomp_time); - device_remove_file(dev, &dev_attr_delay_enable); - device_remove_file(dev, &dev_attr_mod_param_1); - device_remove_file(dev, &dev_attr_delay_param_1); - device_remove_file(dev, &dev_attr_delay_param_1_note_value); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_2_frequency__bass); - device_remove_file(dev, &dev_attr_delay_param_2); - device_remove_file(dev, &dev_attr_delay_volume_mix); - device_remove_file(dev, &dev_attr_delay_param_3); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_enable); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_type); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_decay); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_tone); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_pre_delay); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_reverb_pre_post); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_3_frequency__bass); - device_remove_file(dev, &dev_attr_wah_enable); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_modulation_lo_cut); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_reverb_lo_cut); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_volume_pedal_minimum); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_eq_pre_post); - device_remove_file(dev, &dev_attr_volume_pre_post); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_di_model); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_di_delay); - device_remove_file(dev, &dev_attr_mod_enable); - device_remove_file(dev, &dev_attr_mod_param_1_note_value); - device_remove_file(dev, &dev_attr_mod_param_2); - device_remove_file(dev, &dev_attr_mod_param_3); - device_remove_file(dev, &dev_attr_mod_param_4); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_mod_param_5); - device_remove_file(dev, &dev_attr_mod_volume_mix); - device_remove_file(dev, &dev_attr_mod_pre_post); - device_remove_file(dev, &dev_attr_modulation_model); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, - &dev_attr_band_4_frequency__bass); - device_remove_file(dev, &dev_attr_mod_param_1_double_precision); - device_remove_file(dev, &dev_attr_delay_param_1_double_precision); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_eq_enable); - device_remove_file(dev, &dev_attr_tap); - device_remove_file(dev, &dev_attr_volume_tweak_pedal_assign); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_5_frequency); - device_remove_file(dev, &dev_attr_tuner); - device_remove_file(dev, &dev_attr_mic_selection); - device_remove_file(dev, &dev_attr_cabinet_model); - device_remove_file(dev, &dev_attr_stomp_model); - device_remove_file(dev, &dev_attr_roomlevel); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_frequency); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_6_frequency); - device_remove_file(dev, &dev_attr_stomp_param_1_note_value); - device_remove_file(dev, &dev_attr_stomp_param_2); - device_remove_file(dev, &dev_attr_stomp_param_3); - device_remove_file(dev, &dev_attr_stomp_param_4); - device_remove_file(dev, &dev_attr_stomp_param_5); - device_remove_file(dev, &dev_attr_stomp_param_6); - if ((type & (LINE6_BITS_LIVE)) != 0) - device_remove_file(dev, &dev_attr_amp_switch_select); - device_remove_file(dev, &dev_attr_delay_param_4); - device_remove_file(dev, &dev_attr_delay_param_5); - device_remove_file(dev, &dev_attr_delay_pre_post); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_model); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - device_remove_file(dev, &dev_attr_delay_verb_model); - device_remove_file(dev, &dev_attr_tempo_msb); - device_remove_file(dev, &dev_attr_tempo_lsb); - if (firmware >= 300) - device_remove_file(dev, &dev_attr_wah_model); - if (firmware >= 214) - device_remove_file(dev, &dev_attr_bypass_volume); - if ((type & (LINE6_BITS_PRO)) != 0) - device_remove_file(dev, &dev_attr_fx_loop_on_off); - device_remove_file(dev, &dev_attr_tweak_param_select); - device_remove_file(dev, &dev_attr_amp1_engage); - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_1_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_2_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_3_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_gain__bass); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_5_gain__bass); - if ((type & (LINE6_BITS_PODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_4_gain); - if ((type & (LINE6_BITS_BASSPODXTALL)) != 0) - if (firmware >= 200) - device_remove_file(dev, &dev_attr_band_6_gain__bass); -} - -int line6_variax_create_files(int firmware, int type, struct device *dev) -{ - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_body)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_type)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_angle)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup1_level)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_type)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_position)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_angle)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup2_level)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_phase)); - CHECK_RETURN(device_create_file(dev, &dev_attr_capacitance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tone_resistance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_resistance)); - CHECK_RETURN(device_create_file(dev, &dev_attr_taper)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tone_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_save_tone)); - CHECK_RETURN(device_create_file(dev, &dev_attr_volume_dump)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning_enable)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_tuning1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_detune1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix6)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix5)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix4)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix3)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix2)); - CHECK_RETURN(device_create_file(dev, &dev_attr_mix1)); - CHECK_RETURN(device_create_file(dev, &dev_attr_pickup_wiring)); - return 0; -} - -void line6_variax_remove_files(int firmware, int type, struct device *dev) -{ - device_remove_file(dev, &dev_attr_body); - device_remove_file(dev, &dev_attr_pickup1_enable); - device_remove_file(dev, &dev_attr_pickup1_type); - device_remove_file(dev, &dev_attr_pickup1_position); - device_remove_file(dev, &dev_attr_pickup1_angle); - device_remove_file(dev, &dev_attr_pickup1_level); - device_remove_file(dev, &dev_attr_pickup2_enable); - device_remove_file(dev, &dev_attr_pickup2_type); - device_remove_file(dev, &dev_attr_pickup2_position); - device_remove_file(dev, &dev_attr_pickup2_angle); - device_remove_file(dev, &dev_attr_pickup2_level); - device_remove_file(dev, &dev_attr_pickup_phase); - device_remove_file(dev, &dev_attr_capacitance); - device_remove_file(dev, &dev_attr_tone_resistance); - device_remove_file(dev, &dev_attr_volume_resistance); - device_remove_file(dev, &dev_attr_taper); - device_remove_file(dev, &dev_attr_tone_dump); - device_remove_file(dev, &dev_attr_save_tone); - device_remove_file(dev, &dev_attr_volume_dump); - device_remove_file(dev, &dev_attr_tuning_enable); - device_remove_file(dev, &dev_attr_tuning6); - device_remove_file(dev, &dev_attr_tuning5); - device_remove_file(dev, &dev_attr_tuning4); - device_remove_file(dev, &dev_attr_tuning3); - device_remove_file(dev, &dev_attr_tuning2); - device_remove_file(dev, &dev_attr_tuning1); - device_remove_file(dev, &dev_attr_detune6); - device_remove_file(dev, &dev_attr_detune5); - device_remove_file(dev, &dev_attr_detune4); - device_remove_file(dev, &dev_attr_detune3); - device_remove_file(dev, &dev_attr_detune2); - device_remove_file(dev, &dev_attr_detune1); - device_remove_file(dev, &dev_attr_mix6); - device_remove_file(dev, &dev_attr_mix5); - device_remove_file(dev, &dev_attr_mix4); - device_remove_file(dev, &dev_attr_mix3); - device_remove_file(dev, &dev_attr_mix2); - device_remove_file(dev, &dev_attr_mix1); - device_remove_file(dev, &dev_attr_pickup_wiring); -} diff --git a/drivers/staging/line6/control.h b/drivers/staging/line6/control.h deleted file mode 100644 index e4c5d2c..0000000 --- a/drivers/staging/line6/control.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Line6 Linux USB driver - 0.9.1beta - * - * Copyright (C) 2004-2010 Markus Grabner (gr...@ic...) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - */ - -#ifndef LINE6_CONTROL_H -#define LINE6_CONTROL_H - -/** - List of PODxt Pro controls. - See Appendix C of the "PODxt (Pro) Pilot's Handbook" by Line6. - Comments after the number refer to the PODxt Pro firmware version required - for this feature. - - Please *don't* reformat this file since "control.c" is created automatically - from "control.h", and this process depends on the exact formatting of the - code and the comments below! -*/ - -/* *INDENT-OFF* */ - -enum { - POD_tweak = 1, - POD_wah_position = 4, - POD_compression_gain = 5, /* device: LINE6_BITS_PODXTALL */ - POD_vol_pedal_position = 7, - POD_compression_threshold = 9, - POD_pan = 10, - POD_amp_model_setup = 11, - POD_amp_model = 12, /* firmware: 2.0 */ - POD_drive = 13, - POD_bass = 14, - POD_mid = 15, /* device: LINE6_BITS_PODXTALL */ - POD_lowmid = 15, /* device: LINE6_BITS_BASSPODXTALL */ - POD_treble = 16, /* device: LINE6_BITS_PODXTALL */ - POD_highmid = 16, /* device: LINE6_BITS_BASSPODXTALL */ - POD_chan_vol = 17, - POD_reverb_mix = 18, /* device: LINE6_BITS_PODXTALL */ - POD_effect_setup = 19, - POD_band_1_frequency = 20, /* firmware: 2.0 */ - POD_presence = 21, /* device: LINE6_BITS_PODXTALL */ - POD_treble__bass = 21, /* device: LINE6_BITS_BASSPODXTALL */ - POD_noise_gate_enable = 22, - POD_gate_threshold = 23, - POD_gate_decay_time = 24, - POD_stomp_enable = 25, - POD_comp_enable = 26, - POD_stomp_time = 27, - POD_delay_enable = 28, - POD_mod_param_1 = 29, - POD_delay_param_1 = 30, - POD_delay_param_1_note_value = 31, - POD_band_2_frequency__bass = 32, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_delay_param_2 = 33, - POD_delay_volume_mix = 34, - POD_delay_param_3 = 35, - POD_reverb_enable = 36, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_type = 37, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_decay = 38, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_tone = 39, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_pre_delay = 40, /* device: LINE6_BITS_PODXTALL */ - POD_reverb_pre_post = 41, /* device: LINE6_BITS_PODXTALL */ - POD_band_2_frequency = 42, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_3_frequency__bass = 42, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_wah_enable = 43, - POD_modulation_lo_cut = 44, /* device: LINE6_BITS_BASSPODXTALL */ - POD_delay_reverb_lo_cut = 45, /* device: LINE6_BITS_BASSPODXTALL */ - POD_volume_pedal_minimum = 46, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_eq_pre_post = 46, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_volume_pre_post = 47, - POD_di_model = 48, /* device: LINE6_BITS_BASSPODXTALL */ - POD_di_delay = 49, /* device: LINE6_BITS_BASSPODXTALL */ - POD_mod_enable = 50, - POD_mod_param_1_note_value = 51, - POD_mod_param_2 = 52, - POD_mod_param_3 = 53, - POD_mod_param_4 = 54, - POD_mod_param_5 = 55, /* device: LINE6_BITS_BASSPODXTALL */ - POD_mod_volume_mix = 56, - POD_mod_pre_post = 57, - POD_modulation_model = 58, - POD_band_3_frequency = 60, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_4_frequency__bass = 60, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_mod_param_1_double_precision = 61, - POD_delay_param_1_double_precision = 62, - POD_eq_enable = 63, /* firmware: 2.0 */ - POD_tap = 64, - POD_volume_tweak_pedal_assign = 65, - POD_band_5_frequency = 68, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_tuner = 69, - POD_mic_selection = 70, - POD_cabinet_model = 71, - POD_stomp_model = 75, - POD_roomlevel = 76, - POD_band_4_frequency = 77, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_6_frequency = 77, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_stomp_param_1_note_value = 78, - POD_stomp_param_2 = 79, - POD_stomp_param_3 = 80, - POD_stomp_param_4 = 81, - POD_stomp_param_5 = 82, - POD_stomp_param_6 = 83, - POD_amp_switch_select = 84, /* device: LINE6_BITS_LIVE */ - POD_delay_param_4 = 85, - POD_delay_param_5 = 86, - POD_delay_pre_post = 87, - POD_delay_model = 88, /* device: LINE6_BITS_PODXTALL */ - POD_delay_verb_model = 88, /* device: LINE6_BITS_BASSPODXTALL */ - POD_tempo_msb = 89, - POD_tempo_lsb = 90, - POD_wah_model = 91, /* firmware: 3.0 */ - POD_bypass_volume = 105, /* firmware: 2.14 */ - POD_fx_loop_on_off = 107, /* device: LINE6_BITS_PRO */ - POD_tweak_param_select = 108, - POD_amp1_engage = 111, - POD_band_1_gain = 114, /* firmware: 2.0 */ - POD_band_2_gain__bass = 115, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_2_gain = 116, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_3_gain__bass = 116, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_3_gain = 117, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_4_gain__bass = 117, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_5_gain__bass = 118, /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ - POD_band_4_gain = 119, /* device: LINE6_BITS_PODXTALL */ /* firmware: 2.0 */ - POD_band_6_gain__bass = 119 /* device: LINE6_BITS_BASSPODXTALL */ /* firmware: 2.0 */ -}; - -/** - List of Variax workbench controls (dump). -*/ -enum { - VARIAX_body = 3, - VARIAX_pickup1_enable = 4, /* 0: enabled, 1: disabled */ - VARIAX_pickup1_type = 8, - VARIAX_pickup1_position = 9, /* type: 24 bit float */ - VARIAX_pickup1_angle = 12, /* type: 24 bit float */ - VARIAX_pickup1_level = 15, /* type: 24 bit float */ - VARIAX_pickup2_enable = 18, /* 0: enabled, 1: disabled */ - VARIAX_pickup2_type = 22, - VARIAX_pickup2_position = 23, /* type: 24 bit float */ - VARIAX_pickup2_angle = 26, /* type: 24 bit float */ - VARIAX_pickup2_level = 29, /* type: 24 bit float */ - VARIAX_pickup_phase = 32, /* 0: in phase, 1: out of phase */ - VARIAX_capacitance = 33, /* type: 24 bit float */ - VARIAX_tone_resistance = 36, /* type: 24 bit float */ - VARIAX_volume_resistance = 39, /* type: 24 bit float */ - VARIAX_taper = 42, /* 0: Linear, 1: Audio */ - VARIAX_tone_dump = 43, /* type: 24 bit float */ - VARIAX_save_tone = 46, - VARIAX_volume_dump = 47, /* type: 24 bit float */ - VARIAX_tuning_enable = 50, - VARIAX_tuning6 = 51, - VARIAX_tuning5 = 52, - VARIAX_tuning4 = 53, - VARIAX_tuning3 = 54, - VARIAX_tuning2 = 55, - VARIAX_tuning1 = 56, - VARIAX_detune6 = 57, /* type: 24 bit float */ - VARIAX_detune5 = 60, /* type: 24 bit float */ - VARIAX_detune4 = 63, /* type: 24 bit float */ - VARIAX_detune3 = 66, /* type: 24 bit float */ - VARIAX_detune2 = 69, /* type: 24 bit float */ - VARIAX_detune1 = 72, /* type: 24 bit float */ - VARIAX_mix6 = 75, /* type: 24 bit float */ - VARIAX_mix5 = 78, /* type: 24 bit float */ - VARIAX_mix4 = 81, /* type: 24 bit float */ - VARIAX_mix3 = 84, /* type: 24 bit float */ - VARIAX_mix2 = 87, /* type: 24 bit float */ - VARIAX_mix1 = 90, /* type: 24 bit float */ - VARIAX_pickup_wiring = 96 /* 0: parallel, 1: series */ -}; - -/** - List of Variax workbench controls (MIDI). -*/ -enum { - VARIAXMIDI_volume = 7, - VARIAXMIDI_tone = 79, -}; - -/* *INDENT-ON* */ - -extern int line6_pod_create_files(int firmware, int type, struct device *dev); -extern void line6_pod_remove_files(int firmware, int type, struct device *dev); -extern int line6_variax_create_files(int firmware, int type, - struct device *dev); -extern void line6_variax_remove_files(int firmware, int type, - struct device *dev); - -#endif diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index c0986f5..f5c19b2 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -16,7 +16,6 @@ #include "audio.h" #include "capture.h" -#include "control.h" #include "driver.h" #include "midi.h" #include "playback.h" diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index aa3a547..278976d 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -15,7 +15,6 @@ #include "audio.h" #include "capture.h" -#include "control.h" #include "driver.h" #include "playback.h" #include "pod.h" @@ -404,10 +403,6 @@ static void pod_startup5(struct work_struct *work) /* ALSA audio interface: */ line6_register_audio(line6); - - /* device files: */ - line6_pod_create_files(pod->firmware_version, - line6->properties->device_bit, line6->ifcdev); } /* POD special files: */ @@ -594,10 +589,6 @@ void line6_pod_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ - line6_pod_remove_files(pod->firmware_version, - pod->line6. - properties->device_bit, dev); - device_remove_file(dev, &dev_attr_device_id); device_remove_file(dev, &dev_attr_firmware_version); device_remove_file(dev, &dev_attr_serial_number); diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index ff55ad37..0adba32 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -12,7 +12,6 @@ #include <linux/slab.h> #include "audio.h" -#include "control.h" #include "driver.h" #include "variax.h" @@ -174,15 +173,11 @@ static void variax_startup7(struct work_struct *work) { struct usb_line6_variax *variax = container_of(work, struct usb_line6_variax, startup_work); - struct usb_line6 *line6 = &variax->line6; CHECK_STARTUP_PROGRESS(variax->startup_progress, VARIAX_STARTUP_SETUP); /* ALSA audio interface: */ line6_register_audio(&variax->line6); - - /* device files: */ - line6_variax_create_files(0, 0, line6->ifcdev); } /* @@ -370,16 +365,8 @@ int line6_variax_init(struct usb_interface *interface, */ void line6_variax_disconnect(struct usb_interface *interface) { - struct device *dev; - if (interface == NULL) return; - dev = &interface->dev; - - if (dev != NULL) { - /* remove sysfs entries: */ - line6_variax_remove_files(0, 0, dev); - } variax_destruct(interface); } -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:55
|
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 <ste...@gm...> --- drivers/staging/line6/pod.c | 46 +++------------------------------------------ drivers/staging/line6/pod.h | 25 ------------------------ 2 files changed, 3 insertions(+), 68 deletions(-) diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index 278976d..e892b4a 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -132,14 +132,6 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, } /* - Store parameter value in driver memory. -*/ -static void pod_store_parameter(struct usb_line6_pod *pod, int param, int value) -{ - pod->prog_data.control[param] = value; -} - -/* Handle SAVE button. */ static void pod_save_button_pressed(struct usb_line6_pod *pod, int type, @@ -169,9 +161,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) /* process all remaining messages */ switch (buf[0]) { case LINE6_PARAM_CHANGE | LINE6_CHANNEL_DEVICE: - pod_store_parameter(pod, buf[1], buf[2]); - /* intentionally no break here! */ - case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: break; @@ -187,36 +176,8 @@ void line6_pod_process_message(struct usb_line6_pod *pod) if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) { switch (buf[5]) { case POD_SYSEX_DUMP: - if (pod->line6.message_length == - sizeof(pod->prog_data) + 7) { - switch (pod->dumpreq.in_progress) { - case LINE6_DUMP_CURRENT: - memcpy(&pod->prog_data, buf + 7, - sizeof(pod->prog_data)); - break; - - case POD_DUMP_MEMORY: - memcpy(&pod->prog_data_buf, - buf + 7, - sizeof - (pod->prog_data_buf)); - break; - - default: - dev_dbg(pod->line6.ifcdev, - "unknown dump code %02X\n", - pod->dumpreq.in_progress); - } - - line6_dump_finished(&pod->dumpreq); - pod_startup3(pod); - } else - dev_dbg(pod->line6.ifcdev, - "wrong size of channel dump message (%d instead of %d)\n", - pod->line6.message_length, - (int)sizeof(pod->prog_data) + - 7); - + line6_dump_finished(&pod->dumpreq); + pod_startup3(pod); break; case POD_SYSEX_SYSTEM:{ @@ -279,8 +240,7 @@ void line6_pod_process_message(struct usb_line6_pod *pod) void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, u8 value) { - if (line6_transmit_parameter(&pod->line6, param, value) == 0) - pod_store_parameter(pod, param, value); + line6_transmit_parameter(&pod->line6, param, value); } /* diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h index 8543bae..52534ca 100644 --- a/drivers/staging/line6/pod.h +++ b/drivers/staging/line6/pod.h @@ -52,21 +52,6 @@ enum { POD_STARTUP_LAST = POD_STARTUP_SETUP - 1 }; -/** - Binary PODxt Pro program dump -*/ -struct pod_program { - /** - Header information (including program name). - */ - unsigned char header[0x20]; - - /** - Program parameters. - */ - unsigned char control[POD_CONTROL_SIZE]; -}; - struct usb_line6_pod { /** Generic Line6 USB data. @@ -79,16 +64,6 @@ struct usb_line6_pod { struct line6_dump_request dumpreq; /** - Current program settings. - */ - struct pod_program prog_data; - - /** - Buffer for data retrieved from or to be stored on PODxt Pro. - */ - struct pod_program prog_data_buf; - - /** Instrument monitor level. */ int monitor_level; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:53
|
Now that both pod.c and variax.c have removed their raw sysfs attrs, the CONFIG_LINE6_USB_RAW config option can be dropped. The drivers are being stripped down to just PCM and MIDI I/O so there is less state and filtering. Therefore it's no longer necessary to have a special sysfs attr to bypass the filtering ("raw"). Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/Kconfig | 11 ----------- drivers/staging/line6/driver.c | 14 -------------- 2 files changed, 25 deletions(-) diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig index a5ded12..2a84767 100644 --- a/drivers/staging/line6/Kconfig +++ b/drivers/staging/line6/Kconfig @@ -51,17 +51,6 @@ config LINE6_USB_DUMP_PCM If unsure, say N. -config LINE6_USB_RAW - bool "raw data communication" - default n - help - Say Y here to create special files which allow to send raw data - to the device. This bypasses any sanity checks, so if you discover - the code to erase the firmware, feel free to render your device - useless, but only after reading the GPL section "NO WARRANTY". - - If unsure, say N. - config LINE6_USB_IMPULSE_RESPONSE bool "measure impulse response" default n diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c index 3c27051..c0986f5 100644 --- a/drivers/staging/line6/driver.c +++ b/drivers/staging/line6/driver.c @@ -681,20 +681,6 @@ ssize_t line6_nop_write(struct device *dev, struct device_attribute *attr, } /* - "write" request on "raw" special file. -*/ -#ifdef CONFIG_LINE6_USB_RAW -ssize_t line6_set_raw(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_interface *interface = to_usb_interface(dev); - struct usb_line6 *line6 = usb_get_intfdata(interface); - line6_send_raw_message(line6, buf, count); - return count; -} -#endif - -/* Generic destructor. */ static void line6_destruct(struct usb_interface *interface) -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:52
|
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 <ste...@gm...> --- drivers/staging/line6/pod.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index 157ef68..aa3a547 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c @@ -174,12 +174,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) /* intentionally no break here! */ case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - if ((buf[1] == POD_amp_model_setup) || - (buf[1] == POD_effect_setup)) - /* these also affect other settings */ - line6_dump_request_async(&pod->dumpreq, &pod->line6, 0, - LINE6_DUMP_CURRENT); - break; case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: @@ -288,9 +282,6 @@ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, { if (line6_transmit_parameter(&pod->line6, param, value) == 0) pod_store_parameter(pod, param, value); - - if ((param == POD_amp_model_setup) || (param == POD_effect_setup)) /* these also affect other settings */ - line6_invalidate_current(&pod->dumpreq); } /* -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:52
|
Note that VARIAX_SYSEX_ACTIVATE was never used so drop it along with the other VARIAX_SYSEX_* constants which are now unused. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 73 ------------------------------------------ 1 file changed, 73 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 4db21a3..ff55ad37 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -16,9 +16,6 @@ #include "driver.h" #include "variax.h" -#define VARIAX_SYSEX_CODE 7 -#define VARIAX_SYSEX_PARAM 0x3b -#define VARIAX_SYSEX_ACTIVATE 0x2a #define VARIAX_MODEL_HEADER_LENGTH 7 #define VARIAX_MODEL_MESSAGE_LENGTH 199 #define VARIAX_OFFSET_ACTIVATE 7 @@ -70,7 +67,6 @@ static const char variax_request_model2[] = { }; /* forward declarations: */ -static int variax_create_files2(struct device *dev); static void variax_startup2(unsigned long data); static void variax_startup4(unsigned long data); static void variax_startup5(unsigned long data); @@ -187,7 +183,6 @@ static void variax_startup7(struct work_struct *work) /* device files: */ line6_variax_create_files(0, 0, line6->ifcdev); - variax_create_files2(line6->ifcdev); } /* @@ -270,58 +265,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) } } -#ifdef CONFIG_LINE6_USB_RAW - -static char *variax_alloc_sysex_buffer(struct usb_line6_variax *variax, - int code, int size) -{ - return line6_alloc_sysex_buffer(&variax->line6, VARIAX_SYSEX_CODE, code, - size); -} - -/* - "write" request on "raw" special file. -*/ -static ssize_t variax_set_raw2(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - int size; - int i; - char *sysex; - - count -= count % 3; - size = count * 2; - sysex = variax_alloc_sysex_buffer(variax, VARIAX_SYSEX_PARAM, size); - - if (!sysex) - return 0; - - for (i = 0; i < count; i += 3) { - const unsigned char *p1 = buf + i; - char *p2 = sysex + SYSEX_DATA_OFS + i * 2; - p2[0] = p1[2] & 0x0f; - p2[1] = p1[2] >> 4; - p2[2] = p1[1] & 0x0f; - p2[3] = p1[1] >> 4; - p2[4] = p1[0] & 0x0f; - p2[5] = p1[0] >> 4; - } - - line6_send_sysex_message(&variax->line6, sysex, size); - kfree(sysex); - return count; -} - -#endif - -#ifdef CONFIG_LINE6_USB_RAW -static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); -static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2); -#endif - /* Variax destructor. */ @@ -346,18 +289,6 @@ static void variax_destruct(struct usb_interface *interface) } /* - Create sysfs entries. -*/ -static int variax_create_files2(struct device *dev) -{ -#ifdef CONFIG_LINE6_USB_RAW - CHECK_RETURN(device_create_file(dev, &dev_attr_raw)); - CHECK_RETURN(device_create_file(dev, &dev_attr_raw2)); -#endif - return 0; -} - -/* Try to init workbench device. */ static int variax_try_init(struct usb_interface *interface, @@ -448,10 +379,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); -#ifdef CONFIG_LINE6_USB_RAW - device_remove_file(dev, &dev_attr_raw); - device_remove_file(dev, &dev_attr_raw2); -#endif } variax_destruct(interface); -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:47
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 22 ---------------------- drivers/staging/line6/variax.h | 5 ----- 2 files changed, 27 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 4600d24..4db21a3 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -250,11 +250,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) sizeof(variax_request_bank) - 2) == 0) { line6_dump_finished(&variax->dumpreq); variax_startup6(variax); - } else if (memcmp(buf + 1, variax_init_model + 1, - sizeof(variax_init_model) - 1) == 0) { - memcpy(variax->guitar, - buf + sizeof(variax_init_model), - sizeof(variax->guitar)); } else if (memcmp(buf + 1, variax_init_version + 1, sizeof(variax_init_version) - 1) == 0) { variax_startup3(variax); @@ -275,17 +270,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) } } -/* - "read" request on "guitar" special file. -*/ -static ssize_t variax_get_guitar(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%s\n", variax->guitar); -} - #ifdef CONFIG_LINE6_USB_RAW static char *variax_alloc_sysex_buffer(struct usb_line6_variax *variax, @@ -333,9 +317,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif -/* Variax workbench special files: */ -static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); - #ifdef CONFIG_LINE6_USB_RAW static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2); @@ -369,8 +350,6 @@ static void variax_destruct(struct usb_interface *interface) */ static int variax_create_files2(struct device *dev) { - int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_guitar)); #ifdef CONFIG_LINE6_USB_RAW CHECK_RETURN(device_create_file(dev, &dev_attr_raw)); CHECK_RETURN(device_create_file(dev, &dev_attr_raw2)); @@ -469,7 +448,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_guitar); #ifdef CONFIG_LINE6_USB_RAW device_remove_file(dev, &dev_attr_raw); device_remove_file(dev, &dev_attr_raw2); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index b5d6a66..f3d95fa 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -83,11 +83,6 @@ struct usb_line6_variax { struct variax_model model_data; /** - Name of connected guitar. - */ - unsigned char guitar[18]; - - /** Handler for device initializaton. */ struct work_struct startup_work; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:45
|
The get_string() function has no other callers so remove it too. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 0f1846e..4600d24 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -276,38 +276,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) } /* - "read" request on "active" special file. -*/ -static ssize_t variax_get_active(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", - variax->buffer_activate[VARIAX_OFFSET_ACTIVATE]); -} - -/* - "write" request on "active" special file. -*/ -static ssize_t variax_set_active(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - variax_activate_async(variax, value ? 1 : 0); - return count; -} - -/* "read" request on "guitar" special file. */ static ssize_t variax_get_guitar(struct device *dev, @@ -366,8 +334,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, - variax_set_active); static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); #ifdef CONFIG_LINE6_USB_RAW @@ -404,7 +370,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_active)); CHECK_RETURN(device_create_file(dev, &dev_attr_guitar)); #ifdef CONFIG_LINE6_USB_RAW CHECK_RETURN(device_create_file(dev, &dev_attr_raw)); @@ -504,7 +469,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_active); device_remove_file(dev, &dev_attr_guitar); #ifdef CONFIG_LINE6_USB_RAW device_remove_file(dev, &dev_attr_raw); -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:44
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 8eec139..0f1846e 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -308,23 +308,6 @@ static ssize_t variax_set_active(struct device *dev, } /* - "read" request on "dump" special file. -*/ -static ssize_t variax_get_dump(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - int retval; - retval = line6_dump_wait_interruptible(&variax->dumpreq); - if (retval < 0) - return retval; - memcpy(buf, &variax->model_data.control, - sizeof(variax->model_data.control)); - return sizeof(variax->model_data.control); -} - -/* "read" request on "guitar" special file. */ static ssize_t variax_get_guitar(struct device *dev, @@ -383,7 +366,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, variax_set_active); static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); @@ -422,7 +404,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); CHECK_RETURN(device_create_file(dev, &dev_attr_active)); CHECK_RETURN(device_create_file(dev, &dev_attr_guitar)); #ifdef CONFIG_LINE6_USB_RAW @@ -523,7 +504,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_dump); device_remove_file(dev, &dev_attr_active); device_remove_file(dev, &dev_attr_guitar); #ifdef CONFIG_LINE6_USB_RAW -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:42
|
The get_string() function is no longer used so drop it too. Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 34 ---------------------------------- drivers/staging/line6/variax.h | 5 ----- 2 files changed, 39 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 94a9f71..8eec139 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -248,9 +248,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) } } else if (memcmp(buf + 1, variax_request_bank + 1, sizeof(variax_request_bank) - 2) == 0) { - memcpy(variax->bank, - buf + sizeof(variax_request_bank) - 1, - sizeof(variax->bank)); line6_dump_finished(&variax->dumpreq); variax_startup6(variax); } else if (memcmp(buf + 1, variax_init_model + 1, @@ -310,34 +307,6 @@ static ssize_t variax_set_active(struct device *dev, return count; } -static ssize_t get_string(char *buf, const char *data, int length) -{ - int i; - memcpy(buf, data, length); - - for (i = length; i--;) { - char c = buf[i]; - - if ((c != 0) && (c != ' ')) - break; - } - - buf[i + 1] = '\n'; - return i + 2; -} - -/* - "read" request on "bank" special file. -*/ -static ssize_t variax_get_bank(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - line6_dump_wait_interruptible(&variax->dumpreq); - return get_string(buf, variax->bank, sizeof(variax->bank)); -} - /* "read" request on "dump" special file. */ @@ -414,7 +383,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, variax_set_active); @@ -454,7 +422,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_bank)); CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); CHECK_RETURN(device_create_file(dev, &dev_attr_active)); CHECK_RETURN(device_create_file(dev, &dev_attr_guitar)); @@ -556,7 +523,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_bank); device_remove_file(dev, &dev_attr_dump); device_remove_file(dev, &dev_attr_active); device_remove_file(dev, &dev_attr_guitar); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index 745b5a1..b5d6a66 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -88,11 +88,6 @@ struct usb_line6_variax { unsigned char guitar[18]; /** - Name of current model bank. - */ - unsigned char bank[18]; - - /** Handler for device initializaton. */ struct work_struct startup_work; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:41
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 31ece34..94a9f71 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -218,17 +218,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) VARIAX_MODEL_MESSAGE_LENGTH) { switch (variax->dumpreq.in_progress) { case VARIAX_DUMP_PASS1: - variax_decode(buf + - VARIAX_MODEL_HEADER_LENGTH, - (unsigned char *) - &variax->model_data, - (sizeof - (variax->model_data. - name) + - sizeof(variax-> - model_data. - control) - / 2) * 2); line6_dump_request_async (&variax->dumpreq, &variax->line6, 1, VARIAX_DUMP_PASS2); @@ -338,19 +327,6 @@ static ssize_t get_string(char *buf, const char *data, int length) } /* - "read" request on "name" special file. -*/ -static ssize_t variax_get_name(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - line6_dump_wait_interruptible(&variax->dumpreq); - return get_string(buf, variax->model_data.name, - sizeof(variax->model_data.name)); -} - -/* "read" request on "bank" special file. */ static ssize_t variax_get_bank(struct device *dev, @@ -438,7 +414,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, @@ -479,7 +454,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_name)); CHECK_RETURN(device_create_file(dev, &dev_attr_bank)); CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); CHECK_RETURN(device_create_file(dev, &dev_attr_active)); @@ -582,7 +556,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_name); device_remove_file(dev, &dev_attr_bank); device_remove_file(dev, &dev_attr_dump); device_remove_file(dev, &dev_attr_active); -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:39
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 42 ------------------------------------------ drivers/staging/line6/variax.h | 5 ----- 2 files changed, 47 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index ef78f5a..31ece34 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -199,11 +199,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) switch (buf[0]) { case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: - switch (buf[1]) { - case VARIAXMIDI_tone: - variax->tone = buf[2]; - } - break; case LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_DEVICE: @@ -326,40 +321,6 @@ static ssize_t variax_set_active(struct device *dev, return count; } -/* - "read" request on "tone" special file. -*/ -static ssize_t variax_get_tone(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", variax->tone); -} - -/* - "write" request on "tone" special file. -*/ -static ssize_t variax_set_tone(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_tone, - value) == 0) - variax->tone = value; - - return count; -} - static ssize_t get_string(char *buf, const char *data, int length) { int i; @@ -477,7 +438,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(tone, S_IWUSR | S_IRUGO, variax_get_tone, variax_set_tone); static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); @@ -519,7 +479,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_tone)); CHECK_RETURN(device_create_file(dev, &dev_attr_name)); CHECK_RETURN(device_create_file(dev, &dev_attr_bank)); CHECK_RETURN(device_create_file(dev, &dev_attr_dump)); @@ -623,7 +582,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_tone); device_remove_file(dev, &dev_attr_name); device_remove_file(dev, &dev_attr_bank); device_remove_file(dev, &dev_attr_dump); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index 426c90c..745b5a1 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -93,11 +93,6 @@ struct usb_line6_variax { unsigned char bank[18]; /** - Position of tone control dial. - */ - int tone; - - /** Handler for device initializaton. */ struct work_struct startup_work; -- 1.8.0 |
From: Stefan H. <ste...@gm...> - 2012-11-22 19:51:36
|
Signed-off-by: Stefan Hajnoczi <ste...@gm...> --- drivers/staging/line6/variax.c | 42 ------------------------------------------ drivers/staging/line6/variax.h | 5 ----- 2 files changed, 47 deletions(-) diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index e76255b..ef78f5a 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c @@ -200,10 +200,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) switch (buf[0]) { case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST: switch (buf[1]) { - case VARIAXMIDI_volume: - variax->volume = buf[2]; - break; - case VARIAXMIDI_tone: variax->tone = buf[2]; } @@ -299,40 +295,6 @@ void line6_variax_process_message(struct usb_line6_variax *variax) } /* - "read" request on "volume" special file. -*/ -static ssize_t variax_get_volume(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - return sprintf(buf, "%d\n", variax->volume); -} - -/* - "write" request on "volume" special file. -*/ -static ssize_t variax_set_volume(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - struct usb_line6_variax *variax = - usb_get_intfdata(to_usb_interface(dev)); - u8 value; - int ret; - - ret = kstrtou8(buf, 10, &value); - if (ret) - return ret; - - if (line6_transmit_parameter(&variax->line6, VARIAXMIDI_volume, - value) == 0) - variax->volume = value; - - return count; -} - -/* "read" request on "active" special file. */ static ssize_t variax_get_active(struct device *dev, @@ -515,8 +477,6 @@ static ssize_t variax_set_raw2(struct device *dev, #endif /* Variax workbench special files: */ -static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO, variax_get_volume, - variax_set_volume); static DEVICE_ATTR(tone, S_IWUSR | S_IRUGO, variax_get_tone, variax_set_tone); static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); @@ -559,7 +519,6 @@ static void variax_destruct(struct usb_interface *interface) static int variax_create_files2(struct device *dev) { int err; - CHECK_RETURN(device_create_file(dev, &dev_attr_volume)); CHECK_RETURN(device_create_file(dev, &dev_attr_tone)); CHECK_RETURN(device_create_file(dev, &dev_attr_name)); CHECK_RETURN(device_create_file(dev, &dev_attr_bank)); @@ -664,7 +623,6 @@ void line6_variax_disconnect(struct usb_interface *interface) if (dev != NULL) { /* remove sysfs entries: */ line6_variax_remove_files(0, 0, dev); - device_remove_file(dev, &dev_attr_volume); device_remove_file(dev, &dev_attr_tone); device_remove_file(dev, &dev_attr_name); device_remove_file(dev, &dev_attr_bank); diff --git a/drivers/staging/line6/variax.h b/drivers/staging/line6/variax.h index 4151c14..426c90c 100644 --- a/drivers/staging/line6/variax.h +++ b/drivers/staging/line6/variax.h @@ -93,11 +93,6 @@ struct usb_line6_variax { unsigned char bank[18]; /** - Position of volume dial. - */ - int volume; - - /** Position of tone control dial. */ int tone; -- 1.8.0 |