client_reg.EventMask = CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL #ifdef CONFIG_PM | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME #endif ; client_reg.event_handler = &vxpocket_event; 
dev_link_t *snd_vxpocket_attach(struct snd_vxp_entry *hw){	client_reg_t client_reg;	/* Register with cardmgr */	dev_link_t *link;		/* Info for cardmgr */	int i, ret;	vx_core_t *chip;	struct snd_vxpocket *vxp;	snd_card_t *card;	static snd_device_ops_t ops = {		.dev_free =	snd_vxpocket_dev_free,	};	snd_printdd(KERN_DEBUG "vxpocket_attach called\n");	/* find an empty slot from the card list */	for (i = 0; i < SNDRV_CARDS; i++) {		if (! hw->card_list[i])			break;	}	if (i >= SNDRV_CARDS) {		snd_printk(KERN_ERR "vxpocket: too many cards found\n");		return NULL;	}	if (! hw->enable_table[i])		return NULL; /* disabled explicitly */	/* ok, create a card instance */	card = snd_card_new(hw->index_table[i], hw->id_table[i], THIS_MODULE, 0);	if (card == NULL) {		snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n");		return NULL;	}	chip = snd_vx_create(card, hw->hardware, hw->ops,			     sizeof(struct snd_vxpocket) - sizeof(vx_core_t));	if (! chip)		return NULL;#ifdef SND_VX_FW_LOADER	/* fake a device here since pcmcia doesn't give a valid device... */	chip->dev = kcalloc(1, sizeof(*chip->dev), GFP_KERNEL);	if (! chip->dev) {		snd_printk(KERN_ERR "vxp: can't malloc chip->dev\n");		kfree(chip);		snd_card_free(card);		return NULL;	}	device_initialize(chip->dev);	sprintf(chip->dev->bus_id, "vxpocket%d", i);#endif	if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops) < 0) {		kfree(chip);		snd_card_free(card);		return NULL;	}	vxp = (struct snd_vxpocket *)chip;	vxp->index = i;	vxp->hw_entry = hw;	chip->ibl.size = hw->ibl[i];	hw->card_list[i] = chip;	link = &vxp->link;	link->priv = chip;	link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;	link->io.NumPorts1 = 16;	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;	// link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;	link->irq.IRQInfo1 = IRQ_LEVEL_ID;	link->irq.Handler = &snd_vx_irq_handler;	link->irq.Instance = chip;	link->conf.Attributes = CONF_ENABLE_IRQ;	link->conf.Vcc = 50;	link->conf.IntType = INT_MEMORY_AND_IO;	link->conf.ConfigIndex = 1;	link->conf.Present = PRESENT_OPTION;	/* Register with Card Services */	memset(&client_reg, 0, sizeof(client_reg));	client_reg.dev_info = hw->dev_info;	client_reg.EventMask = 		CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL#ifdef CONFIG_PM		| CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET		| CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME#endif		;	client_reg.event_handler = &vxpocket_event;	client_reg.Version = 0x0210;	client_reg.event_callback_args.client_data = link;	ret = pcmcia_register_client(&link->handle, &client_reg);	if (ret != CS_SUCCESS) {		cs_error(link->handle, RegisterClient, ret);		snd_card_free(card);		return NULL;	}	/* Chain drivers */	link->next = hw->dev_list;	hw->dev_list = link;	/* snd_card_set_pm_callback(card, snd_vxpocket_suspend, snd_vxpocket_resume, chip); */	return link;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1e212f3645a6b355de8c43a23376bc0e2ac49a63/vx_entry.c/clean/sound/pcmcia/vx/vx_entry.c