]> Git Repo - linux.git/blame - drivers/staging/line6/audio.c
Merge branch 'topic/usb' into for-linus
[linux.git] / drivers / staging / line6 / audio.c
CommitLineData
705ececd
MG
1/*
2 * Line6 Linux USB driver - 0.8.0
3 *
4 * Copyright (C) 2004-2009 Markus Grabner ([email protected])
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#include "driver.h"
b702ed25 13#include "audio.h"
705ececd
MG
14
15#include <sound/core.h>
16#include <sound/initval.h>
17
18
19static int line6_index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
20static char *line6_id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
21
22
23/*
24 Initialize the Line6 USB audio system.
25*/
26int line6_init_audio(struct usb_line6 *line6)
27{
dfc70567 28 static int dev;
705ececd 29 struct snd_card *card;
a405f43e 30 int err;
705ececd 31
a405f43e
AB
32 err = snd_card_create(line6_index[dev], line6_id[dev], THIS_MODULE, 0,
33 &card);
34 if (err < 0)
35 return err;
705ececd
MG
36
37 line6->card = card;
38
39 strcpy(card->driver, DRIVER_NAME);
40 strcpy(card->shortname, "Line6-USB");
4717b03b
GKH
41 sprintf(card->longname, "Line6 %s at USB %s", line6->properties->name,
42 dev_name(line6->ifcdev)); /* 80 chars - see asound.h */
705ececd
MG
43 return 0;
44}
45
46/*
47 Register the Line6 USB audio system.
48*/
49int line6_register_audio(struct usb_line6 *line6)
50{
51 int err;
52
dfc70567
GKH
53 err = snd_card_register(line6->card);
54 if (err < 0)
705ececd
MG
55 return err;
56
57 return 0;
58}
59
60/*
61 Cleanup the Line6 USB audio system.
62*/
63void line6_cleanup_audio(struct usb_line6 *line6)
64{
65 struct snd_card *card = line6->card;
66
536165d8 67 if (card == NULL)
705ececd
MG
68 return;
69
70 snd_card_disconnect(card);
71 snd_card_free(card);
536165d8 72 line6->card = NULL;
705ececd 73}
This page took 0.184159 seconds and 4 git commands to generate.