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

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

Version: ~ [ linux-5.12 ] ~ [ linux-5.11.16 ] ~ [ linux-5.10.32 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.114 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.188 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.231 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.267 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.267 ] ~ [ 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 // ak4554.c
  3 //
  4 // Copyright (C) 2013 Renesas Solutions Corp.
  5 // Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
  6 
  7 #include <linux/module.h>
  8 #include <sound/soc.h>
  9 
 10 /*
 11  * ak4554 is very simple DA/AD converter which has no setting register.
 12  *
 13  * CAUTION
 14  *
 15  * ak4554 playback format is SND_SOC_DAIFMT_RIGHT_J,
 16  * and,   capture  format is SND_SOC_DAIFMT_LEFT_J
 17  * on same bit clock, LR clock.
 18  * But, this driver doesn't have snd_soc_dai_ops :: set_fmt
 19  *
 20  * CPU/Codec DAI image
 21  *
 22  * CPU-DAI1 (plaback only fmt = RIGHT_J) --+-- ak4554
 23  *                                         |
 24  * CPU-DAI2 (capture only fmt = LEFT_J) ---+
 25  */
 26 
 27 static const struct snd_soc_dapm_widget ak4554_dapm_widgets[] = {
 28 SND_SOC_DAPM_INPUT("AINL"),
 29 SND_SOC_DAPM_INPUT("AINR"),
 30 
 31 SND_SOC_DAPM_OUTPUT("AOUTL"),
 32 SND_SOC_DAPM_OUTPUT("AOUTR"),
 33 };
 34 
 35 static const struct snd_soc_dapm_route ak4554_dapm_routes[] = {
 36         { "Capture", NULL, "AINL" },
 37         { "Capture", NULL, "AINR" },
 38 
 39         { "AOUTL", NULL, "Playback" },
 40         { "AOUTR", NULL, "Playback" },
 41 };
 42 
 43 static struct snd_soc_dai_driver ak4554_dai = {
 44         .name = "ak4554-hifi",
 45         .playback = {
 46                 .stream_name = "Playback",
 47                 .channels_min = 2,
 48                 .channels_max = 2,
 49                 .rates = SNDRV_PCM_RATE_8000_48000,
 50                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 51         },
 52         .capture = {
 53                 .stream_name = "Capture",
 54                 .channels_min = 2,
 55                 .channels_max = 2,
 56                 .rates = SNDRV_PCM_RATE_8000_48000,
 57                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 58         },
 59         .symmetric_rates = 1,
 60 };
 61 
 62 static const struct snd_soc_component_driver soc_component_dev_ak4554 = {
 63         .dapm_widgets           = ak4554_dapm_widgets,
 64         .num_dapm_widgets       = ARRAY_SIZE(ak4554_dapm_widgets),
 65         .dapm_routes            = ak4554_dapm_routes,
 66         .num_dapm_routes        = ARRAY_SIZE(ak4554_dapm_routes),
 67         .idle_bias_on           = 1,
 68         .use_pmdown_time        = 1,
 69         .endianness             = 1,
 70         .non_legacy_dai_naming  = 1,
 71 };
 72 
 73 static int ak4554_soc_probe(struct platform_device *pdev)
 74 {
 75         return devm_snd_soc_register_component(&pdev->dev,
 76                                       &soc_component_dev_ak4554,
 77                                       &ak4554_dai, 1);
 78 }
 79 
 80 static const struct of_device_id ak4554_of_match[] = {
 81         { .compatible = "asahi-kasei,ak4554" },
 82         {},
 83 };
 84 MODULE_DEVICE_TABLE(of, ak4554_of_match);
 85 
 86 static struct platform_driver ak4554_driver = {
 87         .driver = {
 88                 .name = "ak4554-adc-dac",
 89                 .of_match_table = ak4554_of_match,
 90         },
 91         .probe  = ak4554_soc_probe,
 92 };
 93 module_platform_driver(ak4554_driver);
 94 
 95 MODULE_LICENSE("GPL v2");
 96 MODULE_DESCRIPTION("SoC AK4554 driver");
 97 MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
 98 

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