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

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

Version: ~ [ linux-5.15-rc5 ] ~ [ linux-5.14.11 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.72 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.152 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.210 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.250 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.286 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.288 ] ~ [ 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 // SPDX-License-Identifier: GPL-2.0
  2 //
  3 // Generic AC97 sound support for SH7760
  4 //
  5 // (c) 2007 Manuel Lauss
  6 
  7 #include <linux/module.h>
  8 #include <linux/moduleparam.h>
  9 #include <linux/platform_device.h>
 10 #include <sound/core.h>
 11 #include <sound/pcm.h>
 12 #include <sound/soc.h>
 13 #include <asm/io.h>
 14 
 15 #define IPSEL 0xFE400034
 16 
 17 SND_SOC_DAILINK_DEFS(ac97,
 18         DAILINK_COMP_ARRAY(COMP_CPU("hac-dai.0")),      /* HAC0 */
 19         DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
 20         DAILINK_COMP_ARRAY(COMP_PLATFORM("sh7760-pcm-audio")));
 21 
 22 static struct snd_soc_dai_link sh7760_ac97_dai = {
 23         .name = "AC97",
 24         .stream_name = "AC97 HiFi",
 25         SND_SOC_DAILINK_REG(ac97),
 26 };
 27 
 28 static struct snd_soc_card sh7760_ac97_soc_machine  = {
 29         .name = "SH7760 AC97",
 30         .owner = THIS_MODULE,
 31         .dai_link = &sh7760_ac97_dai,
 32         .num_links = 1,
 33 };
 34 
 35 static struct platform_device *sh7760_ac97_snd_device;
 36 
 37 static int __init sh7760_ac97_init(void)
 38 {
 39         int ret;
 40         unsigned short ipsel;
 41 
 42         /* enable both AC97 controllers in pinmux reg */
 43         ipsel = __raw_readw(IPSEL);
 44         __raw_writew(ipsel | (3 << 10), IPSEL);
 45 
 46         ret = -ENOMEM;
 47         sh7760_ac97_snd_device = platform_device_alloc("soc-audio", -1);
 48         if (!sh7760_ac97_snd_device)
 49                 goto out;
 50 
 51         platform_set_drvdata(sh7760_ac97_snd_device,
 52                              &sh7760_ac97_soc_machine);
 53         ret = platform_device_add(sh7760_ac97_snd_device);
 54 
 55         if (ret)
 56                 platform_device_put(sh7760_ac97_snd_device);
 57 
 58 out:
 59         return ret;
 60 }
 61 
 62 static void __exit sh7760_ac97_exit(void)
 63 {
 64         platform_device_unregister(sh7760_ac97_snd_device);
 65 }
 66 
 67 module_init(sh7760_ac97_init);
 68 module_exit(sh7760_ac97_exit);
 69 
 70 MODULE_LICENSE("GPL v2");
 71 MODULE_DESCRIPTION("Generic SH7760 AC97 sound machine");
 72 MODULE_AUTHOR("Manuel Lauss <mano@roarinelk.homelinux.net>");
 73 

~ [ 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