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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-or-later
  2 /*
  3  * wm8727.c
  4  *
  5  *  Created on: 15-Oct-2009
  6  *      Author: neil.jones@imgtec.com
  7  *
  8  * Copyright (C) 2009 Imagination Technologies Ltd.
  9  */
 10 
 11 #include <linux/init.h>
 12 #include <linux/slab.h>
 13 #include <linux/module.h>
 14 #include <linux/kernel.h>
 15 #include <linux/device.h>
 16 #include <sound/core.h>
 17 #include <sound/pcm.h>
 18 #include <sound/initval.h>
 19 #include <sound/soc.h>
 20 
 21 static const struct snd_soc_dapm_widget wm8727_dapm_widgets[] = {
 22 SND_SOC_DAPM_OUTPUT("VOUTL"),
 23 SND_SOC_DAPM_OUTPUT("VOUTR"),
 24 };
 25 
 26 static const struct snd_soc_dapm_route wm8727_dapm_routes[] = {
 27         { "VOUTL", NULL, "Playback" },
 28         { "VOUTR", NULL, "Playback" },
 29 };
 30 
 31 /*
 32  * Note this is a simple chip with no configuration interface, sample rate is
 33  * determined automatically by examining the Master clock and Bit clock ratios
 34  */
 35 #define WM8727_RATES  (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
 36                         SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |\
 37                         SNDRV_PCM_RATE_192000)
 38 
 39 static struct snd_soc_dai_driver wm8727_dai = {
 40         .name = "wm8727-hifi",
 41         .playback = {
 42                 .stream_name = "Playback",
 43                 .channels_min = 2,
 44                 .channels_max = 2,
 45                 .rates = WM8727_RATES,
 46                 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
 47                 },
 48 };
 49 
 50 static const struct snd_soc_component_driver soc_component_dev_wm8727 = {
 51         .dapm_widgets           = wm8727_dapm_widgets,
 52         .num_dapm_widgets       = ARRAY_SIZE(wm8727_dapm_widgets),
 53         .dapm_routes            = wm8727_dapm_routes,
 54         .num_dapm_routes        = ARRAY_SIZE(wm8727_dapm_routes),
 55         .idle_bias_on           = 1,
 56         .use_pmdown_time        = 1,
 57         .endianness             = 1,
 58 };
 59 
 60 static int wm8727_probe(struct platform_device *pdev)
 61 {
 62         return devm_snd_soc_register_component(&pdev->dev,
 63                         &soc_component_dev_wm8727, &wm8727_dai, 1);
 64 }
 65 
 66 static struct platform_driver wm8727_codec_driver = {
 67         .driver = {
 68                         .name = "wm8727",
 69         },
 70 
 71         .probe = wm8727_probe,
 72 };
 73 
 74 module_platform_driver(wm8727_codec_driver);
 75 
 76 MODULE_DESCRIPTION("ASoC wm8727 driver");
 77 MODULE_AUTHOR("Neil Jones");
 78 MODULE_LICENSE("GPL");
 79 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php