This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
resources:tools-software:linux-drivers:sound:ad1835a [26 Aug 2011 02:04] – Example device initialization Lars-Peter Clausen | resources:tools-software:linux-drivers:sound:ad1835a [04 Feb 2021 15:36] (current) – [Driver testing] Michael Hennerich | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== AD1836 | + | ====== AD1836 |
===== Supported devices ===== | ===== Supported devices ===== | ||
- | This driver supports the | + | * [[adi> |
- | [[adi> | + | |
- | [[adi> | + | |
- | [[adi> | + | * [[adi> |
+ | * [[adi> | ||
- | [[adi> | + | ===== Evaluation Boards ===== |
- | [[adi> | + | |
- | ===== Source ===== | + | * [[adi> |
+ | |||
+ | ====== Source | ||
==== Status ==== | ==== Status ==== | ||
- | ^ Source ^ Mainline? ^ | + | ^ Source ^ Mainline? ^ |
- | | [[bfgit>linux-kernel? | + | | [[git.linux.org> |
==== Files ==== | ==== Files ==== | ||
Line 24: | Line 26: | ||
| include | [[git.linux.org> | | include | [[git.linux.org> | ||
- | ===== Example device initialization ===== | + | ====== Example device initialization |
{{page> | {{page> | ||
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 ^ | ||
+ | | " | ||
+ | | " | ||
+ | | " | ||
+ | |||
+ | ==== Supported DAI formats ==== | ||
^ Name ^ Supported by driver ^ Description ^ | ^ Name ^ Supported by driver ^ Description ^ | ||
- | | SND_SOC_DAIFMT_I2S | + | | SND_SOC_DAIFMT_I2S |
| SND_SOC_DAIFMT_RIGHT_J | no | Right Justified mode | | | SND_SOC_DAIFMT_RIGHT_J | no | Right Justified mode | | ||
| SND_SOC_DAIFMT_LEFT_J | | SND_SOC_DAIFMT_LEFT_J | ||
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-> | ||
+ | struct snd_soc_dai *cpu_dai = rtd-> | ||
+ | struct snd_soc_dai *codec_dai = rtd-> | ||
+ | int ret; | ||
+ | |||
+ | /* set cpu DAI configuration */ | ||
+ | ret = snd_soc_dai_set_fmt(cpu_dai, | ||
+ | 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_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 = " | ||
+ | .stream_name = " | ||
+ | .cpu_dai_name = " | ||
+ | .codec_dai_name = " | ||
+ | .platform_name = " | ||
+ | .codec_name = " | ||
+ | .ops = & | ||
+ | }; | ||
+ | </ | ||
====== AD1836 evaluation board driver ====== | ====== AD1836 evaluation board driver ====== | ||
Line 235: | Line 286: | ||
Also you can run " | Also you can run " | ||
- 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 '' | + | - The first step is to download a mp3 file onto the platform. The '' |
root:/ | root:/ | ||
</ | </ |