23 #include <linux/module.h>
24 #include <linux/slab.h>
58 static unsigned int card_alloc;
63 static void vxpocket_release(
struct pcmcia_device *
link)
105 .output_level_db_scale = db_scale_old_vol,
119 .name =
"VXPocket440",
127 .output_level_db_scale = db_scale_old_vol,
134 static int snd_vxpocket_new(
struct snd_card *
card,
int ibl,
135 struct pcmcia_device *
link,
141 .dev_free = snd_vxpocket_dev_free,
155 chip->
ibl.size = ibl;
162 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
163 link->resource[0]->end = 16;
165 link->config_flags |= CONF_ENABLE_IRQ;
166 link->config_index = 1;
167 link->config_regs = PRESENT_OPTION;
184 static int snd_vxpocket_assign_resources(
struct vx_core *chip,
int port,
int irq)
210 static int vxpocket_config(
struct pcmcia_device *link)
212 struct vx_core *chip = link->priv;
218 if (!
strcmp(link->prod_id[1],
"VX-POCKET")) {
223 chip->
hw = &vxp440_hw;
240 chip->
dev = &link->dev;
243 if (snd_vxpocket_assign_resources(chip, link->resource[0]->start,
256 static int vxp_suspend(
struct pcmcia_device *link)
258 struct vx_core *chip = link->priv;
269 static int vxp_resume(
struct pcmcia_device *link)
271 struct vx_core *chip = link->priv;
291 static int vxpocket_probe(
struct pcmcia_device *p_dev)
299 if (!(card_alloc & (1 << i)))
302 if (i >= SNDRV_CARDS) {
316 err = snd_vxpocket_new(card, ibl[i], p_dev, &vxp);
324 card_alloc |= 1 <<
i;
328 return vxpocket_config(p_dev);
331 static void vxpocket_detach(
struct pcmcia_device *link)
341 card_alloc &= ~(1 << vxp->
index);
345 vxpocket_release(link);
354 PCMCIA_DEVICE_MANF_CARD(0x01f1, 0x0100),
359 static struct pcmcia_driver vxp_cs_driver = {
361 .name =
"snd-vxpocket",
362 .probe = vxpocket_probe,
363 .remove = vxpocket_detach,
366 .suspend = vxp_suspend,
367 .resume = vxp_resume,
371 static int __init init_vxpocket(
void)
376 static void __exit exit_vxpocket(
void)