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

TOMOYO Linux Cross Reference
Linux/sound/soc/sirf/sirf-audio-port.c

Version: ~ [ linux-5.13-rc5 ] ~ [ linux-5.12.9 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.42 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.124 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.193 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.235 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.271 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.271 ] ~ [ 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-or-later
  2 /*
  3  * SiRF Audio port driver
  4  *
  5  * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
  6  */
  7 #include <linux/module.h>
  8 #include <sound/soc.h>
  9 #include <sound/dmaengine_pcm.h>
 10 
 11 struct sirf_audio_port {
 12         struct regmap *regmap;
 13         struct snd_dmaengine_dai_dma_data playback_dma_data;
 14         struct snd_dmaengine_dai_dma_data capture_dma_data;
 15 };
 16 
 17 
 18 static int sirf_audio_port_dai_probe(struct snd_soc_dai *dai)
 19 {
 20         struct sirf_audio_port *port = snd_soc_dai_get_drvdata(dai);
 21 
 22         snd_soc_dai_init_dma_data(dai, &port->playback_dma_data,
 23                         &port->capture_dma_data);
 24         return 0;
 25 }
 26 
 27 static struct snd_soc_dai_driver sirf_audio_port_dai = {
 28         .probe = sirf_audio_port_dai_probe,
 29         .name = "sirf-audio-port",
 30         .id = 0,
 31         .playback = {
 32                 .channels_min = 2,
 33                 .channels_max = 2,
 34                 .rates = SNDRV_PCM_RATE_48000,
 35                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 36         },
 37         .capture = {
 38                 .channels_min = 1,
 39                 .channels_max = 2,
 40                 .rates = SNDRV_PCM_RATE_48000,
 41                 .formats = SNDRV_PCM_FMTBIT_S16_LE,
 42         },
 43 };
 44 
 45 static const struct snd_soc_component_driver sirf_audio_port_component = {
 46         .name       = "sirf-audio-port",
 47 };
 48 
 49 static int sirf_audio_port_probe(struct platform_device *pdev)
 50 {
 51         int ret;
 52         struct sirf_audio_port *port;
 53 
 54         port = devm_kzalloc(&pdev->dev,
 55                         sizeof(struct sirf_audio_port), GFP_KERNEL);
 56         if (!port)
 57                 return -ENOMEM;
 58 
 59         ret = devm_snd_soc_register_component(&pdev->dev,
 60                         &sirf_audio_port_component, &sirf_audio_port_dai, 1);
 61         if (ret)
 62                 return ret;
 63 
 64         platform_set_drvdata(pdev, port);
 65         return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
 66 }
 67 
 68 static const struct of_device_id sirf_audio_port_of_match[] = {
 69         { .compatible = "sirf,audio-port", },
 70         {}
 71 };
 72 MODULE_DEVICE_TABLE(of, sirf_audio_port_of_match);
 73 
 74 static struct platform_driver sirf_audio_port_driver = {
 75         .driver = {
 76                 .name = "sirf-audio-port",
 77                 .of_match_table = sirf_audio_port_of_match,
 78         },
 79         .probe = sirf_audio_port_probe,
 80 };
 81 
 82 module_platform_driver(sirf_audio_port_driver);
 83 
 84 MODULE_DESCRIPTION("SiRF Audio Port driver");
 85 MODULE_AUTHOR("RongJun Ying <Rongjun.Ying@csr.com>");
 86 MODULE_LICENSE("GPL v2");
 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