]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/soc/sh/sh7760-ac97.c
Merge tag 'v2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / sound / soc / sh / sh7760-ac97.c
index ce7f95b59de32aa3efe58bd46389ecb1d0b98c5e..f8e0ab82ef59e188714ba8851048534f0691e10b 100644 (file)
 #include <sound/soc-dapm.h>
 #include <asm/io.h>
 
-#include "../codecs/ac97.h"
-
 #define IPSEL 0xFE400034
 
 /* platform specific structs can be declared here */
-extern struct snd_soc_dai sh4_hac_dai[2];
-extern struct snd_soc_platform sh7760_soc_platform;
+extern struct snd_soc_dai_driver sh4_hac_dai[2];
+extern struct snd_soc_platform_driver sh7760_soc_platform;
 
-static int machine_init(struct snd_soc_codec *codec)
+static int machine_init(struct snd_soc_pcm_runtime *rtd)
 {
-       snd_soc_dapm_sync(codec);
+       snd_soc_dapm_sync(rtd->codec);
        return 0;
 }
 
 static struct snd_soc_dai_link sh7760_ac97_dai = {
        .name = "AC97",
        .stream_name = "AC97 HiFi",
-       .cpu_dai = &sh4_hac_dai[0],     /* HAC0 */
-       .codec_dai = &ac97_dai,
+       .cpu_dai_name = "hac-dai.0",    /* HAC0 */
+       .codec_dai_name = "ac97-hifi",
+       .platform_name = "sh7760-pcm-audio",
+       .codec_name = "ac97-codec",
        .init = machine_init,
        .ops = NULL,
 };
 
 static struct snd_soc_card sh7760_ac97_soc_machine  = {
        .name = "SH7760 AC97",
-       .platform = &sh7760_soc_platform,
        .dai_link = &sh7760_ac97_dai,
        .num_links = 1,
 };
 
-static struct snd_soc_device sh7760_ac97_snd_devdata = {
-       .card = &sh7760_ac97_soc_machine,
-       .codec_dev = &soc_codec_dev_ac97,
-};
-
 static struct platform_device *sh7760_ac97_snd_device;
 
 static int __init sh7760_ac97_init(void)
@@ -58,8 +52,8 @@ static int __init sh7760_ac97_init(void)
        unsigned short ipsel;
 
        /* enable both AC97 controllers in pinmux reg */
-       ipsel = ctrl_inw(IPSEL);
-       ctrl_outw(ipsel | (3 << 10), IPSEL);
+       ipsel = __raw_readw(IPSEL);
+       __raw_writew(ipsel | (3 << 10), IPSEL);
 
        ret = -ENOMEM;
        sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1);
@@ -67,8 +61,7 @@ static int __init sh7760_ac97_init(void)
                goto out;
 
        platform_set_drvdata(sh7760_ac97_snd_device,
-                            &sh7760_ac97_snd_devdata);
-       sh7760_ac97_snd_devdata.dev = &sh7760_ac97_snd_device->dev;
+                            &sh7760_ac97_soc_machine);
        ret = platform_device_add(sh7760_ac97_snd_device);
 
        if (ret)