Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6eb3db91 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'topic/line6' into for-next

parents d832f3dc 1263f611
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -216,12 +216,11 @@ 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->rates);
	if (err < 0)
		return err;

	runtime->hw = line6pcm->properties->snd_line6_capture_hw;
	runtime->hw = line6pcm->properties->capture_hw;
	return 0;
}

+1 −3
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
#include "driver.h"
#include "midi.h"
#include "playback.h"
#include "revision.h"
#include "usbdefs.h"

#define DRIVER_AUTHOR  "Markus Grabner <grabner@icg.tugraz.at>"
#define DRIVER_DESC    "Line 6 USB Driver"
@@ -44,7 +42,7 @@ static const char line6_request_version[] = {
	0xf0, 0x7e, 0x7f, 0x06, 0x01, 0xf7
};

/**
/*
	 Class for asynchronous messages.
*/
struct message {
+38 −51
Original line number Diff line number Diff line
@@ -20,6 +20,12 @@

#define DRIVER_NAME "line6usb"

#define USB_INTERVALS_PER_SECOND 1000

/* Fallback USB interval and max packet size values */
#define LINE6_FALLBACK_INTERVAL 10
#define LINE6_FALLBACK_MAXPACKETSIZE 16

#define LINE6_TIMEOUT 1
#define LINE6_BUFSIZE_LISTEN 32
#define LINE6_MESSAGE_MAXLEN 256
@@ -60,26 +66,20 @@ extern const unsigned char line6_midi_id[3];
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 Line 6 devices.
*/
struct line6_properties {
	/**
		 Card id string (maximum 16 characters).
		 This can be used to address the device in ALSA programs as
		 "default:CARD=<id>"
	/* Card id string (maximum 16 characters).
	 * This can be used to address the device in ALSA programs as
	 * "default:CARD=<id>"
	 */
	const char *id;

	/**
		 Card short name (maximum 32 characters).
	*/
	/* Card short name (maximum 32 characters) */
	const char *name;

	/**
		 Bit vector defining this device's capabilities in the
		 line6usb driver.
	*/
	/* Bit vector defining this device's capabilities in line6usb driver */
	int capabilities;

	int altsetting;
@@ -90,70 +90,57 @@ struct line6_properties {
	unsigned ep_audio_w;
};

/**
/* Capability bits */
enum {
	/* device supports settings parameter via USB */
	LINE6_CAP_CONTROL =	1 << 0,
	/* device supports PCM input/output via USB */
	LINE6_CAP_PCM =		1 << 1,
	/* device support hardware monitoring */
	LINE6_CAP_HWMON =	1 << 2,
};

/*
	 Common data shared by all Line 6 devices.
	 Corresponds to a pair of USB endpoints.
*/
struct usb_line6 {
	/**
		 USB device.
	*/
	/* USB device */
	struct usb_device *usbdev;

	/**
		 Properties.
	*/
	/* Properties */
	const struct line6_properties *properties;

	/**
		 Interval (ms).
	*/
	/* Interval (ms) */
	int interval;

	/**
		 Maximum size of USB packet.
	*/
	/* Maximum size of USB packet */
	int max_packet_size;

	/**
		 Device representing the USB interface.
	*/
	/* Device representing the USB interface */
	struct device *ifcdev;

	/**
		 Line 6 sound card data structure.
		 Each device has at least MIDI or PCM.
	/* Line 6 sound card data structure.
	 * Each device has at least MIDI or PCM.
	 */
	struct snd_card *card;

	/**
		 Line 6 PCM device data structure.
	*/
	/* Line 6 PCM device data structure */
	struct snd_line6_pcm *line6pcm;

	/**
		 Line 6 MIDI device data structure.
	*/
	/* Line 6 MIDI device data structure */
	struct snd_line6_midi *line6midi;

	/**
		 URB for listening to PODxt Pro control endpoint.
	*/
	/* URB for listening to PODxt Pro control endpoint */
	struct urb *urb_listen;

	/**
		 Buffer for listening to PODxt Pro control endpoint.
	*/
	/* Buffer for listening to PODxt Pro control endpoint */
	unsigned char *buffer_listen;

	/**
		 Buffer for message to be processed.
	*/
	/* Buffer for message to be processed */
	unsigned char *buffer_message;

	/**
		 Length of message to be processed.
	*/
	/* Length of message to be processed */
	int message_length;

	void (*process_message)(struct usb_line6 *);
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

#include "driver.h"
#include "midi.h"
#include "usbdefs.h"

#define line6_rawmidi_substream_midi(substream) \
	((struct snd_line6_midi *)((substream)->rmidi->private_data))
+8 −24
Original line number Diff line number Diff line
@@ -19,44 +19,28 @@
#define MIDI_BUFFER_SIZE 1024

struct snd_line6_midi {
	/**
		 Pointer back to the Line 6 driver data structure.
	*/
	/* Pointer back to the Line 6 driver data structure */
	struct usb_line6 *line6;

	/**
		 MIDI substream for receiving (or NULL if not active).
	*/
	/* MIDI substream for receiving (or NULL if not active) */
	struct snd_rawmidi_substream *substream_receive;

	/**
		 MIDI substream for transmitting (or NULL if not active).
	*/
	/* MIDI substream for transmitting (or NULL if not active) */
	struct snd_rawmidi_substream *substream_transmit;

	/**
		 Number of currently active MIDI send URBs.
	*/
	/* Number of currently active MIDI send URBs */
	int num_active_send_urbs;

	/**
		 Spin lock to protect MIDI buffer handling.
	*/
	/* Spin lock to protect MIDI buffer handling */
	spinlock_t lock;

	/**
		 Wait queue for MIDI transmission.
	*/
	/* Wait queue for MIDI transmission */
	wait_queue_head_t send_wait;

	/**
		 Buffer for incoming MIDI stream.
	*/
	/* Buffer for incoming MIDI stream */
	struct midi_buffer midibuf_in;

	/**
		 Buffer for outgoing MIDI stream.
	*/
	/* Buffer for outgoing MIDI stream */
	struct midi_buffer midibuf_out;
};

Loading