Simple Audio Card Driver
Schema identifier ($id): "http://devicetree.org/schemas/sound/simple-card.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
Maintainers (maintainers): "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
Reusable definitions (definitions) #
frame-master #
Indicates dai-link frame master.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
bitclock-master #
Indicates dai-link bit clock master
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle
frame-inversion #
dai-link uses frame clock inversion
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
bitclock-inversion #
dai-link uses bit clock inversion
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
dai-tdm-slot-num #
see tdm-slot.txt.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
dai-tdm-slot-width #
see tdm-slot.txt.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
system-clock-frequency #
If a clock is specified and a multiplication factor is given with mclk-fs, the clock will be set to the calculated mclk frequency when the stream starts.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
system-clock-direction-out #
specifies clock direction as 'out' on initialization. It is useful for some aCPUs with fixed clocks.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
system-clock-fixed #
Specifies that the clock frequency should not be modified. Implied when system-clock-frequency is specified, but can be used when a clock is mapped to the device whose frequency cannot or should not be changed. When mclk-fs is also specified, this restricts the device to a single fixed sampling rate.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
mclk-fs #
Multiplication factor between stream rate and codec mclk. When defined, mclk-fs property defined in dai-link sub nodes are ignored.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
aux-devs #
List of phandles pointing to auxiliary devices, such as amplifiers, to be added to the sound card.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/phandle-array
convert-rate #
CPU to Codec rate convert.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
convert-channels #
CPU to Codec rate channels.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32
prefix #
device name prefix
Shared schema rule ($ref): /schemas/types.yaml#/definitions/string
label #
Maximum number of items (maxItems): 1
routing #
A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, the second being the connection's source.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/non-unique-string-array
widgets #
User specified audio sound widgets.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/non-unique-string-array
pin-switches #
the widget names for which pin switches must be created.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/string-array
format #
audio format.
Array item rules (items) #
Allowed values (
enum):"i2s","right_j","left_j","dsp_a","dsp_b","ac97","pdm","msb","lsb"
dai #
Value type (type): "object"
Properties and child nodes (properties) #
sound-dai — required here
Maximum number of items (maxItems): 1
mclk-fs — not listed as required here
Shared schema rule ($ref): #/definitions/mclk-fs
prefix — not listed as required here
Shared schema rule ($ref): #/definitions/prefix
frame-inversion — not listed as required here
Shared schema rule ($ref): #/definitions/frame-inversion
bitclock-inversion — not listed as required here
Shared schema rule ($ref): #/definitions/bitclock-inversion
frame-master — not listed as required here
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
bitclock-master — not listed as required here
Shared schema rule ($ref): /schemas/types.yaml#/definitions/flag
dai-tdm-slot-num — not listed as required here
Shared schema rule ($ref): #/definitions/dai-tdm-slot-num
dai-tdm-slot-width — not listed as required here
Shared schema rule ($ref): #/definitions/dai-tdm-slot-width
clocks — not listed as required here
Maximum number of items (maxItems): 1
system-clock-frequency — not listed as required here
Shared schema rule ($ref): #/definitions/system-clock-frequency
system-clock-direction-out — not listed as required here
Shared schema rule ($ref): #/definitions/system-clock-direction-out
system-clock-fixed — not listed as required here
Shared schema rule ($ref): #/definitions/system-clock-fixed
Required in this object (required): "sound-dai"
additional-devs #
Value type (type): "object"
Additional devices used by the simple audio card.
Properties matching a name pattern (patternProperties) #
^iio-aux(-.+)?$ — name matches this regular expression
Value type (type): "object"
Shared schema rule ($ref): audio-iio-aux.yaml#
Properties and child nodes (properties) #
compatible — required here #
Rule for matching array elements (contains) #
Allowed values (
enum):"simple-audio-card","simple-scu-audio-card"
#address-cells — not listed as required here #
Exact value (const): 1
#size-cells — not listed as required here #
Exact value (const): 0
label — not listed as required here #
Shared schema rule ($ref): #/definitions/label
simple-audio-card,name — not listed as required here #
User specified audio sound card name.
Shared schema rule ($ref): /schemas/types.yaml#/definitions/string
simple-audio-card,widgets — not listed as required here #
Shared schema rule ($ref): #/definitions/widgets
simple-audio-card,routing — not listed as required here #
Shared schema rule ($ref): #/definitions/routing
simple-audio-card,frame-master — not listed as required here #
Shared schema rule ($ref): #/definitions/frame-master
simple-audio-card,bitclock-master — not listed as required here #
Shared schema rule ($ref): #/definitions/bitclock-master
simple-audio-card,frame-inversion — not listed as required here #
Shared schema rule ($ref): #/definitions/frame-inversion
simple-audio-card,bitclock-inversion — not listed as required here #
Shared schema rule ($ref): #/definitions/bitclock-inversion
simple-audio-card,format — not listed as required here #
Shared schema rule ($ref): #/definitions/format
simple-audio-card,mclk-fs — not listed as required here #
Shared schema rule ($ref): #/definitions/mclk-fs
simple-audio-card,aux-devs — not listed as required here #
Shared schema rule ($ref): #/definitions/aux-devs
simple-audio-card,additional-devs — not listed as required here #
Shared schema rule ($ref): #/definitions/additional-devs
simple-audio-card,convert-rate — not listed as required here #
Shared schema rule ($ref): #/definitions/convert-rate
simple-audio-card,convert-channels — not listed as required here #
Shared schema rule ($ref): #/definitions/convert-channels
simple-audio-card,prefix — not listed as required here #
Shared schema rule ($ref): #/definitions/prefix
simple-audio-card,pin-switches — not listed as required here #
Shared schema rule ($ref): #/definitions/pin-switches
simple-audio-card,hp-det-gpio — not listed as required here #
Deprecated (deprecated): true
Maximum number of items (maxItems): 1
simple-audio-card,hp-det-gpios — not listed as required here #
Maximum number of items (maxItems): 1
simple-audio-card,mic-det-gpio — not listed as required here #
Deprecated (deprecated): true
Maximum number of items (maxItems): 1
simple-audio-card,mic-det-gpios — not listed as required here #
Maximum number of items (maxItems): 1
Properties matching a name pattern (patternProperties) #
^simple-audio-card,cpu(@[0-9a-f]+)?$ — name matches this regular expression #
Shared schema rule ($ref): #/definitions/dai
^simple-audio-card,codec(@[0-9a-f]+)?$ — name matches this regular expression #
Shared schema rule ($ref): #/definitions/dai
^simple-audio-card,plat(@[0-9a-f]+)?$ — name matches this regular expression #
Shared schema rule ($ref): #/definitions/dai
^simple-audio-card,dai-link(@[0-9a-f]+)?$ — name matches this regular expression #
Container for dai-link level properties and the CPU and CODEC sub-nodes. This container may be omitted when the card has only one DAI link.
Value type (type): "object"
Properties and child nodes (properties) #
reg — not listed as required here
Maximum number of items (maxItems): 1
#address-cells — not listed as required here
Exact value (const): 1
#size-cells — not listed as required here
Exact value (const): 0
frame-master — not listed as required here
Shared schema rule ($ref): #/definitions/frame-master
bitclock-master — not listed as required here
Shared schema rule ($ref): #/definitions/bitclock-master
frame-inversion — not listed as required here
Shared schema rule ($ref): #/definitions/frame-inversion
bitclock-inversion — not listed as required here
Shared schema rule ($ref): #/definitions/bitclock-inversion
format — not listed as required here
Shared schema rule ($ref): #/definitions/format
mclk-fs — not listed as required here
Shared schema rule ($ref): #/definitions/mclk-fs
aux-devs — not listed as required here
Shared schema rule ($ref): #/definitions/aux-devs
convert-rate — not listed as required here
Shared schema rule ($ref): #/definitions/convert-rate
convert-channels — not listed as required here
Shared schema rule ($ref): #/definitions/convert-channels
prefix — not listed as required here
Shared schema rule ($ref): #/definitions/prefix
pin-switches — not listed as required here
Shared schema rule ($ref): #/definitions/pin-switches
hp-det-gpio — not listed as required here
Deprecated (deprecated): true
Maximum number of items (maxItems): 1
hp-det-gpios — not listed as required here
Maximum number of items (maxItems): 1
mic-det-gpio — not listed as required here
Deprecated (deprecated): true
Maximum number of items (maxItems): 1
mic-det-gpios — not listed as required here
Maximum number of items (maxItems): 1
Properties matching a name pattern (patternProperties) #
^cpu(-[0-9]+)?$ — name matches this regular expression
Shared schema rule ($ref): #/definitions/dai
^codec(-[0-9]+)?$ — name matches this regular expression
Shared schema rule ($ref): #/definitions/dai
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Required in this object (required): "compatible"
Properties not matched by properties or patternProperties in this schema (additionalProperties) #
false
Not allowed by this rule.
Examples (examples) #
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "VF610-Tower-Sound-Card";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Headphone", "Headphone Jack",
"Speaker", "External Speaker";
simple-audio-card,routing =
"MIC_IN", "Microphone Jack",
"Headphone Jack", "HP_OUT",
"External Speaker", "LINE_OUT";
simple-audio-card,cpu {
sound-dai = <&sh_fsi2 0>;
};
dailink0_master: simple-audio-card,codec {
sound-dai = <&ak4648>;
clocks = <&osc>;
};
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "Cubox Audio";
#address-cells = <1>;
#size-cells = <0>;
simple-audio-card,dai-link@0 { /* I2S - HDMI */
reg = <0>;
format = "i2s";
cpu {
sound-dai = <&audio0>;
};
codec {
sound-dai = <&tda998x0>;
};
};
simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
reg = <1>;
cpu {
sound-dai = <&audio1>;
};
codec {
sound-dai = <&tda998x1>;
};
};
simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
reg = <2>;
cpu {
sound-dai = <&audio2>;
};
codec {
sound-dai = <&spdif_codec>;
};
};
};
sound {
compatible = "simple-audio-card";
simple-audio-card,widgets =
"Headphone", "Headphone Jack";
simple-audio-card,routing =
"Headphone Jack", "HPLEFT",
"Headphone Jack", "HPRIGHT",
"LEFTIN", "HPL",
"RIGHTIN", "HPR";
simple-audio-card,aux-devs = <&>;
simple-audio-card,cpu {
sound-dai = <&ssi2>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
clocks = <&clocks>;
};
};
sound {
compatible = "simple-audio-card";
simple-audio-card,aux-devs = <&_in>, <&_out>;
simple-audio-card,routing =
"CODEC LEFTIN", "AMP_IN LEFT OUT",
"CODEC RIGHTIN", "AMP_IN RIGHT OUT",
"AMP_OUT LEFT IN", "CODEC LEFTOUT",
"AMP_OUT RIGHT IN", "CODEC RIGHTOUT";
simple-audio-card,additional-devs {
amp_out: iio-aux-out {
compatible = "audio-iio-aux";
io-channels = <&pot_out 0>, <&pot_out 1>;
io-channel-names = "LEFT", "RIGHT";
snd-control-invert-range = <1 1>;
sound-name-prefix = "AMP_OUT";
};
amp_in: iio_aux-in {
compatible = "audio-iio-aux";
io-channels = <&pot_in 0>, <&pot_in 1>;
io-channel-names = "LEFT", "RIGHT";
sound-name-prefix = "AMP_IN";
};
};
simple-audio-card,cpu {
sound-dai = <&cpu>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
clocks = <&clocks>;
};
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "rsnd-ak4643";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
simple-audio-card,convert-rate = <48000>;
simple-audio-card,prefix = "ak4642";
simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
"DAI0 Capture", "ak4642 Capture";
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&ak4643>;
system-clock-frequency = <11289600>;
};
};
sound {
compatible = "simple-audio-card";
#address-cells = <1>;
#size-cells = <0>;
simple-audio-card,name = "rsnd-ak4643";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&dpcmcpu>;
simple-audio-card,frame-master = <&dpcmcpu>;
simple-audio-card,convert-rate = <48000>;
simple-audio-card,convert-channels = <2>;
simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
"ak4642 Playback", "DAI1 Playback";
dpcmcpu: simple-audio-card,cpu@0 {
reg = <0>;
sound-dai = <&rcar_sound 0>;
};
simple-audio-card,cpu@1 {
reg = <1>;
sound-dai = <&rcar_sound 1>;
};
simple-audio-card,codec {
prefix = "ak4642";
sound-dai = <&ak4643>;
clocks = <&audio_clock>;
};
};
sound {
compatible = "simple-audio-card";
#address-cells = <1>;
#size-cells = <0>;
simple-audio-card,routing =
"pcm3168a Playback", "DAI1 Playback",
"pcm3168a Playback", "DAI2 Playback",
"pcm3168a Playback", "DAI3 Playback",
"pcm3168a Playback", "DAI4 Playback";
simple-audio-card,dai-link@0 {
reg = <0>;
format = "left_j";
bitclock-master = <&sndcpu0>;
frame-master = <&sndcpu0>;
sndcpu0: cpu {
sound-dai = <&rcar_sound 0>;
};
codec {
sound-dai = <&ak4613>;
};
};
simple-audio-card,dai-link@1 {
reg = <1>;
format = "i2s";
bitclock-master = <&sndcpu1>;
frame-master = <&sndcpu1>;
convert-channels = <8>; /* TDM Split */
sndcpu1: cpu-0 {
sound-dai = <&rcar_sound 1>;
};
cpu-1 {
sound-dai = <&rcar_sound 2>;
};
cpu-2 {
sound-dai = <&rcar_sound 3>;
};
cpu-3 {
sound-dai = <&rcar_sound 4>;
};
codec {
mclk-fs = <512>;
prefix = "pcm3168a";
dai-tdm-slot-num = <8>;
sound-dai = <&pcm3168a 0>;
};
};
simple-audio-card,dai-link@2 {
reg = <2>;
format = "i2s";
bitclock-master = <&sndcpu2>;
frame-master = <&sndcpu2>;
sndcpu2: cpu {
sound-dai = <&rcar_sound 5>;
};
codec {
mclk-fs = <512>;
prefix = "pcm3168a";
sound-dai = <&pcm3168a 1>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: GPL-2.0
Line 122: common properties
Line 184: common properties
Line 241: common properties
Line 288: --------------------
Line 289: single DAI link
Line 290: --------------------
Line 317: --------------------
Line 318: Multi DAI links
Line 319: --------------------
Line 360: --------------------
Line 361: route audio from IMX6 SSI2 through TLV320DAC3100 codec
Line 362: through TPA6130A2 amplifier to headphones:
Line 363: --------------------
Line 385: --------------------
Line 386: route audio to/from a codec through an amplifier
Line 387: designed with a potentiometer driven by IIO:
Line 388: --------------------
Line 427: --------------------
Line 428: Sampling Rate Conversion
Line 429: --------------------
Line 455: --------------------
Line 456: 2 CPU 1 Codec (Mixing)
Line 457: --------------------
Line 492: --------------------
Line 493: Multi DAI links with DPCM:
Line 494:
Line 495: CPU0 ------ ak4613
Line 496: CPU1 ------ PCM3168A-p /* DPCM 1ch/2ch */
Line 497: CPU2 --/ /* DPCM 3ch/4ch */
Line 498: CPU3 --/ /* DPCM 5ch/6ch */
Line 499: CPU4 --/ /* DPCM 7ch/8ch */
Line 500: CPU5 ------ PCM3168A-c
Line 501: --------------------