summaryrefslogtreecommitdiffstats
path: root/sound/usb/usx2y/usbusx2y.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-05-17 15:15:36 +0200
committerTakashi Iwai <tiwai@suse.de>2021-05-17 16:03:46 +0200
commit4c0a58ef36f3de1be0d1c8565ca854bcabd37e2b (patch)
tree6ef2f7a0d0b8a63f9fafbeaed2ada426b6a758e0 /sound/usb/usx2y/usbusx2y.c
parentbae3ce4942980d5f7b2b9855f4a2db0c00f9dfbd (diff)
downloadlinux-stable-4c0a58ef36f3de1be0d1c8565ca854bcabd37e2b.tar.gz
linux-stable-4c0a58ef36f3de1be0d1c8565ca854bcabd37e2b.tar.bz2
linux-stable-4c0a58ef36f3de1be0d1c8565ca854bcabd37e2b.zip
ALSA: usx2y: Fix spaces
This patch corrects merely the spaces in the usx2y code, including the superfluous trailing space in the debug prints and a slight reformat of some comment lines. Nothing really touches about the code itself. Link: https://lore.kernel.org/r/20210517131545.27252-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usx2y/usbusx2y.c')
-rw-r--r--sound/usb/usx2y/usbusx2y.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index cdbb27a96e04..88f2249a0ad5 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -70,7 +70,7 @@
2003-11-03 Karsten Wiese
Version 0.3:
- 24Bit support.
+ 24Bit support.
"arecord -D hw:1 -c 2 -r 48000 -M -f S24_3LE|aplay -D hw:1 -c 2 -r 48000 -M -f S24_3LE" works.
2003-08-22 Karsten Wiese
@@ -94,16 +94,15 @@
This helped me much on my slowish PII 400 & PIII 500.
ACPI yet untested but might cause the same bad behaviour.
Use a kernel with lowlatency and preemptiv patches applied.
- To autoload snd-usb-midi append a line
+ To autoload snd-usb-midi append a line
post-install snd-usb-us428 modprobe snd-usb-midi
to /etc/modules.conf.
known problems:
sliders, knobs, lights not yet handled except MASTER Volume slider.
- "pcm -c 2" doesn't work. "pcm -c 2 -m direct_interleaved" does.
+ "pcm -c 2" doesn't work. "pcm -c 2 -m direct_interleaved" does.
KDE3: "Enable full duplex operation" deadlocks.
-
2002-08-31 Karsten Wiese
Version 0.0.3: audio also simplex;
simplifying: iso urbs only 1 packet, melted structs.
@@ -115,7 +114,7 @@
The firmware has been sniffed from win2k us-428 driver 3.09.
* Copyright (c) 2002 - 2004 Karsten Wiese
-*/
+ */
#include <linux/init.h>
#include <linux/module.h>
@@ -132,14 +131,12 @@
#include "usbusx2y.h"
#include "usX2Yhwdep.h"
-
-
MODULE_AUTHOR("Karsten Wiese <annabellesgarden@yahoo.de>");
MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.2");
MODULE_LICENSE("GPL");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
-static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
+static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
module_param_array(index, int, NULL, 0444);
@@ -149,22 +146,23 @@ MODULE_PARM_DESC(id, "ID string for "NAME_ALLCAPS".");
module_param_array(enable, bool, NULL, 0444);
MODULE_PARM_DESC(enable, "Enable "NAME_ALLCAPS".");
-
static int snd_usx2y_card_used[SNDRV_CARDS];
-static void usx2y_usb_disconnect(struct usb_device* usb_device, void* ptr);
+static void usx2y_usb_disconnect(struct usb_device *usb_device, void *ptr);
static void snd_usx2y_card_private_free(struct snd_card *card);
-/*
- * pipe 4 is used for switching the lamps, setting samplerate, volumes ....
+/*
+ * pipe 4 is used for switching the lamps, setting samplerate, volumes ....
*/
static void i_usx2y_out04_int(struct urb *urb)
{
#ifdef CONFIG_SND_DEBUG
if (urb->status) {
- int i;
+ int i;
struct usx2ydev *usx2y = urb->context;
- for (i = 0; i < 10 && usx2y->as04.urb[i] != urb; i++);
+
+ for (i = 0; i < 10 && usx2y->as04.urb[i] != urb; i++)
+ ;
snd_printdd("i_usx2y_out04_int() urb %i status=%i\n", i, urb->status);
}
#endif
@@ -186,22 +184,25 @@ static void i_usx2y_in04_int(struct urb *urb)
// printk("%i:0x%02X ", 8, (int)((unsigned char*)usx2y->in04_buf)[8]); Master volume shows 0 here if fader is at max during boot ?!?
if (us428ctls) {
int diff = -1;
+
if (-2 == us428ctls->ctl_snapshot_last) {
diff = 0;
memcpy(usx2y->in04_last, usx2y->in04_buf, sizeof(usx2y->in04_last));
us428ctls->ctl_snapshot_last = -1;
} else {
int i;
+
for (i = 0; i < 21; i++) {
- if (usx2y->in04_last[i] != ((char*)usx2y->in04_buf)[i]) {
+ if (usx2y->in04_last[i] != ((char *)usx2y->in04_buf)[i]) {
if (diff < 0)
diff = i;
- usx2y->in04_last[i] = ((char*)usx2y->in04_buf)[i];
+ usx2y->in04_last[i] = ((char *)usx2y->in04_buf)[i];
}
}
}
if (0 <= diff) {
int n = us428ctls->ctl_snapshot_last + 1;
+
if (n >= N_US428_CTL_BUFS || n < 0)
n = 0;
memcpy(us428ctls->ctl_snapshot + n, usx2y->in04_buf, sizeof(us428ctls->ctl_snapshot[0]));
@@ -210,8 +211,7 @@ static void i_usx2y_in04_int(struct urb *urb)
wake_up(&usx2y->us428ctls_wait_queue_head);
}
}
-
-
+
if (usx2y->us04) {
if (0 == usx2y->us04->submitted)
do {
@@ -221,11 +221,13 @@ static void i_usx2y_in04_int(struct urb *urb)
if (us428ctls && us428ctls->p4out_last >= 0 && us428ctls->p4out_last < N_US428_P4OUT_BUFS) {
if (us428ctls->p4out_last != us428ctls->p4out_sent) {
int j, send = us428ctls->p4out_sent + 1;
+
if (send >= N_US428_P4OUT_BUFS)
send = 0;
for (j = 0; j < URBS_ASYNC_SEQ && !err; ++j)
if (0 == usx2y->as04.urb[j]->status) {
struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more than 1 p4out is new, 1 gets lost.
+
usb_fill_bulk_urb(usx2y->as04.urb[j], usx2y->dev,
usb_sndbulkpipe(usx2y->dev, 0x04), &p4out->val.vol,
p4out->type == ELT_LIGHT ? sizeof(struct us428_lights) : 5,
@@ -249,8 +251,7 @@ static void i_usx2y_in04_int(struct urb *urb)
*/
int usx2y_async_seq04_init(struct usx2ydev *usx2y)
{
- int err = 0,
- i;
+ int err = 0, i;
usx2y->as04.buffer = kmalloc_array(URBS_ASYNC_SEQ,
URB_DATA_LEN_ASYNC_SEQ, GFP_KERNEL);
@@ -262,11 +263,10 @@ int usx2y_async_seq04_init(struct usx2ydev *usx2y)
err = -ENOMEM;
break;
}
- usb_fill_bulk_urb( usx2y->as04.urb[i], usx2y->dev,
- usb_sndbulkpipe(usx2y->dev, 0x04),
- usx2y->as04.buffer + URB_DATA_LEN_ASYNC_SEQ*i, 0,
- i_usx2y_out04_int, usx2y
- );
+ usb_fill_bulk_urb(usx2y->as04.urb[i], usx2y->dev,
+ usb_sndbulkpipe(usx2y->dev, 0x04),
+ usx2y->as04.buffer + URB_DATA_LEN_ASYNC_SEQ*i, 0,
+ i_usx2y_out04_int, usx2y);
err = usb_urb_ep_type_check(usx2y->as04.urb[i]);
if (err < 0)
break;
@@ -276,12 +276,12 @@ int usx2y_async_seq04_init(struct usx2ydev *usx2y)
int usx2y_in04_init(struct usx2ydev *usx2y)
{
- if (! (usx2y->in04_urb = usb_alloc_urb(0, GFP_KERNEL)))
+ if (!(usx2y->in04_urb = usb_alloc_urb(0, GFP_KERNEL)))
return -ENOMEM;
- if (! (usx2y->in04_buf = kmalloc(21, GFP_KERNEL)))
+ if (!(usx2y->in04_buf = kmalloc(21, GFP_KERNEL)))
return -ENOMEM;
-
+
init_waitqueue_head(&usx2y->in04_wait_queue);
usb_fill_int_urb(usx2y->in04_urb, usx2y->dev, usb_rcvintpipe(usx2y->dev, 0x4),
usx2y->in04_buf, 21,
@@ -295,6 +295,7 @@ int usx2y_in04_init(struct usx2ydev *usx2y)
static void usx2y_unlinkseq(struct snd_usx2y_async_seq *s)
{
int i;
+
for (i = 0; i < URBS_ASYNC_SEQ; ++i) {
usb_kill_urb(s->urb[i]);
usb_free_urb(s->urb[i]);
@@ -303,32 +304,32 @@ static void usx2y_unlinkseq(struct snd_usx2y_async_seq *s)
kfree(s->buffer);
}
-
static const struct usb_device_id snd_usx2y_usb_id_table[] = {
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x1604,
- .idProduct = USB_ID_US428
+ .idProduct = USB_ID_US428
},
{
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x1604,
- .idProduct = USB_ID_US122
+ .idProduct = USB_ID_US122
},
- {
+ {
.match_flags = USB_DEVICE_ID_MATCH_DEVICE,
.idVendor = 0x1604,
.idProduct = USB_ID_US224
},
{ /* terminator */ }
};
+MODULE_DEVICE_TABLE(usb, snd_usx2y_usb_id_table);
static int usx2y_create_card(struct usb_device *device,
struct usb_interface *intf,
struct snd_card **cardp)
{
int dev;
- struct snd_card * card;
+ struct snd_card *card;
int err;
for (dev = 0; dev < SNDRV_CARDS; ++dev)
@@ -349,7 +350,7 @@ static int usx2y_create_card(struct usb_device *device,
strcpy(card->driver, "USB "NAME_ALLCAPS"");
sprintf(card->shortname, "TASCAM "NAME_ALLCAPS"");
sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)",
- card->shortname,
+ card->shortname,
le16_to_cpu(device->descriptor.idVendor),
le16_to_cpu(device->descriptor.idProduct),
0,//us428(card)->usbmidi.ifnum,
@@ -359,14 +360,13 @@ static int usx2y_create_card(struct usb_device *device,
return 0;
}
-
static int usx2y_usb_probe(struct usb_device *device,
struct usb_interface *intf,
const struct usb_device_id *device_id,
struct snd_card **cardp)
{
int err;
- struct snd_card * card;
+ struct snd_card *card;
*cardp = NULL;
if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 ||
@@ -408,7 +408,6 @@ static void snd_usx2y_disconnect(struct usb_interface *intf)
usb_get_intfdata(intf));
}
-MODULE_DEVICE_TABLE(usb, snd_usx2y_usb_id_table);
static struct usb_driver snd_usx2y_usb_driver = {
.name = "snd-usb-usx2y",
.probe = snd_usx2y_probe,
@@ -430,12 +429,13 @@ static void snd_usx2y_card_private_free(struct snd_card *card)
/*
* Frees the device.
*/
-static void usx2y_usb_disconnect(struct usb_device *device, void* ptr)
+static void usx2y_usb_disconnect(struct usb_device *device, void *ptr)
{
if (ptr) {
struct snd_card *card = ptr;
struct usx2ydev *usx2y = usx2y(card);
struct list_head *p;
+
usx2y->chip_status = USX2Y_STAT_CHIP_HUP;
usx2y_unlinkseq(&usx2y->as04);
usb_kill_urb(usx2y->in04_urb);
@@ -444,7 +444,7 @@ static void usx2y_usb_disconnect(struct usb_device *device, void* ptr)
list_for_each(p, &usx2y->midi_list) {
snd_usbmidi_disconnect(p);
}
- if (usx2y->us428ctls_sharedmem)
+ if (usx2y->us428ctls_sharedmem)
wake_up(&usx2y->us428ctls_wait_queue_head);
snd_card_free(card);
}