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

TOMOYO Linux Cross Reference
Linux/sound/soc/cirrus/simone.c

Version: ~ [ linux-5.15-rc1 ] ~ [ linux-5.14.5 ] ~ [ linux-5.13.18 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.66 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.147 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.206 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.246 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.282 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.283 ] ~ [ 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-only
  2 /*
  3  * simone.c -- ASoC audio for Simplemachines Sim.One board
  4  *
  5  * Copyright (c) 2010 Mika Westerberg
  6  *
  7  * Based on snappercl15 machine driver by Ryan Mallon.
  8  */
  9 
 10 #include <linux/init.h>
 11 #include <linux/module.h>
 12 #include <linux/platform_device.h>
 13 #include <linux/soc/cirrus/ep93xx.h>
 14 
 15 #include <sound/core.h>
 16 #include <sound/pcm.h>
 17 #include <sound/soc.h>
 18 
 19 #include <asm/mach-types.h>
 20 
 21 SND_SOC_DAILINK_DEFS(hifi,
 22         DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-ac97")),
 23         DAILINK_COMP_ARRAY(COMP_CODEC("ac97-codec", "ac97-hifi")),
 24         DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-ac97")));
 25 
 26 static struct snd_soc_dai_link simone_dai = {
 27         .name           = "AC97",
 28         .stream_name    = "AC97 HiFi",
 29         SND_SOC_DAILINK_REG(hifi),
 30 };
 31 
 32 static struct snd_soc_card snd_soc_simone = {
 33         .name           = "Sim.One",
 34         .owner          = THIS_MODULE,
 35         .dai_link       = &simone_dai,
 36         .num_links      = 1,
 37 };
 38 
 39 static struct platform_device *simone_snd_ac97_device;
 40 
 41 static int simone_probe(struct platform_device *pdev)
 42 {
 43         struct snd_soc_card *card = &snd_soc_simone;
 44         int ret;
 45 
 46         simone_snd_ac97_device = platform_device_register_simple("ac97-codec",
 47                                                                  -1, NULL, 0);
 48         if (IS_ERR(simone_snd_ac97_device))
 49                 return PTR_ERR(simone_snd_ac97_device);
 50 
 51         card->dev = &pdev->dev;
 52 
 53         ret = snd_soc_register_card(card);
 54         if (ret) {
 55                 dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
 56                         ret);
 57                 platform_device_unregister(simone_snd_ac97_device);
 58         }
 59 
 60         return ret;
 61 }
 62 
 63 static int simone_remove(struct platform_device *pdev)
 64 {
 65         struct snd_soc_card *card = platform_get_drvdata(pdev);
 66 
 67         snd_soc_unregister_card(card);
 68         platform_device_unregister(simone_snd_ac97_device);
 69 
 70         return 0;
 71 }
 72 
 73 static struct platform_driver simone_driver = {
 74         .driver         = {
 75                 .name   = "simone-audio",
 76         },
 77         .probe          = simone_probe,
 78         .remove         = simone_remove,
 79 };
 80 
 81 module_platform_driver(simone_driver);
 82 
 83 MODULE_DESCRIPTION("ALSA SoC Simplemachines Sim.One");
 84 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>");
 85 MODULE_LICENSE("GPL");
 86 MODULE_ALIAS("platform:simone-audio");
 87 

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