Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219712
b: refs/heads/master
c: e1a164d
h: refs/heads/master
v: v3
  • Loading branch information
Markus Grabner authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent eccc417 commit 3e55294
Show file tree
Hide file tree
Showing 27 changed files with 866 additions and 597 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1027f476f507ef7ed9919cd3e3d32310f3985da1
refs/heads/master: e1a164d7a3e05aae15eb603ee8f1b77446480a3b
7 changes: 2 additions & 5 deletions trunk/drivers/staging/line6/audio.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand All @@ -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.
*/
Expand All @@ -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;
}

Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/staging/line6/audio.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand All @@ -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
49 changes: 27 additions & 22 deletions trunk/drivers/staging/line6/capture.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand All @@ -19,7 +19,6 @@
#include "pcm.h"
#include "pod.h"


/*
Find a free URB and submit it.
*/
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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;

Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/staging/line6/capture.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/line6/control.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/staging/line6/control.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Line6 Linux USB driver - 0.9.0
* Line6 Linux USB driver - 0.9.1beta
*
* Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
*
Expand All @@ -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,
Expand Down Expand Up @@ -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
Loading

0 comments on commit 3e55294

Please sign in to comment.