[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mm-commits
Subject:    + git-alsa-vs-git-pcmcia.patch added to -mm tree
From:       akpm () osdl ! org
Date:       2005-11-30 23:09:31
Message-ID: 200511302308.jAUN8Ce9014762 () shell0 ! pdx ! osdl ! net
[Download RAW message or body]


The patch titled

     git-alsa vs git-pcmcia

has been added to the -mm tree.  Its filename is

     git-alsa-vs-git-pcmcia.patch


From: Takashi Iwai <tiwai@suse.de>



Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 sound/pcmcia/pdaudiocf/pdaudiocf.c |  109 ++++++++++++++----------------------
 sound/pcmcia/vx/vxpocket.c         |  110 ++++++++++++++++---------------------
 2 files changed, 93 insertions(+), 126 deletions(-)

diff -puN sound/pcmcia/pdaudiocf/pdaudiocf.c~git-alsa-vs-git-pcmcia sound/pcmcia/pdaudiocf/pdaudiocf.c
--- 25/sound/pcmcia/pdaudiocf/pdaudiocf.c~git-alsa-vs-git-pcmcia	Wed Nov 30 15:09:28 2005
+++ 25-akpm/sound/pcmcia/pdaudiocf/pdaudiocf.c	Wed Nov 30 15:09:28 2005
@@ -52,16 +52,13 @@ MODULE_PARM_DESC(enable, "Enable " CARD_
 /*
  */
 
-static dev_info_t dev_info = "snd-pdaudiocf";
 static struct snd_card *card_list[SNDRV_CARDS];
-static dev_link_t *dev_list;
 
 /*
  * prototypes
  */
 static void pdacf_config(dev_link_t *link);
-static int pdacf_event(event_t event, int priority, event_callback_args_t *args);
-static void snd_pdacf_detach(dev_link_t *link);
+static void snd_pdacf_detach(struct pcmcia_device *p_dev);
 
 static void pdacf_release(dev_link_t *link)
 {
@@ -99,11 +96,10 @@ static int snd_pdacf_dev_free(struct snd
 /*
  * snd_pdacf_attach - attach callback for cs
  */
-static dev_link_t *snd_pdacf_attach(void)
+static int snd_pdacf_attach(struct pcmcia_device *p_dev)
 {
-	client_reg_t client_reg;	/* Register with cardmgr */
-	dev_link_t *link;		/* Info for cardmgr */
-	int i, ret;
+	int i;
+	dev_link_t *link;               /* Info for cardmgr */
 	struct snd_pdacf *pdacf;
 	struct snd_card *card;
 	static struct snd_device_ops ops = {
@@ -216,21 +212,13 @@ static int snd_pdacf_assign_resources(st
 /*
  * snd_pdacf_detach - detach callback for cs
  */
-static void snd_pdacf_detach(dev_link_t *link)
+static void snd_pdacf_detach(struct pcmcia_device *p_dev)
 {
+	dev_link_t *link = dev_to_instance(p_dev);
 	struct snd_pdacf *chip = link->priv;
 
 	snd_printdd(KERN_DEBUG "pdacf_detach called\n");
-	/* Remove the interface data from the linked list */
-	{
-		dev_link_t **linkp;
-		/* Locate device structure */
-		for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
-			if (*linkp == link)
-				break;
-		if (*linkp)
-			*linkp = link->next;
-	}
+
 	if (chip->chip_status & PDAUDIOCF_STAT_IS_CONFIGURED)
 		snd_pdacf_powerdown(chip);
 	chip->chip_status |= PDAUDIOCF_STAT_IS_STALE; /* to be sure */
@@ -299,62 +287,51 @@ failed:
 	pcmcia_release_irq(link->handle, &link->irq);
 }
 
-/*
- * event callback
- */
-static int pdacf_event(event_t event, int priority, event_callback_args_t *args)
+#ifdef CONFIG_PM
+
+static int pdacf_suspend(struct pcmcia_device *dev)
 {
-	dev_link_t *link = args->client_data;
+	dev_link_t *link = dev_to_instance(dev);
 	struct snd_pdacf *chip = link->priv;
 
-	switch (event) {
-	case CS_EVENT_CARD_REMOVAL:
-		snd_printdd(KERN_DEBUG "CARD_REMOVAL..\n");
-		link->state &= ~DEV_PRESENT;
-		if (link->state & DEV_CONFIG) {
-			chip->chip_status |= PDAUDIOCF_STAT_IS_STALE;
-		}
-		break;
-	case CS_EVENT_CARD_INSERTION:
-		snd_printdd(KERN_DEBUG "CARD_INSERTION..\n");
-		link->state |= DEV_PRESENT;
-		pdacf_config(link);
-		break;
-#ifdef CONFIG_PM
-	case CS_EVENT_PM_SUSPEND:
-		snd_printdd(KERN_DEBUG "SUSPEND\n");
-		link->state |= DEV_SUSPEND;
+	snd_printdd(KERN_DEBUG "SUSPEND\n");
+	link->state |= DEV_SUSPEND;
+	if (chip) {
+		snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n");
+		snd_pdacf_suspend(chip->card, PMSG_SUSPEND);
+	}
+
+	snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
+	if (link->state & DEV_CONFIG)
+		pcmcia_release_configuration(link->handle);
+
+	return 0;
+}
+
+static int pdacf_resume(struct pcmcia_device *dev)
+{
+	dev_link_t *link = dev_to_instance(dev);
+	pdacf_t *chip = link->priv;
+
+	snd_printdd(KERN_DEBUG "RESUME\n");
+	link->state &= ~DEV_SUSPEND;
+
+	snd_printdd(KERN_DEBUG "CARD_RESET\n");
+	if (DEV_OK(link)) {
+		snd_printdd(KERN_DEBUG "requestconfig...\n");
+		pcmcia_request_configuration(link->handle, &link->conf);
 		if (chip) {
-			snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n");
-			snd_pdacf_suspend(chip, PMSG_SUSPEND);
+			snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n");
+			snd_pdacf_resume(chip->card);
 		}
-		/* Fall through... */
-	case CS_EVENT_RESET_PHYSICAL:
-		snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
-		if (link->state & DEV_CONFIG)
-			pcmcia_release_configuration(link->handle);
-		break;
-	case CS_EVENT_PM_RESUME:
-		snd_printdd(KERN_DEBUG "RESUME\n");
-		link->state &= ~DEV_SUSPEND;
-		/* Fall through... */
-	case CS_EVENT_CARD_RESET:
-		snd_printdd(KERN_DEBUG "CARD_RESET\n");
-		if (DEV_OK(link)) {
-			snd_printdd(KERN_DEBUG "requestconfig...\n");
-			pcmcia_request_configuration(link->handle, &link->conf);
-			if (chip) {
-				snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n");
-				snd_pdacf_resume(chip);
-			}
-		}
-		snd_printdd(KERN_DEBUG "resume done!\n");
-		break;
-#endif
 	}
+	snd_printdd(KERN_DEBUG "resume done!\n");
+
 	return 0;
 }
 
+#endif
+
 /*
  * Module entry points
  */
diff -puN sound/pcmcia/vx/vxpocket.c~git-alsa-vs-git-pcmcia sound/pcmcia/vx/vxpocket.c
--- 25/sound/pcmcia/vx/vxpocket.c~git-alsa-vs-git-pcmcia	Wed Nov 30 15:09:28 2005
+++ 25-akpm/sound/pcmcia/vx/vxpocket.c	Wed Nov 30 15:09:28 2005
@@ -133,11 +133,9 @@ static struct snd_vx_hardware vxp440_hw 
  */
 static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl)
 {
-	client_reg_t client_reg;	/* Register with cardmgr */
 	dev_link_t *link;		/* Info for cardmgr */
 	struct vx_core *chip;
 	struct snd_vxpocket *vxp;
-	int ret;
 	static struct snd_device_ops ops = {
 		.dev_free =	snd_vxpocket_dev_free,
 	};
@@ -286,67 +284,55 @@ failed:
 	kfree(parse);
 }
 
+#ifdef CONFIG_PM
 
-/*
- * event callback
- */
-static int vxpocket_event(event_t event, int priority, event_callback_args_t *args)
+static int vxp_suspend(struct pcmcia_device *dev)
 {
-	dev_link_t *link = args->client_data;
+	dev_link_t *link = dev_to_instance(dev);
 	struct vx_core *chip = link->priv;
 
-	switch (event) {
-	case CS_EVENT_CARD_REMOVAL:
-		snd_printdd(KERN_DEBUG "CARD_REMOVAL..\n");
-		link->state &= ~DEV_PRESENT;
-		if (link->state & DEV_CONFIG)
-			chip->chip_status |= VX_STAT_IS_STALE;
-		break;
-	case CS_EVENT_CARD_INSERTION:
-		snd_printdd(KERN_DEBUG "CARD_INSERTION..\n");
-		link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
-		vxpocket_config(link);
-		break;
-#ifdef CONFIG_PM
-	case CS_EVENT_PM_SUSPEND:
-		snd_printdd(KERN_DEBUG "SUSPEND\n");
-		link->state |= DEV_SUSPEND;
-		if (chip) {
-			snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n");
-			snd_vx_suspend(chip, PMSG_SUSPEND);
-		}
-		/* Fall through... */
-	case CS_EVENT_RESET_PHYSICAL:
-		snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
-		if (link->state & DEV_CONFIG)
-			pcmcia_release_configuration(link->handle);
-		break;
-	case CS_EVENT_PM_RESUME:
-		snd_printdd(KERN_DEBUG "RESUME\n");
-		link->state &= ~DEV_SUSPEND;
-		/* Fall through... */
-	case CS_EVENT_CARD_RESET:
-		snd_printdd(KERN_DEBUG "CARD_RESET\n");
-		if (DEV_OK(link)) {
-			//struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
-			snd_printdd(KERN_DEBUG "requestconfig...\n");
-			pcmcia_request_configuration(link->handle, &link->conf);
-			if (chip) {
-				snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
-				snd_vx_resume(chip);
-			}
+	snd_printdd(KERN_DEBUG "SUSPEND\n");
+	link->state |= DEV_SUSPEND;
+	if (chip && chip->card->pm_suspend) {
+		snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n");
+		chip->card->pm_suspend(chip->card, PMSG_SUSPEND);
+	}
+	snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n");
+	if (link->state & DEV_CONFIG)
+		pcmcia_release_configuration(link->handle);
+
+	return 0;
+}
+
+static int vxp_resume(struct pcmcia_device *dev)
+{
+	dev_link_t *link = dev_to_instance(dev);
+	vx_core_t *chip = link->priv;
+
+	snd_printdd(KERN_DEBUG "RESUME\n");
+	link->state &= ~DEV_SUSPEND;
+
+	snd_printdd(KERN_DEBUG "CARD_RESET\n");
+	if (DEV_OK(link)) {
+		//struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip;
+		snd_printdd(KERN_DEBUG "requestconfig...\n");
+		pcmcia_request_configuration(link->handle, &link->conf);
+		if (chip && chip->card->pm_resume) {
+			snd_printdd(KERN_DEBUG "calling snd_vx_resume\n");
+			chip->card->pm_resume(chip->card);
 		}
-		snd_printdd(KERN_DEBUG "resume done!\n");
-		break;
-#endif
 	}
+	snd_printdd(KERN_DEBUG "resume done!\n");
+
 	return 0;
 }
 
+#endif
+
 
 /*
  */
-static dev_link_t *vxpocket_attach(void)
+static int vxpocket_attach(struct pcmcia_device *p_dev)
 {
 	struct snd_card *card;
 	struct snd_vxpocket *vxp;
@@ -359,22 +345,22 @@ static dev_link_t *vxpocket_attach(void)
 	}
 	if (i >= SNDRV_CARDS) {
 		snd_printk(KERN_ERR "vxpocket: too many cards found\n");
-		return NULL;
+		return -EINVAL;
 	}
 	if (! enable[i])
-		return NULL; /* disabled explicitly */
+		return -ENODEV; /* disabled explicitly */
 
 	/* ok, create a card instance */
 	card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
 	if (card == NULL) {
 		snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n");
-		return NULL;
+		return -ENOMEM;
 	}
 
 	vxp = snd_vxpocket_new(card, ibl[i]);
 	if (! vxp) {
 		snd_card_free(card);
-		return NULL;
+		return -ENODEV;
 	}
 	card->private_data = vxp;
 
@@ -382,17 +368,21 @@ static dev_link_t *vxpocket_attach(void)
 	card_alloc |= 1 << i;
 
 	/* Chain drivers */
-	vxp->link.next = dev_list;
-	dev_list = &vxp->link;
+	vxp->link.next = NULL;
 
-	return &vxp->link;
+	vxp->link.handle = p_dev;
+	vxp->link.state |= DEV_PRESENT | DEV_CONFIG_PENDING;
+	p_dev->instance = &vxp->link;
+	vxpocket_config(&vxp->link);
+
+	return 0;
 }
 
-static void vxpocket_detach(dev_link_t *link)
+static void vxpocket_detach(struct pcmcia_device *p_dev)
 {
+	dev_link_t *link = dev_to_instance(p_dev);
 	struct snd_vxpocket *vxp;
 	struct vx_core *chip;
-	dev_link_t **linkp;
 
 	if (! link)
 		return;
_

Patches currently in -mm which might be from tiwai@suse.de are

git-alsa.patch
sound-pci-au88x0-remove-unneeded-call-to-pci_dma_supported.patch
alsa-improved-pnp-suspend-support.patch
git-alsa-vs-git-pcmcia.patch
add-new-quirk-for-devices-with-mute-leds-and-separate-headphone-volume.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic