2 * Driver for Digigram VXpocket V2/440 soundcards
4 * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 please add the following as /etc/pcmcia/vxpocket.conf:
25 class "audio" module "snd-vxpocket"
27 card "Digigram VX-POCKET"
33 #include <sound/driver.h>
34 #include <linux/init.h>
35 #include <linux/moduleparam.h>
36 #include <sound/core.h>
37 #include <pcmcia/version.h>
39 #include <sound/initval.h>
45 #define CARD_NAME "VXPocket440"
47 #define CARD_NAME "VXPocket"
50 MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
51 MODULE_DESCRIPTION("Digigram " CARD_NAME);
52 MODULE_LICENSE("GPL");
53 MODULE_CLASSES("{sound}");
54 MODULE_DEVICES("{{Digigram," CARD_NAME "}}");
56 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
57 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
58 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable switches */
59 static unsigned int irq_mask = 0xffff;
60 static int irq_list[4] = { -1 };
61 static int ibl[SNDRV_CARDS];
64 module_param_array(index, int, boot_devs, 0444);
65 MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
66 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
67 module_param_array(id, charp, boot_devs, 0444);
68 MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
69 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
70 module_param_array(enable, bool, boot_devs, 0444);
71 MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
72 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
73 module_param(irq_mask, int, 0444);
74 MODULE_PARM_DESC(irq_mask, "IRQ bitmask for " CARD_NAME " soundcard.");
75 module_param_array(irq_list, int, boot_devs, 0444);
76 MODULE_PARM_DESC(irq_list, "List of Available interrupts for " CARD_NAME " soundcard.");
77 module_param_array(ibl, int, boot_devs, 0444);
78 MODULE_PARM_DESC(ibl, "Capture IBL size for " CARD_NAME " soundcard.");
79 MODULE_PARM_SYNTAX(ibl, SNDRV_ENABLED);
87 /* 1 DSP, 1 sync UER, 1 sync World Clock (NIY) */
89 /* 2 stereo analog input (line/micro) */
90 /* 2 stereo analog output */
91 /* Only output levels can be modified */
92 /* UER, but only for the first two inputs and outputs. */
95 #define CARD_TYPE VX_TYPE_VXP440
96 #define DEV_INFO "snd-vxp440"
100 /* 1 DSP, 1 sync UER */
101 /* 1 programmable clock (NIY) */
102 /* 1 stereo analog input (line/micro) */
103 /* 1 stereo analog output */
104 /* Only output levels can be modified */
107 #define CARD_TYPE VX_TYPE_VXPOCKET
108 #define DEV_INFO "snd-vxpocket"
112 static dev_info_t dev_info = DEV_INFO;
114 static struct snd_vx_hardware vxp_hw = {
119 .num_codecs = NUM_CODECS,
120 .num_ins = NUM_CODECS,
121 .num_outs = NUM_CODECS,
122 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
125 static struct snd_vxp_entry hw_entry = {
126 .dev_info = &dev_info,
128 /* module parameters */
129 .index_table = index,
131 .enable_table = enable,
132 .irq_mask_p = &irq_mask,
133 .irq_list = irq_list,
138 .ops = &snd_vxpocket_ops,
143 static dev_link_t *vxp_attach(void)
145 return snd_vxpocket_attach(&hw_entry);
148 static void vxp_detach(dev_link_t *link)
150 snd_vxpocket_detach(&hw_entry, link);
154 * Module entry points
157 static struct pcmcia_driver vxp_cs_driver = {
158 .owner = THIS_MODULE,
162 .attach = vxp_attach,
166 static int __init init_vxpocket(void)
168 return pcmcia_register_driver(&vxp_cs_driver);
171 static void __exit exit_vxpocket(void)
173 pcmcia_unregister_driver(&vxp_cs_driver);
174 snd_vxpocket_detach_all(&hw_entry);
177 module_init(init_vxpocket);
178 module_exit(exit_vxpocket);