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

TOMOYO Linux Cross Reference
Linux/sound/soc/codecs/wm8727.c

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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  * wm8727.c
  3  *
  4  *  Created on: 15-Oct-2009
  5  *      Author: neil.jones@imgtec.com
  6  *
  7  * Copyright (C) 2009 Imagination Technologies Ltd.
  8  *
  9  *  This program is free software; you can redistribute  it and/or modify it
 10  *  under  the terms of  the GNU General  Public License as published by the
 11  *  Free Software Foundation;  either version 2 of the  License, or (at your
 12  *  option) any later version.
 13  */
 14 
 15 #include <linux/init.h>
 16 #include <linux/slab.h>
 17 #include <linux/module.h>
 18 #include <linux/kernel.h>
 19 #include <linux/device.h>
 20 #include <sound/core.h>
 21 #include <sound/pcm.h>
 22 #include <sound/ac97_codec.h>
 23 #include <sound/initval.h>
 24 #include <sound/soc.h>
 25 
 26 static const struct snd_soc_dapm_widget wm8727_dapm_widgets[] = {
 27 SND_SOC_DAPM_OUTPUT("VOUTL"),
 28 SND_SOC_DAPM_OUTPUT("VOUTR"),
 29 };
 30 
 31 static const struct snd_soc_dapm_route wm8727_dapm_routes[] = {
 32         { "VOUTL", NULL, "Playback" },
 33         { "VOUTR", NULL, "Playback" },
 34 };
 35 
 36 /*
 37  * Note this is a simple chip with no configuration interface, sample rate is
 38  * determined automatically by examining the Master clock and Bit clock ratios
 39  */
 40 #define WM8727_RATES  (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
 41                         SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |\
 42                         SNDRV_PCM_RATE_192000)
 43 
 44 
 45 static struct snd_soc_dai_driver wm8727_dai = {
 46         .name = "wm8727-hifi",
 47         .playback = {
 48                 .stream_name = "Playback",
 49                 .channels_min = 2,
 50                 .channels_max = 2,
 51                 .rates = WM8727_RATES,
 52                 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
 53                 },
 54 };
 55 
 56 static struct snd_soc_codec_driver soc_codec_dev_wm8727 = {
 57         .dapm_widgets = wm8727_dapm_widgets,
 58         .num_dapm_widgets = ARRAY_SIZE(wm8727_dapm_widgets),
 59         .dapm_routes = wm8727_dapm_routes,
 60         .num_dapm_routes = ARRAY_SIZE(wm8727_dapm_routes),
 61 };
 62 
 63 static int wm8727_probe(struct platform_device *pdev)
 64 {
 65         return snd_soc_register_codec(&pdev->dev,
 66                         &soc_codec_dev_wm8727, &wm8727_dai, 1);
 67 }
 68 
 69 static int wm8727_remove(struct platform_device *pdev)
 70 {
 71         snd_soc_unregister_codec(&pdev->dev);
 72         return 0;
 73 }
 74 
 75 static struct platform_driver wm8727_codec_driver = {
 76         .driver = {
 77                         .name = "wm8727",
 78                         .owner = THIS_MODULE,
 79         },
 80 
 81         .probe = wm8727_probe,
 82         .remove = wm8727_remove,
 83 };
 84 
 85 module_platform_driver(wm8727_codec_driver);
 86 
 87 MODULE_DESCRIPTION("ASoC wm8727 driver");
 88 MODULE_AUTHOR("Neil Jones");
 89 MODULE_LICENSE("GPL");
 90 

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