Commit e1a164d7 authored by Markus Grabner's avatar Markus Grabner Committed by Greg Kroah-Hartman

Staging: line6: another upstream sync

Everything should be in sync now.
Signed-off-by: default avatarMarkus Grabner <grabner@icg.tugraz.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1027f476
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -15,11 +15,9 @@
#include "driver.h"
#include "audio.h"
static int line6_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
static char *line6_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
/*
Initialize the Line6 USB audio system.
*/
......@@ -39,8 +37,7 @@ int line6_init_audio(struct usb_line6 *line6)
strcpy(card->id, line6->properties->id);
strcpy(card->driver, DRIVER_NAME);
strcpy(card->shortname, line6->properties->name);
sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name,
dev_name(line6->ifcdev)); /* 80 chars - see asound.h */
sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name, dev_name(line6->ifcdev)); /* 80 chars - see asound.h */
return 0;
}
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,13 +12,10 @@
#ifndef AUDIO_H
#define AUDIO_H
#include "driver.h"
extern void line6_cleanup_audio(struct usb_line6 *);
extern int line6_init_audio(struct usb_line6 *);
extern int line6_register_audio(struct usb_line6 *);
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -19,7 +19,6 @@
#include "pcm.h"
#include "pod.h"
/*
Find a free URB and submit it.
*/
......@@ -28,6 +27,7 @@ static int submit_audio_in_urb(struct snd_line6_pcm *line6pcm)
int index;
unsigned long flags;
int i, urb_size;
int ret;
struct urb *urb_in;
spin_lock_irqsave(&line6pcm->lock_audio_in, flags);
......@@ -57,11 +57,13 @@ static int submit_audio_in_urb(struct snd_line6_pcm *line6pcm)
urb_in->transfer_buffer_length = urb_size;
urb_in->context = line6pcm;
if (usb_submit_urb(urb_in, GFP_ATOMIC) == 0)
ret = usb_submit_urb(urb_in, GFP_ATOMIC);
if (ret == 0)
set_bit(index, &line6pcm->active_urb_in);
else
dev_err(line6pcm->line6->ifcdev,
"URB in #%d submission failed\n", index);
"URB in #%d submission failed (%d)\n", index, ret);
spin_unlock_irqrestore(&line6pcm->lock_audio_in, flags);
return 0;
......@@ -147,9 +149,9 @@ void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf, int fsize)
if (line6pcm->pos_in_done + frames > runtime->buffer_size) {
/*
The transferred area goes over buffer boundary,
copy two separate chunks.
*/
The transferred area goes over buffer boundary,
copy two separate chunks.
*/
int len;
len = runtime->buffer_size - line6pcm->pos_in_done;
......@@ -216,7 +218,7 @@ static void audio_in_callback(struct urb *urb)
int fsize;
struct usb_iso_packet_descriptor *fin = &urb->iso_frame_desc[i];
if (fin->status == -18) {
if (fin->status == -EXDEV) {
shutdown = 1;
break;
}
......@@ -258,8 +260,11 @@ static void audio_in_callback(struct urb *urb)
if (!shutdown) {
submit_audio_in_urb(line6pcm);
if (test_bit(BIT_PCM_ALSA_CAPTURE, &line6pcm->flags))
line6_capture_check_period(line6pcm, length);
#ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE
if (!(line6pcm->flags & MASK_PCM_IMPULSE))
#endif
if (test_bit(BIT_PCM_ALSA_CAPTURE, &line6pcm->flags))
line6_capture_check_period(line6pcm, length);
}
}
......@@ -272,8 +277,8 @@ static int snd_line6_capture_open(struct snd_pcm_substream *substream)
err = snd_pcm_hw_constraint_ratdens(runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
(&line6pcm->properties->
snd_line6_rates));
(&line6pcm->
properties->snd_line6_rates));
if (err < 0)
return err;
......@@ -366,14 +371,14 @@ snd_line6_capture_pointer(struct snd_pcm_substream *substream)
/* capture operators */
struct snd_pcm_ops snd_line6_capture_ops = {
.open = snd_line6_capture_open,
.close = snd_line6_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_line6_capture_hw_params,
.hw_free = snd_line6_capture_hw_free,
.prepare = snd_line6_prepare,
.trigger = snd_line6_trigger,
.pointer = snd_line6_capture_pointer,
.open = snd_line6_capture_open,
.close = snd_line6_capture_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_line6_capture_hw_params,
.hw_free = snd_line6_capture_hw_free,
.prepare = snd_line6_prepare,
.trigger = snd_line6_trigger,
.pointer = snd_line6_capture_pointer,
};
int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm)
......@@ -396,8 +401,8 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm)
urb->dev = line6pcm->line6->usbdev;
urb->pipe =
usb_rcvisocpipe(line6pcm->line6->usbdev,
line6pcm->
ep_audio_read & USB_ENDPOINT_NUMBER_MASK);
line6pcm->ep_audio_read &
USB_ENDPOINT_NUMBER_MASK);
urb->transfer_flags = URB_ISO_ASAP;
urb->start_frame = -1;
urb->number_of_packets = LINE6_ISO_PACKETS;
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,17 +12,17 @@
#ifndef CAPTURE_H
#define CAPTURE_H
#include <sound/pcm.h>
#include "driver.h"
#include "pcm.h"
extern struct snd_pcm_ops snd_line6_capture_ops;
extern void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf,
int fsize);
extern void line6_capture_check_period(struct snd_line6_pcm *line6pcm,
int length);
extern int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm);
extern int line6_submit_audio_in_all_urbs(struct snd_line6_pcm *line6pcm);
extern void line6_unlink_audio_in_urbs(struct snd_line6_pcm *line6pcm);
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -22,7 +22,9 @@
from "control.h", and this process depends on the exact formatting of the
code and the comments below!
*/
/* *INDENT-OFF* */
enum {
POD_tweak = 1,
POD_wah_position = 4,
......@@ -181,11 +183,13 @@ enum {
VARIAXMIDI_tone = 79,
};
/* *INDENT-ON* */
extern int line6_pod_create_files(int firmware, int type, struct device *dev);
extern void line6_pod_remove_files(int firmware, int type, struct device *dev);
extern int line6_variax_create_files(int firmware, int type, struct device *dev);
extern void line6_variax_remove_files(int firmware, int type, struct device *dev);
extern int line6_variax_create_files(int firmware, int type,
struct device *dev);
extern void line6_variax_remove_files(int firmware, int type,
struct device *dev);
#endif
This diff is collapsed.
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,14 +12,12 @@
#ifndef DRIVER_H
#define DRIVER_H
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <sound/core.h>
#include "midi.h"
#define DRIVER_NAME "line6usb"
#if defined(CONFIG_LINE6_USB_DUMP_CTRL) || defined(CONFIG_LINE6_USB_DUMP_MIDI) || defined(CONFIG_LINE6_USB_DUMP_PCM)
......@@ -51,7 +49,7 @@
*/
#define LINE6_CHANNEL_DEVICE 0x02
#define LINE6_CHANNEL_UNKNOWN 5 /* don't know yet what this is good for */
#define LINE6_CHANNEL_UNKNOWN 5 /* don't know yet what this is good for */
#define LINE6_CHANNEL_MASK 0x0f
......@@ -61,12 +59,10 @@
#define DEBUG_MESSAGES(x)
#endif
#define MISSING_CASE \
printk(KERN_ERR "line6usb driver bug: missing case in %s:%d\n", \
__FILE__, __LINE__)
#define CHECK_RETURN(x) \
do { \
err = x; \
......@@ -79,14 +75,12 @@ do { \
return; \
x = (n);
extern const unsigned char line6_midi_id[3];
extern struct usb_line6 *line6_devices[LINE6_MAX_DEVICES];
static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
/**
Common properties of Line6 devices.
*/
......@@ -202,7 +196,6 @@ struct usb_line6 {
int message_length;
};
extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1,
int code2, int size);
extern ssize_t line6_nop_read(struct device *dev,
......@@ -226,7 +219,8 @@ extern int line6_send_sysex_message_async(struct usb_line6 *line6,
extern ssize_t line6_set_raw(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count);
extern void line6_start_timer(struct timer_list *timer, unsigned int msecs,
void (*function)(unsigned long), unsigned long data);
void (*function) (unsigned long),
unsigned long data);
extern int line6_transmit_parameter(struct usb_line6 *line6, int param,
int value);
extern int line6_version_request_async(struct usb_line6 *line6);
......@@ -238,5 +232,4 @@ extern void line6_write_hexdump(struct usb_line6 *line6, char dir,
const unsigned char *buffer, int size);
#endif
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -14,7 +14,6 @@
#include "driver.h"
#include "dumprequest.h"
/*
Set "dump in progress" flag.
*/
......@@ -63,7 +62,8 @@ int line6_dump_request_async(struct line6_dump_request *l6dr,
*/
int line6_dump_wait_interruptible(struct line6_dump_request *l6dr)
{
return wait_event_interruptible(l6dr->wait, l6dr->in_progress == LINE6_DUMP_NONE);
return wait_event_interruptible(l6dr->wait,
l6dr->in_progress == LINE6_DUMP_NONE);
}
/*
......@@ -79,7 +79,9 @@ void line6_dump_wait(struct line6_dump_request *l6dr)
*/
int line6_dump_wait_timeout(struct line6_dump_request *l6dr, long timeout)
{
return wait_event_timeout(l6dr->wait, l6dr->in_progress == LINE6_DUMP_NONE, timeout);
return wait_event_timeout(l6dr->wait,
l6dr->in_progress == LINE6_DUMP_NONE,
timeout);
}
/*
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,18 +12,15 @@
#ifndef DUMPREQUEST_H
#define DUMPREQUEST_H
#include <linux/usb.h>
#include <linux/wait.h>
#include <sound/core.h>
enum {
LINE6_DUMP_NONE,
LINE6_DUMP_CURRENT
};
struct line6_dump_reqbuf {
/**
Buffer for dump requests.
......@@ -76,5 +73,4 @@ extern int line6_dump_wait_interruptible(struct line6_dump_request *l6dr);
extern int line6_dump_wait_timeout(struct line6_dump_request *l6dr,
long timeout);
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -20,15 +20,12 @@
#include "pod.h"
#include "usbdefs.h"
#define line6_rawmidi_substream_midi(substream) \
((struct snd_line6_midi *)((substream)->rmidi->private_data))
static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
int length);
/*
Pass data received via USB to MIDI.
*/
......@@ -45,7 +42,8 @@ void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
*/
static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
{
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
struct usb_line6 *line6 =
line6_rawmidi_substream_midi(substream)->line6;
struct snd_line6_midi *line6midi = line6->line6midi;
struct MidiBuffer *mb = &line6midi->midibuf_out;
unsigned long flags;
......@@ -74,7 +72,8 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
if (done == 0)
break;
if (line6_midibuf_skip_message(mb, line6midi->midi_mask_transmit))
if (line6_midibuf_skip_message
(mb, line6midi->midi_mask_transmit))
continue;
send_midi_async(line6, chunk, done);
......@@ -132,7 +131,6 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
dev_err(line6->ifcdev, "Out of memory\n");
return -ENOMEM;
}
#ifdef CONFIG_LINE6_USB_DUMP_CTRL
line6_write_hexdump(line6, 'S', data, length);
#endif
......@@ -174,6 +172,9 @@ static int send_midi_async(struct usb_line6 *line6, unsigned char *data,
length);
break;
case LINE6_DEVID_VARIAX:
break;
default:
MISSING_CASE;
}
......@@ -195,7 +196,8 @@ static void line6_midi_output_trigger(struct snd_rawmidi_substream *substream,
int up)
{
unsigned long flags;
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
struct usb_line6 *line6 =
line6_rawmidi_substream_midi(substream)->line6;
line6->line6midi->substream_transmit = substream;
spin_lock_irqsave(&line6->line6midi->send_urb_lock, flags);
......@@ -208,9 +210,11 @@ static void line6_midi_output_trigger(struct snd_rawmidi_substream *substream,
static void line6_midi_output_drain(struct snd_rawmidi_substream *substream)
{
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
struct usb_line6 *line6 =
line6_rawmidi_substream_midi(substream)->line6;
struct snd_line6_midi *midi = line6->line6midi;
wait_event_interruptible(midi->send_wait, midi->num_active_send_urbs == 0);
wait_event_interruptible(midi->send_wait,
midi->num_active_send_urbs == 0);
}
static int line6_midi_input_open(struct snd_rawmidi_substream *substream)
......@@ -226,7 +230,8 @@ static int line6_midi_input_close(struct snd_rawmidi_substream *substream)
static void line6_midi_input_trigger(struct snd_rawmidi_substream *substream,
int up)
{
struct usb_line6 *line6 = line6_rawmidi_substream_midi(substream)->line6;
struct usb_line6 *line6 =
line6_rawmidi_substream_midi(substream)->line6;
if (up)
line6->line6midi->substream_receive = substream;
......@@ -271,9 +276,8 @@ static int snd_line6_new_midi(struct snd_line6_midi *line6midi)
strcpy(rmidi->name, line6midi->line6->properties->name);
rmidi->info_flags =
SNDRV_RAWMIDI_INFO_OUTPUT |
SNDRV_RAWMIDI_INFO_INPUT |
SNDRV_RAWMIDI_INFO_DUPLEX;
SNDRV_RAWMIDI_INFO_OUTPUT |
SNDRV_RAWMIDI_INFO_INPUT | SNDRV_RAWMIDI_INFO_DUPLEX;
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT,
&line6_midi_output_ops);
......@@ -346,15 +350,19 @@ static ssize_t midi_set_midi_mask_receive(struct device *dev,
return count;
}
static DEVICE_ATTR(midi_mask_transmit, S_IWUGO | S_IRUGO, midi_get_midi_mask_transmit, midi_set_midi_mask_transmit);
static DEVICE_ATTR(midi_mask_receive, S_IWUGO | S_IRUGO, midi_get_midi_mask_receive, midi_set_midi_mask_receive);
static DEVICE_ATTR(midi_mask_transmit, S_IWUGO | S_IRUGO,
midi_get_midi_mask_transmit, midi_set_midi_mask_transmit);
static DEVICE_ATTR(midi_mask_receive, S_IWUGO | S_IRUGO,
midi_get_midi_mask_receive, midi_set_midi_mask_receive);
/* 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);
device_remove_file(line6midi->line6->ifcdev, &dev_attr_midi_mask_receive);
device_remove_file(line6midi->line6->ifcdev,
&dev_attr_midi_mask_transmit);
device_remove_file(line6midi->line6->ifcdev,
&dev_attr_midi_mask_receive);
line6_midibuf_destroy(&line6midi->midibuf_in);
line6_midibuf_destroy(&line6midi->midibuf_out);
return 0;
......@@ -373,7 +381,7 @@ int line6_init_midi(struct usb_line6 *line6)
struct snd_line6_midi *line6midi;
if (!(line6->properties->capabilities & LINE6_BIT_CONTROL))
return 0; /* skip MIDI initialization and report success */
return 0; /* skip MIDI initialization and report success */
line6midi = kzalloc(sizeof(struct snd_line6_midi), GFP_KERNEL);
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,15 +12,12 @@
#ifndef MIDI_H
#define MIDI_H
#include <sound/rawmidi.h>
#include "midibuf.h"
#define MIDI_BUFFER_SIZE 1024
struct snd_line6_midi {
/**
Pointer back to the Line6 driver data structure.
......@@ -78,10 +75,8 @@ struct snd_line6_midi {
struct MidiBuffer midibuf_out;
};
extern int line6_init_midi(struct usb_line6 *line6);
extern void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
int length);
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -13,7 +13,6 @@
#include "midibuf.h"
static int midibuf_message_length(unsigned char code)
{
if (code < 0x80)
......@@ -23,12 +22,13 @@ static int midibuf_message_length(unsigned char code)
return length[(code >> 4) - 8];
} else {
/*
Note that according to the MIDI specification 0xf2 is
the "Song Position Pointer", but this is used by Line6
to send sysex messages to the host.
*/
Note that according to the MIDI specification 0xf2 is
the "Song Position Pointer", but this is used by Line6
to send sysex messages to the host.
*/
static const int length[] = { -1, 2, -1, 2, -1, -1, 1, 1, 1, 1,
1, 1, 1, -1, 1, 1 };
1, 1, 1, -1, 1, 1
};
return length[code & 0x0f];
}
}
......@@ -72,20 +72,23 @@ void line6_midibuf_status(struct MidiBuffer *this)
int line6_midibuf_bytes_free(struct MidiBuffer *this)
{
return
midibuf_is_full(this) ?
0 :
(this->pos_read - this->pos_write + this->size - 1) % this->size + 1;
midibuf_is_full(this) ?
0 :
(this->pos_read - this->pos_write + this->size - 1) % this->size +
1;
}
int line6_midibuf_bytes_used(struct MidiBuffer *this)
{
return
midibuf_is_empty(this) ?
0 :
(this->pos_write - this->pos_read + this->size - 1) % this->size + 1;
midibuf_is_empty(this) ?
0 :
(this->pos_write - this->pos_read + this->size - 1) % this->size +
1;
}
int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data, int length)
int line6_midibuf_write(struct MidiBuffer *this, unsigned char *data,
int length)
{
int bytes_free;
int length1, length2;
......@@ -158,7 +161,8 @@ int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
this->command_prev = command;
} else {
if (this->command_prev > 0) {
int midi_length_prev = midibuf_message_length(this->command_prev);
int midi_length_prev =
midibuf_message_length(this->command_prev);
if (midi_length_prev > 0) {
midi_length = midi_length_prev - 1;
......@@ -198,15 +202,15 @@ int line6_midibuf_read(struct MidiBuffer *this, unsigned char *data, int length)
}
if (midi_length == length)
midi_length = -1; /* end of message not found */
midi_length = -1; /* end of message not found */
}
if (midi_length < 0) {
if (!this->split)
return 0; /* command is not yet complete */
return 0; /* command is not yet complete */
} else {
if (length < midi_length)
return 0; /* command is not yet complete */
return 0; /* command is not yet complete */
length = midi_length;
}
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,7 +12,6 @@
#ifndef MIDIBUF_H
#define MIDIBUF_H
struct MidiBuffer {
unsigned char *buf;
int size;
......@@ -22,18 +21,18 @@ struct MidiBuffer {
int command_prev;
};
extern int line6_midibuf_bytes_used(struct MidiBuffer *mb);
extern int line6_midibuf_bytes_free(struct MidiBuffer *mb);
extern void line6_midibuf_destroy(struct MidiBuffer *mb);
extern int line6_midibuf_ignore(struct MidiBuffer *mb, int length);
extern int line6_midibuf_init(struct MidiBuffer *mb, int size, int split);
extern int line6_midibuf_read(struct MidiBuffer *mb, unsigned char *data, int length);
extern int line6_midibuf_read(struct MidiBuffer *mb, unsigned char *data,
int length);
extern void line6_midibuf_reset(struct MidiBuffer *mb);
extern int line6_midibuf_skip_message(struct MidiBuffer *mb, unsigned short mask);
extern int line6_midibuf_skip_message(struct MidiBuffer *mb,
unsigned short mask);
extern void line6_midibuf_status(struct MidiBuffer *mb);
extern int line6_midibuf_write(struct MidiBuffer *mb, unsigned char *data,
int length);
#endif
This diff is collapsed.
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -16,13 +16,11 @@
#ifndef PCM_H
#define PCM_H
#include <sound/pcm.h>
#include "driver.h"
#include "usbdefs.h"
/* number of URBs */
#define LINE6_ISO_BUFFERS 2
......@@ -44,13 +42,11 @@
#define LINE6_BACKUP_MONITOR_SIGNAL 0
#define LINE6_REUSE_DMA_AREA_FOR_PLAYBACK 0
/*
Get substream from Line6 PCM data structure
*/
#define get_substream(line6pcm, stream) (line6pcm->pcm->streams[stream].substream)
/*
PCM mode bits and masks.
"ALSA": operations triggered by applications via ALSA
......@@ -71,6 +67,7 @@ enum {
BIT_PREPARED,
/* individual masks: */
/* *INDENT-OFF* */
MASK_PCM_ALSA_PLAYBACK = 1 << BIT_PCM_ALSA_PLAYBACK,
MASK_PCM_ALSA_CAPTURE = 1 << BIT_PCM_ALSA_CAPTURE,
MASK_PCM_MONITOR_PLAYBACK = 1 << BIT_PCM_MONITOR_PLAYBACK,
......@@ -81,9 +78,10 @@ enum {
#endif
MASK_PAUSE_PLAYBACK = 1 << BIT_PAUSE_PLAYBACK,
MASK_PREPARED = 1 << BIT_PREPARED,
/* *INDENT-ON* */
/* combined masks (by operation): */
MASK_PCM_ALSA = MASK_PCM_ALSA_PLAYBACK | MASK_PCM_ALSA_CAPTURE,
MASK_PCM_ALSA = MASK_PCM_ALSA_PLAYBACK | MASK_PCM_ALSA_CAPTURE,
MASK_PCM_MONITOR = MASK_PCM_MONITOR_PLAYBACK | MASK_PCM_MONITOR_CAPTURE,
#ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE
MASK_PCM_IMPULSE = MASK_PCM_IMPULSE_PLAYBACK | MASK_PCM_IMPULSE_CAPTURE,
......@@ -91,11 +89,15 @@ enum {
/* combined masks (by direction): */
#ifdef CONFIG_LINE6_USB_IMPULSE_RESPONSE
MASK_PLAYBACK = MASK_PCM_ALSA_PLAYBACK | MASK_PCM_MONITOR_PLAYBACK | MASK_PCM_IMPULSE_PLAYBACK,
MASK_CAPTURE = MASK_PCM_ALSA_CAPTURE | MASK_PCM_MONITOR_CAPTURE | MASK_PCM_IMPULSE_CAPTURE
MASK_PLAYBACK =
MASK_PCM_ALSA_PLAYBACK | MASK_PCM_MONITOR_PLAYBACK |
MASK_PCM_IMPULSE_PLAYBACK,
MASK_CAPTURE =
MASK_PCM_ALSA_CAPTURE | MASK_PCM_MONITOR_CAPTURE |
MASK_PCM_IMPULSE_CAPTURE
#else
MASK_PLAYBACK = MASK_PCM_ALSA_PLAYBACK | MASK_PCM_MONITOR_PLAYBACK,
MASK_CAPTURE = MASK_PCM_ALSA_CAPTURE | MASK_PCM_MONITOR_CAPTURE
MASK_CAPTURE = MASK_PCM_ALSA_CAPTURE | MASK_PCM_MONITOR_CAPTURE
#endif
};
......@@ -302,7 +304,6 @@ struct snd_line6_pcm {
int last_frame_in, last_frame_out;
};
extern int line6_init_pcm(struct usb_line6 *line6,
struct line6_pcm_properties *properties);
extern int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd);
......@@ -311,7 +312,6 @@ extern void line6_pcm_disconnect(struct snd_line6_pcm *line6pcm);
extern int line6_pcm_start(struct snd_line6_pcm *line6pcm, int channels);
extern int line6_pcm_stop(struct snd_line6_pcm *line6pcm, int channels);
#define PRINT_FRAME_DIFF(op) { \
static int diff_prev = 1000; \
int diff = line6pcm->last_frame_out - line6pcm->last_frame_in; \
......@@ -321,5 +321,4 @@ extern int line6_pcm_stop(struct snd_line6_pcm *line6pcm, int channels);
} \
}
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -68,7 +68,16 @@ static void create_impulse_test_signal(struct snd_line6_pcm *line6pcm,
int frames = urb_out->transfer_buffer_length / bytes_per_frame;
if (bytes_per_frame == 4) {
/* TODO: add code for TonePort etc. */
int i;
short *pi = (short *)line6pcm->prev_fbuf;
short *po = (short *)urb_out->transfer_buffer;
for (i = 0; i < frames; ++i) {
po[0] = pi[0];
po[1] = 0;
pi += 2;
po += 2;
}
} else if (bytes_per_frame == 6) {
int i, j;
unsigned char *pi = line6pcm->prev_fbuf;
......@@ -84,14 +93,12 @@ static void create_impulse_test_signal(struct snd_line6_pcm *line6pcm,
pi += bytes_per_frame;
po += bytes_per_frame;
}
if (--line6pcm->impulse_count <= 0) {
((unsigned char *)(urb_out->
transfer_buffer))[bytes_per_frame -
1] =
line6pcm->impulse_volume;
line6pcm->impulse_count = line6pcm->impulse_period;
}
}
if (--line6pcm->impulse_count <= 0) {
((unsigned char *)(urb_out->transfer_buffer))[bytes_per_frame -
1] =
line6pcm->impulse_volume;
line6pcm->impulse_count = line6pcm->impulse_period;
}
}
......@@ -117,9 +124,9 @@ static void add_monitor_signal(struct urb *urb_out, unsigned char *signal,
}
/*
We don't need to handle devices with 6 bytes per frame here
since they all support hardware monitoring.
*/
We don't need to handle devices with 6 bytes per frame here
since they all support hardware monitoring.
*/
}
/*
......@@ -130,6 +137,7 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
int index;
unsigned long flags;
int i, urb_size, urb_frames;
int ret;
const int bytes_per_frame = line6pcm->properties->bytes_per_frame;
const int frame_increment =
line6pcm->properties->snd_line6_rates.rats[0].num_min;
......@@ -244,16 +252,20 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
create_impulse_test_signal(line6pcm, urb_out,
bytes_per_frame);
if (line6pcm->flags & MASK_PCM_ALSA_CAPTURE) {
line6_capture_copy(line6pcm, urb_out->transfer_buffer,
urb_out->transfer_buffer_length);
line6_capture_copy(line6pcm,
urb_out->transfer_buffer,
urb_out->
transfer_buffer_length);
line6_capture_check_period(line6pcm,
urb_out->transfer_buffer_length);
}
} else {
#endif
if (!
(line6pcm->line6->properties->
capabilities & LINE6_BIT_HWMON)
&& (line6pcm->flags & MASK_PLAYBACK)
&& (line6pcm->flags & MASK_CAPTURE))
(line6pcm->line6->
properties->capabilities & LINE6_BIT_HWMON)
&& (line6pcm->flags & MASK_PLAYBACK)
&& (line6pcm->flags & MASK_CAPTURE))
add_monitor_signal(urb_out, line6pcm->prev_fbuf,
line6pcm->volume_monitor,
bytes_per_frame);
......@@ -271,11 +283,13 @@ static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
}
#endif
if (usb_submit_urb(urb_out, GFP_ATOMIC) == 0)
ret = usb_submit_urb(urb_out, GFP_ATOMIC);
if (ret == 0)
set_bit(index, &line6pcm->active_urb_out);
else
dev_err(line6pcm->line6->ifcdev,
"URB out #%d submission failed\n", index);
"URB out #%d submission failed (%d)\n", index, ret);
spin_unlock_irqrestore(&line6pcm->lock_audio_out, flags);
return 0;
......@@ -355,8 +369,7 @@ static void audio_out_callback(struct urb *urb)
int i, index, length = 0, shutdown = 0;
unsigned long flags;
struct snd_line6_pcm *line6pcm =
(struct snd_line6_pcm *)urb->context;
struct snd_line6_pcm *line6pcm = (struct snd_line6_pcm *)urb->context;
struct snd_pcm_substream *substream =
get_substream(line6pcm, SNDRV_PCM_STREAM_PLAYBACK);
......@@ -391,7 +404,7 @@ static void audio_out_callback(struct urb *urb)
clear_bit(index, &line6pcm->active_urb_out);
for (i = LINE6_ISO_PACKETS; i--;)
if (urb->iso_frame_desc[i].status == -ESHUTDOWN) {
if (urb->iso_frame_desc[i].status == -EXDEV) {
shutdown = 1;
break;
}
......@@ -422,8 +435,8 @@ static int snd_line6_playback_open(struct snd_pcm_substream *substream)
struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
err = snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
(&line6pcm->properties->
snd_line6_rates));
(&line6pcm->
properties->snd_line6_rates));
if (err < 0)
return err;
......@@ -524,14 +537,14 @@ snd_line6_playback_pointer(struct snd_pcm_substream *substream)
/* playback operators */
struct snd_pcm_ops snd_line6_playback_ops = {
.open = snd_line6_playback_open,
.close = snd_line6_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_line6_playback_hw_params,
.hw_free = snd_line6_playback_hw_free,
.prepare = snd_line6_prepare,
.trigger = snd_line6_trigger,
.pointer = snd_line6_playback_pointer,
.open = snd_line6_playback_open,
.close = snd_line6_playback_close,
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_line6_playback_hw_params,
.hw_free = snd_line6_playback_hw_free,
.prepare = snd_line6_prepare,
.trigger = snd_line6_trigger,
.pointer = snd_line6_playback_pointer,
};
int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm)
......@@ -554,8 +567,8 @@ int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm)
urb->dev = line6pcm->line6->usbdev;
urb->pipe =
usb_sndisocpipe(line6pcm->line6->usbdev,
line6pcm->
ep_audio_write & USB_ENDPOINT_NUMBER_MASK);
line6pcm->ep_audio_write &
USB_ENDPOINT_NUMBER_MASK);
urb->transfer_flags = URB_ISO_ASAP;
urb->start_frame = -1;
urb->number_of_packets = LINE6_ISO_PACKETS;
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,12 +12,10 @@
#ifndef PLAYBACK_H
#define PLAYBACK_H
#include <sound/pcm.h>
#include "driver.h"
/*
When the TonePort is used with jack in full duplex mode and the outputs are
not connected, the software monitor produces an ugly noise since everything
......@@ -28,7 +26,6 @@
*/
#define USE_CLEAR_BUFFER_WORKAROUND 1
extern struct snd_pcm_ops snd_line6_playback_ops;
extern int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm);
......
This diff is collapsed.
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,7 +12,6 @@
#ifndef POD_H
#define POD_H
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
......@@ -23,7 +22,6 @@
#include "driver.h"
#include "dumprequest.h"
/*
PODxt Live interfaces
*/
......@@ -41,7 +39,19 @@
*/
#define POD_CONTROL_SIZE 0x80
#define POD_BUFSIZE_DUMPREQ 7
#define POD_STARTUP_DELAY 3000
#define POD_STARTUP_DELAY 1000
/*
Stages of POD startup procedure
*/
enum {
POD_STARTUP_INIT = 1,
POD_STARTUP_DUMPREQ,
POD_STARTUP_VERSIONREQ,
POD_STARTUP_WORKQUEUE,
POD_STARTUP_SETUP,
POD_STARTUP_LAST = POD_STARTUP_SETUP - 1
};
/**
Data structure for values that need to be requested explicitly.
......@@ -183,14 +193,13 @@ struct usb_line6_pod {
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 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,
int value);
#endif
#ifndef DRIVER_REVISION
/* current subversion revision */
#define DRIVER_REVISION " (revision 665)"
#define DRIVER_REVISION " (revision 684)"
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
* Emil Myhrman (emil.myhrman@gmail.com)
......@@ -19,13 +19,10 @@
#include "playback.h"
#include "toneport.h"
static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2);
#define TONEPORT_PCM_DELAY 1
static struct snd_ratden toneport_ratden = {
.num_min = 44100,
.num_max = 44100,
......@@ -35,52 +32,49 @@ static struct snd_ratden toneport_ratden = {
static struct line6_pcm_properties toneport_pcm_properties = {
.snd_line6_playback_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE |
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_PAUSE |
#ifdef CONFIG_PM
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_RESUME |
#endif
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT,
.rate_min = 44100,
.rate_max = 44100,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = 60000,
.period_bytes_min = 64,
.period_bytes_max = 8192,
.periods_min = 1,
.periods_max = 1024
},
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT,
.rate_min = 44100,
.rate_max = 44100,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = 60000,
.period_bytes_min = 64,
.period_bytes_max = 8192,
.periods_min = 1,
.periods_max = 1024},
.snd_line6_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
#ifdef CONFIG_PM
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_RESUME |
#endif
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT,
.rate_min = 44100,
.rate_max = 44100,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = 60000,
.period_bytes_min = 64,
.period_bytes_max = 8192,
.periods_min = 1,
.periods_max = 1024
},
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT,
.rate_min = 44100,
.rate_max = 44100,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = 60000,
.period_bytes_min = 64,
.period_bytes_max = 8192,
.periods_min = 1,
.periods_max = 1024},
.snd_line6_rates = {
.nrats = 1,
.rats = &toneport_ratden
},
.nrats = 1,
.rats = &toneport_ratden},
.bytes_per_frame = 4
};
......@@ -93,24 +87,23 @@ static struct line6_pcm_properties toneport_pcm_properties = {
static int led_red = 0x00;
static int led_green = 0x26;
struct ToneportSourceInfo
{
struct ToneportSourceInfo {
const char *name;
int code;
};
static const struct ToneportSourceInfo toneport_source_info[] = {
{ "Microphone", 0x0a01 },
{ "Line" , 0x0801 },
{ "Instrument", 0x0b01 },
{ "Inst & Mic", 0x0901 }
{"Microphone", 0x0a01},
{"Line", 0x0801},
{"Instrument", 0x0b01},
{"Inst & Mic", 0x0901}
};
static bool toneport_has_led(short product)
{
return
(product == LINE6_DEVID_GUITARPORT) ||
(product == LINE6_DEVID_TONEPORT_GX);
(product == LINE6_DEVID_GUITARPORT) ||
(product == LINE6_DEVID_TONEPORT_GX);
/* add your device here if you are missing support for the LEDs */
}
......@@ -166,7 +159,6 @@ static DEVICE_ATTR(led_red, S_IWUGO | S_IRUGO, line6_nop_read,
static DEVICE_ATTR(led_green, S_IWUGO | S_IRUGO, line6_nop_read,
toneport_set_led_green);
static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2)
{
int ret;
......@@ -209,10 +201,16 @@ static int snd_toneport_monitor_put(struct snd_kcontrol *kcontrol,
{
struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
if(ucontrol->value.integer.value[0] == line6pcm->volume_monitor)
if (ucontrol->value.integer.value[0] == line6pcm->volume_monitor)
return 0;
line6pcm->volume_monitor = ucontrol->value.integer.value[0];
if (line6pcm->volume_monitor > 0)
line6_pcm_start(line6pcm, MASK_PCM_MONITOR);
else
line6_pcm_stop(line6pcm, MASK_PCM_MONITOR);
return 1;
}
......@@ -225,7 +223,7 @@ static int snd_toneport_source_info(struct snd_kcontrol *kcontrol,
uinfo->count = 1;
uinfo->value.enumerated.items = size;
if(uinfo->value.enumerated.item >= size)
if (uinfo->value.enumerated.item >= size)
uinfo->value.enumerated.item = size - 1;
strcpy(uinfo->value.enumerated.name,
......@@ -239,7 +237,8 @@ static int snd_toneport_source_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
struct usb_line6_toneport *toneport = (struct usb_line6_toneport *)line6pcm->line6;
struct usb_line6_toneport *toneport =
(struct usb_line6_toneport *)line6pcm->line6;
ucontrol->value.enumerated.item[0] = toneport->source;
return 0;
}
......@@ -249,13 +248,15 @@ static int snd_toneport_source_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
struct usb_line6_toneport *toneport = (struct usb_line6_toneport *)line6pcm->line6;
struct usb_line6_toneport *toneport =
(struct usb_line6_toneport *)line6pcm->line6;
if(ucontrol->value.enumerated.item[0] == toneport->source)
if (ucontrol->value.enumerated.item[0] == toneport->source)
return 0;
toneport->source = ucontrol->value.enumerated.item[0];
toneport_send_cmd(toneport->line6.usbdev, toneport_source_info[toneport->source].code, 0x0000);
toneport_send_cmd(toneport->line6.usbdev,
toneport_source_info[toneport->source].code, 0x0000);
return 1;
}
......@@ -321,10 +322,12 @@ static void toneport_setup(struct usb_line6_toneport *toneport)
toneport_send_cmd(usbdev, 0x0301, 0x0000);
/* initialize source select: */
switch(usbdev->descriptor.idProduct) {
switch (usbdev->descriptor.idProduct) {
case LINE6_DEVID_TONEPORT_UX1:
case LINE6_DEVID_PODSTUDIO_UX1:
toneport_send_cmd(usbdev, toneport_source_info[toneport->source].code, 0x0000);
toneport_send_cmd(usbdev,
toneport_source_info[toneport->source].code,
0x0000);
}
if (toneport_has_led(usbdev->descriptor.idProduct))
......@@ -357,16 +360,22 @@ static int toneport_try_init(struct usb_interface *interface,
}
/* register monitor control: */
err = snd_ctl_add(line6->card, snd_ctl_new1(&toneport_control_monitor, line6->line6pcm));
err =
snd_ctl_add(line6->card,
snd_ctl_new1(&toneport_control_monitor,
line6->line6pcm));
if (err < 0) {
return err;
}
/* register source select control: */
switch(usbdev->descriptor.idProduct) {
switch (usbdev->descriptor.idProduct) {
case LINE6_DEVID_TONEPORT_UX1:
case LINE6_DEVID_PODSTUDIO_UX1:
err = snd_ctl_add(line6->card, snd_ctl_new1(&toneport_control_source, line6->line6pcm));
err =
snd_ctl_add(line6->card,
snd_ctl_new1(&toneport_control_source,
line6->line6pcm));
if (err < 0) {
return err;
}
......@@ -382,8 +391,10 @@ static int toneport_try_init(struct usb_interface *interface,
line6_read_data(line6, 0x80c2, &toneport->firmware_version, 1);
if (toneport_has_led(usbdev->descriptor.idProduct)) {
CHECK_RETURN(device_create_file(&interface->dev, &dev_attr_led_red));
CHECK_RETURN(device_create_file(&interface->dev, &dev_attr_led_green));
CHECK_RETURN(device_create_file
(&interface->dev, &dev_attr_led_red));
CHECK_RETURN(device_create_file
(&interface->dev, &dev_attr_led_green));
}
toneport_setup(toneport);
......
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,13 +12,11 @@
#ifndef TONEPORT_H
#define TONEPORT_H
#include <linux/usb.h>
#include <sound/core.h>
#include "driver.h"
struct usb_line6_toneport {
/**
Generic Line6 USB data.
......@@ -46,11 +44,9 @@ struct usb_line6_toneport {
struct timer_list timer;
};
extern void line6_toneport_disconnect(struct usb_interface *interface);
extern int line6_toneport_init(struct usb_interface *interface,
struct usb_line6_toneport *toneport);
extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport);
#endif
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2005-2008 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,7 +12,6 @@
#ifndef USBDEFS_H
#define USBDEFS_H
#define LINE6_VENDOR_ID 0x0e41
#define USB_INTERVALS_PER_SECOND 1000
......@@ -80,5 +79,4 @@
#define LINE6_FALLBACK_INTERVAL 10
#define LINE6_FALLBACK_MAXPACKETSIZE 16
#endif
This diff is collapsed.
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
......@@ -12,7 +12,6 @@
#ifndef VARIAX_H
#define VARIAX_H
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/wait.h>
......@@ -21,11 +20,23 @@
#include "driver.h"
#include "dumprequest.h"
#define VARIAX_STARTUP_DELAY1 1000
#define VARIAX_STARTUP_DELAY3 100
#define VARIAX_STARTUP_DELAY4 100
/*
Stages of Variax startup procedure
*/
enum {
VARIAX_STARTUP_INIT = 1,
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,
......@@ -33,7 +44,6 @@ enum {
VARIAX_DUMP_PASS3
};
/**
Binary Variax model dump
*/
......@@ -59,7 +69,8 @@ struct usb_line6_variax {
Dump request structure.
Append two extra buffers for 3-pass data query.
*/
struct line6_dump_request dumpreq; struct line6_dump_reqbuf extrabuf[2];
struct line6_dump_request dumpreq;
struct line6_dump_reqbuf extrabuf[2];
/**
Buffer for activation code.
......@@ -102,9 +113,10 @@ struct usb_line6_variax {
struct work_struct startup_work;
/**
Timer for device initializaton.
Timers for device initializaton.
*/
struct timer_list startup_timer;
struct timer_list startup_timer1;
struct timer_list startup_timer2;
/**
Current progress in startup procedure.
......@@ -112,11 +124,9 @@ struct usb_line6_variax {
int startup_progress;
};
extern void line6_variax_disconnect(struct usb_interface *interface);
extern int line6_variax_init(struct usb_interface *interface,
struct usb_line6_variax *variax);
extern void line6_variax_process_message(struct usb_line6_variax *variax);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment