~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/sh/sh7760-ac97.c

Version: ~ [ linux-5.16-rc1 ] ~ [ linux-5.15.2 ] ~ [ linux-5.14.18 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.79 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.159 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.217 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.255 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.290 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.292 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Generic AC97 sound support for SH7760
  3  *
  4  * (c) 2007 Manuel Lauss
  5  *
  6  * Licensed under the GPLv2.
  7  */
  8 
  9 #include <linux/module.h>
 10 #include <linux/moduleparam.h>
 11 #include <linux/platform_device.h>
 12 #include <sound/core.h>
 13 #include <sound/pcm.h>
 14 #include <sound/soc.h>
 15 #include <sound/soc-dapm.h>
 16 #include <asm/io.h>
 17 
 18 #include "../codecs/ac97.h"
 19 
 20 #define IPSEL 0xFE400034
 21 
 22 /* platform specific structs can be declared here */
 23 extern struct snd_soc_dai sh4_hac_dai[2];
 24 extern struct snd_soc_platform sh7760_soc_platform;
 25 
 26 static int machine_init(struct snd_soc_codec *codec)
 27 {
 28         snd_soc_dapm_sync(codec);
 29         return 0;
 30 }
 31 
 32 static struct snd_soc_dai_link sh7760_ac97_dai = {
 33         .name = "AC97",
 34         .stream_name = "AC97 HiFi",
 35         .cpu_dai = &sh4_hac_dai[0],     /* HAC0 */
 36         .codec_dai = &ac97_dai,
 37         .init = machine_init,
 38         .ops = NULL,
 39 };
 40 
 41 static struct snd_soc_card sh7760_ac97_soc_machine  = {
 42         .name = "SH7760 AC97",
 43         .platform = &sh7760_soc_platform,
 44         .dai_link = &sh7760_ac97_dai,
 45         .num_links = 1,
 46 };
 47 
 48 static struct snd_soc_device sh7760_ac97_snd_devdata = {
 49         .card = &sh7760_ac97_soc_machine,
 50         .codec_dev = &soc_codec_dev_ac97,
 51 };
 52 
 53 static struct platform_device *sh7760_ac97_snd_device;
 54 
 55 static int __init sh7760_ac97_init(void)
 56 {
 57         int ret;
 58         unsigned short ipsel;
 59 
 60         /* enable both AC97 controllers in pinmux reg */
 61         ipsel = ctrl_inw(IPSEL);
 62         ctrl_outw(ipsel | (3 << 10), IPSEL);
 63 
 64         ret = -ENOMEM;
 65         sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1);
 66         if (!sh7760_ac97_snd_device)
 67                 goto out;
 68 
 69         platform_set_drvdata(sh7760_ac97_snd_device,
 70                              &sh7760_ac97_snd_devdata);
 71         sh7760_ac97_snd_devdata.dev = &sh7760_ac97_snd_device->dev;
 72         ret = platform_device_add(sh7760_ac97_snd_device);
 73 
 74         if (ret)
 75                 platform_device_put(sh7760_ac97_snd_device);
 76 
 77 out:
 78         return ret;
 79 }
 80 
 81 static void __exit sh7760_ac97_exit(void)
 82 {
 83         platform_device_unregister(sh7760_ac97_snd_device);
 84 }
 85 
 86 module_init(sh7760_ac97_init);
 87 module_exit(sh7760_ac97_exit);
 88 
 89 MODULE_LICENSE("GPL");
 90 MODULE_DESCRIPTION("Generic SH7760 AC97 sound machine");
 91 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");
 92 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp