Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:sound:ad1835a [26 Aug 2011 02:04] – Example device initialization Lars-Peter Clausenresources:tools-software:linux-drivers:sound:ad1835a [04 Feb 2021 15:36] (current) – [Driver testing] Michael Hennerich
Line 1: Line 1:
-====== AD1836 driver ======+====== AD1836 Sound CODEC Linux Driver ======
  
 ===== Supported devices ===== ===== Supported devices =====
  
-This driver supports the +  * [[adi>AD1835A]] 
-[[adi>AD1835A]] +  [[adi>AD1836A]] 
-[[adi>AD1836A]] +  [[adi>AD1838A]] 
-[[adi>AD1838A]]+  * [[adi>AD1837A]] 
 +  * [[adi>AD1839A]]
  
-[[adi>AD1837A]] +===== Evaluation Boards =====
-[[adi>AD1839A]]+
  
-===== Source =====+  * [[adi>AD1836AZ-DBRD]] 
 + 
 +====== Source Code ======
  
 ==== Status ==== ==== Status ====
  
- Source ^ Mainline? ^ +^ Source ^ Mainline? ^ 
-| [[bfgit>linux-kernel?sound/soc/codecs/ad1836.c|git]] | [[git.linux.org>sound/soc/codecs/ad1836.c|Yes]] |+| [[git.linux.org>sound/soc/codecs/ad1836.c|git]] | [[git.linux.org>sound/soc/codecs/ad1836.c|Yes]] |
  
 ==== Files ==== ==== Files ====
Line 24: Line 26:
 | include | [[git.linux.org>sound/soc/codecs/ad1836.h]] | | include | [[git.linux.org>sound/soc/codecs/ad1836.h]] |
  
-===== Example device initialization =====+====== Example device initialization ======
  
 {{page>software/linux/docs/platform_and_bus_model#Declaring SPI slave devices&firstseconly&noeditbtn}} {{page>software/linux/docs/platform_and_bus_model#Declaring SPI slave devices&firstseconly&noeditbtn}}
Line 85: Line 87:
 | ADC2 Capture Volume | Gain for ADC Channel 2 | AD1836A | | ADC2 Capture Volume | Gain for ADC Channel 2 | AD1836A |
  
-===== Supported DAI formats =====+===== DAI Configuration ===== 
 + 
 +The CODEC driver registers one DAI named depending on the chip model used. 
 + 
 +^ DAI name ^ Model ^ 
 +| "ad1835-hifi" | AD1835, AD1837 | 
 +| "ad1836-hifi" | AD1836 | 
 +| "ad1838-hifi" | AD1838, AD1839 | 
 + 
 +==== Supported DAI formats ====
  
 ^ Name ^ Supported by driver ^ Description ^ ^ Name ^ Supported by driver ^ Description ^
-| SND_SOC_DAIFMT_I2S     | no  | I2S Justified mode |+| SND_SOC_DAIFMT_I2S     | no  | I2S mode |
 | SND_SOC_DAIFMT_RIGHT_J | no  | Right Justified mode | | SND_SOC_DAIFMT_RIGHT_J | no  | Right Justified mode |
 | SND_SOC_DAIFMT_LEFT_J  | no  | Left Justified mode  | | SND_SOC_DAIFMT_LEFT_J  | no  | Left Justified mode  |
Line 106: Line 117:
 | SND_SOC_DAIFMT_CBS_CFS | no  | Codec bit- and frameclock slave | | SND_SOC_DAIFMT_CBS_CFS | no  | Codec bit- and frameclock slave |
  
 +==== Example DAI Configuration ====
 +
 +<code c>
 +static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream,
 + struct snd_pcm_hw_params *params)
 +{
 + struct snd_soc_pcm_runtime *rtd = substream->private_data;
 + struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 + struct snd_soc_dai *codec_dai = rtd->codec_dai;
 + int ret;
 +
 + /* set cpu DAI configuration */
 + ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
 + SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
 + if (ret < 0)
 + return ret;
 +
 + /* set codec DAI configuration */
 + ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_A |
 + SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_CBM_CFM);
 + if (ret < 0)
 + return ret;
 +
 + return 0;
 +}
 +
 +static struct snd_soc_ops bf5xx_ad1836_ops = {
 + .hw_params = bf5xx_ad1836_hw_params,
 +};
 +
 +static struct snd_soc_dai_link bf5xx_ad1836_dai = {
 + .name = "ad1836",
 + .stream_name = "AD1836",
 + .cpu_dai_name = "bfin-tdm.0",
 + .codec_dai_name = "ad1836-hifi",
 + .platform_name = "bfin-tdm-pcm-audio",
 + .codec_name = "spi0.4",
 + .ops = &bf5xx_ad1836_ops,
 +};
 +</code>
 ====== AD1836 evaluation board driver ====== ====== AD1836 evaluation board driver ======
  
Line 235: Line 286:
   Also you can run "alsamixer" to get graphic configuration interface, OSS-based "mixer" can work too.   Also you can run "alsamixer" to get graphic configuration interface, OSS-based "mixer" can work too.
   - Check to make sure mp3s work (assuming you have built mp3play),   - Check to make sure mp3s work (assuming you have built mp3play),
-    - The first step is to download a mp3 file onto the platform. The ''wget'' command assumes that networking is properly configured (you have an IP number, the default gateway is set, and DNS servers can be accessed), and working. See the [[:setting_up_the_network|network setup page]] for more info. <xterm>root:/> **cd /var**+    - The first step is to download a mp3 file onto the platform. The ''wget'' command assumes that networking is properly configured (you have an IP number, the default gateway is set, and DNS servers can be accessed), and working. <xterm>root:/> **cd /var**
 root:/var> **wget http://www.radiocrazy.com/shows/A/AbbottCostello/ABCOWhosOnFirstclip.mp3** root:/var> **wget http://www.radiocrazy.com/shows/A/AbbottCostello/ABCOWhosOnFirstclip.mp3**
 </xterm> </xterm>
resources/tools-software/linux-drivers/sound/ad1835a.1314317066.txt.gz · Last modified: 26 Aug 2011 02:04 by Lars-Peter Clausen