Title: [7677] trunk: apply upstream private date setting way to ac97 and revert local way
Revision
7677
Author
bhsong
Date
2009-10-20 00:33:27 -0400 (Tue, 20 Oct 2009)

Log Message

apply upstream private date setting way to ac97 and revert local way

author	Marek Vasut <[email protected]>	
commit	474828a40f6ddab6e2a3475a19c5c84aa3ec7d60

ALSA: Allow passing platform_data to devices attached to AC97 bus

This patch allows passing platform_data to devices attached to AC97 bus
(like touchscreens, battery measurement chips ...).

Modified Paths

Diff

Modified: trunk/include/sound/ac97_codec.h (7676 => 7677)


--- trunk/include/sound/ac97_codec.h	2009-10-20 02:09:35 UTC (rev 7676)
+++ trunk/include/sound/ac97_codec.h	2009-10-20 04:33:27 UTC (rev 7677)
@@ -642,4 +642,10 @@
 /* ad hoc AC97 device driver access */
 extern struct bus_type ac97_bus_type;
 
+/* AC97 platform_data adding function */
+static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data)
+{
+	ac97->dev.platform_data = data;
+}
+
 #endif /* __SOUND_AC97_CODEC_H */

Modified: trunk/include/sound/soc-dai.h (7676 => 7677)


--- trunk/include/sound/soc-dai.h	2009-10-20 02:09:35 UTC (rev 7676)
+++ trunk/include/sound/soc-dai.h	2009-10-20 04:33:27 UTC (rev 7677)
@@ -186,6 +186,7 @@
 	int ac97_control;
 
 	struct device *dev;
+	void *ac97_pdata;	/* platform_data for the ac97 codec */
 
 	/* DAI callbacks */
 	int (*probe)(struct platform_device *pdev,

Modified: trunk/sound/soc/soc-core.c (7676 => 7677)


--- trunk/sound/soc/soc-core.c	2009-10-20 02:09:35 UTC (rev 7676)
+++ trunk/sound/soc/soc-core.c	2009-10-20 04:33:27 UTC (rev 7677)
@@ -28,6 +28,7 @@
 #include <linux/bitops.h>
 #include <linux/debugfs.h>
 #include <linux/platform_device.h>
+#include <sound/ac97_codec.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -1358,11 +1359,6 @@
 			mutex_unlock(&codec->mutex);
 			return ret;
 		}
-
-		/* let AC97 cpu DAI be the private_data of snd_ac97 instance */
-		if (codec->ac97 && (!codec->ac97->private_data) &&
-				(card->dai_link[i].cpu_dai->ac97_control == 1))
-			codec->ac97->private_data = card->dai_link[i].cpu_dai;
 	}
 
 	mutex_unlock(&codec->mutex);
@@ -1394,8 +1390,11 @@
 				continue;
 			}
 		}
-		if (card->dai_link[i].codec_dai->ac97_control)
+		if (card->dai_link[i].codec_dai->ac97_control) {
 			ac97 = 1;
+			snd_ac97_dev_add_pdata(codec->ac97,
+				card->dai_link[i].cpu_dai->ac97_pdata);
+		}
 	}
 	snprintf(codec->card->shortname, sizeof(codec->card->shortname),
 		 "%s",  card->name);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to