Commit 1bdb7836 authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-v6.3' of...

Merge tag 'asoc-v6.3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next

ASoC: Updates for v6.3

There's been quite a lot of activity this release, but not really
one big feature - lots of new devices, plus a lot of cleanup and
modernisation work spread throughout the subsystem:

 - More factoring out of common operations into helper functions
   by Morimoto-san.
 - DT schema conversons and stylistic nits.
 - Continued work on building out the new SOF IPC4 scheme.
 - Support for Awinc AT88395, Infineon PEB2466, Iron Device
   SMA1303, Mediatek MT8188, Realtek RT712, Renesas IDT821034,
   Samsung/Tesla FSD SoC I2S, and TI TAS5720A-Q1.
parents 5661706e 76f5aaab
...@@ -15,7 +15,9 @@ description: | ...@@ -15,7 +15,9 @@ description: |
properties: properties:
compatible: compatible:
const: mediatek,mt8186-dsp enum:
- mediatek,mt8186-dsp
- mediatek,mt8188-dsp
reg: reg:
items: items:
......
Analog Devices ADAU7002 Stereo PDM-to-I2S/TDM Converter
Required properties:
- compatible: Must be "adi,adau7002"
Optional properties:
- IOVDD-supply: Phandle and specifier for the power supply providing the IOVDD
supply as covered in Documentation/devicetree/bindings/regulator/regulator.txt
If this property is not present it is assumed that the supply pin is
hardwired to always on.
Example:
adau7002: pdm-to-i2s {
compatible = "adi,adau7002";
IOVDD-supply = <&supply>;
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/adi,adau7002.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADAU7002 Stereo PDM-to-I2S/TDM Converter
maintainers:
- Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
const: adi,adau7002
IOVDD-supply:
description:
IOVDD power supply, if skipped then it is assumed that the supply pin is
hardwired to always on.
wakeup-delay-ms:
description:
Delay after power up needed for device to settle.
required:
- compatible
unevaluatedProperties: false
examples:
- |
audio-codec {
compatible = "adi,adau7002";
IOVDD-supply = <&pp1800_l15a>;
#sound-dai-cells = <0>;
wakeup-delay-ms = <80>;
};
...@@ -25,6 +25,13 @@ properties: ...@@ -25,6 +25,13 @@ properties:
"#sound-dai-cells": "#sound-dai-cells":
const: 0 const: 0
ports:
$ref: audio-graph-port.yaml#/definitions/ports
port:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
patternProperties: patternProperties:
"^asahi-kasei,in[1-2]-single-end$": "^asahi-kasei,in[1-2]-single-end$":
description: Input Pin 1 - 2. description: Input Pin 1 - 2.
......
* Amlogic Audio FIFO controllers
Required properties:
- compatible: 'amlogic,axg-toddr' or
'amlogic,axg-toddr' or
'amlogic,g12a-frddr' or
'amlogic,g12a-toddr' or
'amlogic,sm1-frddr' or
'amlogic,sm1-toddr'
- reg: physical base address of the controller and length of memory
mapped region.
- interrupts: interrupt specifier for the fifo.
- clocks: phandle to the fifo peripheral clock provided by the audio
clock controller.
- resets: list of reset phandle, one for each entry reset-names.
- reset-names: should contain the following:
* "arb" : memory ARB line (required)
* "rst" : dedicated device reset line (optional)
- #sound-dai-cells: must be 0.
- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
is useful for determining certain configuration such
as the flush threshold of the fifo
Example of FRDDR A on the A113 SoC:
frddr_a: audio-controller@1c0 {
compatible = "amlogic,axg-frddr";
reg = <0x0 0x1c0 0x0 0x1c>;
#sound-dai-cells = <0>;
interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
resets = <&arb AXG_ARB_FRDDR_A>;
fifo-depth = <512>;
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-fifo.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic AXG Audio FIFO controllers
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
oneOf:
- enum:
- amlogic,axg-toddr
- amlogic,axg-frddr
- items:
- enum:
- amlogic,g12a-toddr
- amlogic,sm1-toddr
- const: amlogic,axg-toddr
- items:
- enum:
- amlogic,g12a-frddr
- amlogic,sm1-frddr
- const: amlogic,axg-frddr
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
clocks:
items:
- description: Peripheral clock
interrupts:
maxItems: 1
resets:
minItems: 1
maxItems: 2
reset-names:
minItems: 1
maxItems: 2
amlogic,fifo-depth:
$ref: /schemas/types.yaml#/definitions/uint32
description: Size of the controller's fifo in bytes
required:
- compatible
- reg
- "#sound-dai-cells"
- clocks
- interrupts
- resets
- amlogic,fifo-depth
allOf:
- $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- amlogic,g12a-toddr
- amlogic,sm1-toddr
- amlogic,g12a-frddr
- amlogic,sm1-frddr
then:
properties:
resets:
minItems: 2
reset-names:
items:
- const: arb
- const: rst
required:
- reset-names
else:
properties:
resets:
maxItems: 1
reset-names:
const: arb
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
audio-controller@1c0 {
compatible = "amlogic,g12a-frddr", "amlogic,axg-frddr";
reg = <0x1c0 0x1c>;
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
resets = <&arb>, <&clkc_audio AUD_RESET_FRDDR_A>;
reset-names = "arb", "rst";
amlogic,fifo-depth = <512>;
};
* Amlogic Audio PDM input
Required properties:
- compatible: 'amlogic,axg-pdm' or
'amlogic,g12a-pdm' or
'amlogic,sm1-pdm'
- reg: physical base address of the controller and length of memory
mapped region.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "pclk" : peripheral clock.
* "dclk" : pdm digital clock
* "sysclk" : dsp system clock
- #sound-dai-cells: must be 0.
Optional property:
- resets: phandle to the dedicated reset line of the pdm input.
Example of PDM on the A113 SoC:
pdm: audio-controller@ff632000 {
compatible = "amlogic,axg-pdm";
reg = <0x0 0xff632000 0x0 0x34>;
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_PDM>,
<&clkc_audio AUD_CLKID_PDM_DCLK>,
<&clkc_audio AUD_CLKID_PDM_SYSCLK>;
clock-names = "pclk", "dclk", "sysclk";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-pdm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Audio AXG PDM input
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
oneOf:
- items:
- enum:
- amlogic,g12a-pdm
- amlogic,sm1-pdm
- const: amlogic,axg-pdm
- const: amlogic,axg-pdm
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
clocks:
items:
- description: Peripheral clock
- description: PDM digital clock
- description: DSP system clock
clock-names:
items:
- const: pclk
- const: dclk
- const: sysclk
resets:
maxItems: 1
required:
- compatible
- reg
- "#sound-dai-cells"
- clocks
- clock-names
allOf:
- $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- amlogic,g12a-pdm
- amlogic,sm1-pdm
then:
required:
- resets
else:
properties:
resets: false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
audio-controller@ff632000 {
compatible = "amlogic,axg-pdm";
reg = <0xff632000 0x34>;
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_PDM>,
<&clkc_audio AUD_CLKID_PDM_DCLK>,
<&clkc_audio AUD_CLKID_PDM_SYSCLK>;
clock-names = "pclk", "dclk", "sysclk";
};
Amlogic AXG sound card:
Required properties:
- compatible: "amlogic,axg-sound-card"
- model : User specified audio sound card name, one string
Optional properties:
- audio-aux-devs : List of phandles pointing to auxiliary devices
- audio-widgets : Please refer to widgets.txt.
- audio-routing : A list of the connections between audio components.
Subnodes:
- dai-link: Container for dai-link level properties and the CODEC
sub-nodes. There should be at least one (and probably more)
subnode of this type.
Required dai-link properties:
- sound-dai: phandle and port of the CPU DAI.
Required TDM Backend dai-link properties:
- dai-format : CPU/CODEC common audio format
Optional TDM Backend dai-link properties:
- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks
- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks
When omitted, mask is assumed to have to no
slots. A valid must have at one slot, so at
least one these mask should be provided with
an enabled slot.
- dai-tdm-slot-num : Please refer to tdm-slot.txt.
If omitted, slot number is set to accommodate the largest
mask provided.
- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted.
- mclk-fs : Multiplication factor between stream rate and mclk
Backend dai-link subnodes:
- codec: dai-link representing backend links should have at least one subnode.
One subnode for each codec of the dai-link.
dai-link representing frontend links have no codec, therefore have no
subnodes
Required codec subnodes properties:
- sound-dai: phandle and port of the CODEC DAI.
Optional codec subnodes properties:
- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt.
- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt.
Example:
sound {
compatible = "amlogic,axg-sound-card";
model = "AXG-S420";
audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
audio-widgets = "Line", "Lineout",
"Line", "Linein",
"Speaker", "Speaker1 Left",
"Speaker", "Speaker1 Right";
"Speaker", "Speaker2 Left",
"Speaker", "Speaker2 Right";
audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
"SPDIFOUT IN 0", "FRDDR_A OUT 3",
"TDM_C Playback", "TDMOUT_C OUT",
"TDMIN_A IN 2", "TDM_C Capture",
"TDMIN_A IN 5", "TDM_C Loopback",
"TODDR_A IN 0", "TDMIN_A OUT",
"Lineout", "Lineout AOUTL",
"Lineout", "Lineout AOUTR",
"Speaker1 Left", "SPK1 OUT_A",
"Speaker2 Left", "SPK2 OUT_A",
"Speaker1 Right", "SPK1 OUT_B",
"Speaker2 Right", "SPK2 OUT_B",
"Linein AINL", "Linein",
"Linein AINR", "Linein";
dai-link@0 {
sound-dai = <&frddr_a>;
};
dai-link@1 {
sound-dai = <&toddr_a>;
};
dai-link@2 {
sound-dai = <&tdmif_c>;
dai-format = "i2s";
dai-tdm-slot-tx-mask-2 = <1 1>;
dai-tdm-slot-tx-mask-3 = <1 1>;
dai-tdm-slot-rx-mask-1 = <1 1>;
mclk-fs = <256>;
codec@0 {
sound-dai = <&lineout>;
};
codec@1 {
sound-dai = <&speaker_amp1>;
};
codec@2 {
sound-dai = <&speaker_amp2>;
};
codec@3 {
sound-dai = <&linein>;
};
};
dai-link@3 {
sound-dai = <&spdifout>;
codec {
sound-dai = <&spdif_dit>;
};
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-sound-card.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic AXG sound card
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
const: amlogic,axg-sound-card
audio-aux-devs:
$ref: /schemas/types.yaml#/definitions/phandle-array
description: list of auxiliary devices
audio-routing:
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
description:
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.
audio-widgets:
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
description:
A list off component DAPM widget. Each entry is a pair of strings,
the first being the widget type, the second being the widget name
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
patternProperties:
"^dai-link-[0-9]+$":
type: object
additionalProperties: false
description:
Container for dai-link level properties and the CODEC sub-nodes.
There should be at least one (and probably more) subnode of this type
properties:
dai-format:
$ref: /schemas/types.yaml#/definitions/string
enum: [ i2s, left-j, dsp_a ]
dai-tdm-slot-num:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Number of slots in use. If omitted, slot number is set to
accommodate the largest mask provided.
maximum: 32
dai-tdm-slot-width:
$ref: /schemas/types.yaml#/definitions/uint32
description: Width in bits for each slot
enum: [ 8, 16, 20, 24, 32 ]
default: 32
mclk-fs:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Multiplication factor between the frame rate and master clock
rate
sound-dai:
maxItems: 1
description: phandle of the CPU DAI
patternProperties:
"^dai-tdm-slot-(t|r)x-mask-[0-3]$":
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 32
description:
Transmit and receive cpu slot masks of each TDM lane
When omitted, mask is assumed to have to no slots. A valid
interface must have at least one slot, so at least one these
mask should be provided with an enabled slot.
"^codec(-[0-9]+)?$":
type: object
additionalProperties: false
description:
dai-link representing backend links should have at least one subnode.
One subnode for each codec of the dai-link. dai-link representing
frontend links have no codec, therefore have no subnodes
properties:
sound-dai:
maxItems: 1
description: phandle of the codec DAI
patternProperties:
"^dai-tdm-slot-(t|r)x-mask$":
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 1
maxItems: 32
description: Transmit and receive codec slot masks
required:
- sound-dai
required:
- sound-dai
required:
- model
- dai-link-0
unevaluatedProperties: false
examples:
- |
sound {
compatible = "amlogic,axg-sound-card";
model = "AXG-S420";
audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
audio-widgets = "Line", "Lineout",
"Line", "Linein",
"Speaker", "Speaker1 Left",
"Speaker", "Speaker1 Right",
"Speaker", "Speaker2 Left",
"Speaker", "Speaker2 Right";
audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
"SPDIFOUT IN 0", "FRDDR_A OUT 3",
"TDM_C Playback", "TDMOUT_C OUT",
"TDMIN_A IN 2", "TDM_C Capture",
"TDMIN_A IN 5", "TDM_C Loopback",
"TODDR_A IN 0", "TDMIN_A OUT",
"Lineout", "Lineout AOUTL",
"Lineout", "Lineout AOUTR",
"Speaker1 Left", "SPK1 OUT_A",
"Speaker2 Left", "SPK2 OUT_A",
"Speaker1 Right", "SPK1 OUT_B",
"Speaker2 Right", "SPK2 OUT_B",
"Linein AINL", "Linein",
"Linein AINR", "Linein";
dai-link-0 {
sound-dai = <&frddr_a>;
};
dai-link-1 {
sound-dai = <&toddr_a>;
};
dai-link-2 {
sound-dai = <&tdmif_c>;
dai-format = "i2s";
dai-tdm-slot-tx-mask-2 = <1 1>;
dai-tdm-slot-tx-mask-3 = <1 1>;
dai-tdm-slot-rx-mask-1 = <1 1>;
mclk-fs = <256>;
codec-0 {
sound-dai = <&lineout>;
};
codec-1 {
sound-dai = <&speaker_amp1>;
};
codec-2 {
sound-dai = <&speaker_amp2>;
};
codec-3 {
sound-dai = <&linein>;
};
};
dai-link-3 {
sound-dai = <&spdifout>;
codec {
sound-dai = <&spdif_dit>;
};
};
};
* Amlogic Audio SPDIF Input
Required properties:
- compatible: 'amlogic,axg-spdifin' or
'amlogic,g12a-spdifin' or
'amlogic,sm1-spdifin'
- interrupts: interrupt specifier for the spdif input.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "pclk" : peripheral clock.
* "refclk" : spdif input reference clock
- #sound-dai-cells: must be 0.
Optional property:
- resets: phandle to the dedicated reset line of the spdif input.
Example on the A113 SoC:
spdifin: audio-controller@400 {
compatible = "amlogic,axg-spdifin";
reg = <0x0 0x400 0x0 0x30>;
#sound-dai-cells = <0>;
interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
clock-names = "pclk", "refclk";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-spdifin.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Audio AXG SPDIF Input
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
oneOf:
- const: amlogic,axg-spdifin
- items:
- enum:
- amlogic,g12a-spdifin
- amlogic,sm1-spdifin
- const: amlogic,axg-spdifin
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
clocks:
items:
- description: Peripheral clock
- description: SPDIF input reference clock
clock-names:
items:
- const: pclk
- const: refclk
interrupts:
maxItems: 1
resets:
maxItems: 1
required:
- compatible
- reg
- "#sound-dai-cells"
- clocks
- clock-names
- interrupts
allOf:
- $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- amlogic,g12a-spdifin
- amlogic,sm1-spdifin
then:
required:
- resets
else:
properties:
resets: false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
audio-controller@400 {
compatible = "amlogic,axg-spdifin";
reg = <0x400 0x30>;
#sound-dai-cells = <0>;
interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
clock-names = "pclk", "refclk";
};
* Amlogic Audio SPDIF Output
Required properties:
- compatible: 'amlogic,axg-spdifout' or
'amlogic,g12a-spdifout' or
'amlogic,sm1-spdifout'
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "pclk" : peripheral clock.
* "mclk" : master clock
- #sound-dai-cells: must be 0.
Optional property:
- resets: phandle to the dedicated reset line of the spdif output.
Example on the A113 SoC:
spdifout: audio-controller@480 {
compatible = "amlogic,axg-spdifout";
reg = <0x0 0x480 0x0 0x50>;
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
clock-names = "pclk", "mclk";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-spdifout.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Audio AXG SPDIF Output
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
oneOf:
- const: amlogic,axg-spdifout
- items:
- enum:
- amlogic,g12a-spdifout
- amlogic,sm1-spdifout
- const: amlogic,axg-spdifout
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
clocks:
items:
- description: Peripheral clock
- description: SPDIF output master clock
clock-names:
items:
- const: pclk
- const: mclk
resets:
maxItems: 1
required:
- compatible
- reg
- "#sound-dai-cells"
- clocks
- clock-names
allOf:
- $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- amlogic,g12a-spdifout
- amlogic,sm1-spdifout
then:
required:
- resets
else:
properties:
resets: false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
audio-controller@480 {
compatible = "amlogic,axg-spdifout";
reg = <0x480 0x50>;
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
clock-names = "pclk", "mclk";
};
* Amlogic Audio TDM formatters
Required properties:
- compatible: 'amlogic,axg-tdmin' or
'amlogic,axg-tdmout' or
'amlogic,g12a-tdmin' or
'amlogic,g12a-tdmout' or
'amlogic,sm1-tdmin' or
'amlogic,sm1-tdmout
- reg: physical base address of the controller and length of memory
mapped region.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "pclk" : peripheral clock.
* "sclk" : bit clock.
* "sclk_sel" : bit clock input multiplexer.
* "lrclk" : sample clock
* "lrclk_sel": sample clock input multiplexer
Optional property:
- resets: phandle to the dedicated reset line of the tdm formatter.
Example of TDMOUT_A on the S905X2 SoC:
tdmout_a: audio-controller@500 {
compatible = "amlogic,axg-tdmout";
reg = <0x0 0x500 0x0 0x40>;
resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
<&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
<&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
<&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
<&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
clock-names = "pclk", "sclk", "sclk_sel",
"lrclk", "lrclk_sel";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Audio AXG TDM formatters
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
compatible:
enum:
- amlogic,g12a-tdmout
- amlogic,sm1-tdmout
- amlogic,axg-tdmout
- amlogic,g12a-tdmin
- amlogic,sm1-tdmin
- amlogic,axg-tdmin
clocks:
items:
- description: Peripheral clock
- description: Bit clock
- description: Bit clock input multiplexer
- description: Sample clock
- description: Sample clock input multiplexer
clock-names:
items:
- const: pclk
- const: sclk
- const: sclk_sel
- const: lrclk
- const: lrclk_sel
reg:
maxItems: 1
resets:
maxItems: 1
required:
- compatible
- reg
- clocks
- clock-names
allOf:
- $ref: component-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- amlogic,g12a-tdmin
- amlogic,sm1-tdmin
- amlogic,g12a-tdmout
- amlogic,sm1-tdmout
then:
required:
- resets
else:
properties:
resets: false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
#include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>
audio-controller@500 {
compatible = "amlogic,g12a-tdmout";
reg = <0x500 0x40>;
resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
<&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
<&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
<&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
<&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
clock-names = "pclk", "sclk", "sclk_sel",
"lrclk", "lrclk_sel";
};
* Amlogic Audio TDM Interfaces
Required properties:
- compatible: 'amlogic,axg-tdm-iface'
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "sclk" : bit clock.
* "lrclk": sample clock
* "mclk" : master clock
-> optional if the interface is in clock slave mode.
- #sound-dai-cells: must be 0.
Example of TDM_A on the A113 SoC:
tdmif_a: audio-controller@0 {
compatible = "amlogic,axg-tdm-iface";
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
<&clkc_audio AUD_CLKID_MST_A_SCLK>,
<&clkc_audio AUD_CLKID_MST_A_LRCLK>;
clock-names = "mclk", "sclk", "lrclk";
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Amlogic Audio TDM Interfaces
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
const: amlogic,axg-tdm-iface
"#sound-dai-cells":
const: 0
clocks:
minItems: 2
items:
- description: Bit clock
- description: Sample clock
- description: Master clock #optional
clock-names:
minItems: 2
items:
- const: sclk
- const: lrclk
- const: mclk
required:
- compatible
- "#sound-dai-cells"
- clocks
- clock-names
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/axg-audio-clkc.h>
audio-controller {
compatible = "amlogic,axg-tdm-iface";
#sound-dai-cells = <0>;
clocks = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
<&clkc_audio AUD_CLKID_MST_A_LRCLK>,
<&clkc_audio AUD_CLKID_MST_A_MCLK>;
clock-names = "sclk", "lrclk", "mclk";
};
...@@ -62,7 +62,7 @@ patternProperties: ...@@ -62,7 +62,7 @@ patternProperties:
description: phandle of the CPU DAI description: phandle of the CPU DAI
patternProperties: patternProperties:
"^codec-[0-9]+$": "^codec(-[0-9]+)?$":
type: object type: object
additionalProperties: false additionalProperties: false
description: |- description: |-
......
...@@ -11,32 +11,24 @@ maintainers: ...@@ -11,32 +11,24 @@ maintainers:
select: false select: false
allOf: definitions:
- $ref: /schemas/graph.yaml#/$defs/port-base port-base:
$ref: /schemas/graph.yaml#/$defs/port-base
properties: properties:
prefix: convert-rate:
description: "device name prefix" $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
$ref: /schemas/types.yaml#/definitions/string convert-channels:
convert-rate: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-sample-format:
convert-channels: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" mclk-fs:
convert-sample-format: $ref: "simple-card.yaml#/definitions/mclk-fs"
$ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"
patternProperties: endpoint-base:
"^endpoint(@[0-9a-f]+)?":
$ref: /schemas/graph.yaml#/$defs/endpoint-base $ref: /schemas/graph.yaml#/$defs/endpoint-base
unevaluatedProperties: false
properties: properties:
mclk-fs: mclk-fs:
description: | $ref: "simple-card.yaml#/definitions/mclk-fs"
Multiplication factor between stream rate and codec mclk.
When defined, mclk-fs property defined in dai-link sub nodes are
ignored.
$ref: /schemas/types.yaml#/definitions/uint32
frame-inversion: frame-inversion:
description: dai-link uses frame clock inversion description: dai-link uses frame clock inversion
$ref: /schemas/types.yaml#/definitions/flag $ref: /schemas/types.yaml#/definitions/flag
...@@ -53,6 +45,15 @@ patternProperties: ...@@ -53,6 +45,15 @@ patternProperties:
oneOf: oneOf:
- $ref: /schemas/types.yaml#/definitions/flag - $ref: /schemas/types.yaml#/definitions/flag
- $ref: /schemas/types.yaml#/definitions/phandle - $ref: /schemas/types.yaml#/definitions/phandle
clocks:
description: Indicates system clock
$ref: /schemas/types.yaml#/definitions/phandle
system-clock-frequency:
$ref: "simple-card.yaml#/definitions/system-clock-frequency"
system-clock-direction-out:
$ref: "simple-card.yaml#/definitions/system-clock-direction-out"
system-clock-fixed:
$ref: "simple-card.yaml#/definitions/system-clock-fixed"
dai-format: dai-format:
description: audio format. description: audio format.
...@@ -100,4 +101,24 @@ patternProperties: ...@@ -100,4 +101,24 @@ patternProperties:
minimum: 1 minimum: 1
maximum: 64 maximum: 64
ports:
$ref: "#/definitions/port-base"
unevaluatedProperties: false
patternProperties:
"^port(@[0-9a-f]+)?$":
$ref: "#/definitions/port-base"
unevaluatedProperties: false
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: "#/definitions/endpoint-base"
unevaluatedProperties: false
allOf:
- $ref: "#/definitions/port-base"
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: "#/definitions/endpoint-base"
unevaluatedProperties: false
additionalProperties: true additionalProperties: true
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/awinic,aw88395.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Awinic AW88395 Smart Audio Amplifier
maintainers:
- Weidong Wang <wangweidong.a@awinic.com>
description:
The Awinic AW88395 is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert.
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
const: awinic,aw88395
reg:
maxItems: 1
'#sound-dai-cells':
const: 0
reset-gpios:
maxItems: 1
required:
- compatible
- reg
- '#sound-dai-cells'
- reset-gpios
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@34 {
compatible = "awinic,aw88395";
reg = <0x34>;
#sound-dai-cells = <0>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
};
};
...@@ -22,6 +22,9 @@ properties: ...@@ -22,6 +22,9 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
'#sound-dai-cells': '#sound-dai-cells':
description: description:
The first cell indicating the audio interface. The first cell indicating the audio interface.
...@@ -42,7 +45,7 @@ properties: ...@@ -42,7 +45,7 @@ properties:
Configures the peak current by monitoring the current through the boost FET. Configures the peak current by monitoring the current through the boost FET.
Range starts at 1600 mA and goes to a maximum of 4500 mA with increments Range starts at 1600 mA and goes to a maximum of 4500 mA with increments
of 50 mA. See section 4.3.6 of the datasheet for details. of 50 mA. See section 4.3.6 of the datasheet for details.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 1600 minimum: 1600
maximum: 4500 maximum: 4500
default: 4500 default: 4500
...@@ -51,7 +54,7 @@ properties: ...@@ -51,7 +54,7 @@ properties:
description: description:
Boost inductor value, expressed in nH. Valid Boost inductor value, expressed in nH. Valid
values include 1000, 1200, 1500 and 2200. values include 1000, 1200, 1500 and 2200.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 1000 minimum: 1000
maximum: 2200 maximum: 2200
...@@ -60,7 +63,7 @@ properties: ...@@ -60,7 +63,7 @@ properties:
Total equivalent boost capacitance on the VBST Total equivalent boost capacitance on the VBST
and VAMP pins, derated at 11 volts DC. The value must be rounded to the and VAMP pins, derated at 11 volts DC. The value must be rounded to the
nearest integer and expressed in uF. nearest integer and expressed in uF.
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
cirrus,asp-sdout-hiz: cirrus,asp-sdout-hiz:
description: description:
...@@ -70,7 +73,7 @@ properties: ...@@ -70,7 +73,7 @@ properties:
1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled 1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled
2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled 2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled
3 = Hi-Z during unused slots and while all transmit channels disabled 3 = Hi-Z during unused slots and while all transmit channels disabled
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3 maximum: 3
default: 2 default: 2
...@@ -84,7 +87,7 @@ properties: ...@@ -84,7 +87,7 @@ properties:
enable boost voltage. enable boost voltage.
0 = Internal Boost 0 = Internal Boost
1 = External Boost 1 = External Boost
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 1 maximum: 1
...@@ -109,7 +112,7 @@ properties: ...@@ -109,7 +112,7 @@ properties:
1 = GPIO 1 = GPIO
2 = Sync 2 = Sync
3 = MCLK input 3 = MCLK input
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 3 maximum: 3
...@@ -136,7 +139,7 @@ properties: ...@@ -136,7 +139,7 @@ properties:
3 = MCLK input 3 = MCLK input
4 = Push-pull INTB (active low) 4 = Push-pull INTB (active low)
5 = Push-pull INT (active high) 5 = Push-pull INT (active high)
$ref: "/schemas/types.yaml#/definitions/uint32" $ref: /schemas/types.yaml#/definitions/uint32
minimum: 0 minimum: 0
maximum: 5 maximum: 5
...@@ -176,21 +179,23 @@ unevaluatedProperties: false ...@@ -176,21 +179,23 @@ unevaluatedProperties: false
examples: examples:
- | - |
#include <dt-bindings/gpio/gpio.h>
spi { spi {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
cs35l41: cs35l41@2 { cs35l41: speaker-amp@2 {
#sound-dai-cells = <1>; #sound-dai-cells = <1>;
compatible = "cirrus,cs35l41"; compatible = "cirrus,cs35l41";
reg = <2>; reg = <2>;
VA-supply = <&dummy_vreg>; VA-supply = <&dummy_vreg>;
VP-supply = <&dummy_vreg>; VP-supply = <&dummy_vreg>;
reset-gpios = <&gpio 110 0>; reset-gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
cirrus,boost-type = <0>; cirrus,boost-type = <0>;
cirrus,boost-peak-milliamp = <4500>; cirrus,boost-peak-milliamp = <4500>;
cirrus,boost-ind-nanohenry = <1000>; cirrus,boost-ind-nanohenry = <1000>;
cirrus,boost-cap-microfarad = <15>; cirrus,boost-cap-microfarad = <15>;
}; };
}; };
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/component-common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Audio Component Common Properties
maintainers:
- Jerome Brunet <jbrunet@baylibre.com>
properties:
sound-name-prefix:
$ref: /schemas/types.yaml#/definitions/string
description: |
Card implementing the routing property define the connection between
audio components as list of string pair. Component using the same
sink/source names may use this property to prepend the name of their
sinks/sources with the provided string.
additionalProperties: true
...@@ -9,15 +9,10 @@ title: Digital Audio Interface Common Properties ...@@ -9,15 +9,10 @@ title: Digital Audio Interface Common Properties
maintainers: maintainers:
- Jerome Brunet <jbrunet@baylibre.com> - Jerome Brunet <jbrunet@baylibre.com>
properties: allOf:
sound-name-prefix: - $ref: component-common.yaml#
$ref: /schemas/types.yaml#/definitions/string
description: |
Card implementing the routing property define the connection between
audio components as list of string pair. Component using the same
sink/source names may use this property to prepend the name of their
sinks/sources with the provided string.
properties:
'#sound-dai-cells': true '#sound-dai-cells': true
additionalProperties: true additionalProperties: true
...@@ -76,10 +76,14 @@ properties: ...@@ -76,10 +76,14 @@ properties:
minItems: 4 minItems: 4
dmas: dmas:
maxItems: 2 items:
- description: DMA controller phandle and request line for RX
- description: DMA controller phandle and request line for TX
dma-names: dma-names:
maxItems: 2 items:
- const: rx
- const: tx
interrupts: interrupts:
items: items:
...@@ -142,31 +146,6 @@ properties: ...@@ -142,31 +146,6 @@ properties:
allOf: allOf:
- $ref: dai-common.yaml# - $ref: dai-common.yaml#
- if:
properties:
compatible:
contains:
const: fsl,vf610-sai
then:
properties:
dmas:
items:
- description: DMA controller phandle and request line for TX
- description: DMA controller phandle and request line for RX
dma-names:
items:
- const: tx
- const: rx
else:
properties:
dmas:
items:
- description: DMA controller phandle and request line for RX
- description: DMA controller phandle and request line for TX
dma-names:
items:
- const: rx
- const: tx
- if: - if:
required: required:
- fsl,sai-asynchronous - fsl,sai-asynchronous
...@@ -199,9 +178,8 @@ examples: ...@@ -199,9 +178,8 @@ examples:
<&clks VF610_CLK_SAI2>, <&clks VF610_CLK_SAI2>,
<&clks 0>, <&clks 0>; <&clks 0>, <&clks 0>;
clock-names = "bus", "mclk1", "mclk2", "mclk3"; clock-names = "bus", "mclk1", "mclk2", "mclk3";
dma-names = "tx", "rx"; dma-names = "rx", "tx";
dmas = <&edma0 0 21>, dmas = <&edma0 0 20>, <&edma0 0 21>;
<&edma0 0 20>;
big-endian; big-endian;
lsb-first; lsb-first;
}; };
......
...@@ -21,6 +21,7 @@ properties: ...@@ -21,6 +21,7 @@ properties:
compatible: compatible:
enum: enum:
- fsl,imx8mp-xcvr - fsl,imx8mp-xcvr
- fsl,imx93-xcvr
reg: reg:
items: items:
......
...@@ -75,6 +75,18 @@ patternProperties: ...@@ -75,6 +75,18 @@ patternProperties:
additionalProperties: false additionalProperties: false
platform:
description: Holds subnode which includes the phandle of q6apm platform device.
type: object
properties:
sound-dai:
maxItems: 1
required:
- sound-dai
additionalProperties: false
required: required:
- link-name - link-name
- cpu - cpu
......
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/infineon,peb2466.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Infineon PEB2466 codec
maintainers:
- Herve Codina <herve.codina@bootlin.com>
description: |
The Infineon PEB2466 codec is a programmable DSP-based four channels codec
with filters capabilities.
The time-slots used by the codec must be set and so, the properties
'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and
'dai-tdm-slot-rx-mask' must be present in the sound card node for sub-nodes
that involve the codec. The codec uses one 8bit time-slot per channel.
'dai-tdm-tdm-slot-with' must be set to 8.
The PEB2466 codec also supports 28 gpios (signaling pins).
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml
- $ref: dai-common.yaml#
properties:
compatible:
const: infineon,peb2466
reg:
description:
SPI device address.
maxItems: 1
clocks:
items:
- description: Master clock
clock-names:
items:
- const: mclk
spi-max-frequency:
maximum: 8192000
reset-gpios:
description:
GPIO used to reset the device.
maxItems: 1
firmware-name:
$ref: /schemas/types.yaml#/definitions/string
description:
Filters coefficients file to load. If this property is omitted, internal
filters are disabled.
'#sound-dai-cells':
const: 0
'#gpio-cells':
const: 2
gpio-controller: true
required:
- compatible
- reg
- '#sound-dai-cells'
- gpio-controller
- '#gpio-cells'
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@0 {
compatible = "infineon,peb2466";
reg = <0>;
spi-max-frequency = <8192000>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
#sound-dai-cells = <0>;
gpio-controller;
#gpio-cells = <2>;
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/irondevice,sma1303.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Iron Device SMA1303 Audio Amplifier
maintainers:
- Kiseok Jo <kiseok.jo@irondevice.com>
description:
SMA1303 digital class-D audio amplifier
with an integrated boost converter.
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
enum:
- irondevice,sma1303
reg:
maxItems: 1
'#sound-dai-cells':
const: 1
required:
- compatible
- reg
- '#sound-dai-cells'
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
amplifier@1e {
compatible = "irondevice,sma1303";
reg = <0x1e>;
#sound-dai-cells = <1>;
};
};
MAX98090 audio CODEC
This device supports I2C only.
Required properties:
- compatible : "maxim,max98090" or "maxim,max98091".
- reg : The I2C address of the device.
- interrupts : The CODEC's interrupt output.
Optional properties:
- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"
- #sound-dai-cells : should be 0.
- maxim,dmic-freq: Frequency at which to clock DMIC
- maxim,micbias: Micbias voltage applies to the analog mic, valid voltages value are:
0 - 2.2v
1 - 2.55v
2 - 2.4v
3 - 2.8v
Pins on the device (for linking into audio routes):
* MIC1
* MIC2
* DMICL
* DMICR
* IN1
* IN2
* IN3
* IN4
* IN5
* IN6
* IN12
* IN34
* IN56
* HPL
* HPR
* SPKL
* SPKR
* RCVL
* RCVR
* MICBIAS
Example:
audio-codec@10 {
compatible = "maxim,max98090";
reg = <0x10>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(H, 4) IRQ_TYPE_LEVEL_HIGH>;
};
MAX98095 audio CODEC
This device supports I2C only.
Required properties:
- compatible : "maxim,max98095".
- reg : The I2C address of the device.
Optional properties:
- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"
Example:
max98095: codec@11 {
compatible = "maxim,max98095";
reg = <0x11>;
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/maxim,max98090.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim Integrated MAX98090/MAX98091 audio codecs
maintainers:
- Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
description: |
Pins on the device (for linking into audio routes):
MIC1, MIC2, DMICL, DMICR, IN1, IN2, IN3, IN4, IN5, IN6, IN12, IN34, IN56,
HPL, HPR, SPKL, SPKR, RCVL, RCVR, MICBIAS
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
enum:
- maxim,max98090
- maxim,max98091
reg:
maxItems: 1
clocks:
items:
- description: master clock
clock-names:
items:
- const: mclk
interrupts:
maxItems: 1
maxim,dmic-freq:
$ref: /schemas/types.yaml#/definitions/uint32
default: 2500000
description:
DMIC clock frequency
maxim,micbias:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 0, 1, 2, 3 ]
default: 3
description: |
Micbias voltage applied to the analog mic, valid voltages value are:
0 - 2.2v
1 - 2.55v
2 - 2.4v
3 - 2.8v
'#sound-dai-cells':
const: 0
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@10 {
compatible = "maxim,max98090";
reg = <0x10>;
interrupt-parent = <&gpx3>;
interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
clocks = <&i2s0 0>;
clock-names = "mclk";
#sound-dai-cells = <0>;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/maxim,max98095.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim Integrated MAX98095 audio codec
maintainers:
- Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
allOf:
- $ref: dai-common.yaml#
properties:
compatible:
enum:
- maxim,max98095
reg:
maxItems: 1
clocks:
items:
- description: master clock
clock-names:
items:
- const: mclk
'#sound-dai-cells':
const: 1
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@11 {
compatible = "maxim,max98095";
reg = <0x11>;
clocks = <&i2s0 0>;
clock-names = "mclk";
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/mediatek,mt8188-afe.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek AFE PCM controller for mt8188
maintainers:
- Trevor Wu <trevor.wu@mediatek.com>
properties:
compatible:
const: mediatek,mt8188-afe
reg:
maxItems: 1
interrupts:
maxItems: 1
resets:
maxItems: 1
reset-names:
const: audiosys
mediatek,topckgen:
$ref: /schemas/types.yaml#/definitions/phandle
description: The phandle of the mediatek topckgen controller
power-domains:
maxItems: 1
clocks:
items:
- description: 26M clock
- description: audio pll1 clock
- description: audio pll2 clock
- description: clock divider for i2si1_mck
- description: clock divider for i2si2_mck
- description: clock divider for i2so1_mck
- description: clock divider for i2so2_mck
- description: clock divider for dptx_mck
- description: a1sys hoping clock
- description: audio intbus clock
- description: audio hires clock
- description: audio local bus clock
- description: mux for dptx_mck
- description: mux for i2so1_mck
- description: mux for i2so2_mck
- description: mux for i2si1_mck
- description: mux for i2si2_mck
- description: audio 26m clock
clock-names:
items:
- const: clk26m
- const: apll1
- const: apll2
- const: apll12_div0
- const: apll12_div1
- const: apll12_div2
- const: apll12_div3
- const: apll12_div9
- const: a1sys_hp_sel
- const: aud_intbus_sel
- const: audio_h_sel
- const: audio_local_bus_sel
- const: dptx_m_sel
- const: i2so1_m_sel
- const: i2so2_m_sel
- const: i2si1_m_sel
- const: i2si2_m_sel
- const: adsp_audio_26m
mediatek,etdm-in1-cowork-source:
$ref: /schemas/types.yaml#/definitions/uint32
description:
etdm modules can share the same external clock pin. Specify
which etdm clock source is required by this etdm in module.
enum:
- 1 # etdm2_in
- 2 # etdm1_out
- 3 # etdm2_out
mediatek,etdm-in2-cowork-source:
$ref: /schemas/types.yaml#/definitions/uint32
description:
etdm modules can share the same external clock pin. Specify
which etdm clock source is required by this etdm in module.
enum:
- 0 # etdm1_in
- 2 # etdm1_out
- 3 # etdm2_out
mediatek,etdm-out1-cowork-source:
$ref: /schemas/types.yaml#/definitions/uint32
description:
etdm modules can share the same external clock pin. Specify
which etdm clock source is required by this etdm out module.
enum:
- 0 # etdm1_in
- 1 # etdm2_in
- 3 # etdm2_out
mediatek,etdm-out2-cowork-source:
$ref: /schemas/types.yaml#/definitions/uint32
description:
etdm modules can share the same external clock pin. Specify
which etdm clock source is required by this etdm out module.
enum:
- 0 # etdm1_in
- 1 # etdm2_in
- 2 # etdm1_out
patternProperties:
"^mediatek,etdm-in[1-2]-chn-disabled$":
$ref: /schemas/types.yaml#/definitions/uint8-array
minItems: 1
maxItems: 16
description:
This is a list of channel IDs which should be disabled.
By default, all data received from ETDM pins will be outputed to
memory. etdm in supports disable_out in direct mode(w/o interconn),
so user can disable the specified channels by the property.
uniqueItems: true
items:
minimum: 0
maximum: 15
"^mediatek,etdm-in[1-2]-multi-pin-mode$":
type: boolean
description: if present, the etdm data mode is I2S.
"^mediatek,etdm-out[1-3]-multi-pin-mode$":
type: boolean
description: if present, the etdm data mode is I2S.
required:
- compatible
- reg
- interrupts
- resets
- reset-names
- mediatek,topckgen
- power-domains
- clocks
- clock-names
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
afe@10b10000 {
compatible = "mediatek,mt8188-afe";
reg = <0x10b10000 0x10000>;
interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
resets = <&watchdog 14>;
reset-names = "audiosys";
mediatek,topckgen = <&topckgen>;
power-domains = <&spm 13>; //MT8188_POWER_DOMAIN_AUDIO
mediatek,etdm-in2-cowork-source = <2>;
mediatek,etdm-out2-cowork-source = <0>;
mediatek,etdm-in1-multi-pin-mode;
mediatek,etdm-in1-chn-disabled = /bits/ 8 <0x0 0x2>;
clocks = <&clk26m>,
<&apmixedsys 9>, //CLK_APMIXED_APLL1
<&apmixedsys 10>, //CLK_APMIXED_APLL2
<&topckgen 186>, //CLK_TOP_APLL12_CK_DIV0
<&topckgen 187>, //CLK_TOP_APLL12_CK_DIV1
<&topckgen 188>, //CLK_TOP_APLL12_CK_DIV2
<&topckgen 189>, //CLK_TOP_APLL12_CK_DIV3
<&topckgen 191>, //CLK_TOP_APLL12_CK_DIV9
<&topckgen 83>, //CLK_TOP_A1SYS_HP
<&topckgen 31>, //CLK_TOP_AUD_INTBUS
<&topckgen 32>, //CLK_TOP_AUDIO_H
<&topckgen 69>, //CLK_TOP_AUDIO_LOCAL_BUS
<&topckgen 81>, //CLK_TOP_DPTX
<&topckgen 77>, //CLK_TOP_I2SO1
<&topckgen 78>, //CLK_TOP_I2SO2
<&topckgen 79>, //CLK_TOP_I2SI1
<&topckgen 80>, //CLK_TOP_I2SI2
<&adsp_audio26m 0>; //CLK_AUDIODSP_AUDIO26M
clock-names = "clk26m",
"apll1",
"apll2",
"apll12_div0",
"apll12_div1",
"apll12_div2",
"apll12_div3",
"apll12_div9",
"a1sys_hp_sel",
"aud_intbus_sel",
"audio_h_sel",
"audio_local_bus_sel",
"dptx_m_sel",
"i2so1_m_sel",
"i2so2_m_sel",
"i2si1_m_sel",
"i2si2_m_sel",
"adsp_audio_26m";
};
...
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/mediatek,mt8188-mt6359.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: MediaTek MT8188 ASoC sound card
maintainers:
- Trevor Wu <trevor.wu@mediatek.com>
properties:
compatible:
const: mediatek,mt8188-mt6359-evb
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
audio-routing:
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
description:
A list of the connections between audio components. Each entry is a
sink/source pair of strings. Valid names could be the input or output
widgets of audio components, power supplies, MicBias of codec and the
software switch.
mediatek,platform:
$ref: /schemas/types.yaml#/definitions/phandle
description: The phandle of MT8188 ASoC platform.
patternProperties:
"^dai-link-[0-9]+$":
type: object
description:
Container for dai-link level properties and CODEC sub-nodes.
properties:
link-name:
description:
This property corresponds to the name of the BE dai-link to which
we are going to update parameters in this node.
items:
enum:
- ADDA_BE
- DPTX_BE
- ETDM1_IN_BE
- ETDM2_IN_BE
- ETDM1_OUT_BE
- ETDM2_OUT_BE
- ETDM3_OUT_BE
- PCM1_BE
codec:
description: Holds subnode which indicates codec dai.
type: object
additionalProperties: false
properties:
sound-dai:
minItems: 1
maxItems: 2
required:
- sound-dai
additionalProperties: false
required:
- link-name
- codec
additionalProperties: false
required:
- compatible
- mediatek,platform
examples:
- |
sound {
compatible = "mediatek,mt8188-mt6359-evb";
mediatek,platform = <&afe>;
pinctrl-names = "default";
pinctrl-0 = <&aud_pins_default>;
audio-routing =
"Headphone", "Headphone L",
"Headphone", "Headphone R",
"AIN1", "Headset Mic";
dai-link-0 {
link-name = "ETDM3_OUT_BE";
codec {
sound-dai = <&hdmi0>;
};
};
};
...
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/sound/mchp,i2s-mcc.yaml# $id: http://devicetree.org/schemas/sound/microchip,sama7g5-i2smcc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip I2S Multi-Channel Controller title: Microchip I2S Multi-Channel Controller
......
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/sound/microchip,pdmc.yaml# $id: http://devicetree.org/schemas/sound/microchip,sama7g5-pdmc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip Pulse Density Microphone Controller title: Microchip Pulse Density Microphone Controller
......
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/sound/mchp,spdifrx.yaml# $id: http://devicetree.org/schemas/sound/microchip,sama7g5-spdifrx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip S/PDIF Rx Controller title: Microchip S/PDIF Rx Controller
......
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/sound/mchp,spdiftx.yaml# $id: http://devicetree.org/schemas/sound/microchip,sama7g5-spdiftx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip S/PDIF Tx Controller title: Microchip S/PDIF Tx Controller
......
NAU8822 audio CODEC
This device supports I2C only.
Required properties:
- compatible : "nuvoton,nau8822"
- reg : the I2C address of the device.
Example:
codec: nau8822@1a {
compatible = "nuvoton,nau8822";
reg = <0x1a>;
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/nuvoton,nau8822.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NAU8822 audio CODEC
description: |
24 bit stereo audio codec with speaker driver.
This device supports I2C/SPI.
maintainers:
- David Lin <CTLIN0@nuvoton.com>
properties:
compatible:
enum:
- nuvoton,nau8822
reg:
maxItems: 1
nuvoton,spk-btl:
description:
If set, configure the two loudspeaker outputs as a Bridge Tied Load output
to drive a high power external loudspeaker.
$ref: /schemas/types.yaml#/definitions/flag
required:
- compatible
- reg
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
codec@1a {
compatible = "nuvoton,nau8822";
reg = <0x1a>;
};
};
...@@ -35,7 +35,7 @@ properties: ...@@ -35,7 +35,7 @@ properties:
clocks: clocks:
minItems: 3 minItems: 3
maxItems: 7 maxItems: 10
clock-names: clock-names:
minItems: 1 minItems: 1
...@@ -65,6 +65,9 @@ properties: ...@@ -65,6 +65,9 @@ properties:
power-domain-names: power-domain-names:
maxItems: 1 maxItems: 1
required-opps:
maxItems: 1
'#sound-dai-cells': '#sound-dai-cells':
const: 1 const: 1
...@@ -75,7 +78,7 @@ properties: ...@@ -75,7 +78,7 @@ properties:
const: 0 const: 0
patternProperties: patternProperties:
"^dai-link@[0-9a-f]$": "^dai-link@[0-9a-f]+$":
type: object type: object
description: | description: |
LPASS CPU dai node for each I2S device or Soundwire device. Bindings of each node LPASS CPU dai node for each I2S device or Soundwire device. Bindings of each node
...@@ -121,6 +124,8 @@ allOf: ...@@ -121,6 +124,8 @@ allOf:
then: then:
properties: properties:
clocks:
maxItems: 3
clock-names: clock-names:
items: items:
- const: ahbix-clk - const: ahbix-clk
...@@ -135,6 +140,9 @@ allOf: ...@@ -135,6 +140,9 @@ allOf:
then: then:
properties: properties:
clocks:
minItems: 7
maxItems: 7
clock-names: clock-names:
items: items:
- const: ahbix-clk - const: ahbix-clk
...@@ -153,33 +161,31 @@ allOf: ...@@ -153,33 +161,31 @@ allOf:
then: then:
properties: properties:
clocks:
minItems: 6
maxItems: 6
clock-names: clock-names:
oneOf: items:
- items: #for I2S - const: pcnoc-sway-clk
- const: pcnoc-sway-clk - const: audio-core
- const: audio-core - const: mclk0
- const: mclk0 - const: pcnoc-mport-clk
- const: pcnoc-mport-clk - const: mi2s-bit-clk0
- const: mi2s-bit-clk0 - const: mi2s-bit-clk1
- const: mi2s-bit-clk1 reg:
- items: #for HDMI minItems: 2
- const: pcnoc-sway-clk maxItems: 2
- const: audio-core
- const: pcnoc-mport-clk
reg-names: reg-names:
anyOf: items:
- items: #for I2S - const: lpass-hdmiif
- const: lpass-lpaif - const: lpass-lpaif
- items: #for I2S and HDMI interrupts:
- const: lpass-hdmiif minItems: 2
- const: lpass-lpaif maxItems: 2
interrupt-names: interrupt-names:
anyOf: items:
- items: #for I2S - const: lpass-irq-lpaif
- const: lpass-irq-lpaif - const: lpass-irq-hdmi
- items: #for I2S and HDMI
- const: lpass-irq-lpaif
- const: lpass-irq-hdmi
required: required:
- iommus - iommus
- power-domains - power-domains
...@@ -192,54 +198,44 @@ allOf: ...@@ -192,54 +198,44 @@ allOf:
then: then:
properties: properties:
clocks:
minItems: 10
maxItems: 10
clock-names: clock-names:
oneOf: items:
- items: #for I2S - const: aon_cc_audio_hm_h
- const: aon_cc_audio_hm_h - const: audio_cc_ext_mclk0
- const: audio_cc_ext_mclk0 - const: core_cc_sysnoc_mport_core
- const: core_cc_sysnoc_mport_core - const: core_cc_ext_if0_ibit
- const: core_cc_ext_if0_ibit - const: core_cc_ext_if1_ibit
- const: core_cc_ext_if1_ibit - const: audio_cc_codec_mem
- items: #for Soundwire - const: audio_cc_codec_mem0
- const: aon_cc_audio_hm_h - const: audio_cc_codec_mem1
- const: audio_cc_codec_mem - const: audio_cc_codec_mem2
- const: audio_cc_codec_mem0 - const: aon_cc_va_mem0
- const: audio_cc_codec_mem1 reg:
- const: audio_cc_codec_mem2 minItems: 6
- const: aon_cc_va_mem0 maxItems: 6
- items: #for HDMI
- const: core_cc_sysnoc_mport_core
reg-names: reg-names:
anyOf: items:
- items: #for I2S - const: lpass-hdmiif
- const: lpass-lpaif - const: lpass-lpaif
- items: #for I2S and HDMI - const: lpass-rxtx-cdc-dma-lpm
- const: lpass-hdmiif - const: lpass-rxtx-lpaif
- const: lpass-lpaif - const: lpass-va-lpaif
- items: #for I2S, soundwire and HDMI - const: lpass-va-cdc-dma-lpm
- const: lpass-hdmiif interrupts:
- const: lpass-lpaif minItems: 4
- const: lpass-rxtx-cdc-dma-lpm maxItems: 4
- const: lpass-rxtx-lpaif
- const: lpass-va-lpaif
- const: lpass-va-cdc-dma-lpm
interrupt-names: interrupt-names:
anyOf: items:
- items: #for I2S - const: lpass-irq-lpaif
- const: lpass-irq-lpaif - const: lpass-irq-hdmi
- items: #for I2S and HDMI - const: lpass-irq-vaif
- const: lpass-irq-lpaif - const: lpass-irq-rxtxif
- const: lpass-irq-hdmi
- items: #for I2S, soundwire and HDMI
- const: lpass-irq-lpaif
- const: lpass-irq-hdmi
- const: lpass-irq-vaif
- const: lpass-irq-rxtxif
power-domain-names: power-domain-names:
allOf: items:
- items: - const: lcx
- const: lcx
required: required:
- iommus - iommus
......
...@@ -36,7 +36,7 @@ properties: ...@@ -36,7 +36,7 @@ properties:
oneOf: oneOf:
- items: #for ADSP based platforms - items: #for ADSP based platforms
- const: mclk - const: mclk
- const: core - const: macro
- const: dcodec - const: dcodec
- items: #for ADSP bypass based platforms - items: #for ADSP bypass based platforms
- const: mclk - const: mclk
...@@ -77,7 +77,7 @@ examples: ...@@ -77,7 +77,7 @@ examples:
clocks = <&aoncc 0>, clocks = <&aoncc 0>,
<&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>, <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
<&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>; <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
clock-names = "mclk", "core", "dcodec"; clock-names = "mclk", "macro", "dcodec";
clock-output-names = "fsgen"; clock-output-names = "fsgen";
qcom,dmic-sample-rate = <600000>; qcom,dmic-sample-rate = <600000>;
vdd-micb-supply = <&vreg_s4a_1p8>; vdd-micb-supply = <&vreg_s4a_1p8>;
......
...@@ -17,7 +17,8 @@ properties: ...@@ -17,7 +17,8 @@ properties:
const: qcom,q6apm-dais const: qcom,q6apm-dais
iommus: iommus:
maxItems: 1 minItems: 1
maxItems: 2
required: required:
- compatible - compatible
......
...@@ -15,16 +15,20 @@ description: ...@@ -15,16 +15,20 @@ description:
properties: properties:
compatible: compatible:
enum: oneOf:
- lenovo,yoga-c630-sndcard - items:
- qcom,apq8016-sbc-sndcard - enum:
- qcom,db845c-sndcard - lenovo,yoga-c630-sndcard
- qcom,msm8916-qdsp6-sndcard - qcom,db845c-sndcard
- qcom,qrb5165-rb5-sndcard - const: qcom,sdm845-sndcard
- qcom,sc8280xp-sndcard - enum:
- qcom,sdm845-sndcard - qcom,apq8016-sbc-sndcard
- qcom,sm8250-sndcard - qcom,msm8916-qdsp6-sndcard
- qcom,sm8450-sndcard - qcom,qrb5165-rb5-sndcard
- qcom,sc8280xp-sndcard
- qcom,sdm845-sndcard
- qcom,sm8250-sndcard
- qcom,sm8450-sndcard
audio-routing: audio-routing:
$ref: /schemas/types.yaml#/definitions/non-unique-string-array $ref: /schemas/types.yaml#/definitions/non-unique-string-array
......
...@@ -28,7 +28,9 @@ properties: ...@@ -28,7 +28,9 @@ properties:
description: GPIO spec for reset line to use description: GPIO spec for reset line to use
maxItems: 1 maxItems: 1
slim-ifc-dev: true slim-ifc-dev:
description: IFC device interface
$ref: /schemas/types.yaml#/definitions/phandle
clocks: clocks:
maxItems: 1 maxItems: 1
...@@ -147,21 +149,49 @@ patternProperties: ...@@ -147,21 +149,49 @@ patternProperties:
required: required:
- compatible - compatible
- reg - reg
- reset-gpios
- slim-ifc-dev allOf:
- interrupts - if:
- interrupt-controller required:
- clock-frequency - slim-ifc-dev
- clock-output-names then:
- qcom,micbias1-microvolt required:
- qcom,micbias2-microvolt - reset-gpios
- qcom,micbias3-microvolt - slim-ifc-dev
- qcom,micbias4-microvolt - interrupt-controller
- "#interrupt-cells" - clock-frequency
- "#clock-cells" - clock-output-names
- "#sound-dai-cells" - qcom,micbias1-microvolt
- "#address-cells" - qcom,micbias2-microvolt
- "#size-cells" - qcom,micbias3-microvolt
- qcom,micbias4-microvolt
- "#interrupt-cells"
- "#clock-cells"
- "#sound-dai-cells"
- "#address-cells"
- "#size-cells"
oneOf:
- required:
- interrupts-extended
- required:
- interrupts
else:
properties:
reset-gpios: false
slim-ifc-dev: false
interrupts: false
interrupt-controller: false
clock-frequency: false
clock-output-names: false
qcom,micbias1-microvolt: false
qcom,micbias2-microvolt: false
qcom,micbias3-microvolt: false
qcom,micbias4-microvolt: false
"#interrupt-cells": false
"#clock-cells": false
"#sound-dai-cells": false
"#address-cells": false
"#size-cells": false
additionalProperties: false additionalProperties: false
......
...@@ -15,6 +15,9 @@ description: | ...@@ -15,6 +15,9 @@ description: |
Their primary operating mode uses a SoundWire digital audio Their primary operating mode uses a SoundWire digital audio
interface. This binding is for SoundWire interface. interface. This binding is for SoundWire interface.
allOf:
- $ref: dai-common.yaml#
properties: properties:
compatible: compatible:
const: sdw10217201000 const: sdw10217201000
...@@ -39,7 +42,7 @@ required: ...@@ -39,7 +42,7 @@ required:
- "#thermal-sensor-cells" - "#thermal-sensor-cells"
- "#sound-dai-cells" - "#sound-dai-cells"
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/renesas,idt821034.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas IDT821034 codec device
maintainers:
- Herve Codina <herve.codina@bootlin.com>
description: |
The IDT821034 codec is a four channel PCM codec with onchip filters and
programmable gain setting.
The time-slots used by the codec must be set and so, the properties
'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and
'dai-tdm-slot-rx-mask' must be present in the ALSA sound card node for
sub-nodes that involve the codec. The codec uses one 8bit time-slot per
channel.
'dai-tdm-tdm-slot-with' must be set to 8.
The IDT821034 codec also supports 5 gpios (SLIC signals) per channel.
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- $ref: dai-common.yaml#
properties:
compatible:
const: renesas,idt821034
reg:
description:
SPI device address.
maxItems: 1
spi-max-frequency:
maximum: 8192000
spi-cpha: true
'#sound-dai-cells':
const: 0
'#gpio-cells':
const: 2
gpio-controller: true
required:
- compatible
- reg
- spi-cpha
- '#sound-dai-cells'
- gpio-controller
- '#gpio-cells'
unevaluatedProperties: false
examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@0 {
compatible = "renesas,idt821034";
reg = <0>;
spi-max-frequency = <8192000>;
spi-cpha;
#sound-dai-cells = <0>;
gpio-controller;
#gpio-cells = <2>;
};
};
...@@ -18,8 +18,7 @@ properties: ...@@ -18,8 +18,7 @@ properties:
- enum: - enum:
- renesas,rcar_sound-r8a7778 # R-Car M1A - renesas,rcar_sound-r8a7778 # R-Car M1A
- renesas,rcar_sound-r8a7779 # R-Car H1 - renesas,rcar_sound-r8a7779 # R-Car H1
- enum: - const: renesas,rcar_sound-gen1
- renesas,rcar_sound-gen1
# for Gen2 SoC # for Gen2 SoC
- items: - items:
- enum: - enum:
...@@ -32,8 +31,7 @@ properties: ...@@ -32,8 +31,7 @@ properties:
- renesas,rcar_sound-r8a7791 # R-Car M2-W - renesas,rcar_sound-r8a7791 # R-Car M2-W
- renesas,rcar_sound-r8a7793 # R-Car M2-N - renesas,rcar_sound-r8a7793 # R-Car M2-N
- renesas,rcar_sound-r8a7794 # R-Car E2 - renesas,rcar_sound-r8a7794 # R-Car E2
- enum: - const: renesas,rcar_sound-gen2
- renesas,rcar_sound-gen2
# for Gen3 SoC # for Gen3 SoC
- items: - items:
- enum: - enum:
...@@ -47,14 +45,16 @@ properties: ...@@ -47,14 +45,16 @@ properties:
- renesas,rcar_sound-r8a77965 # R-Car M3-N - renesas,rcar_sound-r8a77965 # R-Car M3-N
- renesas,rcar_sound-r8a77990 # R-Car E3 - renesas,rcar_sound-r8a77990 # R-Car E3
- renesas,rcar_sound-r8a77995 # R-Car D3 - renesas,rcar_sound-r8a77995 # R-Car D3
- enum: - const: renesas,rcar_sound-gen3
- renesas,rcar_sound-gen3 # for Gen4 SoC
# for Generic
- items: - items:
- enum: - const: renesas,rcar_sound-r8a779g0 # R-Car V4H
- renesas,rcar_sound-gen1 - const: renesas,rcar_sound-gen4
- renesas,rcar_sound-gen2 # for Generic
- renesas,rcar_sound-gen3 - enum:
- renesas,rcar_sound-gen1
- renesas,rcar_sound-gen2
- renesas,rcar_sound-gen3
reg: reg:
minItems: 1 minItems: 1
...@@ -68,6 +68,7 @@ properties: ...@@ -68,6 +68,7 @@ properties:
description: | description: |
it must be 0 if your system is using single DAI it must be 0 if your system is using single DAI
it must be 1 if your system is using multi DAIs it must be 1 if your system is using multi DAIs
This is used on simple-audio-card
enum: [0, 1] enum: [0, 1]
"#clock-cells": "#clock-cells":
...@@ -113,15 +114,34 @@ properties: ...@@ -113,15 +114,34 @@ properties:
- pattern: '^clk_(a|b|c|i)$' - pattern: '^clk_(a|b|c|i)$'
ports: ports:
$ref: /schemas/graph.yaml#/properties/ports $ref: audio-graph-port.yaml#/definitions/port-base
unevaluatedProperties: false
patternProperties: patternProperties:
'^port(@[0-9a-f]+)?$': '^port(@[0-9a-f]+)?$':
$ref: audio-graph-port.yaml# $ref: audio-graph-port.yaml#/definitions/port-base
unevaluatedProperties: false unevaluatedProperties: false
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: audio-graph-port.yaml#/definitions/endpoint-base
properties:
playback:
$ref: /schemas/types.yaml#/definitions/phandle-array
capture:
$ref: /schemas/types.yaml#/definitions/phandle-array
unevaluatedProperties: false
port: port:
$ref: audio-graph-port.yaml# $ref: audio-graph-port.yaml#/definitions/port-base
unevaluatedProperties: false unevaluatedProperties: false
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: audio-graph-port.yaml#/definitions/endpoint-base
properties:
playback:
$ref: /schemas/types.yaml#/definitions/phandle-array
capture:
$ref: /schemas/types.yaml#/definitions/phandle-array
unevaluatedProperties: false
rcar_sound,dvc: rcar_sound,dvc:
description: DVC subnode. description: DVC subnode.
...@@ -178,10 +198,6 @@ properties: ...@@ -178,10 +198,6 @@ properties:
enum: enum:
- tx - tx
- rx - rx
required:
- interrupts
- dmas
- dma-names
additionalProperties: false additionalProperties: false
rcar_sound,ssiu: rcar_sound,ssiu:
...@@ -240,8 +256,6 @@ properties: ...@@ -240,8 +256,6 @@ properties:
$ref: /schemas/types.yaml#/definitions/flag $ref: /schemas/types.yaml#/definitions/flag
required: required:
- interrupts - interrupts
- dmas
- dma-names
additionalProperties: false additionalProperties: false
# For DAI base # For DAI base
...@@ -271,7 +285,6 @@ required: ...@@ -271,7 +285,6 @@ required:
- reg-names - reg-names
- clocks - clocks
- clock-names - clock-names
- "#sound-dai-cells"
allOf: allOf:
- $ref: dai-common.yaml# - $ref: dai-common.yaml#
...@@ -285,7 +298,6 @@ allOf: ...@@ -285,7 +298,6 @@ allOf:
reg: reg:
maxItems: 3 maxItems: 3
reg-names: reg-names:
maxItems: 3
items: items:
enum: enum:
- scu - scu
...@@ -294,9 +306,8 @@ allOf: ...@@ -294,9 +306,8 @@ allOf:
else: else:
properties: properties:
reg: reg:
maxItems: 5 minItems: 5
reg-names: reg-names:
maxItems: 5
items: items:
enum: enum:
- scu - scu
......
...@@ -20,6 +20,9 @@ Optional properties: ...@@ -20,6 +20,9 @@ Optional properties:
- realtek,in3-differential - realtek,in3-differential
Boolean. Indicate MIC1/2/3 input are differential, rather than single-ended. Boolean. Indicate MIC1/2/3 input are differential, rather than single-ended.
- realtek,lout-differential
Boolean. Indicate LOUT output is differential, rather than stereo.
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin. - realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.
- realtek,dmic1-data-pin - realtek,dmic1-data-pin
......
...@@ -43,9 +43,10 @@ properties: ...@@ -43,9 +43,10 @@ properties:
type: object type: object
properties: properties:
sound-dai: sound-dai:
minItems: 1
items: items:
- description: phandle of the MAX98090 CODEC
- description: phandle of the HDMI IP block node - description: phandle of the HDMI IP block node
- description: phandle of the MAX98090 CODEC
samsung,audio-routing: samsung,audio-routing:
$ref: /schemas/types.yaml#/definitions/non-unique-string-array $ref: /schemas/types.yaml#/definitions/non-unique-string-array
......
...@@ -37,12 +37,20 @@ properties: ...@@ -37,12 +37,20 @@ properties:
samsung,exynos7-i2s1: I2S1 on previous samsung platforms supports samsung,exynos7-i2s1: I2S1 on previous samsung platforms supports
stereo channels. Exynos7 I2S1 upgraded to 5.1 multichannel with stereo channels. Exynos7 I2S1 upgraded to 5.1 multichannel with
slightly modified bit offsets. slightly modified bit offsets.
tesla,fsd-i2s: for 8/16/24bit stereo channel I2S for playback and
capture, secondary FIFO using external DMA, s/w reset control,
internal mux for root clock source with all root clock sampling
frequencies supported by Exynos7 I2S and 7.1 channel TDM support
for playback and capture TDM (Time division multiplexing) to allow
transfer of multiple channel audio data on single data line.
enum: enum:
- samsung,s3c6410-i2s - samsung,s3c6410-i2s
- samsung,s5pv210-i2s - samsung,s5pv210-i2s
- samsung,exynos5420-i2s - samsung,exynos5420-i2s
- samsung,exynos7-i2s - samsung,exynos7-i2s
- samsung,exynos7-i2s1 - samsung,exynos7-i2s1
- tesla,fsd-i2s
'#address-cells': '#address-cells':
const: 1 const: 1
...@@ -67,9 +75,6 @@ properties: ...@@ -67,9 +75,6 @@ properties:
- const: rx - const: rx
- const: tx-sec - const: tx-sec
assigned-clock-parents: true
assigned-clocks: true
clocks: clocks:
minItems: 1 minItems: 1
maxItems: 3 maxItems: 3
......
...@@ -205,6 +205,8 @@ patternProperties: ...@@ -205,6 +205,8 @@ patternProperties:
$ref: "#/definitions/dai" $ref: "#/definitions/dai"
"^simple-audio-card,codec(@[0-9a-f]+)?$": "^simple-audio-card,codec(@[0-9a-f]+)?$":
$ref: "#/definitions/dai" $ref: "#/definitions/dai"
"^simple-audio-card,plat(@[0-9a-f]+)?$":
$ref: "#/definitions/dai"
"^simple-audio-card,dai-link(@[0-9a-f]+)?$": "^simple-audio-card,dai-link(@[0-9a-f]+)?$":
description: | description: |
...@@ -215,6 +217,10 @@ patternProperties: ...@@ -215,6 +217,10 @@ patternProperties:
reg: reg:
maxItems: 1 maxItems: 1
"#address-cells":
const: 1
"#size-cells":
const: 0
# common properties # common properties
frame-master: frame-master:
$ref: "#/definitions/frame-master" $ref: "#/definitions/frame-master"
...@@ -244,9 +250,9 @@ patternProperties: ...@@ -244,9 +250,9 @@ patternProperties:
maxItems: 1 maxItems: 1
patternProperties: patternProperties:
"^cpu(@[0-9a-f]+)?": "^cpu(-[0-9]+)?$":
$ref: "#/definitions/dai" $ref: "#/definitions/dai"
"^codec(@[0-9a-f]+)?": "^codec(-[0-9]+)?$":
$ref: "#/definitions/dai" $ref: "#/definitions/dai"
additionalProperties: false additionalProperties: false
...@@ -462,16 +468,16 @@ examples: ...@@ -462,16 +468,16 @@ examples:
convert-channels = <8>; /* TDM Split */ convert-channels = <8>; /* TDM Split */
sndcpu1: cpu0 { sndcpu1: cpu-0 {
sound-dai = <&rcar_sound 1>; sound-dai = <&rcar_sound 1>;
}; };
cpu1 { cpu-1 {
sound-dai = <&rcar_sound 2>; sound-dai = <&rcar_sound 2>;
}; };
cpu2 { cpu-2 {
sound-dai = <&rcar_sound 3>; sound-dai = <&rcar_sound 3>;
}; };
cpu3 { cpu-3 {
sound-dai = <&rcar_sound 4>; sound-dai = <&rcar_sound 4>;
}; };
codec { codec {
......
...@@ -6,11 +6,13 @@ audio playback. For more product information please see the links below: ...@@ -6,11 +6,13 @@ audio playback. For more product information please see the links below:
https://www.ti.com/product/TAS5720L https://www.ti.com/product/TAS5720L
https://www.ti.com/product/TAS5720M https://www.ti.com/product/TAS5720M
https://www.ti.com/product/TAS5720A-Q1
https://www.ti.com/product/TAS5722L https://www.ti.com/product/TAS5722L
Required properties: Required properties:
- compatible : "ti,tas5720", - compatible : "ti,tas5720",
"ti,tas5720a-q1",
"ti,tas5722" "ti,tas5722"
- reg : I2C slave address - reg : I2C slave address
- dvdd-supply : phandle to a 3.3-V supply for the digital circuitry - dvdd-supply : phandle to a 3.3-V supply for the digital circuitry
......
Texas Instruments pcm3168a DT bindings
This driver supports both SPI and I2C bus access for this codec
Required properties:
- compatible: "ti,pcm3168a"
- clocks : Contains an entry for each entry in clock-names
- clock-names : Includes the following entries:
"scki" The system clock
- VDD1-supply : Digital power supply regulator 1 (+3.3V)
- VDD2-supply : Digital power supply regulator 2 (+3.3V)
- VCCAD1-supply : ADC power supply regulator 1 (+5V)
- VCCAD2-supply : ADC power supply regulator 2 (+5V)
- VCCDA1-supply : DAC power supply regulator 1 (+5V)
- VCCDA2-supply : DAC power supply regulator 2 (+5V)
For required properties on SPI/I2C, consult SPI/I2C device tree documentation
Optional properties:
- reset-gpios : Optional reset gpio line connected to RST pin of the codec.
The RST line is low active:
RST = low: device power-down
RST = high: device is enabled
Examples:
i2c0: i2c0@0 {
...
pcm3168a: audio-codec@44 {
compatible = "ti,pcm3168a";
reg = <0x44>;
reset-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
clocks = <&clk_core CLK_AUDIO>;
clock-names = "scki";
VDD1-supply = <&supply3v3>;
VDD2-supply = <&supply3v3>;
VCCAD1-supply = <&supply5v0>;
VCCAD2-supply = <&supply5v0>;
VCCDA1-supply = <&supply5v0>;
VCCDA2-supply = <&supply5v0>;
pinctrl-names = "default";
pinctrl-0 = <&dac_clk_pin>;
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/ti,pcm3168a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments PCM3168A Audio Codec
maintainers:
- Damien Horsley <Damien.Horsley@imgtec.com>
- Geert Uytterhoeven <geert+renesas@glider.be>
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
description:
The Texas Instruments PCM3168A is a 24-bit Multi-channel Audio CODEC with
96/192kHz sampling rate, supporting both SPI and I2C bus access.
properties:
compatible:
const: ti,pcm3168a
reg:
maxItems: 1
clocks:
items:
- description: System clock input
clock-names:
items:
- const: scki
reset-gpios:
items:
- description: |
GPIO line connected to the active-low RST pin of the codec.
RST = low: device power-down
RST = high: device is enabled
"#sound-dai-cells":
enum: [0, 1]
VDD1-supply:
description: Digital power supply regulator 1 (+3.3V)
VDD2-supply:
description: Digital power supply regulator 2 (+3.3V)
VCCAD1-supply:
description: ADC power supply regulator 1 (+5V)
VCCAD2-supply:
description: ADC power supply regulator 2 (+5V)
VCCDA1-supply:
description: DAC power supply regulator 1 (+5V)
VCCDA2-supply:
description: DAC power supply regulator 2 (+5V)
ports:
$ref: audio-graph-port.yaml#/definitions/port-base
properties:
port@0:
$ref: audio-graph-port.yaml#
description: Audio input port.
port@1:
$ref: audio-graph-port.yaml#
description: Audio output port.
required:
- compatible
- reg
- clocks
- clock-names
- VDD1-supply
- VDD2-supply
- VCCAD1-supply
- VCCAD2-supply
- VCCDA1-supply
- VCCDA2-supply
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
pcm3168a: audio-codec@44 {
compatible = "ti,pcm3168a";
reg = <0x44>;
reset-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
clocks = <&clk_core 42>;
clock-names = "scki";
VDD1-supply = <&supply3v3>;
VDD2-supply = <&supply3v3>;
VCCAD1-supply = <&supply5v0>;
VCCAD2-supply = <&supply5v0>;
VCCDA1-supply = <&supply5v0>;
VCCDA2-supply = <&supply5v0>;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
# Copyright (C) 2022 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/ti,tlv320aic3x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Texas Instruments TLV320AIC3x Codec
description: |
TLV320AIC3x are a series of low-power stereo audio codecs with stereo
headphone amplifier, as well as multiple inputs and outputs programmable in
single-ended or fully differential configurations.
The serial control bus supports SPI or I2C protocols, while the serial audio
data bus is programmable for I2S, left/right-justified, DSP, or TDM modes.
The following pins can be referred in the sound node's audio routing property:
CODEC output pins:
LLOUT
RLOUT
MONO_LOUT
HPLOUT
HPROUT
HPLCOM
HPRCOM
CODEC input pins for TLV320AIC3104:
MIC2L
MIC2R
LINE1L
LINE1R
CODEC input pins for other compatible codecs:
MIC3L
MIC3R
LINE1L
LINE2L
LINE1R
LINE2R
maintainers:
- Jai Luthra <j-luthra@ti.com>
properties:
compatible:
enum:
- ti,tlv320aic3x
- ti,tlv320aic33
- ti,tlv320aic3007
- ti,tlv320aic3106
- ti,tlv320aic3104
reg:
maxItems: 1
reset-gpios:
maxItems: 1
description:
GPIO specification for the active low RESET input.
gpio-reset:
maxItems: 1
description:
Deprecated, please use reset-gpios instead.
deprecated: true
ai3x-gpio-func:
description: AIC3X_GPIO1 & AIC3X_GPIO2 Functionality
$ref: /schemas/types.yaml#/definitions/uint32-array
maxItems: 2
ai3x-micbias-vg:
description: MicBias required voltage. If node is omitted then MicBias is powered down.
$ref: /schemas/types.yaml#/definitions/uint32
oneOf:
- const: 1
description: MICBIAS output is powered to 2.0V.
- const: 2
description: MICBIAS output is powered to 2.5V.
- const: 3
description: MICBIAS output is connected to AVDD.
ai3x-ocmv:
description: Output Common-Mode Voltage selection.
$ref: /schemas/types.yaml#/definitions/uint32
oneOf:
- const: 0
description: 1.35V
- const: 1
description: 1.5V
- const: 2
description: 1.65V
- const: 3
description: 1.8V
AVDD-supply:
description: Analog DAC voltage.
IOVDD-supply:
description: I/O voltage.
DRVDD-supply:
description: ADC analog and output driver voltage.
DVDD-supply:
description: Digital core voltage.
'#sound-dai-cells':
const: 0
clocks:
maxItems: 1
port:
$ref: audio-graph-port.yaml#
unevaluatedProperties: false
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
tlv320aic3x_i2c: audio-codec@1b {
compatible = "ti,tlv320aic3x";
reg = <0x1b>;
reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
AVDD-supply = <&regulator>;
IOVDD-supply = <&regulator>;
DRVDD-supply = <&regulator>;
DVDD-supply = <&regulator>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
tlv320aic3x_spi: audio-codec@0 {
compatible = "ti,tlv320aic3x";
reg = <0>; /* CS number */
#sound-dai-cells = <0>;
AVDD-supply = <&regulator>;
IOVDD-supply = <&regulator>;
DRVDD-supply = <&regulator>;
DVDD-supply = <&regulator>;
ai3x-ocmv = <0>;
};
};
...
Texas Instruments - tlv320aic3x Codec module
The tlv320aic3x serial control bus communicates through both I2C and SPI bus protocols
Required properties:
- compatible - "string" - One of:
"ti,tlv320aic3x" - Generic TLV320AIC3x device
"ti,tlv320aic33" - TLV320AIC33
"ti,tlv320aic3007" - TLV320AIC3007
"ti,tlv320aic3106" - TLV320AIC3106
"ti,tlv320aic3104" - TLV320AIC3104
- reg - <int> - I2C slave address
Optional properties:
- reset-gpios - GPIO specification for the active low RESET input.
- ai3x-gpio-func - <array of 2 int> - AIC3X_GPIO1 & AIC3X_GPIO2 Functionality
- Not supported on tlv320aic3104
- ai3x-micbias-vg - MicBias Voltage required.
1 - MICBIAS output is powered to 2.0V,
2 - MICBIAS output is powered to 2.5V,
3 - MICBIAS output is connected to AVDD,
If this node is not mentioned or if the value is incorrect, then MicBias
is powered down.
- ai3x-ocmv - Output Common-Mode Voltage selection:
0 - 1.35V,
1 - 1.5V,
2 - 1.65V,
3 - 1.8V
- AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the
device as covered in Documentation/devicetree/bindings/regulator/regulator.txt
Deprecated properties:
- gpio-reset - gpio pin number used for codec reset
CODEC output pins:
* LLOUT
* RLOUT
* MONO_LOUT
* HPLOUT
* HPROUT
* HPLCOM
* HPRCOM
CODEC input pins for TLV320AIC3104:
* MIC2L
* MIC2R
* LINE1L
* LINE1R
CODEC input pins for other compatible codecs:
* MIC3L
* MIC3R
* LINE1L
* LINE2L
* LINE1R
* LINE2R
The pins can be used in referring sound node's audio-routing property.
I2C example:
#include <dt-bindings/gpio/gpio.h>
tlv320aic3x: tlv320aic3x@1b {
compatible = "ti,tlv320aic3x";
reg = <0x1b>;
reset-gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
AVDD-supply = <&regulator>;
IOVDD-supply = <&regulator>;
DRVDD-supply = <&regulator>;
DVDD-supply = <&regulator>;
};
SPI example:
spi0: spi@f0000000 {
tlv320aic3x: codec@0 {
compatible = "ti,tlv320aic3x";
reg = <0>; /* CS number */
#sound-dai-cells = <0>;
spi-max-frequency = <1000000>;
AVDD-supply = <&regulator>;
IOVDD-supply = <&regulator>;
DRVDD-supply = <&regulator>;
DVDD-supply = <&regulator>;
ai3x-ocmv = <0>;
};
};
...@@ -635,6 +635,8 @@ patternProperties: ...@@ -635,6 +635,8 @@ patternProperties:
description: Inverse Path description: Inverse Path
"^iom,.*": "^iom,.*":
description: Iomega Corporation description: Iomega Corporation
"^irondevice,.*":
description: Iron Device Corporation
"^isee,.*": "^isee,.*":
description: ISEE 2007 S.L. description: ISEE 2007 S.L.
"^isil,.*": "^isil,.*":
......
...@@ -10166,6 +10166,13 @@ L: linux-iio@vger.kernel.org ...@@ -10166,6 +10166,13 @@ L: linux-iio@vger.kernel.org
S: Maintained S: Maintained
F: drivers/iio/pressure/dps310.c F: drivers/iio/pressure/dps310.c
INFINEON PEB2466 ASoC CODEC
M: Herve Codina <herve.codina@bootlin.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/sound/infineon,peb2466.yaml
F: sound/soc/codecs/peb2466.c
INFINIBAND SUBSYSTEM INFINIBAND SUBSYSTEM
M: Jason Gunthorpe <jgg@nvidia.com> M: Jason Gunthorpe <jgg@nvidia.com>
M: Leon Romanovsky <leonro@nvidia.com> M: Leon Romanovsky <leonro@nvidia.com>
...@@ -10927,6 +10934,13 @@ M: David Sterba <dsterba@suse.com> ...@@ -10927,6 +10934,13 @@ M: David Sterba <dsterba@suse.com>
S: Odd Fixes S: Odd Fixes
F: drivers/tty/ipwireless/ F: drivers/tty/ipwireless/
IRON DEVICE AUDIO CODEC DRIVERS
M: Kiseok Jo <kiseok.jo@irondevice.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/sound/irondevice,*
F: sound/soc/codecs/sma*
IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY) IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
M: Marc Zyngier <maz@kernel.org> M: Marc Zyngier <maz@kernel.org>
S: Maintained S: Maintained
...@@ -17803,6 +17817,13 @@ F: Documentation/devicetree/bindings/net/renesas,*.yaml ...@@ -17803,6 +17817,13 @@ F: Documentation/devicetree/bindings/net/renesas,*.yaml
F: drivers/net/ethernet/renesas/ F: drivers/net/ethernet/renesas/
F: include/linux/sh_eth.h F: include/linux/sh_eth.h
RENESAS IDT821034 ASoC CODEC
M: Herve Codina <herve.codina@bootlin.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/sound/renesas,idt821034.yaml
F: sound/soc/codecs/idt821034.c
RENESAS R-CAR GYROADC DRIVER RENESAS R-CAR GYROADC DRIVER
M: Marek Vasut <marek.vasut@gmail.com> M: Marek Vasut <marek.vasut@gmail.com>
L: linux-iio@vger.kernel.org L: linux-iio@vger.kernel.org
......
...@@ -469,7 +469,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, ...@@ -469,7 +469,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
} }
/* Inform slave about the impending port prepare */ /* Inform slave about the impending port prepare */
sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_PRE_PREP); sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_PRE_PREP : SDW_OPS_PORT_PRE_DEPREP);
/* Prepare Slave port implementing CP_SM */ /* Prepare Slave port implementing CP_SM */
if (!dpn_prop->simple_ch_prep_sm) { if (!dpn_prop->simple_ch_prep_sm) {
...@@ -501,7 +501,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus, ...@@ -501,7 +501,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
} }
/* Inform slaves about ports prepared */ /* Inform slaves about ports prepared */
sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_POST_PREP); sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_POST_PREP : SDW_OPS_PORT_POST_DEPREP);
/* Disable interrupt after Port de-prepare */ /* Disable interrupt after Port de-prepare */
if (!prep && intr) if (!prep && intr)
......
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) ST-Ericsson SA 2010
*
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
*/
#ifndef __MSP_H
#define __MSP_H
#include <linux/platform_data/dma-ste-dma40.h>
/* Platform data structure for a MSP I2S-device */
struct msp_i2s_platform_data {
int id;
struct stedma40_chan_cfg *msp_i2s_dma_rx;
struct stedma40_chan_cfg *msp_i2s_dma_tx;
};
#endif
...@@ -566,13 +566,15 @@ struct sdw_prepare_ch { ...@@ -566,13 +566,15 @@ struct sdw_prepare_ch {
* enum sdw_port_prep_ops: Prepare operations for Data Port * enum sdw_port_prep_ops: Prepare operations for Data Port
* *
* @SDW_OPS_PORT_PRE_PREP: Pre prepare operation for the Port * @SDW_OPS_PORT_PRE_PREP: Pre prepare operation for the Port
* @SDW_OPS_PORT_PREP: Prepare operation for the Port * @SDW_OPS_PORT_PRE_DEPREP: Pre deprepare operation for the Port
* @SDW_OPS_PORT_POST_PREP: Post prepare operation for the Port * @SDW_OPS_PORT_POST_PREP: Post prepare operation for the Port
* @SDW_OPS_PORT_POST_DEPREP: Post deprepare operation for the Port
*/ */
enum sdw_port_prep_ops { enum sdw_port_prep_ops {
SDW_OPS_PORT_PRE_PREP = 0, SDW_OPS_PORT_PRE_PREP = 0,
SDW_OPS_PORT_PREP = 1, SDW_OPS_PORT_PRE_DEPREP,
SDW_OPS_PORT_POST_PREP = 2, SDW_OPS_PORT_POST_PREP,
SDW_OPS_PORT_POST_DEPREP,
}; };
/** /**
......
This diff is collapsed.
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define CS42L42_PAGE_24 0x2400 #define CS42L42_PAGE_24 0x2400
#define CS42L42_PAGE_25 0x2500 #define CS42L42_PAGE_25 0x2500
#define CS42L42_PAGE_26 0x2600 #define CS42L42_PAGE_26 0x2600
#define CS42L42_PAGE_27 0x2700
#define CS42L42_PAGE_28 0x2800 #define CS42L42_PAGE_28 0x2800
#define CS42L42_PAGE_29 0x2900 #define CS42L42_PAGE_29 0x2900
#define CS42L42_PAGE_2A 0x2A00 #define CS42L42_PAGE_2A 0x2A00
...@@ -720,6 +721,10 @@ ...@@ -720,6 +721,10 @@
#define CS42L42_SRC_SDOUT_FS (CS42L42_PAGE_26 + 0x09) #define CS42L42_SRC_SDOUT_FS (CS42L42_PAGE_26 + 0x09)
/* Page 0x27 DMA */
#define CS42L42_SOFT_RESET_REBOOT (CS42L42_PAGE_27 + 0x01)
#define CS42L42_SFT_RST_REBOOT_MASK BIT(1)
/* Page 0x28 S/PDIF Registers */ /* Page 0x28 S/PDIF Registers */
#define CS42L42_SPDIF_CTL1 (CS42L42_PAGE_28 + 0x01) #define CS42L42_SPDIF_CTL1 (CS42L42_PAGE_28 + 0x01)
#define CS42L42_SPDIF_CTL2 (CS42L42_PAGE_28 + 0x02) #define CS42L42_SPDIF_CTL2 (CS42L42_PAGE_28 + 0x02)
......
...@@ -69,6 +69,7 @@ struct asoc_simple_priv { ...@@ -69,6 +69,7 @@ struct asoc_simple_priv {
} *dai_props; } *dai_props;
struct asoc_simple_jack hp_jack; struct asoc_simple_jack hp_jack;
struct asoc_simple_jack mic_jack; struct asoc_simple_jack mic_jack;
struct snd_soc_jack *aux_jacks;
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
struct asoc_simple_dai *dais; struct asoc_simple_dai *dais;
struct snd_soc_dai_link_component *dlcs; struct snd_soc_dai_link_component *dlcs;
...@@ -187,6 +188,8 @@ int asoc_simple_parse_pin_switches(struct snd_soc_card *card, ...@@ -187,6 +188,8 @@ int asoc_simple_parse_pin_switches(struct snd_soc_card *card,
int asoc_simple_init_jack(struct snd_soc_card *card, int asoc_simple_init_jack(struct snd_soc_card *card,
struct asoc_simple_jack *sjack, struct asoc_simple_jack *sjack,
int is_hp, char *prefix, char *pin); int is_hp, char *prefix, char *pin);
int asoc_simple_init_aux_jacks(struct asoc_simple_priv *priv,
char *prefix);
int asoc_simple_init_priv(struct asoc_simple_priv *priv, int asoc_simple_init_priv(struct asoc_simple_priv *priv,
struct link_info *li); struct link_info *li);
int asoc_simple_remove(struct platform_device *pdev); int asoc_simple_remove(struct platform_device *pdev);
......
...@@ -98,6 +98,7 @@ struct snd_soc_component_driver { ...@@ -98,6 +98,7 @@ struct snd_soc_component_driver {
int source, unsigned int freq_in, unsigned int freq_out); int source, unsigned int freq_in, unsigned int freq_out);
int (*set_jack)(struct snd_soc_component *component, int (*set_jack)(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data); struct snd_soc_jack *jack, void *data);
int (*get_jack_type)(struct snd_soc_component *component);
/* DT */ /* DT */
int (*of_xlate_dai_name)(struct snd_soc_component *component, int (*of_xlate_dai_name)(struct snd_soc_component *component,
...@@ -384,6 +385,7 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id, ...@@ -384,6 +385,7 @@ int snd_soc_component_set_pll(struct snd_soc_component *component, int pll_id,
unsigned int freq_out); unsigned int freq_out);
int snd_soc_component_set_jack(struct snd_soc_component *component, int snd_soc_component_set_jack(struct snd_soc_component *component,
struct snd_soc_jack *jack, void *data); struct snd_soc_jack *jack, void *data);
int snd_soc_component_get_jack_type(struct snd_soc_component *component);
void snd_soc_component_seq_notifier(struct snd_soc_component *component, void snd_soc_component_seq_notifier(struct snd_soc_component *component,
enum snd_soc_dapm_type type, int subseq); enum snd_soc_dapm_type type, int subseq);
......
...@@ -423,6 +423,16 @@ struct snd_soc_dai_driver { ...@@ -423,6 +423,16 @@ struct snd_soc_dai_driver {
int remove_order; int remove_order;
}; };
/* for Playback/Capture */
struct snd_soc_dai_stream {
struct snd_soc_dapm_widget *widget;
unsigned int active; /* usage count */
unsigned int tdm_mask; /* CODEC TDM slot masks and params (for fixup) */
void *dma_data; /* DAI DMA data */
};
/* /*
* Digital Audio Interface runtime data. * Digital Audio Interface runtime data.
* *
...@@ -437,14 +447,7 @@ struct snd_soc_dai { ...@@ -437,14 +447,7 @@ struct snd_soc_dai {
struct snd_soc_dai_driver *driver; struct snd_soc_dai_driver *driver;
/* DAI runtime info */ /* DAI runtime info */
unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1]; /* usage count */ struct snd_soc_dai_stream stream[SNDRV_PCM_STREAM_LAST + 1];
struct snd_soc_dapm_widget *playback_widget;
struct snd_soc_dapm_widget *capture_widget;
/* DAI DMA data */
void *playback_dma_data;
void *capture_dma_data;
/* Symmetry data - only valid if symmetry is being enforced */ /* Symmetry data - only valid if symmetry is being enforced */
unsigned int rate; unsigned int rate;
...@@ -454,10 +457,6 @@ struct snd_soc_dai { ...@@ -454,10 +457,6 @@ struct snd_soc_dai {
/* parent platform/codec */ /* parent platform/codec */
struct snd_soc_component *component; struct snd_soc_component *component;
/* CODEC TDM slot masks and params (for fixup) */
unsigned int tx_mask;
unsigned int rx_mask;
struct list_head list; struct list_head list;
/* function mark */ /* function mark */
...@@ -477,36 +476,59 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) ...@@ -477,36 +476,59 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
&dai->driver->playback : &dai->driver->capture; &dai->driver->playback : &dai->driver->capture;
} }
#define snd_soc_dai_get_widget_playback(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_PLAYBACK)
#define snd_soc_dai_get_widget_capture(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_CAPTURE)
static inline static inline
struct snd_soc_dapm_widget *snd_soc_dai_get_widget( struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream)
struct snd_soc_dai *dai, int stream)
{ {
return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? return dai->stream[stream].widget;
dai->playback_widget : dai->capture_widget;
} }
static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, #define snd_soc_dai_set_widget_playback(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_PLAYBACK, widget)
const struct snd_pcm_substream *ss) #define snd_soc_dai_set_widget_capture(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_CAPTURE, widget)
static inline
void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget)
{ {
return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? dai->stream[stream].widget = widget;
dai->playback_dma_data : dai->capture_dma_data;
} }
static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, #define snd_soc_dai_dma_data_get_playback(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_PLAYBACK)
const struct snd_pcm_substream *ss, #define snd_soc_dai_dma_data_get_capture(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_CAPTURE)
void *data) #define snd_soc_dai_get_dma_data(dai, ss) snd_soc_dai_dma_data_get(dai, ss->stream)
static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int stream)
{ {
if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) return dai->stream[stream].dma_data;
dai->playback_dma_data = data; }
else
dai->capture_dma_data = data; #define snd_soc_dai_dma_data_set_playback(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_PLAYBACK, data)
#define snd_soc_dai_dma_data_set_capture(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_CAPTURE, data)
#define snd_soc_dai_set_dma_data(dai, ss, data) snd_soc_dai_dma_data_set(dai, ss->stream, data)
static inline void snd_soc_dai_dma_data_set(struct snd_soc_dai *dai, int stream, void *data)
{
dai->stream[stream].dma_data = data;
} }
static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *playback, void *capture)
void *playback, void *capture)
{ {
dai->playback_dma_data = playback; snd_soc_dai_dma_data_set_playback(dai, playback);
dai->capture_dma_data = capture; snd_soc_dai_dma_data_set_capture(dai, capture);
}
static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream)
{
return dai->stream[stream].tdm_mask;
}
static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream,
unsigned int tdm_mask)
{
dai->stream[stream].tdm_mask = tdm_mask;
}
static inline unsigned int snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream)
{
/* see snd_soc_dai_action() for setup */
return dai->stream[stream].active;
} }
static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai, static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai,
...@@ -561,10 +583,4 @@ static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai, ...@@ -561,10 +583,4 @@ static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai,
return ERR_PTR(-ENOTSUPP); return ERR_PTR(-ENOTSUPP);
} }
static inline unsigned int
snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream)
{
return dai->stream_active[stream];
}
#endif #endif
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <sound/asoc.h> #include <sound/asoc.h>
struct device; struct device;
struct snd_pcm_substream;
struct snd_soc_pcm_runtime; struct snd_soc_pcm_runtime;
struct soc_enum; struct soc_enum;
......
...@@ -162,6 +162,8 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream); ...@@ -162,6 +162,8 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
int event); int event);
bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget *widget, enum snd_soc_dapm_direction dir); bool dpcm_end_walk_at_be(struct snd_soc_dapm_widget *widget, enum snd_soc_dapm_direction dir);
int widget_in_list(struct snd_soc_dapm_widget_list *list,
struct snd_soc_dapm_widget *widget);
#define dpcm_be_dai_startup_rollback(fe, stream, last) \ #define dpcm_be_dai_startup_rollback(fe, stream, last) \
dpcm_be_dai_stop(fe, stream, 0, last) dpcm_be_dai_stop(fe, stream, 0, last)
......
...@@ -62,7 +62,7 @@ struct snd_soc_dobj { ...@@ -62,7 +62,7 @@ struct snd_soc_dobj {
enum snd_soc_dobj_type type; enum snd_soc_dobj_type type;
unsigned int index; /* objects can belong in different groups */ unsigned int index; /* objects can belong in different groups */
struct list_head list; struct list_head list;
struct snd_soc_tplg_ops *ops; int (*unload)(struct snd_soc_component *comp, struct snd_soc_dobj *dobj);
union { union {
struct snd_soc_dobj_control control; struct snd_soc_dobj_control control;
struct snd_soc_dobj_widget widget; struct snd_soc_dobj_widget widget;
......
...@@ -1052,6 +1052,12 @@ struct snd_soc_card { ...@@ -1052,6 +1052,12 @@ struct snd_soc_card {
#define for_each_card_widgets_safe(card, w, _w) \ #define for_each_card_widgets_safe(card, w, _w) \
list_for_each_entry_safe(w, _w, &card->widgets, list) list_for_each_entry_safe(w, _w, &card->widgets, list)
static inline int snd_soc_card_is_instantiated(struct snd_soc_card *card)
{
return card && card->instantiated;
}
/* SoC machine DAI configuration, glues a codec and cpu DAI together */ /* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_pcm_runtime { struct snd_soc_pcm_runtime {
struct device *dev; struct device *dev;
......
...@@ -185,6 +185,9 @@ enum sof_ipc4_pipeline_state { ...@@ -185,6 +185,9 @@ enum sof_ipc4_pipeline_state {
#define SOF_IPC4_GLB_PIPE_STATE_MASK GENMASK(15, 0) #define SOF_IPC4_GLB_PIPE_STATE_MASK GENMASK(15, 0)
#define SOF_IPC4_GLB_PIPE_STATE(x) ((x) << SOF_IPC4_GLB_PIPE_STATE_SHIFT) #define SOF_IPC4_GLB_PIPE_STATE(x) ((x) << SOF_IPC4_GLB_PIPE_STATE_SHIFT)
/* pipeline set state IPC msg extension */
#define SOF_IPC4_GLB_PIPE_STATE_EXT_MULTI BIT(0)
/* load library ipc msg */ /* load library ipc msg */
#define SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID_SHIFT 16 #define SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID_SHIFT 16
#define SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID(x) ((x) << SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID_SHIFT) #define SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID(x) ((x) << SOF_IPC4_GLB_LOAD_LIBRARY_LIB_ID_SHIFT)
......
...@@ -108,6 +108,7 @@ enum avs_tplg_token { ...@@ -108,6 +108,7 @@ enum avs_tplg_token {
AVS_TKN_MOD_CORE_ID_U8 = 1704, AVS_TKN_MOD_CORE_ID_U8 = 1704,
AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705, AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705,
AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706, AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706,
AVS_TKN_MOD_KCONTROL_ID_U32 = 1707,
/* struct avs_tplg_path_template */ /* struct avs_tplg_path_template */
AVS_TKN_PATH_TMPL_ID_U32 = 1801, AVS_TKN_PATH_TMPL_ID_U32 = 1801,
...@@ -121,6 +122,9 @@ enum avs_tplg_token { ...@@ -121,6 +122,9 @@ enum avs_tplg_token {
AVS_TKN_PIN_FMT_INDEX_U32 = 2201, AVS_TKN_PIN_FMT_INDEX_U32 = 2201,
AVS_TKN_PIN_FMT_IOBS_U32 = 2202, AVS_TKN_PIN_FMT_IOBS_U32 = 2202,
AVS_TKN_PIN_FMT_AFMT_ID_U32 = 2203, AVS_TKN_PIN_FMT_AFMT_ID_U32 = 2203,
/* struct avs_tplg_kcontrol */
AVS_TKN_KCONTROL_ID_U32 = 2301,
}; };
#endif #endif
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc-acpi.h> #include <sound/soc-acpi.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#include <linux/dmi.h>
#include <linux/module.h> #include <linux/module.h>
#include "acp-mach.h" #include "acp-mach.h"
...@@ -27,6 +28,7 @@ static struct acp_card_drvdata rt5682_rt1019_data = { ...@@ -27,6 +28,7 @@ static struct acp_card_drvdata rt5682_rt1019_data = {
.hs_codec_id = RT5682, .hs_codec_id = RT5682,
.amp_codec_id = RT1019, .amp_codec_id = RT1019,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata rt5682s_max_data = { static struct acp_card_drvdata rt5682s_max_data = {
...@@ -36,6 +38,7 @@ static struct acp_card_drvdata rt5682s_max_data = { ...@@ -36,6 +38,7 @@ static struct acp_card_drvdata rt5682s_max_data = {
.hs_codec_id = RT5682S, .hs_codec_id = RT5682S,
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata rt5682s_rt1019_data = { static struct acp_card_drvdata rt5682s_rt1019_data = {
...@@ -45,6 +48,7 @@ static struct acp_card_drvdata rt5682s_rt1019_data = { ...@@ -45,6 +48,7 @@ static struct acp_card_drvdata rt5682s_rt1019_data = {
.hs_codec_id = RT5682S, .hs_codec_id = RT5682S,
.amp_codec_id = RT1019, .amp_codec_id = RT1019,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata max_nau8825_data = { static struct acp_card_drvdata max_nau8825_data = {
...@@ -56,6 +60,7 @@ static struct acp_card_drvdata max_nau8825_data = { ...@@ -56,6 +60,7 @@ static struct acp_card_drvdata max_nau8825_data = {
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.soc_mclk = true, .soc_mclk = true,
.platform = REMBRANDT, .platform = REMBRANDT,
.tdm_mode = false,
}; };
static struct acp_card_drvdata rt5682s_rt1019_rmb_data = { static struct acp_card_drvdata rt5682s_rt1019_rmb_data = {
...@@ -67,6 +72,7 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = { ...@@ -67,6 +72,7 @@ static struct acp_card_drvdata rt5682s_rt1019_rmb_data = {
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.soc_mclk = true, .soc_mclk = true,
.platform = REMBRANDT, .platform = REMBRANDT,
.tdm_mode = false,
}; };
static const struct snd_kcontrol_new acp_controls[] = { static const struct snd_kcontrol_new acp_controls[] = {
...@@ -90,6 +96,8 @@ static int acp_asoc_probe(struct platform_device *pdev) ...@@ -90,6 +96,8 @@ static int acp_asoc_probe(struct platform_device *pdev)
{ {
struct snd_soc_card *card = NULL; struct snd_soc_card *card = NULL;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct dmi_system_id *dmi_id;
struct acp_card_drvdata *acp_card_drvdata;
int ret; int ret;
if (!pdev->id_entry) if (!pdev->id_entry)
...@@ -108,6 +116,11 @@ static int acp_asoc_probe(struct platform_device *pdev) ...@@ -108,6 +116,11 @@ static int acp_asoc_probe(struct platform_device *pdev)
card->num_controls = ARRAY_SIZE(acp_controls); card->num_controls = ARRAY_SIZE(acp_controls);
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data; card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
acp_card_drvdata = card->drvdata;
dmi_id = dmi_first_match(acp_quirk_table);
if (dmi_id && dmi_id->driver_data)
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
acp_legacy_dai_links_create(card); acp_legacy_dai_links_create(card);
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
......
This diff is collapsed.
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <linux/module.h> #include <linux/module.h>
#include <sound/soc.h> #include <sound/soc.h>
#define TDM_CHANNELS 8
enum be_id { enum be_id {
HEADSET_BE_ID = 0, HEADSET_BE_ID = 0,
AMP_BE_ID, AMP_BE_ID,
...@@ -58,9 +60,11 @@ struct acp_card_drvdata { ...@@ -58,9 +60,11 @@ struct acp_card_drvdata {
struct clk *wclk; struct clk *wclk;
struct clk *bclk; struct clk *bclk;
bool soc_mclk; bool soc_mclk;
bool tdm_mode;
}; };
int acp_sofdsp_dai_links_create(struct snd_soc_card *card); int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
int acp_legacy_dai_links_create(struct snd_soc_card *card); int acp_legacy_dai_links_create(struct snd_soc_card *card);
extern const struct dmi_system_id acp_quirk_table[];
#endif #endif
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc-acpi.h> #include <sound/soc-acpi.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#include <linux/dmi.h>
#include <linux/module.h> #include <linux/module.h>
#include "acp-mach.h" #include "acp-mach.h"
...@@ -27,6 +28,7 @@ static struct acp_card_drvdata sof_rt5682_rt1019_data = { ...@@ -27,6 +28,7 @@ static struct acp_card_drvdata sof_rt5682_rt1019_data = {
.hs_codec_id = RT5682, .hs_codec_id = RT5682,
.amp_codec_id = RT1019, .amp_codec_id = RT1019,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata sof_rt5682_max_data = { static struct acp_card_drvdata sof_rt5682_max_data = {
...@@ -36,6 +38,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = { ...@@ -36,6 +38,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
.hs_codec_id = RT5682, .hs_codec_id = RT5682,
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata sof_rt5682s_rt1019_data = { static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
...@@ -45,6 +48,7 @@ static struct acp_card_drvdata sof_rt5682s_rt1019_data = { ...@@ -45,6 +48,7 @@ static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
.hs_codec_id = RT5682S, .hs_codec_id = RT5682S,
.amp_codec_id = RT1019, .amp_codec_id = RT1019,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata sof_rt5682s_max_data = { static struct acp_card_drvdata sof_rt5682s_max_data = {
...@@ -54,6 +58,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = { ...@@ -54,6 +58,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
.hs_codec_id = RT5682S, .hs_codec_id = RT5682S,
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.tdm_mode = false,
}; };
static struct acp_card_drvdata sof_nau8825_data = { static struct acp_card_drvdata sof_nau8825_data = {
...@@ -64,6 +69,7 @@ static struct acp_card_drvdata sof_nau8825_data = { ...@@ -64,6 +69,7 @@ static struct acp_card_drvdata sof_nau8825_data = {
.amp_codec_id = MAX98360A, .amp_codec_id = MAX98360A,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.soc_mclk = true, .soc_mclk = true,
.tdm_mode = false,
}; };
static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = {
...@@ -74,6 +80,7 @@ static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = { ...@@ -74,6 +80,7 @@ static struct acp_card_drvdata sof_rt5682s_hs_rt1019_data = {
.amp_codec_id = RT1019, .amp_codec_id = RT1019,
.dmic_codec_id = DMIC, .dmic_codec_id = DMIC,
.soc_mclk = true, .soc_mclk = true,
.tdm_mode = false,
}; };
static const struct snd_kcontrol_new acp_controls[] = { static const struct snd_kcontrol_new acp_controls[] = {
...@@ -96,6 +103,8 @@ static int acp_sof_probe(struct platform_device *pdev) ...@@ -96,6 +103,8 @@ static int acp_sof_probe(struct platform_device *pdev)
{ {
struct snd_soc_card *card = NULL; struct snd_soc_card *card = NULL;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct dmi_system_id *dmi_id;
struct acp_card_drvdata *acp_card_drvdata;
int ret; int ret;
if (!pdev->id_entry) if (!pdev->id_entry)
...@@ -114,6 +123,11 @@ static int acp_sof_probe(struct platform_device *pdev) ...@@ -114,6 +123,11 @@ static int acp_sof_probe(struct platform_device *pdev)
card->num_controls = ARRAY_SIZE(acp_controls); card->num_controls = ARRAY_SIZE(acp_controls);
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data; card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
acp_card_drvdata = card->drvdata;
dmi_id = dmi_first_match(acp_quirk_table);
if (dmi_id && dmi_id->driver_data)
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
acp_sofdsp_dai_links_create(card); acp_sofdsp_dai_links_create(card);
ret = devm_snd_soc_register_card(&pdev->dev, card); ret = devm_snd_soc_register_card(&pdev->dev, card);
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#define ACP63_REG_START 0x1240000 #define ACP63_REG_START 0x1240000
#define ACP63_REG_END 0x1250200 #define ACP63_REG_END 0x1250200
#define ACP63_DEVS 3 #define ACP63_DEVS 3
#define ACP63_PDM_MODE 1
#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001 #define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001
#define ACP_PGFSM_CNTL_POWER_ON_MASK 1 #define ACP_PGFSM_CNTL_POWER_ON_MASK 1
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
#define ACP_ERROR_STAT 29 #define ACP_ERROR_STAT 29
#define PDM_DECIMATION_FACTOR 2 #define PDM_DECIMATION_FACTOR 2
#define ACP_PDM_CLK_FREQ_MASK 7 #define ACP_PDM_CLK_FREQ_MASK 7
#define ACP_WOV_MISC_CTRL_MASK 0x10 #define ACP_WOV_GAIN_CONTROL GENMASK(4, 3)
#define ACP_PDM_ENABLE 1 #define ACP_PDM_ENABLE 1
#define ACP_PDM_DISABLE 0 #define ACP_PDM_DISABLE 0
#define ACP_PDM_DMA_EN_STATUS 2 #define ACP_PDM_DMA_EN_STATUS 2
...@@ -54,6 +53,11 @@ ...@@ -54,6 +53,11 @@
/* time in ms for runtime suspend delay */ /* time in ms for runtime suspend delay */
#define ACP_SUSPEND_DELAY_MS 2000 #define ACP_SUSPEND_DELAY_MS 2000
#define ACP63_DMIC_ADDR 2
#define ACP63_PDM_MODE_DEVS 3
#define ACP63_PDM_DEV_MASK 1
#define ACP_DMIC_DEV 2
enum acp_config { enum acp_config {
ACP_CONFIG_0 = 0, ACP_CONFIG_0 = 0,
ACP_CONFIG_1, ACP_CONFIG_1,
...@@ -84,6 +88,7 @@ struct pdm_stream_instance { ...@@ -84,6 +88,7 @@ struct pdm_stream_instance {
struct pdm_dev_data { struct pdm_dev_data {
u32 pdm_irq; u32 pdm_irq;
void __iomem *acp63_base; void __iomem *acp63_base;
struct mutex *acp_lock;
struct snd_pcm_substream *capture_stream; struct snd_pcm_substream *capture_stream;
}; };
...@@ -100,6 +105,9 @@ static inline void acp63_writel(u32 val, void __iomem *base_addr) ...@@ -100,6 +105,9 @@ static inline void acp63_writel(u32 val, void __iomem *base_addr)
struct acp63_dev_data { struct acp63_dev_data {
void __iomem *acp63_base; void __iomem *acp63_base;
struct resource *res; struct resource *res;
bool acp63_audio_mode;
struct platform_device *pdev[ACP63_DEVS]; struct platform_device *pdev[ACP63_DEVS];
struct mutex acp_lock; /* protect shared registers */
u16 pdev_mask;
u16 pdev_count;
u16 pdm_dev_index;
}; };
...@@ -116,6 +116,7 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) ...@@ -116,6 +116,7 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id)
struct acp63_dev_data *adata; struct acp63_dev_data *adata;
struct pdm_dev_data *ps_pdm_data; struct pdm_dev_data *ps_pdm_data;
u32 val; u32 val;
u16 pdev_index;
adata = dev_id; adata = dev_id;
if (!adata) if (!adata)
...@@ -123,7 +124,8 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) ...@@ -123,7 +124,8 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id)
val = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT); val = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT);
if (val & BIT(PDM_DMA_STAT)) { if (val & BIT(PDM_DMA_STAT)) {
ps_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); pdev_index = adata->pdm_dev_index;
ps_pdm_data = dev_get_drvdata(&adata->pdev[pdev_index]->dev);
acp63_writel(BIT(PDM_DMA_STAT), adata->acp63_base + ACP_EXTERNAL_INTR_STAT); acp63_writel(BIT(PDM_DMA_STAT), adata->acp63_base + ACP_EXTERNAL_INTR_STAT);
if (ps_pdm_data->capture_stream) if (ps_pdm_data->capture_stream)
snd_pcm_period_elapsed(ps_pdm_data->capture_stream); snd_pcm_period_elapsed(ps_pdm_data->capture_stream);
...@@ -132,17 +134,124 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) ...@@ -132,17 +134,124 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id)
return IRQ_NONE; return IRQ_NONE;
} }
static void get_acp63_device_config(u32 config, struct pci_dev *pci,
struct acp63_dev_data *acp_data)
{
struct acpi_device *dmic_dev;
const union acpi_object *obj;
bool is_dmic_dev = false;
dmic_dev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), ACP63_DMIC_ADDR, 0);
if (dmic_dev) {
if (!acpi_dev_get_property(dmic_dev, "acp-audio-device-type",
ACPI_TYPE_INTEGER, &obj) &&
obj->integer.value == ACP_DMIC_DEV)
is_dmic_dev = true;
}
switch (config) {
case ACP_CONFIG_0:
case ACP_CONFIG_1:
case ACP_CONFIG_2:
case ACP_CONFIG_3:
case ACP_CONFIG_9:
case ACP_CONFIG_15:
dev_dbg(&pci->dev, "Audio Mode %d\n", config);
break;
default:
if (is_dmic_dev) {
acp_data->pdev_mask = ACP63_PDM_DEV_MASK;
acp_data->pdev_count = ACP63_PDM_MODE_DEVS;
}
break;
}
}
static void acp63_fill_platform_dev_info(struct platform_device_info *pdevinfo,
struct device *parent,
struct fwnode_handle *fw_node,
char *name, unsigned int id,
const struct resource *res,
unsigned int num_res,
const void *data,
size_t size_data)
{
pdevinfo->name = name;
pdevinfo->id = id;
pdevinfo->parent = parent;
pdevinfo->num_res = num_res;
pdevinfo->res = res;
pdevinfo->data = data;
pdevinfo->size_data = size_data;
pdevinfo->fwnode = fw_node;
}
static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data *adata, u32 addr)
{
struct platform_device_info pdevinfo[ACP63_DEVS];
struct device *parent;
int index;
int ret;
parent = &pci->dev;
dev_dbg(&pci->dev,
"%s pdev_mask:0x%x pdev_count:0x%x\n", __func__, adata->pdev_mask,
adata->pdev_count);
if (adata->pdev_mask) {
adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL);
if (!adata->res) {
ret = -ENOMEM;
goto de_init;
}
adata->res->flags = IORESOURCE_MEM;
adata->res->start = addr;
adata->res->end = addr + (ACP63_REG_END - ACP63_REG_START);
memset(&pdevinfo, 0, sizeof(pdevinfo));
}
switch (adata->pdev_mask) {
case ACP63_PDM_DEV_MASK:
adata->pdm_dev_index = 0;
acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma",
0, adata->res, 1, &adata->acp_lock,
sizeof(adata->acp_lock));
acp63_fill_platform_dev_info(&pdevinfo[1], parent, NULL, "dmic-codec",
0, NULL, 0, NULL, 0);
acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "acp_ps_mach",
0, NULL, 0, NULL, 0);
break;
default:
dev_dbg(&pci->dev, "No PDM devices found\n");
return 0;
}
for (index = 0; index < adata->pdev_count; index++) {
adata->pdev[index] = platform_device_register_full(&pdevinfo[index]);
if (IS_ERR(adata->pdev[index])) {
dev_err(&pci->dev,
"cannot register %s device\n", pdevinfo[index].name);
ret = PTR_ERR(adata->pdev[index]);
goto unregister_devs;
}
}
return 0;
unregister_devs:
for (--index; index >= 0; index--)
platform_device_unregister(adata->pdev[index]);
de_init:
if (acp63_deinit(adata->acp63_base, &pci->dev))
dev_err(&pci->dev, "ACP de-init failed\n");
return ret;
}
static int snd_acp63_probe(struct pci_dev *pci, static int snd_acp63_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
struct acp63_dev_data *adata; struct acp63_dev_data *adata;
struct platform_device_info pdevinfo[ACP63_DEVS];
int index, ret;
int val = 0x00;
struct acpi_device *adev;
const union acpi_object *obj;
u32 addr; u32 addr;
unsigned int irqflags; u32 irqflags;
int val;
int ret;
irqflags = IRQF_SHARED; irqflags = IRQF_SHARED;
/* Pink Sardine device check */ /* Pink Sardine device check */
...@@ -179,86 +288,28 @@ static int snd_acp63_probe(struct pci_dev *pci, ...@@ -179,86 +288,28 @@ static int snd_acp63_probe(struct pci_dev *pci,
} }
pci_set_master(pci); pci_set_master(pci);
pci_set_drvdata(pci, adata); pci_set_drvdata(pci, adata);
mutex_init(&adata->acp_lock);
ret = acp63_init(adata->acp63_base, &pci->dev); ret = acp63_init(adata->acp63_base, &pci->dev);
if (ret) if (ret)
goto release_regions; goto release_regions;
ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler,
irqflags, "ACP_PCI_IRQ", adata);
if (ret) {
dev_err(&pci->dev, "ACP PCI IRQ request failed\n");
goto de_init;
}
val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG); val = acp63_readl(adata->acp63_base + ACP_PIN_CONFIG);
switch (val) { get_acp63_device_config(val, pci, adata);
case ACP_CONFIG_0: ret = create_acp63_platform_devs(pci, adata, addr);
case ACP_CONFIG_1: if (ret < 0) {
case ACP_CONFIG_2: dev_err(&pci->dev, "ACP platform devices creation failed\n");
case ACP_CONFIG_3: goto de_init;
case ACP_CONFIG_9:
case ACP_CONFIG_15:
dev_info(&pci->dev, "Audio Mode %d\n", val);
break;
default:
/* Checking DMIC hardware*/
adev = acpi_find_child_device(ACPI_COMPANION(&pci->dev), 0x02, 0);
if (!adev)
break;
if (!acpi_dev_get_property(adev, "acp-audio-device-type",
ACPI_TYPE_INTEGER, &obj) &&
obj->integer.value == 2) {
adata->res = devm_kzalloc(&pci->dev, sizeof(struct resource), GFP_KERNEL);
if (!adata->res) {
ret = -ENOMEM;
goto de_init;
}
adata->res->name = "acp_iomem";
adata->res->flags = IORESOURCE_MEM;
adata->res->start = addr;
adata->res->end = addr + (ACP63_REG_END - ACP63_REG_START);
adata->acp63_audio_mode = ACP63_PDM_MODE;
memset(&pdevinfo, 0, sizeof(pdevinfo));
pdevinfo[0].name = "acp_ps_pdm_dma";
pdevinfo[0].id = 0;
pdevinfo[0].parent = &pci->dev;
pdevinfo[0].num_res = 1;
pdevinfo[0].res = adata->res;
pdevinfo[1].name = "dmic-codec";
pdevinfo[1].id = 0;
pdevinfo[1].parent = &pci->dev;
pdevinfo[2].name = "acp_ps_mach";
pdevinfo[2].id = 0;
pdevinfo[2].parent = &pci->dev;
for (index = 0; index < ACP63_DEVS; index++) {
adata->pdev[index] =
platform_device_register_full(&pdevinfo[index]);
if (IS_ERR(adata->pdev[index])) {
dev_err(&pci->dev,
"cannot register %s device\n",
pdevinfo[index].name);
ret = PTR_ERR(adata->pdev[index]);
goto unregister_devs;
}
ret = devm_request_irq(&pci->dev, pci->irq, acp63_irq_handler,
irqflags, "ACP_PCI_IRQ", adata);
if (ret) {
dev_err(&pci->dev, "ACP PCI IRQ request failed\n");
goto unregister_devs;
}
}
}
break;
} }
pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS); pm_runtime_set_autosuspend_delay(&pci->dev, ACP_SUSPEND_DELAY_MS);
pm_runtime_use_autosuspend(&pci->dev); pm_runtime_use_autosuspend(&pci->dev);
pm_runtime_put_noidle(&pci->dev); pm_runtime_put_noidle(&pci->dev);
pm_runtime_allow(&pci->dev); pm_runtime_allow(&pci->dev);
return 0; return 0;
unregister_devs:
for (--index; index >= 0; index--)
platform_device_unregister(adata->pdev[index]);
de_init: de_init:
if (acp63_deinit(adata->acp63_base, &pci->dev)) if (acp63_deinit(adata->acp63_base, &pci->dev))
dev_err(&pci->dev, "ACP de-init failed\n"); dev_err(&pci->dev, "ACP de-init failed\n");
...@@ -305,10 +356,8 @@ static void snd_acp63_remove(struct pci_dev *pci) ...@@ -305,10 +356,8 @@ static void snd_acp63_remove(struct pci_dev *pci)
int ret, index; int ret, index;
adata = pci_get_drvdata(pci); adata = pci_get_drvdata(pci);
if (adata->acp63_audio_mode == ACP63_PDM_MODE) { for (index = 0; index < adata->pdev_count; index++)
for (index = 0; index < ACP63_DEVS; index++) platform_device_unregister(adata->pdev[index]);
platform_device_unregister(adata->pdev[index]);
}
ret = acp63_deinit(adata->acp63_base, &pci->dev); ret = acp63_deinit(adata->acp63_base, &pci->dev);
if (ret) if (ret)
dev_err(&pci->dev, "ACP de-init failed\n"); dev_err(&pci->dev, "ACP de-init failed\n");
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
...@@ -18,6 +19,10 @@ ...@@ -18,6 +19,10 @@
#define DRV_NAME "acp_ps_pdm_dma" #define DRV_NAME "acp_ps_pdm_dma"
static int pdm_gain = 3;
module_param(pdm_gain, int, 0644);
MODULE_PARM_DESC(pdm_gain, "Gain control (0-3)");
static const struct snd_pcm_hardware acp63_pdm_hardware_capture = { static const struct snd_pcm_hardware acp63_pdm_hardware_capture = {
.info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -55,26 +60,31 @@ static void acp63_enable_pdm_clock(void __iomem *acp_base) ...@@ -55,26 +60,31 @@ static void acp63_enable_pdm_clock(void __iomem *acp_base)
acp63_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); acp63_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL);
pdm_ctrl = acp63_readl(acp_base + ACP_WOV_MISC_CTRL); pdm_ctrl = acp63_readl(acp_base + ACP_WOV_MISC_CTRL);
pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; pdm_ctrl &= ~ACP_WOV_GAIN_CONTROL;
pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, clamp(pdm_gain, 0, 3));
acp63_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); acp63_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL);
} }
static void acp63_enable_pdm_interrupts(void __iomem *acp_base) static void acp63_enable_pdm_interrupts(struct pdm_dev_data *adata)
{ {
u32 ext_int_ctrl; u32 ext_int_ctrl;
ext_int_ctrl = acp63_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); mutex_lock(adata->acp_lock);
ext_int_ctrl = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_CNTL);
ext_int_ctrl |= PDM_DMA_INTR_MASK; ext_int_ctrl |= PDM_DMA_INTR_MASK;
acp63_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); acp63_writel(ext_int_ctrl, adata->acp63_base + ACP_EXTERNAL_INTR_CNTL);
mutex_unlock(adata->acp_lock);
} }
static void acp63_disable_pdm_interrupts(void __iomem *acp_base) static void acp63_disable_pdm_interrupts(struct pdm_dev_data *adata)
{ {
u32 ext_int_ctrl; u32 ext_int_ctrl;
ext_int_ctrl = acp63_readl(acp_base + ACP_EXTERNAL_INTR_CNTL); mutex_lock(adata->acp_lock);
ext_int_ctrl = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_CNTL);
ext_int_ctrl &= ~PDM_DMA_INTR_MASK; ext_int_ctrl &= ~PDM_DMA_INTR_MASK;
acp63_writel(ext_int_ctrl, acp_base + ACP_EXTERNAL_INTR_CNTL); acp63_writel(ext_int_ctrl, adata->acp63_base + ACP_EXTERNAL_INTR_CNTL);
mutex_unlock(adata->acp_lock);
} }
static bool acp63_check_pdm_dma_status(void __iomem *acp_base) static bool acp63_check_pdm_dma_status(void __iomem *acp_base)
...@@ -196,7 +206,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, ...@@ -196,7 +206,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component,
return ret; return ret;
} }
acp63_enable_pdm_interrupts(adata->acp63_base); acp63_enable_pdm_interrupts(adata);
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
adata->capture_stream = substream; adata->capture_stream = substream;
...@@ -272,7 +282,7 @@ static int acp63_pdm_dma_close(struct snd_soc_component *component, ...@@ -272,7 +282,7 @@ static int acp63_pdm_dma_close(struct snd_soc_component *component,
struct pdm_dev_data *adata = dev_get_drvdata(component->dev); struct pdm_dev_data *adata = dev_get_drvdata(component->dev);
struct snd_pcm_runtime *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
acp63_disable_pdm_interrupts(adata->acp63_base); acp63_disable_pdm_interrupts(adata);
adata->capture_stream = NULL; adata->capture_stream = NULL;
kfree(runtime->private_data); kfree(runtime->private_data);
return 0; return 0;
...@@ -353,6 +363,10 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev) ...@@ -353,6 +363,10 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
struct pdm_dev_data *adata; struct pdm_dev_data *adata;
int status; int status;
if (!pdev->dev.platform_data) {
dev_err(&pdev->dev, "platform_data not retrieved\n");
return -ENODEV;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { if (!res) {
dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n");
...@@ -368,7 +382,7 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev) ...@@ -368,7 +382,7 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
adata->capture_stream = NULL; adata->capture_stream = NULL;
adata->acp_lock = pdev->dev.platform_data;
dev_set_drvdata(&pdev->dev, adata); dev_set_drvdata(&pdev->dev, adata);
status = devm_snd_soc_register_component(&pdev->dev, status = devm_snd_soc_register_component(&pdev->dev,
&acp63_pdm_component, &acp63_pdm_component,
...@@ -408,7 +422,7 @@ static int __maybe_unused acp63_pdm_resume(struct device *dev) ...@@ -408,7 +422,7 @@ static int __maybe_unused acp63_pdm_resume(struct device *dev)
acp63_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, buffer_len, acp63_init_pdm_ring_buffer(PDM_MEM_WINDOW_START, buffer_len,
period_bytes, adata->acp63_base); period_bytes, adata->acp63_base);
} }
acp63_enable_pdm_interrupts(adata->acp63_base); acp63_enable_pdm_interrupts(adata);
return 0; return 0;
} }
...@@ -417,7 +431,7 @@ static int __maybe_unused acp63_pdm_suspend(struct device *dev) ...@@ -417,7 +431,7 @@ static int __maybe_unused acp63_pdm_suspend(struct device *dev)
struct pdm_dev_data *adata; struct pdm_dev_data *adata;
adata = dev_get_drvdata(dev); adata = dev_get_drvdata(dev);
acp63_disable_pdm_interrupts(adata->acp63_base); acp63_disable_pdm_interrupts(adata);
return 0; return 0;
} }
...@@ -426,7 +440,7 @@ static int __maybe_unused acp63_pdm_runtime_resume(struct device *dev) ...@@ -426,7 +440,7 @@ static int __maybe_unused acp63_pdm_runtime_resume(struct device *dev)
struct pdm_dev_data *adata; struct pdm_dev_data *adata;
adata = dev_get_drvdata(dev); adata = dev_get_drvdata(dev);
acp63_enable_pdm_interrupts(adata->acp63_base); acp63_enable_pdm_interrupts(adata);
return 0; return 0;
} }
......
...@@ -315,16 +315,8 @@ static int acp3x_dai_probe(struct platform_device *pdev) ...@@ -315,16 +315,8 @@ static int acp3x_dai_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int acp3x_dai_remove(struct platform_device *pdev)
{
/* As we use devm_ memory alloc there is nothing TBD here */
return 0;
}
static struct platform_driver acp3x_dai_driver = { static struct platform_driver acp3x_dai_driver = {
.probe = acp3x_dai_probe, .probe = acp3x_dai_probe,
.remove = acp3x_dai_remove,
.driver = { .driver = {
.name = "acp3x_i2s_playcap", .name = "acp3x_i2s_playcap",
}, },
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/bitfield.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
...@@ -17,6 +18,10 @@ ...@@ -17,6 +18,10 @@
#define DRV_NAME "acp_rn_pdm_dma" #define DRV_NAME "acp_rn_pdm_dma"
static int pdm_gain = 3;
module_param(pdm_gain, int, 0644);
MODULE_PARM_DESC(pdm_gain, "Gain control (0-3)");
static const struct snd_pcm_hardware acp_pdm_hardware_capture = { static const struct snd_pcm_hardware acp_pdm_hardware_capture = {
.info = SNDRV_PCM_INFO_INTERLEAVED | .info = SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -80,7 +85,8 @@ static void enable_pdm_clock(void __iomem *acp_base) ...@@ -80,7 +85,8 @@ static void enable_pdm_clock(void __iomem *acp_base)
rn_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL); rn_writel(pdm_clk_enable, acp_base + ACP_WOV_CLK_CTRL);
pdm_ctrl = rn_readl(acp_base + ACP_WOV_MISC_CTRL); pdm_ctrl = rn_readl(acp_base + ACP_WOV_MISC_CTRL);
pdm_ctrl |= ACP_WOV_MISC_CTRL_MASK; pdm_ctrl &= ~ACP_WOV_GAIN_CONTROL;
pdm_ctrl |= FIELD_PREP(ACP_WOV_GAIN_CONTROL, clamp(pdm_gain, 0, 3));
rn_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL); rn_writel(pdm_ctrl, acp_base + ACP_WOV_MISC_CTRL);
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#define ACP_ERROR_STAT 29 #define ACP_ERROR_STAT 29
#define PDM_DECIMATION_FACTOR 0x2 #define PDM_DECIMATION_FACTOR 0x2
#define ACP_PDM_CLK_FREQ_MASK 0x07 #define ACP_PDM_CLK_FREQ_MASK 0x07
#define ACP_WOV_MISC_CTRL_MASK 0x10 #define ACP_WOV_GAIN_CONTROL GENMASK(4, 3)
#define ACP_PDM_ENABLE 0x01 #define ACP_PDM_ENABLE 0x01
#define ACP_PDM_DISABLE 0x00 #define ACP_PDM_DISABLE 0x00
#define ACP_PDM_DMA_EN_STATUS 0x02 #define ACP_PDM_DMA_EN_STATUS 0x02
......
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define ACP_ERROR_STAT 29 #define ACP_ERROR_STAT 29
#define PDM_DECIMATION_FACTOR 2 #define PDM_DECIMATION_FACTOR 2
#define ACP_PDM_CLK_FREQ_MASK 7 #define ACP_PDM_CLK_FREQ_MASK 7
#define ACP_WOV_MISC_CTRL_MASK 0x10 #define ACP_WOV_GAIN_CONTROL GENMASK(4, 3)
#define ACP_PDM_ENABLE 1 #define ACP_PDM_ENABLE 1
#define ACP_PDM_DISABLE 0 #define ACP_PDM_DISABLE 0
#define ACP_PDM_DMA_EN_STATUS 2 #define ACP_PDM_DMA_EN_STATUS 2
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment