staging: line6: drop MIDI state sysfs attrs
cover staging: line6: drop MIDI state sysfs attrs
Let's put the line6 staging driver on a diet for Thanksgiving! :)
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.
Testing would be appreciated and especially necessary for POD XT and Variax devices where the startup process has been modified. I only have access to a POD HD300 device which doesn't take these code paths.
The only MIDI processing left are initialization commands and the monitor volume level, which remains in the kernel because the driver presents an ALSA volume control.
Stefan Hajnoczi (46):
staging: line6: drop channel sysfs attr
staging: line6: drop clip sysfs attr
staging: line6: drop unused param_dirty bitmap
staging: line6: drop dirty sysfs attr
staging: line6: drop dump sysfs attr
staging: line6: drop dump_buf sysfs attr
staging: line6: drop monitor_level sysfs attr
staging: line6: change monitor_level type ValueWait -> int
staging: line6: drop name sysfs attr
staging: line6: drop name_buf sysfs attr
staging: line6: drop retrieve_amp_setup sysfs attr
staging: line6: drop retrieve_channel sysfs attr
staging: line6: drop retrieve_effects_setup sysfs attr
staging: line6: drop store_amp_setup sysfs attr
staging: line6: drop store_channel sysfs attr
staging: line6: drop store_effects_setup sysfs attr
staging: line6: drop routing sysfs attr
staging: line6: drop tuner_freq sysfs attr
staging: line6: drop tuner_note sysfs attr
staging: line6: drop tuner_mute sysfs attr
staging: line6: drop tuner_pitch sysfs attr
staging: line6: drop finish sysfs attr
staging: line6: drop midi_postprocess sysfs attr
staging: line6: drop midi_mask_receive
staging: line6: drop midi_mask_transmit
staging: line6: drop midi_postprocess flag
staging: line6: drop pod.c raw sysfs attr
staging: line6: drop tuner param filtering
staging: line6: drop variax model sysfs attr
staging: line6: drop variax volume sysfs attr
staging: line6: drop variax tone sysfs attr
staging: line6: drop variax name sysfs attr
staging: line6: drop variax bank sysfs attr
staging: line6: drop variax dump sysfs attr
staging: line6: drop variax active sysfs attr
staging: line6: drop variax guitar sysfs attr
staging: line6: drop variax raw sysfs attrs
staging: line6: drop CONFIG_LINE6_USB_RAW
staging: line6: drop amp/effects dump request triggers
staging: line6: drop MIDI parameter sysfs attrs
staging: line6: drop pod prog_data buffers
staging: line6: drop unused pod atomic_flags field
staging: line6: drop variax model_data field
staging: line6: drop dump requests from variax startup
staging: line6: drop dump requests from pod startup
staging: line6: drop unused dumprequest code
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
Signature · 1 line
1.8.0
PATCH 1/46 staging: line6: drop channel sysfs attr
--- drivers/staging/line6/pod.c | 51 --------------------------------------------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 56 deletions(-)
drivers/staging/line6/pod.c +0 -51
@@ -223,7 +223,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 : - pod->channel_num = buf[1 ]; pod->dirty =0 ;set_bit (POD_CHANNEL_DIRTY , &pod->atomic_flags); line6_dump_request_async(&pod->dumpreq, &pod->line6, 0,
@@ -388,19 +387,6 @@ void line6_pod_midi_postprocess(struct usb_line6_pod *pod, unsigned char *data, }/* -Send channel number (i.e., switch to a different sound). -*/ -static void pod_send_channel (struct usb_line6_pod *pod,u8 value) -{ -line6_invalidate_current (&pod->dumpreq); - -if (line6_send_program (&pod->line6, value) ==0 ) - pod->channel_num = value; -else -line6_dump_finished (&pod->dumpreq); -} - -/* Transmit PODxt Pro control parameter. */ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
@@ -526,37 +512,6 @@ static ssize_t get_name_generic(struct usb_line6_pod *pod, const char *str, }/* -"read" request on "channel" special file. -*/ -static ssize_t pod_get_channel (struct device *dev, -struct device_attribute *attr,char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -return sprintf (buf,"%d\n" , pod->channel_num); -} - -/* -"write" request on "channel" special file. -*/ -static ssize_t pod_set_channel (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -u8 value; -int ret; - - ret =kstrtou8 (buf,10 , &value); -if (ret) -return ret; - -pod_send_channel (pod, value); -return count; -} - -/* "read" request on "name" special file. */ static ssize_t pod_get_name(struct device *dev, struct device_attribute *attr,
@@ -1036,8 +991,6 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1);#undef GET_SYSTEM_PARAM/* POD special files: */ -static DEVICE_ATTR(channel, S_IWUSR | S_IRUGO, pod_get_channel, - pod_set_channel); static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write);
@@ -1153,7 +1106,6 @@ static int pod_create_files2(struct device *dev) {int err; -CHECK_RETURN (device_create_file (dev, &dev_attr_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_clip));CHECK_RETURN (device_create_file (dev, &dev_attr_device_id));CHECK_RETURN (device_create_file (dev, &dev_attr_dirty));
@@ -1200,8 +1152,6 @@ static int pod_try_init(struct usb_interface *interface,if ((interface ==NULL ) || (pod ==NULL ))return -ENODEV ; - pod->channel_num =255 ; -/* initialize wait queues: */ init_waitqueue_head (&pod->monitor_level.wait);init_waitqueue_head (&pod->routing.wait);
@@ -1300,7 +1250,6 @@ void line6_pod_disconnect(struct usb_interface *interface) pod->line6. properties->device_bit, dev); -device_remove_file (dev, &dev_attr_channel);device_remove_file (dev, &dev_attr_clip);device_remove_file (dev, &dev_attr_device_id);device_remove_file (dev, &dev_attr_dirty);
drivers/staging/line6/pod.h +0 -5
@@ -89,11 +89,6 @@ struct usb_line6_pod {struct line6_dump_request dumpreq;/** -Current program number. -*/ -unsigned char channel_num; - -/** Current program settings. */ struct pod_program prog_data;
Signature · 1 line
1.8.0
PATCH 2/46 staging: line6: drop clip sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 23 ----------------------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 28 deletions(-)
drivers/staging/line6/pod.c +0 -23
@@ -26,7 +26,6 @@/* *INDENT-OFF* */ enum { -POD_SYSEX_CLIP =0x0f ,POD_SYSEX_SAVE =0x24 ,POD_SYSEX_SYSTEM =0x56 ,POD_SYSEX_SYSTEMREQ =0x57 ,
@@ -311,12 +310,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)pod_save_button_pressed (pod, buf[6 ], buf[7 ]);break ; -case POD_SYSEX_CLIP : -dev_dbg (pod->line6.ifcdev,"audio clipped\n" ); - pod->clipping.value =1 ; -wake_up (&pod->clipping.wait); -break ; -case POD_SYSEX_STORE : dev_dbg(pod->line6.ifcdev, "message %02X not yet implemented\n",
@@ -879,18 +872,6 @@ static ssize_t pod_get_device_id(struct device *dev, }/* -"read" request on "clip" special file. -*/ -static ssize_t pod_wait_for_clip (struct device *dev, -struct device_attribute *attr,char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -return wait_event_interruptible (pod->clipping.wait, - pod->clipping.value !=0 ); -} - -/* POD startup procedure. This is a sequence of functions with special requirements (e.g., must not run immediately after initialization, must not run in interrupt
@@ -991,7 +972,6 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1);#undef GET_SYSTEM_PARAM/* POD special files: */ -static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump);
@@ -1106,7 +1086,6 @@ static int pod_create_files2(struct device *dev) {int err; -CHECK_RETURN (device_create_file (dev, &dev_attr_clip));CHECK_RETURN (device_create_file (dev, &dev_attr_device_id));CHECK_RETURN (device_create_file (dev, &dev_attr_dirty));CHECK_RETURN (device_create_file (dev, &dev_attr_dump));
@@ -1159,7 +1138,6 @@ static int pod_try_init(struct usb_interface *interface,init_waitqueue_head (&pod->tuner_freq.wait);init_waitqueue_head (&pod->tuner_note.wait);init_waitqueue_head (&pod->tuner_pitch.wait); -init_waitqueue_head (&pod->clipping.wait);memset (pod->param_dirty,0xff ,sizeof (pod->param_dirty));
@@ -1250,7 +1228,6 @@ void line6_pod_disconnect(struct usb_interface *interface) pod->line6. properties->device_bit, dev); -device_remove_file (dev, &dev_attr_clip);device_remove_file (dev, &dev_attr_device_id);device_remove_file (dev, &dev_attr_dirty);device_remove_file (dev, &dev_attr_dump);
drivers/staging/line6/pod.h +0 -5
@@ -133,11 +133,6 @@ struct usb_line6_pod {struct ValueWait routing;/** -Wait for audio clipping event. -*/ -struct ValueWait clipping; - -/** Timer for device initializaton. */ struct timer_list startup_timer;
Signature · 1 line
1.8.0
PATCH 3/46 staging: line6: drop unused param_dirty bitmap
In reply to Stefan HajnocziThe param_dirty bitmap tracks which parameters have been modified since saving a preset. The bitmap is never used though so we can drop this deadcode.
--- drivers/staging/line6/pod.c | 16 ---------------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 21 deletions(-)
drivers/staging/line6/pod.c +0 -16
@@ -130,17 +130,6 @@ 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); -/* -Mark all parameters as dirty and notify waiting processes. -*/ -static void pod_mark_batch_all_dirty (struct usb_line6_pod *pod) -{ -int i; - -for (i =0 ; i <POD_CONTROL_SIZE ; i++) -set_bit (i, pod->param_dirty); -} -static char *pod_alloc_sysex_buffer (struct usb_line6_pod *pod,int code,int size) {
@@ -163,7 +152,6 @@ static void pod_dump(struct usb_line6_pod *pod, const unsigned char *data)memcpy (sysex +SYSEX_DATA_OFS +1 , data,sizeof (pod->prog_data));line6_send_sysex_message (&pod->line6, sysex, size);memcpy (&pod->prog_data, data,sizeof (pod->prog_data)); -pod_mark_batch_all_dirty (pod);kfree (sysex); }
@@ -173,7 +161,6 @@ static void pod_dump(struct usb_line6_pod *pod, const unsigned char *data)static void pod_store_parameter (struct usb_line6_pod *pod,int param,int value) { pod->prog_data.control[param] = value; -set_bit (param, pod->param_dirty); pod->dirty =1 ; }
@@ -239,7 +226,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)case LINE6_DUMP_CURRENT :memcpy (&pod->prog_data, buf +7 ,sizeof (pod->prog_data)); -pod_mark_batch_all_dirty (pod);break ;case POD_DUMP_MEMORY :
@@ -1139,8 +1125,6 @@ static int pod_try_init(struct usb_interface *interface,init_waitqueue_head (&pod->tuner_note.wait);init_waitqueue_head (&pod->tuner_pitch.wait); -memset (pod->param_dirty,0xff ,sizeof (pod->param_dirty)); -/* initialize USB buffers: */ err =line6_dumpreq_init (&pod->dumpreq, pod_request_channel,sizeof (pod_request_channel));
drivers/staging/line6/pod.h +0 -5
@@ -148,11 +148,6 @@ struct usb_line6_pod {int startup_progress;/** -Dirty flags for access to parameter data. -*/ -unsigned long param_dirty[POD_CONTROL_SIZE /sizeof (unsigned long )]; - -/** Some atomic flags. */ unsigned long atomic_flags;
Signature · 1 line
1.8.0
PATCH 4/46 staging: line6: drop dirty sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 21 +-------------------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 1 insertion(+), 25 deletions(-)
drivers/staging/line6/pod.c +1 -20
@@ -156,12 +156,11 @@ static void pod_dump(struct usb_line6_pod *pod, const unsigned char *data) }/* -Store parameter value in driver memory and mark it as dirty. +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; - pod->dirty =1 ; }/*
@@ -170,7 +169,6 @@ static void pod_store_parameter(struct usb_line6_pod *pod, int param, int value)static void pod_save_button_pressed (struct usb_line6_pod *pod,int type,int index) { - pod->dirty =0 ;set_bit (POD_SAVE_PRESSED , &pod->atomic_flags); }
@@ -209,7 +207,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 : - pod->dirty =0 ;set_bit (POD_CHANNEL_DIRTY , &pod->atomic_flags);line6_dump_request_async (&pod->dumpreq, &pod->line6,0 ,LINE6_DUMP_CURRENT );
@@ -778,19 +775,6 @@ static ssize_t pod_set_retrieve_amp_setup(struct device *dev, }/* -"read" request on "dirty" special file. -*/ -static ssize_t pod_get_dirty (struct device *dev,struct device_attribute *attr, -char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); - buf[0 ] = pod->dirty ?'1' :'0' ; - buf[1 ] ='\n' ; -return 2 ; -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -959,7 +943,6 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1);/* POD special files: */ static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); -static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump); static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, pod_set_dump_buf);
@@ -1073,7 +1056,6 @@ static int pod_create_files2(struct device *dev)int err;CHECK_RETURN (device_create_file (dev, &dev_attr_device_id)); -CHECK_RETURN (device_create_file (dev, &dev_attr_dirty));CHECK_RETURN (device_create_file (dev, &dev_attr_dump));CHECK_RETURN (device_create_file (dev, &dev_attr_dump_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_finish));
@@ -1213,7 +1195,6 @@ void line6_pod_disconnect(struct usb_interface *interface) properties->device_bit, dev);device_remove_file (dev, &dev_attr_device_id); -device_remove_file (dev, &dev_attr_dirty);device_remove_file (dev, &dev_attr_dump);device_remove_file (dev, &dev_attr_dump_buf);device_remove_file (dev, &dev_attr_finish);
drivers/staging/line6/pod.h +0 -5
@@ -168,11 +168,6 @@ struct usb_line6_pod {int device_id;/** -Flag to indicate modification of current program settings. -*/ -char dirty; - -/** Flag to enable MIDI postprocessing. */ char midi_postprocess;
Signature · 1 line
1.8.0
PATCH 5/46 staging: line6: drop dump sysfs attr
In reply to Stefan HajnocziOnce further sysfs attrs have been removed it will also be possible to drop prog_data and other pieces which we keep for now.
--- drivers/staging/line6/pod.c | 60 +++------------------------------------------ 1 file changed, 3 insertions(+), 57 deletions(-)
drivers/staging/line6/pod.c +3 -57
@@ -138,24 +138,6 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code, }/* -Send channel dump data to the PODxt Pro. -*/ -static void pod_dump (struct usb_line6_pod *pod,const unsigned char *data) -{ -int size =1 +sizeof (pod->prog_data); -char *sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_DUMP , size); -if (!sysex) -return ; -/* Don't know what this is good for, but PODxt Pro transmits it, so we -* also do... */ - sysex[SYSEX_DATA_OFS ] =5 ; -memcpy (sysex +SYSEX_DATA_OFS +1 , data,sizeof (pod->prog_data)); -line6_send_sysex_message (&pod->line6, sysex, size); -memcpy (&pod->prog_data, data,sizeof (pod->prog_data)); -kfree (sysex); -} - -/* Store parameter value in driver memory. */ static void pod_store_parameter (struct usb_line6_pod *pod,int param,int value)
@@ -411,7 +393,9 @@ static ssize_t pod_send_store_command(struct device *dev, const char *buf,if (!sysex)return 0 ; - sysex[SYSEX_DATA_OFS ] =5 ;/* see pod_dump() */ +/* Don't know what this is good for, but PODxt Pro transmits it, so we +* also do... */ + sysex[SYSEX_DATA_OFS ] =5 ; ret =pod_resolve (buf, block0, block1, sysex +SYSEX_DATA_OFS +1 );if (ret) {kfree (sysex);
@@ -513,41 +497,6 @@ static ssize_t pod_get_name_buf(struct device *dev, }/* -"read" request on "dump" special file. -*/ -static ssize_t pod_get_dump (struct device *dev,struct device_attribute *attr, -char *buf) -{ -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; -memcpy (buf, &pod->prog_data,sizeof (pod->prog_data)); -return sizeof (pod->prog_data); -} - -/* -"write" request on "dump" special file. -*/ -static ssize_t pod_set_dump (struct device *dev,struct device_attribute *attr, -const char *buf,size_t count) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); - -if (count !=sizeof (pod->prog_data)) { -dev_err (pod->line6.ifcdev, -"data block must be exactly %d bytes\n" , - (int )sizeof (pod->prog_data)); -return -EINVAL ; - } - -pod_dump (pod, buf); -return sizeof (pod->prog_data); -} - -/* Identify system parameters related to the tuner. */ static bool pod_is_tuner (int code)
@@ -943,7 +892,6 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1);/* POD special files: */ static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); -static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump); static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, pod_set_dump_buf); static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish);
@@ -1056,7 +1004,6 @@ static int pod_create_files2(struct device *dev)int err;CHECK_RETURN (device_create_file (dev, &dev_attr_device_id)); -CHECK_RETURN (device_create_file (dev, &dev_attr_dump));CHECK_RETURN (device_create_file (dev, &dev_attr_dump_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));
@@ -1195,7 +1142,6 @@ void line6_pod_disconnect(struct usb_interface *interface) properties->device_bit, dev);device_remove_file (dev, &dev_attr_device_id); -device_remove_file (dev, &dev_attr_dump);device_remove_file (dev, &dev_attr_dump_buf);device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);
Signature · 1 line
1.8.0
PATCH 6/46 staging: line6: drop dump_buf sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-)
drivers/staging/line6/pod.c +0 -40
@@ -610,42 +610,6 @@ static ssize_t pod_set_system_param_string(struct usb_line6_pod *pod, }/* -"read" request on "dump_buf" special file. -*/ -static ssize_t pod_get_dump_buf (struct device *dev, -struct device_attribute *attr,char *buf) -{ -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; -memcpy (buf, &pod->prog_data_buf,sizeof (pod->prog_data_buf)); -return sizeof (pod->prog_data_buf); -} - -/* -"write" request on "dump_buf" special file. -*/ -static ssize_t pod_set_dump_buf (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); - -if (count !=sizeof (pod->prog_data)) { -dev_err (pod->line6.ifcdev, -"data block must be exactly %d bytes\n" , - (int )sizeof (pod->prog_data)); -return -EINVAL ; - } - -memcpy (&pod->prog_data_buf, buf,sizeof (pod->prog_data)); -return sizeof (pod->prog_data); -} - -/* "write" request on "finish" special file. */ static ssize_t pod_set_finish(struct device *dev,
@@ -892,8 +856,6 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1);/* POD special files: */ static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); -static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, - pod_set_dump_buf); static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish); static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write);
@@ -1004,7 +966,6 @@ static int pod_create_files2(struct device *dev)int err;CHECK_RETURN (device_create_file (dev, &dev_attr_device_id)); -CHECK_RETURN (device_create_file (dev, &dev_attr_dump_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));
@@ -1142,7 +1103,6 @@ void line6_pod_disconnect(struct usb_interface *interface) properties->device_bit, dev);device_remove_file (dev, &dev_attr_device_id); -device_remove_file (dev, &dev_attr_dump_buf);device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess);
Signature · 1 line
1.8.0
PATCH 7/46 staging: line6: drop monitor_level sysfs attr
In reply to Stefan HajnocziThe monitor level can be adjusted using an ALSA volume control. Therefore the sysfs attribute is unnecessary. Note that we leave the monitor_level driver variable so that the ALSA volume control still works.
--- drivers/staging/line6/pod.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/staging/line6/pod.c +4 -8
@@ -244,8 +244,10 @@ void line6_pod_process_message(struct usb_line6_pod *pod)break ;switch (buf[6 ]) { -PROCESS_SYSTEM_PARAM - (monitor_level); +case POD_monitor_level: + pod->monitor_level.value = value; +break ; +PROCESS_SYSTEM_PARAM (routing);PROCESS_SYSTEM_PARAM (tuner_mute);
@@ -844,7 +846,6 @@ static ssize_t pod_set_ ## code(struct device *dev, \ return pod_set_system_param_string(pod, buf, count, POD_ ## code, mask); \ } -POD_GET_SET_SYSTEM_PARAM (monitor_level,0xffff ,0 );POD_GET_SET_SYSTEM_PARAM (routing,0x0003 ,0 );POD_GET_SET_SYSTEM_PARAM (tuner_mute,0x0001 ,0 );POD_GET_SET_SYSTEM_PARAM (tuner_freq,0xffff ,0 );
@@ -861,8 +862,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(monitor_level, S_IWUSR | S_IRUGO, pod_get_monitor_level, - pod_set_monitor_level); static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read,
@@ -969,7 +968,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_monitor_level));CHECK_RETURN (device_create_file (dev, &dev_attr_name));CHECK_RETURN (device_create_file (dev, &dev_attr_name_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_amp_setup));
@@ -1008,7 +1006,6 @@ static int pod_try_init(struct usb_interface *interface,return -ENODEV ;/* initialize wait queues: */ -init_waitqueue_head (&pod->monitor_level.wait);init_waitqueue_head (&pod->routing.wait);init_waitqueue_head (&pod->tuner_mute.wait);init_waitqueue_head (&pod->tuner_freq.wait);
@@ -1106,7 +1103,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_monitor_level);device_remove_file (dev, &dev_attr_name);device_remove_file (dev, &dev_attr_name_buf);device_remove_file (dev, &dev_attr_retrieve_amp_setup);
Signature · 1 line
1.8.0
PATCH 8/46 staging: line6: change monitor_level type ValueWait -> int
In reply to Stefan HajnocziThe monitor_level sysfs attr has been dropped and we never need to wait on the monitor_level value to change. Switch to a plain int and drop the wait queue.
--- drivers/staging/line6/pod.c | 10 +++++----- drivers/staging/line6/pod.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/line6/pod.c +5 -5
@@ -245,7 +245,7 @@ void line6_pod_process_message(struct usb_line6_pod *pod)switch (buf[6 ]) {case POD_monitor_level: - pod->monitor_level.value = value; + pod->monitor_level = value;break ;PROCESS_SYSTEM_PARAM (routing);
@@ -908,7 +908,7 @@ static int snd_pod_control_monitor_get(struct snd_kcontrol *kcontrol, {struct snd_line6_pcm *line6pcm =snd_kcontrol_chip (kcontrol);struct usb_line6_pod *pod = (struct usb_line6_pod *)line6pcm->line6; - ucontrol->value.integer.value[0 ] = pod->monitor_level.value; + ucontrol->value.integer.value[0 ] = pod->monitor_level;return 0 ; }
@@ -919,10 +919,10 @@ static int snd_pod_control_monitor_put(struct snd_kcontrol *kcontrol,struct snd_line6_pcm *line6pcm =snd_kcontrol_chip (kcontrol);struct usb_line6_pod *pod = (struct usb_line6_pod *)line6pcm->line6; -if (ucontrol->value.integer.value[0 ] == pod->monitor_level.value) +if (ucontrol->value.integer.value[0 ] == pod->monitor_level)return 0 ; - pod->monitor_level.value = ucontrol->value.integer.value[0 ]; + pod->monitor_level = ucontrol->value.integer.value[0 ];pod_set_system_param_int (pod, ucontrol->value.integer.value[0 ], POD_monitor_level);return 1 ;
@@ -1053,7 +1053,7 @@ static int pod_try_init(struct usb_interface *interface,*/ if (pod->line6.properties->capabilities &LINE6_BIT_CONTROL ) { - pod->monitor_level.value = POD_system_invalid; + pod->monitor_level = POD_system_invalid;/* initiate startup procedure: */ pod_startup1 (pod);
drivers/staging/line6/pod.h +1 -1
@@ -121,7 +121,7 @@ struct usb_line6_pod {/** Instrument monitor level. */ -struct ValueWait monitor_level; +int monitor_level;/** Audio routing mode.
Signature · 1 line
1.8.0
PATCH 9/46 staging: line6: drop name sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 15 --------------- 1 file changed, 15 deletions(-)
drivers/staging/line6/pod.c +0 -15
@@ -476,18 +476,6 @@ static ssize_t get_name_generic(struct usb_line6_pod *pod, const char *str,/* "read" request on "name" special file. */ -static ssize_t pod_get_name (struct device *dev,struct device_attribute *attr, -char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -return get_name_generic (pod, pod->prog_data.header +POD_NAME_OFFSET , - buf); -} - -/* -"read" request on "name" special file. -*/ static ssize_t pod_get_name_buf (struct device *dev,struct device_attribute *attr,char *buf) {
@@ -862,7 +850,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, pod_set_retrieve_amp_setup);
@@ -968,7 +955,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_name));CHECK_RETURN (device_create_file (dev, &dev_attr_name_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_amp_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_channel));
@@ -1103,7 +1089,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_name);device_remove_file (dev, &dev_attr_name_buf);device_remove_file (dev, &dev_attr_retrieve_amp_setup);device_remove_file (dev, &dev_attr_retrieve_channel);
Signature · 1 line
1.8.0
PATCH 10/46 staging: line6: drop name_buf sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-)
drivers/staging/line6/pod.c +0 -43
@@ -447,46 +447,6 @@ static ssize_t pod_send_retrieve_command(struct device *dev, const char *buf, }/* -Generic get name function. -*/ -static ssize_t get_name_generic (struct usb_line6_pod *pod,const char *str, -char *buf) -{ -int length =0 ; -const char *p1; -char *p2; -char *last_non_space = buf; - -int retval =line6_dump_wait_interruptible (&pod->dumpreq); -if (retval <0 ) -return retval; - -for (p1 = str, p2 = buf; *p1; ++p1, ++p2) { - *p2 = *p1; -if (*p2 !=' ' ) - last_non_space = p2; -if (++length ==POD_NAME_LENGTH ) -break ; - } - - *(last_non_space +1 ) ='\n' ; -return last_non_space - buf +2 ; -} - -/* -"read" request on "name" special file. -*/ -static ssize_t pod_get_name_buf (struct device *dev, -struct device_attribute *attr,char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -return get_name_generic (pod, - pod->prog_data_buf.header +POD_NAME_OFFSET , - buf); -} - -/* Identify system parameters related to the tuner. */ static bool pod_is_tuner (int code)
@@ -850,7 +810,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, pod_set_retrieve_amp_setup); static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read,
@@ -955,7 +914,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_name_buf));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_amp_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_effects_setup));
@@ -1089,7 +1047,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_name_buf);device_remove_file (dev, &dev_attr_retrieve_amp_setup);device_remove_file (dev, &dev_attr_retrieve_channel); device_remove_file(dev,
Signature · 1 line
1.8.0
PATCH 11/46 staging: line6: drop retrieve_amp_setup sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/line6/pod.c +0 -14
@@ -628,16 +628,6 @@ static ssize_t pod_set_retrieve_effects_setup(struct device *dev, }/* -"write" request on "retrieve_amp_setup" special file. -*/ -static ssize_t pod_set_retrieve_amp_setup (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_retrieve_command (dev, buf, count,0x0040 ,0x0100 ); -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -810,8 +800,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, - pod_set_retrieve_amp_setup); static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read, pod_set_retrieve_channel); static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read,
@@ -914,7 +902,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_amp_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));
@@ -1047,7 +1034,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_retrieve_amp_setup);device_remove_file (dev, &dev_attr_retrieve_channel);device_remove_file (dev, &dev_attr_retrieve_effects_setup);
Signature · 1 line
1.8.0
PATCH 12/46 staging: line6: drop retrieve_channel sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/line6/pod.c +0 -14
@@ -608,16 +608,6 @@ static ssize_t pod_set_store_amp_setup(struct device *dev, }/* -"write" request on "retrieve_channel" special file. -*/ -static ssize_t pod_set_retrieve_channel (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_retrieve_command (dev, buf, count,0x0000 ,0x00c0 ); -} - -/* "write" request on "retrieve_effects_setup" special file. */ static ssize_t pod_set_retrieve_effects_setup(struct device *dev,
@@ -800,8 +790,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read, - pod_set_retrieve_channel); static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read, pod_set_retrieve_effects_setup); static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing,
@@ -902,7 +890,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));
@@ -1034,7 +1021,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_retrieve_channel);device_remove_file (dev, &dev_attr_retrieve_effects_setup);device_remove_file (dev, &dev_attr_routing);
Signature · 1 line
1.8.0
PATCH 13/46 staging: line6: drop retrieve_effects_setup sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 48 --------------------------------------------- 1 file changed, 48 deletions(-)
drivers/staging/line6/pod.c +0 -48
@@ -381,39 +381,6 @@ static int pod_resolve(const char *buf, short block0, short block1, }/* -Send command to store channel/effects setup/amp setup to PODxt Pro. -*/ -static ssize_t pod_send_store_command (struct device *dev,const char *buf, -size_t count,short block0,short block1) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -int ret; -int size =3 +sizeof (pod->prog_data_buf); -char *sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_STORE , size); - -if (!sysex) -return 0 ; - -/* Don't know what this is good for, but PODxt Pro transmits it, so we -* also do... */ - sysex[SYSEX_DATA_OFS ] =5 ; - ret =pod_resolve (buf, block0, block1, sysex +SYSEX_DATA_OFS +1 ); -if (ret) { -kfree (sysex); -return ret; - } - -memcpy (sysex +SYSEX_DATA_OFS +3 , &pod->prog_data_buf, -sizeof (pod->prog_data_buf)); - -line6_send_sysex_message (&pod->line6, sysex, size); -kfree (sysex); -/* needs some delay here on AMD64 platform */ -return count; -} - -/* Send command to retrieve channel/effects setup/amp setup to PODxt Pro. */ static ssize_t pod_send_retrieve_command(struct device *dev, const char *buf,
@@ -608,16 +575,6 @@ static ssize_t pod_set_store_amp_setup(struct device *dev, }/* -"write" request on "retrieve_effects_setup" special file. -*/ -static ssize_t pod_set_retrieve_effects_setup (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_retrieve_command (dev, buf, count,0x0080 ,0x0080 ); -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -790,8 +747,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read, - pod_set_retrieve_effects_setup); static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number,
@@ -890,7 +845,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_retrieve_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));CHECK_RETURN (device_create_file (dev, &dev_attr_store_amp_setup));
@@ -1021,8 +975,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, - &dev_attr_retrieve_effects_setup);device_remove_file (dev, &dev_attr_routing);device_remove_file (dev, &dev_attr_serial_number);device_remove_file (dev, &dev_attr_store_amp_setup);
Signature · 1 line
1.8.0
PATCH 14/46 staging: line6: drop store_amp_setup sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/line6/pod.c +0 -14
@@ -565,16 +565,6 @@ static ssize_t pod_set_store_effects_setup(struct device *dev, }/* -"write" request on "store_amp_setup" special file. -*/ -static ssize_t pod_set_store_amp_setup (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_store_command (dev, buf, count,0x0040 ,0x0100 ); -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -751,8 +741,6 @@ static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(store_amp_setup, S_IWUSR, line6_nop_read, - pod_set_store_amp_setup); static DEVICE_ATTR(store_channel, S_IWUSR, line6_nop_read, pod_set_store_channel); static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read,
@@ -847,7 +835,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_store_amp_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_store_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_store_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_freq));
@@ -977,7 +964,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_routing);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_store_amp_setup);device_remove_file (dev, &dev_attr_store_channel);device_remove_file (dev, &dev_attr_store_effects_setup);device_remove_file (dev, &dev_attr_tuner_freq);
Signature · 1 line
1.8.0
PATCH 15/46 staging: line6: drop store_channel sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/line6/pod.c +0 -14
@@ -545,16 +545,6 @@ static ssize_t pod_set_finish(struct device *dev, }/* -"write" request on "store_channel" special file. -*/ -static ssize_t pod_set_store_channel (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_store_command (dev, buf, count,0x0000 ,0x00c0 ); -} - -/* "write" request on "store_effects_setup" special file. */ static ssize_t pod_set_store_effects_setup(struct device *dev,
@@ -741,8 +731,6 @@ static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(store_channel, S_IWUSR, line6_nop_read, - pod_set_store_channel); static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read, pod_set_store_effects_setup); static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq,
@@ -835,7 +823,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_store_channel));CHECK_RETURN (device_create_file (dev, &dev_attr_store_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_freq));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute));
@@ -964,7 +951,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_routing);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_store_channel);device_remove_file (dev, &dev_attr_store_effects_setup);device_remove_file (dev, &dev_attr_tuner_freq);device_remove_file (dev, &dev_attr_tuner_mute);
Signature · 1 line
1.8.0
PATCH 16/46 staging: line6: drop store_effects_setup sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 68 --------------------------------------------- 1 file changed, 68 deletions(-)
drivers/staging/line6/pod.c +0 -68
@@ -360,60 +360,6 @@ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, }/* -Resolve value to memory location. -*/ -static int pod_resolve (const char *buf,short block0,short block1, -unsigned char *location) -{ -u8 value; -short block; -int ret; - - ret =kstrtou8 (buf,10 , &value); -if (ret) -return ret; - - block = (value <0x40 ) ? block0 : block1; - value &=0x3f ; - location[0 ] = block >>7 ; - location[1 ] = value | (block &0x7f ); -return 0 ; -} - -/* -Send command to retrieve channel/effects setup/amp setup to PODxt Pro. -*/ -static ssize_t pod_send_retrieve_command (struct device *dev,const char *buf, -size_t count,short block0, -short block1) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -int ret; -int size =4 ; -char *sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_DUMPMEM , size); - -if (!sysex) -return 0 ; - - ret =pod_resolve (buf, block0, block1, sysex +SYSEX_DATA_OFS ); -if (ret) { -kfree (sysex); -return ret; - } - sysex[SYSEX_DATA_OFS +2 ] =0 ; - sysex[SYSEX_DATA_OFS +3 ] =0 ; -line6_dump_started (&pod->dumpreq,POD_DUMP_MEMORY ); - -if (line6_send_sysex_message (&pod->line6, sysex, size) < size) -line6_dump_finished (&pod->dumpreq); - -kfree (sysex); -/* needs some delay here on AMD64 platform */ -return count; -} - -/* Identify system parameters related to the tuner. */ static bool pod_is_tuner (int code)
@@ -545,16 +491,6 @@ static ssize_t pod_set_finish(struct device *dev, }/* -"write" request on "store_effects_setup" special file. -*/ -static ssize_t pod_set_store_effects_setup (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -return pod_send_store_command (dev, buf, count,0x0080 ,0x0080 ); -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -731,8 +667,6 @@ static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read, - pod_set_store_effects_setup); static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq, pod_set_tuner_freq); static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute,
@@ -823,7 +757,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_store_effects_setup));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_freq));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_note));
@@ -951,7 +884,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_routing);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_store_effects_setup);device_remove_file (dev, &dev_attr_tuner_freq);device_remove_file (dev, &dev_attr_tuner_mute);device_remove_file (dev, &dev_attr_tuner_note);
Signature · 1 line
1.8.0
PATCH 17/46 staging: line6: drop routing sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 8 -------- drivers/staging/line6/pod.h | 9 --------- 2 files changed, 17 deletions(-)
drivers/staging/line6/pod.c +0 -8
@@ -40,7 +40,6 @@ enum {enum { POD_monitor_level =0x04 , - POD_routing =0x05 , POD_tuner_mute =0x13 , POD_tuner_freq =0x15 , POD_tuner_note =0x16 ,
@@ -248,7 +247,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) pod->monitor_level = value;break ; -PROCESS_SYSTEM_PARAM (routing);PROCESS_SYSTEM_PARAM (tuner_mute);PROCESS_SYSTEM_PARAM
@@ -647,7 +645,6 @@ static ssize_t pod_set_ ## code(struct device *dev, \ return pod_set_system_param_string(pod, buf, count, POD_ ## code, mask); \ } -POD_GET_SET_SYSTEM_PARAM (routing,0x0003 ,0 );POD_GET_SET_SYSTEM_PARAM (tuner_mute,0x0001 ,0 );POD_GET_SET_SYSTEM_PARAM (tuner_freq,0xffff ,0 );POD_GET_SYSTEM_PARAM (tuner_note,1 );
@@ -663,8 +660,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); -static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, - pod_set_routing); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq,
@@ -755,7 +750,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess)); -CHECK_RETURN (device_create_file (dev, &dev_attr_routing));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_freq));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute));
@@ -785,7 +779,6 @@ static int pod_try_init(struct usb_interface *interface,return -ENODEV ;/* initialize wait queues: */ -init_waitqueue_head (&pod->routing.wait);init_waitqueue_head (&pod->tuner_mute.wait);init_waitqueue_head (&pod->tuner_freq.wait);init_waitqueue_head (&pod->tuner_note.wait);
@@ -882,7 +875,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess); -device_remove_file (dev, &dev_attr_routing);device_remove_file (dev, &dev_attr_serial_number);device_remove_file (dev, &dev_attr_tuner_freq);device_remove_file (dev, &dev_attr_tuner_mute);
drivers/staging/line6/pod.h +0 -9
@@ -124,15 +124,6 @@ struct usb_line6_pod {int monitor_level;/** -Audio routing mode. -0: send processed guitar -1: send clean guitar -2: send clean guitar re-amp playback -3: send re-amp playback -*/ -struct ValueWait routing; - -/** Timer for device initializaton. */ struct timer_list startup_timer;
Signature · 1 line
1.8.0
PATCH 18/46 staging: line6: drop tuner_freq sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 8 -------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 13 deletions(-)
drivers/staging/line6/pod.c +0 -8
@@ -250,8 +250,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)PROCESS_SYSTEM_PARAM (tuner_mute);PROCESS_SYSTEM_PARAM - (tuner_freq); -PROCESS_SYSTEM_PARAM (tuner_note);PROCESS_SYSTEM_PARAM (tuner_pitch);
@@ -646,7 +644,6 @@ static ssize_t pod_set_ ## code(struct device *dev, \ }POD_GET_SET_SYSTEM_PARAM (tuner_mute,0x0001 ,0 ); -POD_GET_SET_SYSTEM_PARAM (tuner_freq,0xffff ,0 );POD_GET_SYSTEM_PARAM (tuner_note,1 );POD_GET_SYSTEM_PARAM (tuner_pitch,1 );
@@ -662,8 +659,6 @@ static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq, - pod_set_tuner_freq); static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, pod_set_tuner_mute); static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write);
@@ -751,7 +746,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_freq));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_note));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_pitch));
@@ -780,7 +774,6 @@ static int pod_try_init(struct usb_interface *interface,/* initialize wait queues: */ init_waitqueue_head (&pod->tuner_mute.wait); -init_waitqueue_head (&pod->tuner_freq.wait);init_waitqueue_head (&pod->tuner_note.wait);init_waitqueue_head (&pod->tuner_pitch.wait);
@@ -876,7 +869,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_tuner_freq);device_remove_file (dev, &dev_attr_tuner_mute);device_remove_file (dev, &dev_attr_tuner_note);device_remove_file (dev, &dev_attr_tuner_pitch);
drivers/staging/line6/pod.h +0 -5
@@ -104,11 +104,6 @@ struct usb_line6_pod {struct ValueWait tuner_mute;/** -Tuner base frequency (typically 440Hz). -*/ -struct ValueWait tuner_freq; - -/** Note received from tuner. */ struct ValueWait tuner_note;
Signature · 1 line
1.8.0
PATCH 19/46 staging: line6: drop tuner_note sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 7 ------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 12 deletions(-)
drivers/staging/line6/pod.c +0 -7
@@ -250,8 +250,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)PROCESS_SYSTEM_PARAM (tuner_mute);PROCESS_SYSTEM_PARAM - (tuner_note); -PROCESS_SYSTEM_PARAM (tuner_pitch);#undef PROCESS_SYSTEM_PARAM
@@ -644,7 +642,6 @@ static ssize_t pod_set_ ## code(struct device *dev, \ }POD_GET_SET_SYSTEM_PARAM (tuner_mute,0x0001 ,0 ); -POD_GET_SYSTEM_PARAM (tuner_note,1 );POD_GET_SYSTEM_PARAM (tuner_pitch,1 );#undef GET_SET_SYSTEM_PARAM
@@ -661,7 +658,6 @@ static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, pod_set_tuner_mute); -static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write); static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write);#ifdef CONFIG_LINE6_USB_RAW
@@ -747,7 +743,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute)); -CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_note));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_pitch));#ifdef CONFIG_LINE6_USB_RAW
@@ -774,7 +769,6 @@ static int pod_try_init(struct usb_interface *interface,/* initialize wait queues: */ init_waitqueue_head (&pod->tuner_mute.wait); -init_waitqueue_head (&pod->tuner_note.wait);init_waitqueue_head (&pod->tuner_pitch.wait);/* initialize USB buffers: */
@@ -870,7 +864,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number);device_remove_file (dev, &dev_attr_tuner_mute); -device_remove_file (dev, &dev_attr_tuner_note);device_remove_file (dev, &dev_attr_tuner_pitch);#ifdef CONFIG_LINE6_USB_RAW
drivers/staging/line6/pod.h +0 -5
@@ -104,11 +104,6 @@ struct usb_line6_pod {struct ValueWait tuner_mute;/** -Note received from tuner. -*/ -struct ValueWait tuner_note; - -/** Pitch value received from tuner. */ struct ValueWait tuner_pitch;
Signature · 1 line
1.8.0
PATCH 20/46 staging: line6: drop tuner_mute sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 34 ---------------------------------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 39 deletions(-)
drivers/staging/line6/pod.c +0 -34
@@ -248,8 +248,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)break ;PROCESS_SYSTEM_PARAM - (tuner_mute); -PROCESS_SYSTEM_PARAM (tuner_pitch);#undef PROCESS_SYSTEM_PARAM
@@ -453,20 +451,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, }/* -Send system parameter (from string). -@param tuner non-zero, if code refers to a tuner parameter -*/ -static ssize_t pod_set_system_param_string (struct usb_line6_pod *pod, -const char *buf,int count,int code, -unsigned short mask) -{ -int retval; -unsigned short value =simple_strtoul (buf,NULL ,10 ) & mask; - retval =pod_set_system_param_int (pod, value, code); -return (retval <0 ) ? retval : count; -} - -/* "write" request on "finish" special file. */ static ssize_t pod_set_finish(struct device *dev,
@@ -630,21 +614,8 @@ static ssize_t pod_get_ ## code(struct device *dev, \ &pod->code, sign); \ } -#define POD_GET_SET_SYSTEM_PARAM (code, mask, sign) \ -POD_GET_SYSTEM_PARAM(code, sign) \ -static ssize_t pod_set_ ## code(struct device *dev, \ - struct device_attribute *attr, \ - const char *buf, size_t count) \ -{ \ - struct usb_interface *interface = to_usb_interface(dev); \ - struct usb_line6_pod *pod = usb_get_intfdata(interface); \ - return pod_set_system_param_string(pod, buf, count, POD_ ## code, mask); \ -} - -POD_GET_SET_SYSTEM_PARAM (tuner_mute,0x0001 ,0 );POD_GET_SYSTEM_PARAM (tuner_pitch,1 ); -#undef GET_SET_SYSTEM_PARAM#undef GET_SYSTEM_PARAM/* POD special files: */
@@ -656,8 +627,6 @@ static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, - pod_set_tuner_mute); static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write);#ifdef CONFIG_LINE6_USB_RAW
@@ -742,7 +711,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_mute));CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_pitch));#ifdef CONFIG_LINE6_USB_RAW
@@ -768,7 +736,6 @@ static int pod_try_init(struct usb_interface *interface,return -ENODEV ;/* initialize wait queues: */ -init_waitqueue_head (&pod->tuner_mute.wait);init_waitqueue_head (&pod->tuner_pitch.wait);/* initialize USB buffers: */
@@ -863,7 +830,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_tuner_mute);device_remove_file (dev, &dev_attr_tuner_pitch);#ifdef CONFIG_LINE6_USB_RAW
drivers/staging/line6/pod.h +0 -5
@@ -99,11 +99,6 @@ struct usb_line6_pod {struct pod_program prog_data_buf;/** -Tuner mute mode. -*/ -struct ValueWait tuner_mute; - -/** Pitch value received from tuner. */ struct ValueWait tuner_pitch;
Signature · 1 line
1.8.0
PATCH 21/46 staging: line6: drop tuner_pitch sysfs attr
In reply to Stefan HajnocziDropping this final tuner sysfs attr also leaves the POD_GET_SYSTEM_PARAM() macro, pod_get_system_param_string(), and pod_get_system_param_int() unused. Remove them immediately to avoid compiler warnings.
POD_monitor_level is now the only SYSEX value that needs to be watched by the driver since the ALSA volume control should reflect the current monitor volume level used by the device. Therefore, drop the switch statement entirely and just check for POD_monitor_level, ignoring unknown system parameter changes.
--- drivers/staging/line6/pod.c | 102 +------------------------------------------- drivers/staging/line6/pod.h | 15 ------- 2 files changed, 1 insertion(+), 116 deletions(-)
drivers/staging/line6/pod.c +1 -101
@@ -236,28 +236,8 @@ void line6_pod_process_message(struct usb_line6_pod *pod) << 8) | ((int )buf[9 ] <<4 ) | (int )buf[10 ]; -#define PROCESS_SYSTEM_PARAM (x) \ - case POD_ ## x: \ - pod->x.value = value; \ - wake_up(&pod->x.wait); \ - break; - -switch (buf[6 ]) { -case POD_monitor_level: +if (buf[6 ] == POD_monitor_level) pod->monitor_level = value; -break ; - -PROCESS_SYSTEM_PARAM - (tuner_pitch); - -#undef PROCESS_SYSTEM_PARAM - -default : -dev_dbg (pod->line6.ifcdev, -"unknown tuner/system response %02X\n" , - buf[6 ]); - } -break ; }
@@ -363,66 +343,6 @@ static bool pod_is_tuner(int code) }/* -Get system parameter (as integer). -@param tuner non-zero, if code refers to a tuner parameter -*/ -static int pod_get_system_param_int (struct usb_line6_pod *pod,int *value, -int code,struct ValueWait *param,int sign) -{ -char *sysex; -static const int size =1 ; -int retval =0 ; - -if (((pod->prog_data.control[POD_tuner] &0x40 ) ==0 ) - &&pod_is_tuner (code)) -return -ENODEV ; - -/* send value request to device: */ - param->value = POD_system_invalid; - sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_SYSTEMREQ , size); - -if (!sysex) -return -ENOMEM ; - - sysex[SYSEX_DATA_OFS ] = code; -line6_send_sysex_message (&pod->line6, sysex, size); -kfree (sysex); - -/* wait for device to respond: */ - retval = -wait_event_interruptible (param->wait, - param->value != POD_system_invalid); - -if (retval <0 ) -return retval; - - *value = sign ? (int )(signed short )param->value : (int )(unsigned short ) - param->value; - -if (*value == POD_system_invalid) - *value =0 ;/* don't report uninitialized values */ - -return 0 ; -} - -/* -Get system parameter (as string). -@param tuner non-zero, if code refers to a tuner parameter -*/ -static ssize_t pod_get_system_param_string (struct usb_line6_pod *pod,char *buf, -int code,struct ValueWait *param, -int sign) -{ -int retval, value =0 ; - retval =pod_get_system_param_int (pod, &value, code, param, sign); - -if (retval <0 ) -return retval; - -return sprintf (buf,"%d\n" , value); -} - -/* Send system parameter (from integer). @param tuner non-zero, if code refers to a tuner parameter */
@@ -604,20 +524,6 @@ static void pod_startup5(struct work_struct *work) line6->properties->device_bit, line6->ifcdev); } -#define POD_GET_SYSTEM_PARAM (code, sign) \ -static ssize_t pod_get_ ## code(struct device *dev, \ - struct device_attribute *attr, char *buf) \ -{ \ - struct usb_interface *interface = to_usb_interface(dev); \ - struct usb_line6_pod *pod = usb_get_intfdata(interface); \ - return pod_get_system_param_string(pod, buf, POD_ ## code, \ - &pod->code, sign); \ -} - -POD_GET_SYSTEM_PARAM (tuner_pitch,1 ); - -#undef GET_SYSTEM_PARAM -/* POD special files: */ static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish);
@@ -627,7 +533,6 @@ static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, pod_get_midi_postprocess, pod_set_midi_postprocess); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write);#ifdef CONFIG_LINE6_USB_RAW static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw);
@@ -711,7 +616,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); -CHECK_RETURN (device_create_file (dev, &dev_attr_tuner_pitch));#ifdef CONFIG_LINE6_USB_RAW CHECK_RETURN (device_create_file (dev, &dev_attr_raw));
@@ -735,9 +639,6 @@ static int pod_try_init(struct usb_interface *interface,if ((interface ==NULL ) || (pod ==NULL ))return -ENODEV ; -/* initialize wait queues: */ -init_waitqueue_head (&pod->tuner_pitch.wait); -/* initialize USB buffers: */ err =line6_dumpreq_init (&pod->dumpreq, pod_request_channel,sizeof (pod_request_channel));
@@ -830,7 +731,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number); -device_remove_file (dev, &dev_attr_tuner_pitch);#ifdef CONFIG_LINE6_USB_RAW device_remove_file (dev, &dev_attr_raw);
drivers/staging/line6/pod.h +0 -15
@@ -15,7 +15,6 @@#include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/usb.h> -#include <linux/wait.h> #include <sound/core.h>
@@ -54,15 +53,6 @@ enum { };/** -Data structure for values that need to be requested explicitly. -This is the case for system and tuner settings. -*/ -struct ValueWait { -int value; -wait_queue_head_t wait; -}; - -/** Binary PODxt Pro program dump */ struct pod_program {
@@ -99,11 +89,6 @@ struct usb_line6_pod {struct pod_program prog_data_buf;/** -Pitch value received from tuner. -*/ -struct ValueWait tuner_pitch; - -/** Instrument monitor level. */ int monitor_level;
Signature · 1 line
1.8.0
PATCH 22/46 staging: line6: drop finish sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/staging/line6/pod.c +0 -21
@@ -371,24 +371,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, }/* -"write" request on "finish" special file. -*/ -static ssize_t pod_set_finish (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -int size =0 ; -char *sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_FINISH , size); -if (!sysex) -return 0 ; -line6_send_sysex_message (&pod->line6, sysex, size); -kfree (sysex); -return count; -} - -/* "read" request on "midi_postprocess" special file. */ static ssize_t pod_get_midi_postprocess(struct device *dev,
@@ -526,7 +508,6 @@ static void pod_startup5(struct work_struct *work)/* POD special files: */ static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); -static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish); static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO,
@@ -612,7 +593,6 @@ static int pod_create_files2(struct device *dev)int err;CHECK_RETURN (device_create_file (dev, &dev_attr_device_id)); -CHECK_RETURN (device_create_file (dev, &dev_attr_finish));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));
@@ -727,7 +707,6 @@ void line6_pod_disconnect(struct usb_interface *interface) properties->device_bit, dev);device_remove_file (dev, &dev_attr_device_id); -device_remove_file (dev, &dev_attr_finish);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number);
Signature · 1 line
1.8.0
PATCH 23/46 staging: line6: drop midi_postprocess sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 36 ------------------------------------ 1 file changed, 36 deletions(-)
drivers/staging/line6/pod.c +0 -36
@@ -371,38 +371,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value, }/* -"read" request on "midi_postprocess" special file. -*/ -static ssize_t pod_get_midi_postprocess (struct device *dev, -struct device_attribute *attr, -char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -return sprintf (buf,"%d\n" , pod->midi_postprocess); -} - -/* -"write" request on "midi_postprocess" special file. -*/ -static ssize_t pod_set_midi_postprocess (struct device *dev, -struct device_attribute *attr, -const char *buf,size_t count) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6_pod *pod =usb_get_intfdata (interface); -u8 value; -int ret; - - ret =kstrtou8 (buf,10 , &value); -if (ret) -return ret; - - pod->midi_postprocess = value ?1 :0 ; -return count; -} - -/* "read" request on "serial_number" special file. */ static ssize_t pod_get_serial_number(struct device *dev,
@@ -510,8 +478,6 @@ static void pod_startup5(struct work_struct *work) static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, line6_nop_write); -static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, - pod_get_midi_postprocess, pod_set_midi_postprocess); static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write);
@@ -594,7 +560,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_device_id));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version)); -CHECK_RETURN (device_create_file (dev, &dev_attr_midi_postprocess));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number));#ifdef CONFIG_LINE6_USB_RAW
@@ -708,7 +673,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_device_id);device_remove_file (dev, &dev_attr_firmware_version); -device_remove_file (dev, &dev_attr_midi_postprocess);device_remove_file (dev, &dev_attr_serial_number);#ifdef CONFIG_LINE6_USB_RAW
Signature · 1 line
1.8.0
Greg Kroah-Hartman
maintainerQuoted 1 line · Stefan Hajnoczi
Let's put the line6 staging driver on a diet for Thanksgiving! :)
Yeah!
Quoted 10 lines
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.
Quoted 6 lines
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.
Quoted 10 lines
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 +-----------------------------
Quoted 8 lines
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
Quoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Stefan Hajnoczi
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.
Quoted 6 lines
Quoted 3 lines
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
Am Donnerstag, 22. November 2012, 21:08:55 schrieb Stefan Hajnoczi:
Quoted 25 lines
On Thu, Nov 22, 2012 at 8:58 PM, Greg Kroah-Hartman
Quoted 22 lines · <[email protected]> wrote:
Quoted 20 lines · Stefan Hajnoczi
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.
Quoted 6 lines
Quoted 2 lines
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
PATCH 24/46 staging: line6: drop midi_mask_receive
In reply to Stefan HajnocziThe midi_mask_receive sysfs attribute selects the MIDI channels on which to receive messages. There is no need to do this at the driver level, instead the MIDI application endpoints decide which channels to use. Other drivers don't implement midi_mask_receive so applications cannot make use of this feature. Therefore we drop it as part of the effort to clean up the staging driver.
--- drivers/staging/line6/driver.c | 5 ----- drivers/staging/line6/midi.c | 42 ------------------------------------------ drivers/staging/line6/midi.h | 5 ----- 3 files changed, 52 deletions(-)
drivers/staging/line6/driver.c +0 -5
@@ -424,11 +424,6 @@ static void line6_data_received(struct urb *urb)if (done ==0 )break ; -/* MIDI input filter */ -if (line6_midibuf_skip_message - (mb, line6->line6midi->midi_mask_receive)) -continue ; - line6->message_length = done;#ifdef CONFIG_LINE6_USB_DUMP_MIDI line6_write_hexdump (line6,'r' , line6->buffer_message, done);
drivers/staging/line6/midi.c +0 -42
72 lines not on this page · raw message
drivers/staging/line6/midi.h +0 -5
@@ -60,11 +60,6 @@ struct snd_line6_midi {unsigned short midi_mask_transmit;/** -Bit mask for input MIDI channels. -*/ -unsigned short midi_mask_receive; - -/** Buffer for incoming MIDI stream. */ struct MidiBuffer midibuf_in;
Signature · 1 line
1.8.0
PATCH 25/46 staging: line6: drop midi_mask_transmit
In reply to Stefan HajnocziThe midi_mask_transmit sysfs attribute selects the MIDI channels on which to transmit messages. If ALSA wants to transmit a message that does not match an allowed channel, the message will be dropped. This driver feature is not really used and applications don't know how to take advantage of it. Therefore we drop it and rely on applications or MIDI sequencers to select the channels used for communication.
--- drivers/staging/line6/midi.c | 56 -------------------------------------------- drivers/staging/line6/midi.h | 5 ---- 2 files changed, 61 deletions(-)
drivers/staging/line6/midi.c +0 -56
@@ -72,10 +72,6 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)if (done ==0 )break ; -if (line6_midibuf_skip_message - (mb, line6midi->midi_mask_transmit)) -continue ; -send_midi_async (line6, chunk, done); }
@@ -287,47 +283,10 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi)return 0 ; } -/* -"read" request on "midi_mask_transmit" special file. -*/ -static ssize_t midi_get_midi_mask_transmit (struct device *dev, -struct device_attribute *attr, -char *buf) -{ -struct usb_interface *interface =to_usb_interface (dev); -struct usb_line6 *line6 =usb_get_intfdata (interface); -return sprintf (buf,"%d\n" , line6->line6midi->midi_mask_transmit); -} - -/* -"write" request on "midi_mask" special file. -*/ -static ssize_t midi_set_midi_mask_transmit (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); -unsigned short value; -int ret; - - ret =kstrtou16 (buf,10 , &value); -if (ret) -return ret; - - line6->line6midi->midi_mask_transmit = value; -return count; -} - -static DEVICE_ATTR(midi_mask_transmit, S_IWUSR | S_IRUGO, - midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); -/* MIDI device destructor */ static int snd_line6_midi_free (struct snd_device *device) {struct snd_line6_midi *line6midi = device->device_data; -device_remove_file (line6midi->line6->ifcdev, - &dev_attr_midi_mask_transmit);line6_midibuf_destroy (&line6midi->midibuf_in);line6_midibuf_destroy (&line6midi->midibuf_out);return 0 ;
@@ -369,17 +328,6 @@ int line6_init_midi(struct usb_line6 *line6) } line6midi->line6 = line6; - -switch (line6->product) { -case LINE6_DEVID_PODHD300 : -case LINE6_DEVID_PODHD500 : - line6midi->midi_mask_transmit =1 ; -break ; - -default : - line6midi->midi_mask_transmit =1 ; - } - line6->line6midi = line6midi; err = snd_device_new(line6->card, SNDRV_DEV_RAWMIDI, line6midi,
@@ -393,10 +341,6 @@ int line6_init_midi(struct usb_line6 *line6)if (err <0 )return err; - err =device_create_file (line6->ifcdev, &dev_attr_midi_mask_transmit); -if (err <0 ) -return err; -init_waitqueue_head (&line6midi->send_wait);spin_lock_init (&line6midi->send_urb_lock);spin_lock_init (&line6midi->midi_transmit_lock);
drivers/staging/line6/midi.h +0 -5
@@ -55,11 +55,6 @@ struct snd_line6_midi {wait_queue_head_t send_wait;/** -Bit mask for output MIDI channels. -*/ -unsigned short midi_mask_transmit; - -/** Buffer for incoming MIDI stream. */ struct MidiBuffer midibuf_in;
Signature · 1 line
1.8.0
PATCH 26/46 staging: line6: drop midi_postprocess flag
In reply to Stefan HajnocziIt is no longer necessary to trigger on MIDI transmit messages that will change the state of the device since:
1. We've dropped the midi_postprocess sysfs attr in a previous commit so it is not possible to activate this feature anymore.
2. The other sysfs attrs that could inspect the state after a dump request have been dropped.
Therefore we can safely remove this dead code.
--- drivers/staging/line6/midi.c | 22 ---------------------- drivers/staging/line6/pod.c | 34 ---------------------------------- drivers/staging/line6/pod.h | 7 ------- 3 files changed, 63 deletions(-)
drivers/staging/line6/midi.c +0 -22
@@ -154,28 +154,6 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data, } ++line6->line6midi->num_active_send_urbs; - -switch (line6->usbdev->descriptor.idProduct) { -case LINE6_DEVID_BASSPODXT : -case LINE6_DEVID_BASSPODXTLIVE : -case LINE6_DEVID_BASSPODXTPRO : -case LINE6_DEVID_PODXT : -case LINE6_DEVID_PODXTLIVE : -case LINE6_DEVID_PODXTPRO : -case LINE6_DEVID_POCKETPOD : -line6_pod_midi_postprocess ((struct usb_line6_pod *)line6, data, - length); -break ; - -case LINE6_DEVID_VARIAX : -case LINE6_DEVID_PODHD300 : -case LINE6_DEVID_PODHD500 : -break ; - -default : -MISSING_CASE ; - } -return 0 ; }
drivers/staging/line6/pod.c +0 -34
@@ -285,40 +285,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod) }/* -Detect some cases that require a channel dump after sending a command to the -device. Important notes: -*) The actual dump request can not be sent here since we are not allowed to -wait for the completion of the first message in this context, and sending -the dump request before completion of the previous message leaves the POD -in an undefined state. The dump request will be sent when the echoed -commands are received. -*) This method fails if a param change message is "chopped" after the first -byte. -*/ -void line6_pod_midi_postprocess (struct usb_line6_pod *pod,unsigned char *data, -int length) -{ -int i; - -if (!pod->midi_postprocess) -return ; - -for (i =0 ; i < length; ++i) { -if (data[i] == (LINE6_PROGRAM_CHANGE |LINE6_CHANNEL_HOST )) { -line6_invalidate_current (&pod->dumpreq); -break ; - }else -if ((data[i] == (LINE6_PARAM_CHANGE |LINE6_CHANNEL_HOST )) - && (i < length -1 )) -if ((data[i +1 ] == POD_amp_model_setup) - || (data[i +1 ] == POD_effect_setup)) { -line6_invalidate_current (&pod->dumpreq); -break ; - } - } -} - -/* Transmit PODxt Pro control parameter. */ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
drivers/staging/line6/pod.h +0 -7
@@ -127,18 +127,11 @@ struct usb_line6_pod {Device ID. */ int device_id; - -/** -Flag to enable MIDI postprocessing. -*/ -char midi_postprocess; };extern void line6_pod_disconnect (struct usb_interface *interface);extern int line6_pod_init (struct usb_interface *interface,struct usb_line6_pod *pod); -extern void line6_pod_midi_postprocess (struct usb_line6_pod *pod, -unsigned char *data,int length);extern void line6_pod_process_message (struct usb_line6_pod *pod);extern void line6_pod_transmit_parameter (struct usb_line6_pod *pod,int param,u8 value);
Signature · 1 line
1.8.0
PATCH 27/46 staging: line6: drop pod.c raw sysfs attr
In reply to Stefan HajnocziThe raw sysfs attr transmits MIDI messages with less filtering. This was a useful debugging tool while the staging driver still had a lot of state and filtering. It is not useful anymore since the filtering is being dropped.
--- drivers/staging/line6/pod.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/staging/line6/pod.c +0 -13
@@ -447,10 +447,6 @@ static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, line6_nop_write); -#ifdef CONFIG_LINE6_USB_RAW -static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); -#endif -/* control info callback */ static int snd_pod_control_monitor_info (struct snd_kcontrol *kcontrol,struct snd_ctl_elem_info *uinfo)
@@ -527,11 +523,6 @@ static int pod_create_files2(struct device *dev)CHECK_RETURN (device_create_file (dev, &dev_attr_device_id));CHECK_RETURN (device_create_file (dev, &dev_attr_firmware_version));CHECK_RETURN (device_create_file (dev, &dev_attr_serial_number)); - -#ifdef CONFIG_LINE6_USB_RAW -CHECK_RETURN (device_create_file (dev, &dev_attr_raw)); -#endif -return 0 ; }
@@ -640,10 +631,6 @@ void line6_pod_disconnect(struct usb_interface *interface)device_remove_file (dev, &dev_attr_device_id);device_remove_file (dev, &dev_attr_firmware_version);device_remove_file (dev, &dev_attr_serial_number); - -#ifdef CONFIG_LINE6_USB_RAW -device_remove_file (dev, &dev_attr_raw); -#endif } }
Signature · 1 line
1.8.0
PATCH 28/46 staging: line6: drop tuner param filtering
In reply to Stefan HajnocziThe pod_set_system_param_int() helper function is only used to set the monitor level. Previously it was also used to control the tuner and has special checks. These checks can now be dropped, along with the tuner constants.
--- drivers/staging/line6/pod.c | 21 --------------------- 1 file changed, 21 deletions(-)
drivers/staging/line6/pod.c +0 -21
@@ -40,10 +40,6 @@ enum {enum { POD_monitor_level =0x04 , - POD_tuner_mute =0x13 , - POD_tuner_freq =0x15 , - POD_tuner_note =0x16 , - POD_tuner_pitch =0x17 , POD_system_invalid =0x10000 };
@@ -298,19 +294,7 @@ void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param, }/* -Identify system parameters related to the tuner. -*/ -static bool pod_is_tuner (int code) -{ -return - (code == POD_tuner_mute) || - (code == POD_tuner_freq) || - (code == POD_tuner_note) || (code == POD_tuner_pitch); -} - -/* Send system parameter (from integer). -@param tuner non-zero, if code refers to a tuner parameter */ static int pod_set_system_param_int (struct usb_line6_pod *pod,int value,int code)
@@ -318,11 +302,6 @@ static int pod_set_system_param_int(struct usb_line6_pod *pod, int value,char *sysex;static const int size =5 ; -if (((pod->prog_data.control[POD_tuner] &0x40 ) ==0 ) - &&pod_is_tuner (code)) -return -EINVAL ; - -/* send value to tuner: */ sysex =pod_alloc_sysex_buffer (pod,POD_SYSEX_SYSTEM , size);if (!sysex)return -ENOMEM ;
Signature · 1 line
1.8.0
PATCH 29/46 staging: line6: drop variax model sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 38 -------------------------------------- drivers/staging/line6/variax.h | 5 ----- 2 files changed, 43 deletions(-)
drivers/staging/line6/variax.c +0 -38
@@ -212,7 +212,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 : - variax->model = buf[1 ];line6_dump_request_async (&variax->dumpreq, &variax->line6,0 ,VARIAX_DUMP_PASS1 );break ;
@@ -334,39 +333,6 @@ static ssize_t variax_set_volume(struct device *dev, }/* -"read" request on "model" special file. -*/ -static ssize_t variax_get_model (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->model); -} - -/* -"write" request on "model" special file. -*/ -static ssize_t variax_set_model (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_send_program (&variax->line6, value) ==0 ) - variax->model = value; - -return count; -} - -/* "read" request on "active" special file. */ static ssize_t variax_get_active(struct device *dev,
@@ -549,8 +515,6 @@ static ssize_t variax_set_raw2(struct device *dev,#endif /* Variax workbench special files: */ -static DEVICE_ATTR(model, S_IWUSR | S_IRUGO, variax_get_model, - variax_set_model); 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);
@@ -595,7 +559,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_model));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));
@@ -701,7 +664,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_model);device_remove_file (dev, &dev_attr_volume);device_remove_file (dev, &dev_attr_tone);device_remove_file (dev, &dev_attr_name);
drivers/staging/line6/variax.h +0 -5
@@ -78,11 +78,6 @@ struct usb_line6_variax {unsigned char *buffer_activate;/** -Model number. -*/ -int model; - -/** Current model settings. */ struct variax_model model_data;
Signature · 1 line
1.8.0
PATCH 30/46 staging: line6: drop variax volume sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 42 ------------------------------------------ drivers/staging/line6/variax.h | 5 ----- 2 files changed, 47 deletions(-)
drivers/staging/line6/variax.c +0 -42
@@ -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);
drivers/staging/line6/variax.h +0 -5
@@ -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;
Signature · 1 line
1.8.0
PATCH 31/46 staging: line6: drop variax tone sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 42 ------------------------------------------ drivers/staging/line6/variax.h | 5 ----- 2 files changed, 47 deletions(-)
drivers/staging/line6/variax.c +0 -42
@@ -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);
drivers/staging/line6/variax.h +0 -5
@@ -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;
Signature · 1 line
1.8.0
PATCH 32/46 staging: line6: drop variax name sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 27 --------------------------- 1 file changed, 27 deletions(-)
drivers/staging/line6/variax.c +0 -27
@@ -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);
Signature · 1 line
1.8.0
PATCH 33/46 staging: line6: drop variax bank sysfs attr
In reply to Stefan HajnocziThe get_string() function is no longer used so drop it too.
--- drivers/staging/line6/variax.c | 34 ---------------------------------- drivers/staging/line6/variax.h | 5 ----- 2 files changed, 39 deletions(-)
drivers/staging/line6/variax.c +0 -34
@@ -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);
drivers/staging/line6/variax.h +0 -5
@@ -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;
Signature · 1 line
1.8.0
PATCH 34/46 staging: line6: drop variax dump sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 20 -------------------- 1 file changed, 20 deletions(-)
drivers/staging/line6/variax.c +0 -20
@@ -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
Signature · 1 line
1.8.0
PATCH 35/46 staging: line6: drop variax active sysfs attr
In reply to Stefan HajnocziThe get_string() function has no other callers so remove it too.
--- drivers/staging/line6/variax.c | 36 ------------------------------------ 1 file changed, 36 deletions(-)
drivers/staging/line6/variax.c +0 -36
@@ -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);
Signature · 1 line
1.8.0
PATCH 36/46 staging: line6: drop variax guitar sysfs attr
In reply to Stefan Hajnoczi--- drivers/staging/line6/variax.c | 22 ---------------------- drivers/staging/line6/variax.h | 5 ----- 2 files changed, 27 deletions(-)
drivers/staging/line6/variax.c +0 -22
@@ -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);
drivers/staging/line6/variax.h +0 -5
@@ -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;
Signature · 1 line
1.8.0
PATCH 37/46 staging: line6: drop variax raw sysfs attrs
In reply to Stefan HajnocziNote that VARIAX_SYSEX_ACTIVATE was never used so drop it along with the other VARIAX_SYSEX_* constants which are now unused.
--- drivers/staging/line6/variax.c | 73 ------------------------------------------ 1 file changed, 73 deletions(-)
drivers/staging/line6/variax.c +0 -73
@@ -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);
Signature · 1 line
1.8.0
PATCH 38/46 staging: line6: drop CONFIG_LINE6_USB_RAW
In reply to Stefan HajnocziNow 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").
--- drivers/staging/line6/Kconfig | 11 ----------- drivers/staging/line6/driver.c | 14 -------------- 2 files changed, 25 deletions(-)
drivers/staging/line6/Kconfig +0 -11
@@ -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
drivers/staging/line6/driver.c +0 -14
@@ -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)
Signature · 1 line
1.8.0
PATCH 39/46 staging: line6: drop amp/effects dump request triggers
In reply to Stefan HajnocziSince 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.
--- drivers/staging/line6/pod.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/staging/line6/pod.c +0 -9
@@ -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); }/*
Signature · 1 line
1.8.0
PATCH 40/46 staging: line6: drop MIDI parameter sysfs attrs
In reply to Stefan HajnocziBoth 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.
--- 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
drivers/staging/line6/Makefile +0 -1
@@ -3,7 +3,6 @@ obj-$(CONFIG_LINE6_USB) += line6usb.o line6usb-y := \ audio.o \ capture.o \ - control.o \ driver.o \ dumprequest.o \ midi.o \
drivers/staging/line6/control.c deleted +0 -995
995 lines not on this page · raw message
drivers/staging/line6/control.h deleted +0 -195
195 lines not on this page · raw message
drivers/staging/line6/driver.c +0 -1
@@ -16,7 +16,6 @@#include "audio.h" #include "capture.h" -#include "control.h" #include "driver.h" #include "midi.h" #include "playback.h"
drivers/staging/line6/pod.c +0 -9
@@ -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);
drivers/staging/line6/variax.c +0 -13
@@ -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); }
Signature · 1 line
1.8.0
PATCH 41/46 staging: line6: drop pod prog_data buffers
In reply to Stefan HajnocziThe 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.
--- drivers/staging/line6/pod.c | 46 +++------------------------------------------ drivers/staging/line6/pod.h | 25 ------------------------ 2 files changed, 3 insertions(+), 68 deletions(-)
drivers/staging/line6/pod.c +3 -43
@@ -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); }/*
drivers/staging/line6/pod.h +0 -25
@@ -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;
Signature · 1 line
1.8.0
PATCH 42/46 staging: line6: drop unused pod atomic_flags field
In reply to Stefan Hajnoczi--- drivers/staging/line6/pod.c | 11 ----------- drivers/staging/line6/pod.h | 5 ----- 2 files changed, 16 deletions(-)
drivers/staging/line6/pod.c +0 -11
@@ -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 :
drivers/staging/line6/pod.h +0 -5
@@ -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;
Signature · 1 line
1.8.0
PATCH 43/46 staging: line6: drop variax model_data field
In reply to Stefan HajnocziThe 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.
--- drivers/staging/line6/variax.c | 27 --------------------------- drivers/staging/line6/variax.h | 20 -------------------- 2 files changed, 47 deletions(-)
drivers/staging/line6/variax.c +0 -27
@@ -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 );
drivers/staging/line6/variax.h +0 -20
@@ -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;
Signature · 1 line
1.8.0
PATCH 44/46 staging: line6: drop dump requests from variax startup
In reply to Stefan HajnocziThe 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.
--- drivers/staging/line6/variax.c | 106 ++--------------------------------------- drivers/staging/line6/variax.h | 15 ------ 2 files changed, 4 insertions(+), 117 deletions(-)
drivers/staging/line6/variax.c +4 -102
@@ -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 );
drivers/staging/line6/variax.h +0 -15
@@ -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;
Signature · 1 line
1.8.0
PATCH 45/46 staging: line6: drop dump requests from pod startup
In reply to Stefan HajnocziThe 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.
--- drivers/staging/line6/pod.c | 44 ++++---------------------------------------- drivers/staging/line6/pod.h | 7 ------- 2 files changed, 4 insertions(+), 47 deletions(-)
drivers/staging/line6/pod.c +4 -40
@@ -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 )
drivers/staging/line6/pod.h +0 -7
@@ -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;
Signature · 1 line
1.8.0
PATCH 46/46 staging: line6: drop unused dumprequest code
In reply to Stefan HajnocziThe line6 drive no longer requests MIDI dumps from the device so dumprequest.c is not needed.
--- 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
drivers/staging/line6/Makefile +0 -1
@@ -4,7 +4,6 @@ line6usb-y := \ audio.o \ capture.o \ driver.o \ - dumprequest.o \ midi.o \ midibuf.o \ pcm.o \
drivers/staging/line6/dumprequest.c deleted +0 -135
135 lines not on this page · raw message
drivers/staging/line6/dumprequest.h deleted +0 -76
76 lines not on this page · raw message
Signature · 1 line
1.8.0