ASoC: Updates for v5.11

There's a lot of changes here but mostly cleanups and driver specific
 things, the most user visible change is the support for boot time
 selection of Intel DSP firmware which will make it easier for people to
 move over to the preferred modern implementations in distros and other
 large scale deployments.
 
 This also includes a merge of the new auxillary bus which was done in
 anticipation of use by the Intel DSP drivers which didn't quite make it.
 
  - Lots more cleanups and simplifications from Morimoto-san.
  - Support for some basic DPCM systems in the audio graph card from
    Sameer Pujar.
  - Remove some old pre-DT Freescale drivers for platforms that are now
    DT only.
  - Move selection of which Intel DSP implementation to use to boot time
    rather than requiring it to be selected at build time.
  - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
    Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715,
    Qualcomm SM8250 and simple GPIO based muxes.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl/XcxYACgkQJNaLcl1U
 h9ApEgf/ZkKxj1Nq6RCfUqhyGK2u1ktzCpnugvjHebutXV1LD0y+y0/CnjdN5Vou
 8r+BsX6izfEx6JuZyu1ryQcz+Rsp6VH6uK9e/vRPExIkkAw+JQzEGVzQRyrnREoA
 eV8BO92YKrRtJM1HoIBnQOhoWMc/4Kqi7hklaiXDhHRDGpLcbTyeVK8ROarORLcy
 aupt7WinLvbhP++xjs9YR/RffjpwxyxOkmkIaM9TpkKqADays+sBDCZXSVgFjQik
 1rFLQ8jYAb/EOPNdCXrMEILrSaNMCz719vh2gZkm1yYQ3Tp5dH9WGqLROq9Oy/D4
 FaCGJoxX0HUe7MWbJeI97PFZB8i2gQ==
 =iCuN
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v5.11' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v5.11

There's a lot of changes here but mostly cleanups and driver specific
things, the most user visible change is the support for boot time
selection of Intel DSP firmware which will make it easier for people to
move over to the preferred modern implementations in distros and other
large scale deployments.

This also includes a merge of the new auxillary bus which was done in
anticipation of use by the Intel DSP drivers which didn't quite make it.

 - Lots more cleanups and simplifications from Morimoto-san.
 - Support for some basic DPCM systems in the audio graph card from
   Sameer Pujar.
 - Remove some old pre-DT Freescale drivers for platforms that are now
   DT only.
 - Move selection of which Intel DSP implementation to use to boot time
   rather than requiring it to be selected at build time.
 - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel
   Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715,
   Qualcomm SM8250 and simple GPIO based muxes.
This commit is contained in:
Takashi Iwai 2020-12-14 15:57:14 +01:00
commit 598100be30
338 changed files with 30883 additions and 5086 deletions

View File

@ -199,8 +199,6 @@ patternProperties:
description:
From common IIO binding. Used to pipe external sigma delta
modulator or internal ADC output to DFSDM channel.
This is not required for "st,stm32-dfsdm-pdm" compatibility as
PDM microphone is binded in Audio DT node.
required:
- io-channels
@ -235,6 +233,10 @@ patternProperties:
description: child node
properties:
compatible:
enum:
- st,stm32h7-dfsdm-dai
"#sound-dai-cells":
const: 0
@ -244,6 +246,7 @@ patternProperties:
modulator or internal ADC output to DFSDM channel.
required:
- compatible
- "#sound-dai-cells"
- io-channels

View File

@ -0,0 +1,67 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/adi,adau1372.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADAU1372 CODEC
maintainers:
- Alexandre Belloni <alexandre.belloni@bootlin.om>
description: |
Analog Devices ADAU1372 four inputs and two outputs codec.
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1372.pdf
properties:
compatible:
enum:
- adi,adau1372
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
clocks:
maxItems: 1
clock-names:
const: "mclk"
powerdown-gpios:
description: GPIO used for hardware power-down.
maxItems: 1
required:
- "#sound-dai-cells"
- compatible
- reg
- clocks
- clock-names
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
audio-codec@3c {
compatible = "adi,adau1372";
reg = <0x3c>;
#sound-dai-cells = <0>;
clock-names = "mclk";
clocks = <&adau1372z_xtal>;
};
};
adau1372z_xtal: clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <12288000>;
};
...

View File

@ -1,61 +0,0 @@
Analog Devices ADAU1977/ADAU1978/ADAU1979
Datasheets:
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1977.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1978.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1979.pdf
This driver supports both the I2C and SPI bus.
Required properties:
- compatible: Should contain one of the following:
"adi,adau1977"
"adi,adau1978"
"adi,adau1979"
- AVDD-supply: analog power supply for the device, please consult
Documentation/devicetree/bindings/regulator/regulator.txt
Optional properties:
- reset-gpios: the reset pin for the chip, for more details consult
Documentation/devicetree/bindings/gpio/gpio.txt
- DVDD-supply: supply voltage for the digital core, please consult
Documentation/devicetree/bindings/regulator/regulator.txt
- adi,micbias: configures the voltage setting for the MICBIAS pin.
Select 0/1/2/3/4/5/6/7/8 to specify MICBIAS voltage
5V/5.5V/6V/6.5V/7V/7.5V/8V/8.5V/9V
If not specified the default value will be "7" meaning 8.5 Volts.
This property is only valid for the ADAU1977
For required properties on SPI, please consult
Documentation/devicetree/bindings/spi/spi-bus.txt
Required properties on I2C:
- reg: The i2c address. Value depends on the state of ADDR0
and ADDR1, as wired in hardware.
Examples:
adau1977_spi: adau1977@0 {
compatible = "adi,adau1977";
spi-max-frequency = <600000>;
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;
adi,micbias = <3>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
};
adau1977_i2c: adau1977@11 {
compatible = "adi,adau1977";
reg = <0x11>;
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
};

View File

@ -0,0 +1,92 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/adi,adau1977.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices ADAU1977/ADAU1978/ADAU1979 Quad ADC with Diagnostics
maintainers:
- Lars-Peter Clausen <lars@metafoo.de>
- Bogdan Togorean <bogdan.togorean@analog.com>
description: |
Analog Devices ADAU1977 and similar quad ADC with Diagnostics
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1977.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1978.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ADAU1979.pdf
properties:
compatible:
enum:
- adi,adau1977
- adi,adau1978
- adi,adau1979
reg:
maxItems: 1
"#sound-dai-cells":
const: 0
reset-gpios:
maxItems: 1
spi-max-frequency: true
AVDD-supply:
description: Analog power support for the device.
DVDD-supply:
description: Supply voltage for digital core.
adi,micbias:
description: |
Configures the voltage setting for the MICBIAS pin.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6, 7, 8]
default: 7
required:
- reg
- compatible
- AVDD-supply
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
adau1977_spi: adau1977@0 {
compatible = "adi,adau1977";
reg = <0>;
spi-max-frequency = <600000>;
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
adi,micbias = <3>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
adau1977_i2c: adau1977@11 {
compatible = "adi,adau1977";
reg = <0x11>;
AVDD-supply = <&regulator>;
DVDD-supply = <&regulator_digital>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
};
};

View File

@ -24,6 +24,7 @@ properties:
- items:
- const: allwinner,sun50i-a64-i2s
- const: allwinner,sun8i-h3-i2s
- const: allwinner,sun50i-h6-i2s
reg:
maxItems: 1
@ -59,6 +60,7 @@ allOf:
- allwinner,sun8i-a83t-i2s
- allwinner,sun8i-h3-i2s
- allwinner,sun50i-a64-codec-i2s
- allwinner,sun50i-h6-i2s
then:
required:
@ -68,7 +70,9 @@ allOf:
properties:
compatible:
contains:
const: allwinner,sun8i-a83t-i2s
enum:
- allwinner,sun8i-a83t-i2s
- allwinner,sun8i-h3-i2s
then:
properties:

View File

@ -1,337 +0,0 @@
Audio Graph Card:
Audio Graph Card specifies audio DAI connections of SoC <-> codec.
It is based on common bindings for device graphs.
see ${LINUX}/Documentation/devicetree/bindings/graph.txt
Basically, Audio Graph Card property is same as Simple Card.
see ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
Below are same as Simple-Card.
- label
- widgets
- routing
- dai-format
- frame-master
- bitclock-master
- bitclock-inversion
- frame-inversion
- mclk-fs
- hp-det-gpio
- mic-det-gpio
- dai-tdm-slot-num
- dai-tdm-slot-width
- clocks / system-clock-frequency
Required properties:
- compatible : "audio-graph-card";
- dais : list of CPU DAI port{s}
Optional properties:
- pa-gpios: GPIO used to control external amplifier.
-----------------------
Example: Single DAI case
-----------------------
sound_card {
compatible = "audio-graph-card";
dais = <&cpu_port>;
};
dai-controller {
...
cpu_port: port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "left_j";
...
};
};
};
audio-codec {
...
port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};
-----------------------
Example: Multi DAI case
-----------------------
sound-card {
compatible = "audio-graph-card";
label = "sound-card";
dais = <&cpu_port0
&cpu_port1
&cpu_port2>;
};
audio-codec@0 {
...
port {
codec0_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint0>;
};
};
};
audio-codec@1 {
...
port {
codec1_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint1>;
};
};
};
audio-codec@2 {
...
port {
codec2_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint2>;
};
};
};
dai-controller {
...
ports {
cpu_port0: port@0 {
cpu_endpoint0: endpoint {
remote-endpoint = <&codec0_endpoint>;
dai-format = "left_j";
...
};
};
cpu_port1: port@1 {
cpu_endpoint1: endpoint {
remote-endpoint = <&codec1_endpoint>;
dai-format = "i2s";
...
};
};
cpu_port2: port@2 {
cpu_endpoint2: endpoint {
remote-endpoint = <&codec2_endpoint>;
dai-format = "i2s";
...
};
};
};
};
-----------------------
Example: Sampling Rate Conversion
-----------------------
sound_card {
compatible = "audio-graph-card";
label = "sound-card";
prefix = "codec";
routing = "codec Playback", "DAI0 Playback",
"DAI0 Capture", "codec Capture";
convert-rate = <48000>;
dais = <&cpu_port>;
};
audio-codec {
...
port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};
dai-controller {
...
cpu_port: port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "left_j";
...
};
};
};
-----------------------
Example: 2 CPU 1 Codec (Mixing)
-----------------------
sound_card {
compatible = "audio-graph-card";
label = "sound-card";
routing = "codec Playback", "DAI0 Playback",
"codec Playback", "DAI1 Playback",
"DAI0 Capture", "codec Capture";
dais = <&cpu_port>;
};
audio-codec {
...
audio-graph-card,prefix = "codec";
audio-graph-card,convert-rate = <48000>;
port {
reg = <0>;
codec_endpoint0: endpoint@0 {
remote-endpoint = <&cpu_endpoint0>;
};
codec_endpoint1: endpoint@1 {
remote-endpoint = <&cpu_endpoint1>;
};
};
};
dai-controller {
...
cpu_port: port {
cpu_endpoint0: endpoint@0 {
remote-endpoint = <&codec_endpoint0>;
dai-format = "left_j";
...
};
cpu_endpoint1: endpoint@1 {
remote-endpoint = <&codec_endpoint1>;
dai-format = "left_j";
...
};
};
};
-----------------------
Example: Multi DAI with DPCM
-----------------------
CPU0 ------ ak4613
CPU1 ------ HDMI
CPU2 ------ PCM3168A-p /* DPCM 1ch/2ch */
CPU3 --/ /* DPCM 3ch/4ch */
CPU4 --/ /* DPCM 5ch/6ch */
CPU5 --/ /* DPCM 7ch/8ch */
CPU6 ------ PCM3168A-c
sound_card: sound {
compatible = "audio-graph-card";
label = "sound-card";
routing = "pcm3168a Playback", "DAI2 Playback",
"pcm3168a Playback", "DAI3 Playback",
"pcm3168a Playback", "DAI4 Playback",
"pcm3168a Playback", "DAI5 Playback";
dais = <&snd_port0 /* ak4613 */
&snd_port1 /* HDMI0 */
&snd_port2 /* pcm3168a playback */
&snd_port3 /* pcm3168a capture */
>;
};
ak4613: codec@10 {
...
port {
ak4613_endpoint: endpoint {
remote-endpoint = <&rsnd_endpoint0>;
};
};
};
pcm3168a: audio-codec@44 {
...
audio-graph-card,prefix = "pcm3168a";
audio-graph-card,convert-channels = <8>; /* TDM Split */
ports {
port@0 {
reg = <0>;
pcm3168a_endpoint_p1: endpoint@1 {
remote-endpoint = <&rsnd_endpoint2>;
...
};
pcm3168a_endpoint_p2: endpoint@2 {
remote-endpoint = <&rsnd_endpoint3>;
...
};
pcm3168a_endpoint_p3: endpoint@3 {
remote-endpoint = <&rsnd_endpoint4>;
...
};
pcm3168a_endpoint_p4: endpoint@4 {
remote-endpoint = <&rsnd_endpoint5>;
...
};
};
port@1 {
reg = <1>;
pcm3168a_endpoint_c: endpoint {
remote-endpoint = <&rsnd_endpoint6>;
...
};
};
};
};
&sound {
ports {
snd_port0: port@0 {
rsnd_endpoint0: endpoint {
remote-endpoint = <&ak4613_endpoint>;
...
};
};
snd_port1: port@1 {
rsnd_endpoint1: endpoint {
remote-endpoint = <&dw_hdmi0_snd_in>;
...
};
};
snd_port2: port@2 {
#address-cells = <1>;
#size-cells = <0>;
rsnd_endpoint2: endpoint@2 {
remote-endpoint = <&pcm3168a_endpoint_p1>;
...
};
rsnd_endpoint3: endpoint@3 {
remote-endpoint = <&pcm3168a_endpoint_p2>;
...
};
rsnd_endpoint4: endpoint@4 {
remote-endpoint = <&pcm3168a_endpoint_p3>;
...
};
rsnd_endpoint5: endpoint@5 {
remote-endpoint = <&pcm3168a_endpoint_p4>;
...
};
};
snd_port3: port@6 {
rsnd_endpoint6: endpoint {
remote-endpoint = <&pcm3168a_endpoint_c>;
...
};
};
};
};

View File

@ -0,0 +1,57 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph-card.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Audio Graph Card Device Tree Bindings
maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
allOf:
- $ref: /schemas/sound/audio-graph.yaml#
properties:
compatible:
enum:
- audio-graph-card
- audio-graph-scu-card
required:
- compatible
unevaluatedProperties: false
examples:
- |
sound {
compatible = "audio-graph-card";
dais = <&cpu_port_a>;
};
cpu {
/*
* dai-controller own settings
*/
port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "left_j";
};
};
};
codec {
/*
* codec own settings
*/
port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};

View File

@ -0,0 +1,84 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph-port.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Audio Graph Card 'port' Node Bindings
maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
select: false
properties:
port:
description: single OF-Graph subnode
type: object
properties:
reg:
maxItems: 1
prefix:
description: "device name prefix"
$ref: /schemas/types.yaml#/definitions/string
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
patternProperties:
"^endpoint(@[0-9a-f]+)?":
type: object
properties:
remote-endpoint:
maxItems: 1
mclk-fs:
description: |
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:
description: dai-link uses frame clock inversion
$ref: /schemas/types.yaml#/definitions/flag
bitclock-inversion:
description: dai-link uses bit clock inversion
$ref: /schemas/types.yaml#/definitions/flag
frame-master:
description: Indicates dai-link frame master.
$ref: /schemas/types.yaml#/definitions/phandle
bitclock-master:
description: Indicates dai-link bit clock master
$ref: /schemas/types.yaml#/definitions/phandle
dai-format:
description: audio format.
items:
enum:
- i2s
- right_j
- left_j
- dsp_a
- dsp_b
- ac97
- pdm
- msb
- lsb
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
required:
- remote-endpoint
ports:
description: multi OF-Graph subnode
type: object
patternProperties:
"^port(@[0-9a-f]+)?":
$ref: "#/properties/port"
additionalProperties: true

View File

@ -0,0 +1,45 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Audio Graph Device Tree Bindings
maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
properties:
dais:
$ref: /schemas/types.yaml#/definitions/phandle-array
label:
maxItems: 1
prefix:
description: "device name prefix"
$ref: /schemas/types.yaml#/definitions/string
routing:
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.
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
widgets:
description: User specified audio sound widgets.
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
convert-rate:
description: CPU to Codec rate convert.
$ref: /schemas/types.yaml#/definitions/uint32
convert-channels:
description: CPU to Codec rate channels.
$ref: /schemas/types.yaml#/definitions/uint32
pa-gpios:
maxItems: 1
hp-det-gpio:
maxItems: 1
mic-det-gpio:
maxItems: 1
required:
- dais
additionalProperties: true

View File

@ -0,0 +1,66 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/fsl,aud2htx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP Audio Subsystem to HDMI RTX Subsystem Controller
maintainers:
- Shengjiu Wang <shengjiu.wang@nxp.com>
properties:
compatible:
const: fsl,imx8mp-aud2htx
reg:
maxItems: 1
interrupts:
maxItems: 1
clocks:
items:
- description: Peripheral clock
clock-names:
items:
- const: bus
dmas:
items:
- description: DMA controller phandle and request line for TX
dma-names:
items:
- const: tx
power-domains:
maxItems: 1
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- dmas
- dma-names
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/imx8mp-clock.h>
aud2htx: aud2htx@30cb0000 {
compatible = "fsl,imx8mp-aud2htx";
reg = <0x30cb0000 0x10000>;
interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_AUD2HTX_IPG>;
clock-names = "bus";
dmas = <&sdma2 26 2 0>;
dma-names = "tx";
power-domains = <&audiomix_pd>;
};

View File

@ -20,6 +20,7 @@ properties:
- fsl,imx35-spdif
- fsl,vf610-spdif
- fsl,imx6sx-spdif
- fsl,imx8qm-spdif
reg:
maxItems: 1

View File

@ -0,0 +1,104 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/fsl,xcvr.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP Audio Transceiver (XCVR) Controller
maintainers:
- Viorel Suman <viorel.suman@nxp.com>
description: |
NXP XCVR (Audio Transceiver) is a on-chip functional module
that allows CPU to receive and transmit digital audio via
HDMI2.1 eARC, HDMI1.4 ARC and SPDIF.
properties:
$nodename:
pattern: "^xcvr@.*"
compatible:
enum:
- fsl,imx8mp-xcvr
reg:
items:
- description: 20K RAM for code and data
- description: registers space
- description: RX FIFO address
- description: TX FIFO address
reg-names:
items:
- const: ram
- const: regs
- const: rxfifo
- const: txfifo
interrupts:
maxItems: 1
clocks:
items:
- description: Peripheral clock
- description: PHY clock
- description: SPBA clock
- description: PLL clock
clock-names:
items:
- const: ipg
- const: phy
- const: spba
- const: pll_ipg
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
resets:
maxItems: 1
required:
- compatible
- reg
- reg-names
- interrupts
- clocks
- clock-names
- dmas
- dma-names
- resets
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/reset/imx8mp-reset.h>
xcvr: xcvr@30cc0000 {
compatible = "fsl,imx8mp-xcvr";
reg = <0x30cc0000 0x800>,
<0x30cc0800 0x400>,
<0x30cc0c00 0x080>,
<0x30cc0e00 0x080>;
reg-names = "ram", "regs", "rxfifo", "txfifo";
interrupts = <0x0 128 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_EARC_IPG>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_EARC_PHY>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_SPBA2_ROOT>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_AUDPLL_ROOT>;
clock-names = "ipg", "phy", "spba", "pll_ipg";
dmas = <&sdma2 30 2 0>, <&sdma2 31 2 0>;
dma-names = "rx", "tx";
resets = <&audiomix_reset 0>;
};

View File

@ -40,6 +40,8 @@ The compatible list for this generic sound card currently:
"fsl,imx-audio-tlv320aic32x4"
"fsl,imx-audio-si476x"
Required properties:
- compatible : Contains one of entries in the compatible list.

View File

@ -0,0 +1,138 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/google,sc7180-trogdor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Google SC7180-Trogdor ASoC sound card driver
maintainers:
- Rohit kumar <rohitkr@codeaurora.org>
- Cheng-Yi Chiang <cychiang@chromium.org>
description:
This binding describes the SC7180 sound card which uses LPASS for audio.
properties:
compatible:
enum:
- google,sc7180-trogdor
- google,sc7180-coachz
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.
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
"#address-cells":
const: 1
"#size-cells":
const: 0
dmic-gpios:
maxItems: 1
description: GPIO for switching between DMICs
patternProperties:
"^dai-link(@[0-9])?$":
description:
Each subnode represents a dai link. Subnodes of each dai links would be
cpu/codec dais.
type: object
properties:
link-name:
description: Indicates dai-link name and PCM stream name.
$ref: /schemas/types.yaml#/definitions/string
maxItems: 1
reg:
description: dai link address.
cpu:
description: Holds subnode which indicates cpu dai.
type: object
properties:
sound-dai: true
codec:
description: Holds subnode which indicates codec dai.
type: object
properties:
sound-dai: true
required:
- link-name
- cpu
- codec
additionalProperties: false
required:
- compatible
- model
- "#address-cells"
- "#size-cells"
additionalProperties: false
examples:
- |
sound {
compatible = "google,sc7180-trogdor";
model = "sc7180-rt5682-max98357a-2mic";
audio-routing =
"Headphone Jack", "HPOL",
"Headphone Jack", "HPOR";
#address-cells = <1>;
#size-cells = <0>;
dmic-gpios = <&tlmm 86 0>;
dai-link@0 {
link-name = "MultiMedia0";
reg = <0>;
cpu {
sound-dai = <&lpass_cpu 0>;
};
codec {
sound-dai = <&alc5682 0>;
};
};
dai-link@1 {
link-name = "MultiMedia1";
reg = <1>;
cpu {
sound-dai = <&lpass_cpu 1>;
};
codec {
sound-dai = <&max98357a>;
};
};
dai-link@2 {
link-name = "MultiMedia2";
reg = <2>;
cpu {
sound-dai = <&lpass_hdmi 0>;
};
codec {
sound-dai = <&msm_dp>;
};
};
};

View File

@ -0,0 +1,52 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/imx-audio-hdmi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP i.MX audio complex with HDMI
maintainers:
- Shengjiu Wang <shengjiu.wang@nxp.com>
properties:
compatible:
enum:
- fsl,imx-audio-hdmi
- fsl,imx-audio-sii902x
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
audio-cpu:
description: The phandle of an CPU DAI controller
hdmi-out:
description: |
This is a boolean property. If present, the transmitting function
of HDMI will be enabled, indicating there's a physical HDMI out
connector or jack on the board or it's connecting to some other IP
block, such as an HDMI encoder or display-controller.
hdmi-in:
description: |
This is a boolean property. If present, the receiving function of
HDMI will be enabled, indicating there is a physical HDMI in
connector/jack on the board.
required:
- compatible
- model
- audio-cpu
additionalProperties: false
examples:
- |
sound-hdmi {
compatible = "fsl,imx-audio-hdmi";
model = "audio-hdmi";
audio-cpu = <&aud2htx>;
hdmi-out;
};

View File

@ -9,6 +9,9 @@ title: Marvel SSPA Digital Audio Interface Bindings
maintainers:
- Lubomir Rintel <lkundrak@v3.sk>
allOf:
- $ref: audio-graph-port.yaml#
properties:
$nodename:
pattern: "^audio-controller(@.*)?$"
@ -58,29 +61,9 @@ properties:
type: object
properties:
remote-endpoint: true
frame-master:
type: boolean
description: SoC generates the frame clock
bitclock-master:
type: boolean
description: SoC generates the bit clock
dai-format:
$ref: /schemas/types.yaml#/definitions/string
description: The digital audio format
const: i2s
required:
- remote-endpoint
required:
- endpoint
additionalProperties: false
required:
- "#sound-dai-cells"
- compatible
@ -112,8 +95,6 @@ examples:
port {
endpoint {
remote-endpoint = <&rt5631_0>;
frame-master;
bitclock-master;
dai-format = "i2s";
};
};

View File

@ -0,0 +1,44 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/mt8192-mt6359-rt1015-rt5682.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek MT8192 with MT6359, RT1015 and RT5682 ASoC sound card driver
maintainers:
- Jiaxin Yu <jiaxin.yu@mediatek.com>
- Shane Chien <shane.chien@mediatek.com>
description:
This binding describes the MT8192 sound card.
properties:
compatible:
enum:
- mediatek,mt8192_mt6359_rt1015_rt5682
- mediatek,mt8192_mt6359_rt1015p_rt5682
mediatek,platform:
$ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8192 ASoC platform.
additionalProperties: false
required:
- compatible
- mediatek,platform
examples:
- |
sound: mt8192-sound {
compatible = "mediatek,mt8192_mt6359_rt1015_rt5682";
mediatek,platform = <&afe>;
pinctrl-names = "aud_clk_mosi_off",
"aud_clk_mosi_on";
pinctrl-0 = <&aud_clk_mosi_off>;
pinctrl-1 = <&aud_clk_mosi_on>;
};
...

View File

@ -0,0 +1,18 @@
Nuvoton NAU8315 Mono Class-D Amplifier
Required properties:
- compatible : "nuvoton,nau8315"
Optional properties:
- enable-gpios : GPIO specifier for the chip's device enable input(EN) pin.
If this option is not specified then driver does not manage
the pin state (e.g. chip is always on).
Example:
#include <dt-bindings/gpio/gpio.h>
nau8315 {
compatible = "nuvoton,nau8315";
enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
};

View File

@ -1,35 +0,0 @@
NVIDIA Tegra30 HDA controller
Required properties:
- compatible : For Tegra30, must contain "nvidia,tegra30-hda". Otherwise,
must contain '"nvidia,<chip>-hda", "nvidia,tegra30-hda"', where <chip> is
tegra114, tegra124, or tegra132.
- reg : Should contain the HDA registers location and length.
- interrupts : The interrupt from the HDA controller.
- clocks : Must contain an entry for each required entry in clock-names.
See ../clocks/clock-bindings.txt for details.
- clock-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x
- resets : Must contain an entry for each entry in reset-names.
See ../reset/reset.txt for details.
- reset-names : Must include the following entries: hda, hda2hdmi, hda2codec_2x
Optional properties:
- nvidia,model : The user-visible name of this sound complex. Since the property
is optional, legacy boards can use default name provided in hda driver.
Example:
hda@70030000 {
compatible = "nvidia,tegra124-hda", "nvidia,tegra30-hda";
reg = <0x0 0x70030000 0x0 0x10000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&tegra_car TEGRA124_CLK_HDA>,
<&tegra_car TEGRA124_CLK_HDA2HDMI>,
<&tegra_car TEGRA124_CLK_HDA2CODEC_2X>;
clock-names = "hda", "hda2hdmi", "hda2codec_2x";
resets = <&tegra_car 125>, /* hda */
<&tegra_car 128>, /* hda2hdmi */
<&tegra_car 111>; /* hda2codec_2x */
reset-names = "hda", "hda2hdmi", "hda2codec_2x";
nvidia,model = "jetson-tk1-hda";
};

View File

@ -0,0 +1,112 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/nvidia,tegra30-hda.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NVIDIA Tegra HDA controller
description: |
The High Definition Audio (HDA) block provides a serial interface to
audio codec. It supports multiple input and output streams.
maintainers:
- Thierry Reding <treding@nvidia.com>
- Jon Hunter <jonathanh@nvidia.com>
properties:
$nodename:
pattern: "^hda@[0-9a-f]*$"
compatible:
oneOf:
- const: nvidia,tegra30-hda
- items:
- enum:
- nvidia,tegra194-hda
- nvidia,tegra186-hda
- nvidia,tegra210-hda
- nvidia,tegra124-hda
- const: nvidia,tegra30-hda
- items:
- const: nvidia,tegra132-hda
- const: nvidia,tegra124-hda
- const: nvidia,tegra30-hda
reg:
maxItems: 1
interrupts:
description: The interrupt from the HDA controller
maxItems: 1
clocks:
maxItems: 3
clock-names:
maxItems: 3
items:
- const: hda
- const: hda2hdmi
- const: hda2codec_2x
resets:
maxItems: 3
reset-names:
maxItems: 3
items:
- const: hda
- const: hda2hdmi
- const: hda2codec_2x
power-domains:
maxItems: 1
interconnects:
maxItems: 2
interconnect-names:
items:
- const: dma-mem
- const: write
iommus:
maxItems: 1
nvidia,model:
$ref: /schemas/types.yaml#/definitions/string
description: |
The user-visible name of this sound complex. If this property is
not specified then boards can use default name provided in hda driver.
required:
- compatible
- reg
- interrupts
- clocks
- clock-names
additionalProperties: false
examples:
- |
#include<dt-bindings/clock/tegra124-car-common.h>
#include<dt-bindings/interrupt-controller/arm-gic.h>
hda@70030000 {
compatible = "nvidia,tegra124-hda", "nvidia,tegra30-hda";
reg = <0x70030000 0x10000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&tegra_car TEGRA124_CLK_HDA>,
<&tegra_car TEGRA124_CLK_HDA2HDMI>,
<&tegra_car TEGRA124_CLK_HDA2CODEC_2X>;
clock-names = "hda", "hda2hdmi", "hda2codec_2x";
resets = <&tegra_car 125>, /* hda */
<&tegra_car 128>, /* hda2hdmi */
<&tegra_car 111>; /* hda2codec_2x */
reset-names = "hda", "hda2hdmi", "hda2codec_2x";
nvidia,model = "jetson-tk1-hda";
};
...

View File

@ -0,0 +1,67 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,lpass-va-macro.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: LPASS(Low Power Audio Subsystem) VA Macro audio codec DT bindings
maintainers:
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
properties:
compatible:
const: qcom,sm8250-lpass-va-macro
reg:
maxItems: 1
"#sound-dai-cells":
const: 1
'#clock-cells':
const: 0
clocks:
maxItems: 3
clock-names:
items:
- const: mclk
- const: core
- const: dcodec
clock-output-names:
items:
- const: fsgen
qcom,dmic-sample-rate:
description: dmic sample rate
$ref: /schemas/types.yaml#/definitions/uint32
vdd-micb-supply:
description: phandle to voltage regulator of MIC Bias
required:
- compatible
- reg
- "#sound-dai-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/sound/qcom,q6afe.h>
codec@3370000 {
compatible = "qcom,sm8250-lpass-va-macro";
reg = <0x3370000 0x1000>;
#sound-dai-cells = <1>;
#clock-cells = <0>;
clocks = <&aoncc 0>,
<&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
<&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
clock-names = "mclk", "core", "dcodec";
clock-output-names = "fsgen";
qcom,dmic-sample-rate = <600000>;
vdd-micb-supply = <&vreg_s4a_1p8>;
};

View File

@ -0,0 +1,69 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,lpass-wsa-macro.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: LPASS(Low Power Audio Subsystem) VA Macro audio codec DT bindings
maintainers:
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
properties:
compatible:
const: qcom,sm8250-lpass-wsa-macro
reg:
maxItems: 1
"#sound-dai-cells":
const: 1
'#clock-cells':
const: 0
clocks:
maxItems: 5
clock-names:
items:
- const: mclk
- const: npl
- const: macro
- const: dcodec
- const: fsgen
clock-output-names:
items:
- const: mclk
qcom,dmic-sample-rate:
description: dmic sample rate
$ref: /schemas/types.yaml#/definitions/uint32
vdd-micb-supply:
description: phandle to voltage regulator of MIC Bias
required:
- compatible
- reg
- "#sound-dai-cells"
additionalProperties: false
examples:
- |
#include <dt-bindings/sound/qcom,q6afe.h>
codec@3240000 {
compatible = "qcom,sm8250-lpass-wsa-macro";
reg = <0x3240000 0x1000>;
#sound-dai-cells = <1>;
#clock-cells = <0>;
clocks = <&audiocc 1>,
<&audiocc 0>,
<&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
<&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
<&vamacro>;
clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
clock-output-names = "mclk";
};

View File

@ -0,0 +1,159 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/qcom,sm8250.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies Inc. SM8250 ASoC sound card driver
maintainers:
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
description:
This bindings describes SC8250 SoC based sound cards
which uses LPASS internal codec for audio.
properties:
compatible:
oneOf:
- const: qcom,sm8250-sndcard
- const: qcom,qrb5165-rb5-sndcard
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. Valid names could be power supplies,
MicBias of codec and the jacks on the board.
model:
$ref: /schemas/types.yaml#/definitions/string
description: User visible long sound card name
patternProperties:
".*-dai-link$":
description:
Each subnode represents a dai link. Subnodes of each dai links would be
cpu/codec dais.
type: object
properties:
link-name:
description: Indicates dai-link name and PCM stream name.
$ref: /schemas/types.yaml#/definitions/string
maxItems: 1
cpu:
description: Holds subnode which indicates cpu dai.
type: object
properties:
sound-dai: true
platform:
description: Holds subnode which indicates platform dai.
type: object
properties:
sound-dai: true
codec:
description: Holds subnode which indicates codec dai.
type: object
properties:
sound-dai: true
required:
- link-name
- cpu
additionalProperties: false
required:
- compatible
- model
additionalProperties: false
examples:
- |
#include <dt-bindings/sound/qcom,q6afe.h>
#include <dt-bindings/sound/qcom,q6asm.h>
sound {
compatible = "qcom,qrb5165-rb5-sndcard";
model = "Qualcomm-qrb5165-RB5-WSA8815-Speakers-DMIC0";
audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
"SpkrRight IN", "WSA_SPK2 OUT",
"VA DMIC0", "vdd-micb",
"VA DMIC1", "vdd-micb",
"MM_DL1", "MultiMedia1 Playback",
"MM_DL2", "MultiMedia2 Playback",
"MultiMedia3 Capture", "MM_UL3";
mm1-dai-link {
link-name = "MultiMedia0";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
};
};
mm2-dai-link {
link-name = "MultiMedia2";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
};
};
mm3-dai-link {
link-name = "MultiMedia3";
cpu {
sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
};
};
hdmi-dai-link {
link-name = "HDMI Playback";
cpu {
sound-dai = <&q6afedai TERTIARY_MI2S_RX>;
};
platform {
sound-dai = <&q6routing>;
};
codec {
sound-dai = <&lt9611_codec 0>;
};
};
wsa-dai-link {
link-name = "WSA Playback";
cpu {
sound-dai = <&q6afedai WSA_CODEC_DMA_RX_0>;
};
platform {
sound-dai = <&q6routing>;
};
codec {
sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro>;
};
};
va-dai-link {
link-name = "VA Capture";
cpu {
sound-dai = <&q6afedai VA_CODEC_DMA_TX_0>;
};
platform {
sound-dai = <&q6routing>;
};
codec {
sound-dai = <&vamacro 0>;
};
};
};

View File

@ -253,523 +253,3 @@ This is example of TDM 6ch.
Driver can automatically switches TDM <-> stereo mode in this case.
see "Example: simple sound card for TDM"
=============================================
Required properties:
=============================================
- compatible : "renesas,rcar_sound-<soctype>", fallbacks
"renesas,rcar_sound-gen1" if generation1, and
"renesas,rcar_sound-gen2" if generation2 (or RZ/G1)
"renesas,rcar_sound-gen3" if generation3 (or RZ/G2)
Examples with soctypes are:
- "renesas,rcar_sound-r8a7742" (RZ/G1H)
- "renesas,rcar_sound-r8a7743" (RZ/G1M)
- "renesas,rcar_sound-r8a7744" (RZ/G1N)
- "renesas,rcar_sound-r8a7745" (RZ/G1E)
- "renesas,rcar_sound-r8a77470" (RZ/G1C)
- "renesas,rcar_sound-r8a774a1" (RZ/G2M)
- "renesas,rcar_sound-r8a774b1" (RZ/G2N)
- "renesas,rcar_sound-r8a774c0" (RZ/G2E)
- "renesas,rcar_sound-r8a774e1" (RZ/G2H)
- "renesas,rcar_sound-r8a7778" (R-Car M1A)
- "renesas,rcar_sound-r8a7779" (R-Car H1)
- "renesas,rcar_sound-r8a7790" (R-Car H2)
- "renesas,rcar_sound-r8a7791" (R-Car M2-W)
- "renesas,rcar_sound-r8a7793" (R-Car M2-N)
- "renesas,rcar_sound-r8a7794" (R-Car E2)
- "renesas,rcar_sound-r8a7795" (R-Car H3)
- "renesas,rcar_sound-r8a7796" (R-Car M3-W)
- "renesas,rcar_sound-r8a77965" (R-Car M3-N)
- "renesas,rcar_sound-r8a77990" (R-Car E3)
- "renesas,rcar_sound-r8a77995" (R-Car D3)
- reg : Should contain the register physical address.
required register is
SRU/ADG/SSI if generation1
SRU/ADG/SSIU/SSI/AUDIO-DMAC-periperi if generation2/generation3
Select extended AUDIO-DMAC-periperi address if SoC has it,
otherwise select normal AUDIO-DMAC-periperi address.
- reg-names : Should contain the register names.
scu/adg/ssi if generation1
scu/adg/ssiu/ssi/audmapp if generation2/generation3
- rcar_sound,ssi : Should contain SSI feature.
The number of SSI subnode should be same as HW.
see below for detail.
- rcar_sound,ssiu : Should contain SSIU feature.
The number of SSIU subnode should be same as HW.
see below for detail.
- rcar_sound,src : Should contain SRC feature.
The number of SRC subnode should be same as HW.
see below for detail.
- rcar_sound,ctu : Should contain CTU feature.
The number of CTU subnode should be same as HW.
see below for detail.
- rcar_sound,mix : Should contain MIX feature.
The number of MIX subnode should be same as HW.
see below for detail.
- rcar_sound,dvc : Should contain DVC feature.
The number of DVC subnode should be same as HW.
see below for detail.
- rcar_sound,dai : DAI contents.
The number of DAI subnode should be same as HW.
see below for detail.
- #sound-dai-cells : it must be 0 if your system is using single DAI
it must be 1 if your system is using multi DAI
- clocks : References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.
- clock-names : List of necessary clock names.
"ssi-all", "ssi.X", "src.X", "mix.X", "ctu.X",
"dvc.X", "clk_a", "clk_b", "clk_c", "clk_i"
Optional properties:
- #clock-cells : it must be 0 if your system has audio_clkout
it must be 1 if your system has audio_clkout0/1/2/3
- clock-frequency : for all audio_clkout0/1/2/3
- clkout-lr-asynchronous : boolean property. it indicates that audio_clkoutn
is asynchronizes with lr-clock.
- resets : References to SSI resets.
- reset-names : List of valid reset names.
"ssi-all", "ssi.X"
SSI subnode properties:
- interrupts : Should contain SSI interrupt for PIO transfer
- shared-pin : if shared clock pin
- pio-transfer : use PIO transfer mode
- no-busif : BUSIF is not ussed when [mem -> SSI] via DMA case
- dma : Should contain Audio DMAC entry
- dma-names : SSI case "rx" (=playback), "tx" (=capture)
Deprecated: see SSIU subnode properties
SSIU case "rxu" (=playback), "txu" (=capture)
SSIU subnode properties:
- dma : Should contain Audio DMAC entry
- dma-names : "rx" (=playback), "tx" (=capture)
SRC subnode properties:
- dma : Should contain Audio DMAC entry
- dma-names : "rx" (=playback), "tx" (=capture)
DVC subnode properties:
- dma : Should contain Audio DMAC entry
- dma-names : "tx" (=playback/capture)
DAI subnode properties:
- playback : list of playback modules
- capture : list of capture modules
=============================================
Example:
=============================================
rcar_sound: sound@ec500000 {
#sound-dai-cells = <1>;
compatible = "renesas,rcar_sound-r8a7791", "renesas,rcar_sound-gen2";
reg = <0 0xec500000 0 0x1000>, /* SCU */
<0 0xec5a0000 0 0x100>, /* ADG */
<0 0xec540000 0 0x1000>, /* SSIU */
<0 0xec541000 0 0x1280>, /* SSI */
<0 0xec740000 0 0x200>; /* Audio DMAC peri peri*/
reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
clocks = <&mstp10_clks R8A7790_CLK_SSI_ALL>,
<&mstp10_clks R8A7790_CLK_SSI9>, <&mstp10_clks R8A7790_CLK_SSI8>,
<&mstp10_clks R8A7790_CLK_SSI7>, <&mstp10_clks R8A7790_CLK_SSI6>,
<&mstp10_clks R8A7790_CLK_SSI5>, <&mstp10_clks R8A7790_CLK_SSI4>,
<&mstp10_clks R8A7790_CLK_SSI3>, <&mstp10_clks R8A7790_CLK_SSI2>,
<&mstp10_clks R8A7790_CLK_SSI1>, <&mstp10_clks R8A7790_CLK_SSI0>,
<&mstp10_clks R8A7790_CLK_SCU_SRC9>, <&mstp10_clks R8A7790_CLK_SCU_SRC8>,
<&mstp10_clks R8A7790_CLK_SCU_SRC7>, <&mstp10_clks R8A7790_CLK_SCU_SRC6>,
<&mstp10_clks R8A7790_CLK_SCU_SRC5>, <&mstp10_clks R8A7790_CLK_SCU_SRC4>,
<&mstp10_clks R8A7790_CLK_SCU_SRC3>, <&mstp10_clks R8A7790_CLK_SCU_SRC2>,
<&mstp10_clks R8A7790_CLK_SCU_SRC1>, <&mstp10_clks R8A7790_CLK_SCU_SRC0>,
<&mstp10_clks R8A7790_CLK_SCU_DVC0>, <&mstp10_clks R8A7790_CLK_SCU_DVC1>,
<&audio_clk_a>, <&audio_clk_b>, <&audio_clk_c>, <&m2_clk>;
clock-names = "ssi-all",
"ssi.9", "ssi.8", "ssi.7", "ssi.6", "ssi.5",
"ssi.4", "ssi.3", "ssi.2", "ssi.1", "ssi.0",
"src.9", "src.8", "src.7", "src.6", "src.5",
"src.4", "src.3", "src.2", "src.1", "src.0",
"dvc.0", "dvc.1",
"clk_a", "clk_b", "clk_c", "clk_i";
rcar_sound,dvc {
dvc0: dvc-0 {
dmas = <&audma0 0xbc>;
dma-names = "tx";
};
dvc1: dvc-1 {
dmas = <&audma0 0xbe>;
dma-names = "tx";
};
};
rcar_sound,mix {
mix0: mix-0 { };
mix1: mix-1 { };
};
rcar_sound,ctu {
ctu00: ctu-0 { };
ctu01: ctu-1 { };
ctu02: ctu-2 { };
ctu03: ctu-3 { };
ctu10: ctu-4 { };
ctu11: ctu-5 { };
ctu12: ctu-6 { };
ctu13: ctu-7 { };
};
rcar_sound,src {
src0: src-0 {
interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x85>, <&audma1 0x9a>;
dma-names = "rx", "tx";
};
src1: src-1 {
interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x87>, <&audma1 0x9c>;
dma-names = "rx", "tx";
};
src2: src-2 {
interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x89>, <&audma1 0x9e>;
dma-names = "rx", "tx";
};
src3: src-3 {
interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x8b>, <&audma1 0xa0>;
dma-names = "rx", "tx";
};
src4: src-4 {
interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x8d>, <&audma1 0xb0>;
dma-names = "rx", "tx";
};
src5: src-5 {
interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x8f>, <&audma1 0xb2>;
dma-names = "rx", "tx";
};
src6: src-6 {
interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x91>, <&audma1 0xb4>;
dma-names = "rx", "tx";
};
src7: src-7 {
interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x93>, <&audma1 0xb6>;
dma-names = "rx", "tx";
};
src8: src-8 {
interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x95>, <&audma1 0xb8>;
dma-names = "rx", "tx";
};
src9: src-9 {
interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x97>, <&audma1 0xba>;
dma-names = "rx", "tx";
};
};
rcar_sound,ssiu {
ssiu00: ssiu-0 {
dmas = <&audma0 0x15>, <&audma1 0x16>;
dma-names = "rx", "tx";
};
ssiu01: ssiu-1 {
dmas = <&audma0 0x35>, <&audma1 0x36>;
dma-names = "rx", "tx";
};
...
ssiu95: ssiu-49 {
dmas = <&audma0 0xA5>, <&audma1 0xA6>;
dma-names = "rx", "tx";
};
ssiu96: ssiu-50 {
dmas = <&audma0 0xA7>, <&audma1 0xA8>;
dma-names = "rx", "tx";
};
ssiu97: ssiu-51 {
dmas = <&audma0 0xA9>, <&audma1 0xAA>;
dma-names = "rx", "tx";
};
};
rcar_sound,ssi {
ssi0: ssi-0 {
interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x01>, <&audma1 0x02>;
dma-names = "rx", "tx";
};
ssi1: ssi-1 {
interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x03>, <&audma1 0x04>;
dma-names = "rx", "tx";
};
...
ssi8: ssi-8 {
interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x11>, <&audma1 0x12>;
dma-names = "rx", "tx";
};
ssi9: ssi-9 {
interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&audma0 0x13>, <&audma1 0x14>;
dma-names = "rx", "tx";
};
};
rcar_sound,dai {
dai0 {
playback = <&ssi5 &src5>;
capture = <&ssi6>;
};
dai1 {
playback = <&ssi3>;
};
dai2 {
capture = <&ssi4>;
};
dai3 {
playback = <&ssi7>;
};
dai4 {
capture = <&ssi8>;
};
};
};
=============================================
Example: simple sound card
=============================================
rsnd_ak4643: sound {
compatible = "simple-audio-card";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&ak4643>;
clocks = <&audio_clock>;
};
};
&rcar_sound {
pinctrl-0 = <&sound_pins &sound_clk_pins>;
pinctrl-names = "default";
/* Single DAI */
#sound-dai-cells = <0>;
rcar_sound,dai {
dai0 {
playback = <&ssi0 &src2 &dvc0>;
capture = <&ssi1 &src3 &dvc1>;
};
};
};
&ssi1 {
shared-pin;
};
=============================================
Example: simple sound card for Asynchronous mode
=============================================
sound {
compatible = "simple-scu-audio-card";
...
/*
* SRC Asynchronous mode setting
* Playback:
* All input data will be converted to 48kHz
* Capture:
* Inputed 48kHz data will be converted to
* system specified Hz
*/
simple-audio-card,convert-rate = <48000>;
...
simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
simple-audio-card,codec {
...
};
};
=============================================
Example: simple sound card for channel convert
=============================================
sound {
compatible = "simple-scu-audio-card";
...
/*
* CTU setting
* All input data will be converted to 2ch
* as output data
*/
simple-audio-card,convert-channels = <2>;
...
simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
simple-audio-card,codec {
...
};
};
=============================================
Example: simple sound card for MIXer
=============================================
sound {
compatible = "simple-scu-audio-card";
...
simple-audio-card,cpu@0 {
sound-dai = <&rcar_sound 0>;
};
simple-audio-card,cpu@1 {
sound-dai = <&rcar_sound 1>;
};
simple-audio-card,codec {
...
};
};
&rcar_sound {
...
rcar_sound,dai {
dai0 {
playback = <&src1 &ctu02 &mix0 &dvc0 &ssi0>;
};
dai1 {
playback = <&src2 &ctu03 &mix0 &dvc0 &ssi0>;
};
};
};
=============================================
Example: simple sound card for TDM
=============================================
rsnd_tdm: sound {
compatible = "simple-audio-card";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
dai-tdm-slot-num = <6>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&xxx>;
};
};
=============================================
Example: simple sound card for TDM Split
=============================================
sound_card: sound {
compatible = "audio-graph-scu-card";
prefix = "xxxx";
routing = "xxxx Playback", "DAI0 Playback",
"xxxx Playback", "DAI1 Playback",
"xxxx Playback", "DAI2 Playback",
"xxxx Playback", "DAI3 Playback";
convert-channels = <8>; /* TDM Split */
dais = <&rsnd_port0 /* playback ch1/ch2 */
&rsnd_port1 /* playback ch3/ch4 */
&rsnd_port2 /* playback ch5/ch6 */
&rsnd_port3 /* playback ch7/ch8 */
>;
};
audio-codec {
...
port {
codec_0: endpoint@1 {
remote-endpoint = <&rsnd_ep0>;
};
codec_1: endpoint@2 {
remote-endpoint = <&rsnd_ep1>;
};
codec_2: endpoint@3 {
remote-endpoint = <&rsnd_ep2>;
};
codec_3: endpoint@4 {
remote-endpoint = <&rsnd_ep3>;
};
};
};
&rcar_sound {
...
ports {
rsnd_port0: port@0 {
rsnd_ep0: endpoint {
remote-endpoint = <&codec_0>;
...
playback = <&ssiu30 &ssi3>;
};
};
rsnd_port1: port@1 {
rsnd_ep1: endpoint {
remote-endpoint = <&codec_1>;
...
playback = <&ssiu31 &ssi3>;
};
};
rsnd_port2: port@2 {
rsnd_ep2: endpoint {
remote-endpoint = <&codec_2>;
...
playback = <&ssiu32 &ssi3>;
};
};
rsnd_port3: port@3 {
rsnd_ep3: endpoint {
remote-endpoint = <&codec_3>;
...
playback = <&ssiu33 &ssi3>;
};
};
};
};
=============================================
Example: simple sound card for Multi channel
=============================================
&rcar_sound {
pinctrl-0 = <&sound_pins &sound_clk_pins>;
pinctrl-names = "default";
/* Single DAI */
#sound-dai-cells = <0>;
rcar_sound,dai {
dai0 {
playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>;
};
};
};

View File

@ -0,0 +1,447 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/renesas,rsnd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Renesas R-Car Sound Driver Device Tree Bindings
maintainers:
- Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
properties:
compatible:
oneOf:
# for Gen1 SoC
- items:
- enum:
- renesas,rcar_sound-r8a7778 # R-Car M1A
- renesas,rcar_sound-r8a7779 # R-Car H1
- enum:
- renesas,rcar_sound-gen1
# for Gen2 SoC
- items:
- enum:
- renesas,rcar_sound-r8a7742 # RZ/G1H
- renesas,rcar_sound-r8a7743 # RZ/G1M
- renesas,rcar_sound-r8a7744 # RZ/G1N
- renesas,rcar_sound-r8a7745 # RZ/G1E
- renesas,rcar_sound-r8a77470 # RZ/G1C
- renesas,rcar_sound-r8a7790 # R-Car H2
- renesas,rcar_sound-r8a7791 # R-Car M2-W
- renesas,rcar_sound-r8a7793 # R-Car M2-N
- renesas,rcar_sound-r8a7794 # R-Car E2
- enum:
- renesas,rcar_sound-gen2
# for Gen3 SoC
- items:
- enum:
- renesas,rcar_sound-r8a774a1 # RZ/G2M
- renesas,rcar_sound-r8a774b1 # RZ/G2N
- renesas,rcar_sound-r8a774c0 # RZ/G2E
- renesas,rcar_sound-r8a774e1 # RZ/G2H
- renesas,rcar_sound-r8a7795 # R-Car H3
- renesas,rcar_sound-r8a7796 # R-Car M3-W
- renesas,rcar_sound-r8a77961 # R-Car M3-W+
- renesas,rcar_sound-r8a77965 # R-Car M3-N
- renesas,rcar_sound-r8a77990 # R-Car E3
- renesas,rcar_sound-r8a77995 # R-Car D3
- enum:
- renesas,rcar_sound-gen3
# for Generic
- items:
- enum:
- renesas,rcar_sound-gen1
- renesas,rcar_sound-gen2
- renesas,rcar_sound-gen3
reg:
minItems: 1
maxItems: 5
reg-names:
minItems: 1
maxItems: 5
"#sound-dai-cells":
description: |
it must be 0 if your system is using single DAI
it must be 1 if your system is using multi DAIs
enum: [0, 1]
"#clock-cells":
description: |
it must be 0 if your system has audio_clkout
it must be 1 if your system has audio_clkout0/1/2/3
enum: [0, 1]
clock-frequency:
description: for audio_clkout0/1/2/3
$ref: /schemas/types.yaml#/definitions/uint32-array
clkout-lr-asynchronous:
description: audio_clkoutn is asynchronizes with lr-clock.
$ref: /schemas/types.yaml#/definitions/flag
power-domains: true
resets:
maxItems: 11
reset-names:
maxItems: 11
clocks:
description: References to SSI/SRC/MIX/CTU/DVC/AUDIO_CLK clocks.
minItems: 1
maxItems: 31
clock-names:
description: List of necessary clock names.
minItems: 1
maxItems: 31
items:
oneOf:
- const: ssi-all
- pattern: '^ssi\.[0-9]$'
- pattern: '^src\.[0-9]$'
- pattern: '^mix\.[0-1]$'
- pattern: '^ctu\.[0-1]$'
- pattern: '^dvc\.[0-1]$'
- pattern: '^clk_(a|b|c|i)$'
port: true
# use patternProperties to avoid naming "xxx,yyy" issue
patternProperties:
"^rcar_sound,dvc$":
description: DVC subnode.
type: object
patternProperties:
"^dvc-[0-1]$":
type: object
properties:
dmas:
maxItems: 1
dma-names:
const: "tx"
required:
- dmas
- dma-names
additionalProperties: false
"^rcar_sound,mix$":
description: MIX subnode.
type: object
patternProperties:
"^mix-[0-1]$":
type: object
# no properties
additionalProperties: false
"^rcar_sound,ctu$":
description: CTU subnode.
type: object
patternProperties:
"^ctu-[0-7]$":
type: object
# no properties
additionalProperties: false
"^rcar_sound,src$":
description: SRC subnode.
type: object
patternProperties:
"^src-[0-9]$":
type: object
properties:
interrupts:
maxItems: 1
dmas:
maxItems: 2
dma-names:
allOf:
- items:
enum:
- tx
- rx
required:
- interrupts
- dmas
- dma-names
additionalProperties: false
"^rcar_sound,ssiu$":
description: SSIU subnode.
type: object
patternProperties:
"^ssiu-[0-9]+$":
type: object
properties:
dmas:
maxItems: 2
dma-names:
allOf:
- items:
enum:
- tx
- rx
required:
- dmas
- dma-names
additionalProperties: false
"^rcar_sound,ssi$":
description: SSI subnode.
type: object
patternProperties:
"^ssi-[0-9]$":
type: object
properties:
interrupts:
maxItems: 1
dmas:
minItems: 2
maxItems: 4
dma-names:
allOf:
- items:
enum:
- tx
- rx
- txu # if no ssiu node
- rxu # if no ssiu node
shared-pin:
description: shared clock pin
$ref: /schemas/types.yaml#/definitions/flag
pio-transfer:
description: PIO transfer mode
$ref: /schemas/types.yaml#/definitions/flag
no-busif:
description: BUSIF is not used when [mem -> SSI] via DMA case
$ref: /schemas/types.yaml#/definitions/flag
required:
- interrupts
- dmas
- dma-names
additionalProperties: false
# For DAI base
"^rcar_sound,dai$":
description: DAI subnode.
type: object
patternProperties:
"^dai([0-9]+)?$":
type: object
properties:
playback:
$ref: /schemas/types.yaml#/definitions/phandle-array
capture:
$ref: /schemas/types.yaml#/definitions/phandle-array
anyOf:
- required:
- playback
- required:
- capture
additionalProperties: false
required:
- compatible
- reg
- reg-names
- clocks
- clock-names
- "#sound-dai-cells"
allOf:
- $ref: audio-graph.yaml#
- $ref: audio-graph-port.yaml#
- if:
properties:
compatible:
contains:
const: renesas,rcar_sound-gen1
then:
properties:
reg:
maxItems: 3
reg-names:
maxItems: 3
items:
enum:
- scu
- ssi
- adg
else:
properties:
reg:
maxItems: 5
reg-names:
maxItems: 5
items:
enum:
- scu
- adg
- ssiu
- ssi
- audmapp
additionalProperties: false
examples:
- |
rcar_sound: sound@ec500000 {
#sound-dai-cells = <1>;
compatible = "renesas,rcar_sound-r8a7790", "renesas,rcar_sound-gen2";
reg = <0xec500000 0x1000>, /* SCU */
<0xec5a0000 0x100>, /* ADG */
<0xec540000 0x1000>, /* SSIU */
<0xec541000 0x1280>, /* SSI */
<0xec740000 0x200>; /* Audio DMAC peri peri*/
reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
clocks = <&mstp10_clks 1005>, /* SSI-ALL */
<&mstp10_clks 1006>, <&mstp10_clks 1007>, /* SSI9, SSI8 */
<&mstp10_clks 1008>, <&mstp10_clks 1009>, /* SSI7, SSI6 */
<&mstp10_clks 1010>, <&mstp10_clks 1011>, /* SSI5, SSI4 */
<&mstp10_clks 1012>, <&mstp10_clks 1013>, /* SSI3, SSI2 */
<&mstp10_clks 1014>, <&mstp10_clks 1015>, /* SSI1, SSI0 */
<&mstp10_clks 1022>, <&mstp10_clks 1023>, /* SRC9, SRC8 */
<&mstp10_clks 1024>, <&mstp10_clks 1025>, /* SRC7, SRC6 */
<&mstp10_clks 1026>, <&mstp10_clks 1027>, /* SRC5, SRC4 */
<&mstp10_clks 1028>, <&mstp10_clks 1029>, /* SRC3, SRC2 */
<&mstp10_clks 1030>, <&mstp10_clks 1031>, /* SRC1, SRC0 */
<&mstp10_clks 1020>, <&mstp10_clks 1021>, /* MIX1, MIX0 */
<&mstp10_clks 1020>, <&mstp10_clks 1021>, /* CTU1, CTU0 */
<&mstp10_clks 1019>, <&mstp10_clks 1018>, /* DVC0, DVC1 */
<&audio_clk_a>, <&audio_clk_b>, /* CLKA, CLKB */
<&audio_clk_c>, <&audio_clk_i>; /* CLKC, CLKI */
clock-names = "ssi-all",
"ssi.9", "ssi.8",
"ssi.7", "ssi.6",
"ssi.5", "ssi.4",
"ssi.3", "ssi.2",
"ssi.1", "ssi.0",
"src.9", "src.8",
"src.7", "src.6",
"src.5", "src.4",
"src.3", "src.2",
"src.1", "src.0",
"mix.1", "mix.0",
"ctu.1", "ctu.0",
"dvc.0", "dvc.1",
"clk_a", "clk_b",
"clk_c", "clk_i";
rcar_sound,dvc {
dvc0: dvc-0 {
dmas = <&audma0 0xbc>;
dma-names = "tx";
};
dvc1: dvc-1 {
dmas = <&audma0 0xbe>;
dma-names = "tx";
};
};
rcar_sound,mix {
mix0: mix-0 { };
mix1: mix-1 { };
};
rcar_sound,ctu {
ctu00: ctu-0 { };
ctu01: ctu-1 { };
ctu02: ctu-2 { };
ctu03: ctu-3 { };
ctu10: ctu-4 { };
ctu11: ctu-5 { };
ctu12: ctu-6 { };
ctu13: ctu-7 { };
};
rcar_sound,src {
src0: src-0 {
status = "disabled";
};
src1: src-1 {
interrupts = <0 353 0>;
dmas = <&audma0 0x87>, <&audma1 0x9c>;
dma-names = "rx", "tx";
};
/* skip after src-2 */
};
rcar_sound,ssiu {
ssiu00: ssiu-0 {
dmas = <&audma0 0x15>, <&audma1 0x16>;
dma-names = "rx", "tx";
};
ssiu01: ssiu-1 {
dmas = <&audma0 0x35>, <&audma1 0x36>;
dma-names = "rx", "tx";
};
/* skip after ssiu-2 */
};
rcar_sound,ssi {
ssi0: ssi-0 {
interrupts = <0 370 1>;
dmas = <&audma0 0x01>, <&audma1 0x02>;
dma-names = "rx", "tx";
};
ssi1: ssi-1 {
interrupts = <0 371 1>;
dmas = <&audma0 0x03>, <&audma1 0x04>;
dma-names = "rx", "tx";
};
/* skip other ssi-2 */
};
/* DAI base */
rcar_sound,dai {
dai0 {
playback = <&ssi5 &src5>;
capture = <&ssi6>;
};
dai1 {
playback = <&ssi3>;
};
dai2 {
capture = <&ssi4>;
};
dai3 {
playback = <&ssi7>;
};
dai4 {
capture = <&ssi8>;
};
};
/* assume audio-graph */
port {
rsnd_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "left_j";
bitclock-master = <&rsnd_endpoint0>;
frame-master = <&rsnd_endpoint0>;
playback = <&ssi0 &src0 &dvc0>;
capture = <&ssi1 &src1 &dvc1>;
};
};
};
/* assume audio-graph */
codec {
port {
codec_endpoint: endpoint {
remote-endpoint = <&rsnd_endpoint>;
};
};
};

View File

@ -44,6 +44,8 @@ Optional properties:
- realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
the particular DMIC.
- realtek,dmic-clk-driving-high : Set the high drving of the DMIC clock out.
Pins on the device (for linking into audio routes) for RT5682:
* DMIC L1

View File

@ -0,0 +1,41 @@
# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/simple-audio-mux.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Simple Audio Multiplexer
maintainers:
- Alexandre Belloni <aleandre.belloni@bootlin.com>
description: |
Simple audio multiplexers are driven using gpios, allowing to select which of
their input line is connected to the output line.
properties:
compatible:
const: simple-audio-mux
mux-gpios:
description: |
GPIOs used to select the input line.
sound-name-prefix:
$ref: /schemas/types.yaml#/definitions/string
description:
Used as prefix for sink/source names of the component. Must be a
unique string among multiple instances of the same component.
required:
- compatible
- mux-gpios
additionalProperties: false
examples:
- |
mux {
compatible = "simple-audio-mux";
mux-gpios = <&gpio 3 0>;
};

View File

@ -13,13 +13,11 @@ definitions:
frame-master:
description: Indicates dai-link frame master.
$ref: /schemas/types.yaml#/definitions/phandle-array
maxItems: 1
$ref: /schemas/types.yaml#/definitions/phandle
bitclock-master:
description: Indicates dai-link bit clock master
$ref: /schemas/types.yaml#/definitions/phandle-array
maxItems: 1
$ref: /schemas/types.yaml#/definitions/phandle
frame-inversion:
description: dai-link uses frame clock inversion

View File

@ -1,63 +0,0 @@
STMicroelectronics Audio Digital Filter Sigma Delta modulators(DFSDM)
The DFSDM allows PDM microphones capture through SPI interface. The Audio
interface is seems as a sub block of the DFSDM device.
For details on DFSDM bindings refer to ../iio/adc/st,stm32-dfsdm-adc.txt
Required properties:
- compatible: "st,stm32h7-dfsdm-dai".
- #sound-dai-cells : Must be equal to 0
- io-channels : phandle to iio dfsdm instance node.
Example of a sound card using audio DFSDM node.
sound_card {
compatible = "audio-graph-card";
dais = <&cpu_port>;
};
dfsdm: dfsdm@40017000 {
compatible = "st,stm32h7-dfsdm";
reg = <0x40017000 0x400>;
clocks = <&rcc DFSDM1_CK>;
clock-names = "dfsdm";
#interrupt-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
dfsdm_adc0: filter@0 {
compatible = "st,stm32-dfsdm-dmic";
reg = <0>;
interrupts = <110>;
dmas = <&dmamux1 101 0x400 0x00>;
dma-names = "rx";
st,adc-channels = <1>;
st,adc-channel-names = "dmic0";
st,adc-channel-types = "SPI_R";
st,adc-channel-clk-src = "CLKOUT";
st,filter-order = <5>;
dfsdm_dai0: dfsdm-dai {
compatible = "st,stm32h7-dfsdm-dai";
#sound-dai-cells = <0>;
io-channels = <&dfsdm_adc0 0>;
cpu_port: port {
dfsdm_endpoint: endpoint {
remote-endpoint = <&dmic0_endpoint>;
};
};
};
};
dmic0: dmic@0 {
compatible = "dmic-codec";
#sound-dai-cells = <0>;
port {
dmic0_endpoint: endpoint {
remote-endpoint = <&dfsdm_endpoint>;
};
};
};

View File

@ -1,107 +0,0 @@
STMicroelectronics STM32 Serial Audio Interface (SAI).
The SAI interface (Serial Audio Interface) offers a wide set of audio protocols
as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97.
The SAI contains two independent audio sub-blocks. Each sub-block has
its own clock generator and I/O lines controller.
Required properties:
- compatible: Should be "st,stm32f4-sai" or "st,stm32h7-sai"
- reg: Base address and size of SAI common register set.
- clocks: Must contain phandle and clock specifier pairs for each entry
in clock-names.
- clock-names: Must contain "pclk" "x8k" and "x11k"
"pclk": Clock which feeds the peripheral bus interface.
Mandatory for "st,stm32h7-sai" compatible.
Not used for "st,stm32f4-sai" compatible.
"x8k": SAI parent clock for sampling rates multiple of 8kHz.
"x11k": SAI parent clock for sampling rates multiple of 11.025kHz.
- interrupts: cpu DAI interrupt line shared by SAI sub-blocks
Optional properties:
- resets: Reference to a reset controller asserting the SAI
SAI subnodes:
Two subnodes corresponding to SAI sub-block instances A et B can be defined.
Subnode can be omitted for unsused sub-block.
SAI subnodes required properties:
- compatible: Should be "st,stm32-sai-sub-a" or "st,stm32-sai-sub-b"
for SAI sub-block A or B respectively.
- reg: Base address and size of SAI sub-block register set.
- clocks: Must contain one phandle and clock specifier pair
for sai_ck which feeds the internal clock generator.
If the SAI shares a master clock, with another SAI set as MCLK
clock provider, SAI provider phandle must be specified here.
- clock-names: Must contain "sai_ck".
Must also contain "MCLK", if SAI shares a master clock,
with a SAI set as MCLK clock provider.
- dmas: see Documentation/devicetree/bindings/dma/st,stm32-dma.yaml
- dma-names: identifier string for each DMA request line
"tx": if sai sub-block is configured as playback DAI
"rx": if sai sub-block is configured as capture DAI
- pinctrl-names: should contain only value "default"
- pinctrl-0: see Documentation/devicetree/bindings/pinctrl/st,stm32-pinctrl.yaml
SAI subnodes Optional properties:
- st,sync: specify synchronization mode.
By default SAI sub-block is in asynchronous mode.
This property sets SAI sub-block as slave of another SAI sub-block.
Must contain the phandle and index of the sai sub-block providing
the synchronization.
- st,iec60958: support S/PDIF IEC6958 protocol for playback
IEC60958 protocol is not available for capture.
By default, custom protocol is assumed, meaning that protocol is
configured according to protocol defined in related DAI link node,
such as i2s, left justified, right justified, dsp and pdm protocols.
Note: ac97 protocol is not supported by SAI driver
- #clock-cells: should be 0. This property must be present if the SAI device
is a master clock provider, according to clocks bindings, described in
Documentation/devicetree/bindings/clock/clock-bindings.txt.
The device node should contain one 'port' child node with one child 'endpoint'
node, according to the bindings defined in Documentation/devicetree/bindings/
graph.txt.
Example:
sound_card {
compatible = "audio-graph-card";
dais = <&sai1b_port>;
};
sai1: sai1@40015800 {
compatible = "st,stm32h7-sai";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x40015800 0x400>;
reg = <0x40015800 0x4>;
clocks = <&rcc SAI1_CK>, <&rcc PLL1_Q>, <&rcc PLL2_P>;
clock-names = "pclk", "x8k", "x11k";
interrupts = <87>;
sai1a: audio-controller@40015804 {
compatible = "st,stm32-sai-sub-a";
reg = <0x4 0x1C>;
clocks = <&rcc SAI1_CK>;
clock-names = "sai_ck";
dmas = <&dmamux1 1 87 0x400 0x0>;
dma-names = "tx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1a>;
sai1b_port: port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
format = "i2s";
};
};
};
};
audio-codec {
codec_port: port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};

View File

@ -0,0 +1,200 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/st,stm32-sai.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: STMicroelectronics STM32 Serial Audio Interface (SAI)
maintainers:
- Olivier Moysan <olivier.moysan@st.com>
description:
The SAI interface (Serial Audio Interface) offers a wide set of audio
protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97.
The SAI contains two independent audio sub-blocks. Each sub-block has
its own clock generator and I/O lines controller.
properties:
compatible:
enum:
- st,stm32f4-sai
- st,stm32h7-sai
reg:
items:
- description: Base address and size of SAI common register set.
- description: Base address and size of SAI identification register set.
minItems: 1
maxItems: 2
ranges:
maxItems: 1
interrupts:
maxItems: 1
resets:
maxItems: 1
"#address-cells":
const: 1
"#size-cells":
const: 1
clocks:
maxItems: 3
clock-names:
maxItems: 3
required:
- compatible
- reg
- ranges
- "#address-cells"
- "#size-cells"
- clocks
- clock-names
patternProperties:
"^audio-controller@[0-9a-f]+$":
type: object
description:
Two subnodes corresponding to SAI sub-block instances A et B
can be defined. Subnode can be omitted for unsused sub-block.
properties:
compatible:
description: Compatible for SAI sub-block A or B.
pattern: "st,stm32-sai-sub-[ab]"
"#sound-dai-cells":
const: 0
reg:
maxItems: 1
clocks:
items:
- description: sai_ck clock feeding the internal clock generator.
- description: MCLK clock from a SAI set as master clock provider.
minItems: 1
maxItems: 2
clock-names:
items:
- const: sai_ck
- const: MCLK
minItems: 1
maxItems: 2
dmas:
maxItems: 1
dma-names:
description: |
rx: SAI sub-block is configured as a capture DAI.
tx: SAI sub-block is configured as a playback DAI.
enum: [ rx, tx ]
st,sync:
description:
Configure the SAI sub-block as slave of another SAI sub-block.
By default SAI sub-block is in asynchronous mode.
Must contain the phandle and index of the SAI sub-block providing
the synchronization.
allOf:
- $ref: /schemas/types.yaml#definitions/phandle-array
- maxItems: 1
st,iec60958:
description:
If set, support S/PDIF IEC6958 protocol for playback.
IEC60958 protocol is not available for capture.
By default, custom protocol is assumed, meaning that protocol is
configured according to protocol defined in related DAI link node,
such as i2s, left justified, right justified, dsp and pdm protocols.
allOf:
- $ref: /schemas/types.yaml#definitions/flag
"#clock-cells":
description: Configure the SAI device as master clock provider.
const: 0
required:
- compatible
- "#sound-dai-cells"
- reg
- clocks
- clock-names
- dmas
- dma-names
allOf:
- if:
properties:
compatible:
contains:
const: st,stm32f4-sai
- then:
properties:
clocks:
items:
- description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
- description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.
clock-names:
items:
- const: x8k
- const: x11k
- else:
properties:
clocks:
items:
- description: pclk feeds the peripheral bus interface.
- description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
- description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.
clock-names:
items:
- const: pclk
- const: x8k
- const: x11k
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/stm32mp1-clks.h>
#include <dt-bindings/reset/stm32mp1-resets.h>
sai2: sai@4400b000 {
compatible = "st,stm32h7-sai";
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x4400b000 0x400>;
reg = <0x4400b000 0x4>, <0x4400b3f0 0x10>;
clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
clock-names = "pclk", "x8k", "x11k";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;
status = "okay";
sai2a: audio-controller@4400b004 {
#sound-dai-cells = <0>;
compatible = "st,stm32-sai-sub-a";
reg = <0x4 0x1c>;
dmas = <&dmamux1 89 0x400 0x01>;
dma-names = "tx";
clocks = <&rcc SAI2_K>;
clock-names = "sai_ck";
status = "okay";
};
};
...

View File

@ -0,0 +1,234 @@
.. SPDX-License-Identifier: GPL-2.0-only
=============
Auxiliary Bus
=============
In some subsystems, the functionality of the core device (PCI/ACPI/other) is
too complex for a single device to be managed by a monolithic driver
(e.g. Sound Open Firmware), multiple devices might implement a common
intersection of functionality (e.g. NICs + RDMA), or a driver may want to
export an interface for another subsystem to drive (e.g. SIOV Physical Function
export Virtual Function management). A split of the functinoality into child-
devices representing sub-domains of functionality makes it possible to
compartmentalize, layer, and distribute domain-specific concerns via a Linux
device-driver model.
An example for this kind of requirement is the audio subsystem where a single
IP is handling multiple entities such as HDMI, Soundwire, local devices such as
mics/speakers etc. The split for the core's functionality can be arbitrary or
be defined by the DSP firmware topology and include hooks for test/debug. This
allows for the audio core device to be minimal and focused on hardware-specific
control and communication.
Each auxiliary_device represents a part of its parent functionality. The
generic behavior can be extended and specialized as needed by encapsulating an
auxiliary_device within other domain-specific structures and the use of .ops
callbacks. Devices on the auxiliary bus do not share any structures and the use
of a communication channel with the parent is domain-specific.
Note that ops are intended as a way to augment instance behavior within a class
of auxiliary devices, it is not the mechanism for exporting common
infrastructure from the parent. Consider EXPORT_SYMBOL_NS() to convey
infrastructure from the parent module to the auxiliary module(s).
When Should the Auxiliary Bus Be Used
=====================================
The auxiliary bus is to be used when a driver and one or more kernel modules,
who share a common header file with the driver, need a mechanism to connect and
provide access to a shared object allocated by the auxiliary_device's
registering driver. The registering driver for the auxiliary_device(s) and the
kernel module(s) registering auxiliary_drivers can be from the same subsystem,
or from multiple subsystems.
The emphasis here is on a common generic interface that keeps subsystem
customization out of the bus infrastructure.
One example is a PCI network device that is RDMA-capable and exports a child
device to be driven by an auxiliary_driver in the RDMA subsystem. The PCI
driver allocates and registers an auxiliary_device for each physical
function on the NIC. The RDMA driver registers an auxiliary_driver that claims
each of these auxiliary_devices. This conveys data/ops published by the parent
PCI device/driver to the RDMA auxiliary_driver.
Another use case is for the PCI device to be split out into multiple sub
functions. For each sub function an auxiliary_device is created. A PCI sub
function driver binds to such devices that creates its own one or more class
devices. A PCI sub function auxiliary device is likely to be contained in a
struct with additional attributes such as user defined sub function number and
optional attributes such as resources and a link to the parent device. These
attributes could be used by systemd/udev; and hence should be initialized
before a driver binds to an auxiliary_device.
A key requirement for utilizing the auxiliary bus is that there is no
dependency on a physical bus, device, register accesses or regmap support.
These individual devices split from the core cannot live on the platform bus as
they are not physical devices that are controlled by DT/ACPI. The same
argument applies for not using MFD in this scenario as MFD relies on individual
function devices being physical devices.
Auxiliary Device
================
An auxiliary_device represents a part of its parent device's functionality. It
is given a name that, combined with the registering drivers KBUILD_MODNAME,
creates a match_name that is used for driver binding, and an id that combined
with the match_name provide a unique name to register with the bus subsystem.
Registering an auxiliary_device is a two-step process. First call
auxiliary_device_init(), which checks several aspects of the auxiliary_device
struct and performs a device_initialize(). After this step completes, any
error state must have a call to auxiliary_device_uninit() in its resolution path.
The second step in registering an auxiliary_device is to perform a call to
auxiliary_device_add(), which sets the name of the device and add the device to
the bus.
Unregistering an auxiliary_device is also a two-step process to mirror the
register process. First call auxiliary_device_delete(), then call
auxiliary_device_uninit().
.. code-block:: c
struct auxiliary_device {
struct device dev;
const char *name;
u32 id;
};
If two auxiliary_devices both with a match_name "mod.foo" are registered onto
the bus, they must have unique id values (e.g. "x" and "y") so that the
registered devices names are "mod.foo.x" and "mod.foo.y". If match_name + id
are not unique, then the device_add fails and generates an error message.
The auxiliary_device.dev.type.release or auxiliary_device.dev.release must be
populated with a non-NULL pointer to successfully register the auxiliary_device.
The auxiliary_device.dev.parent must also be populated.
Auxiliary Device Memory Model and Lifespan
------------------------------------------
The registering driver is the entity that allocates memory for the
auxiliary_device and register it on the auxiliary bus. It is important to note
that, as opposed to the platform bus, the registering driver is wholly
responsible for the management for the memory used for the driver object.
A parent object, defined in the shared header file, contains the
auxiliary_device. It also contains a pointer to the shared object(s), which
also is defined in the shared header. Both the parent object and the shared
object(s) are allocated by the registering driver. This layout allows the
auxiliary_driver's registering module to perform a container_of() call to go
from the pointer to the auxiliary_device, that is passed during the call to the
auxiliary_driver's probe function, up to the parent object, and then have
access to the shared object(s).
The memory for the auxiliary_device is freed only in its release() callback
flow as defined by its registering driver.
The memory for the shared object(s) must have a lifespan equal to, or greater
than, the lifespan of the memory for the auxiliary_device. The auxiliary_driver
should only consider that this shared object is valid as long as the
auxiliary_device is still registered on the auxiliary bus. It is up to the
registering driver to manage (e.g. free or keep available) the memory for the
shared object beyond the life of the auxiliary_device.
The registering driver must unregister all auxiliary devices before its own
driver.remove() is completed.
Auxiliary Drivers
=================
Auxiliary drivers follow the standard driver model convention, where
discovery/enumeration is handled by the core, and drivers
provide probe() and remove() methods. They support power management
and shutdown notifications using the standard conventions.
.. code-block:: c
struct auxiliary_driver {
int (*probe)(struct auxiliary_device *,
const struct auxiliary_device_id *id);
void (*remove)(struct auxiliary_device *);
void (*shutdown)(struct auxiliary_device *);
int (*suspend)(struct auxiliary_device *, pm_message_t);
int (*resume)(struct auxiliary_device *);
struct device_driver driver;
const struct auxiliary_device_id *id_table;
};
Auxiliary drivers register themselves with the bus by calling
auxiliary_driver_register(). The id_table contains the match_names of auxiliary
devices that a driver can bind with.
Example Usage
=============
Auxiliary devices are created and registered by a subsystem-level core device
that needs to break up its functionality into smaller fragments. One way to
extend the scope of an auxiliary_device is to encapsulate it within a domain-
pecific structure defined by the parent device. This structure contains the
auxiliary_device and any associated shared data/callbacks needed to establish
the connection with the parent.
An example is:
.. code-block:: c
struct foo {
struct auxiliary_device auxdev;
void (*connect)(struct auxiliary_device *auxdev);
void (*disconnect)(struct auxiliary_device *auxdev);
void *data;
};
The parent device then registers the auxiliary_device by calling
auxiliary_device_init(), and then auxiliary_device_add(), with the pointer to
the auxdev member of the above structure. The parent provides a name for the
auxiliary_device that, combined with the parent's KBUILD_MODNAME, creates a
match_name that is be used for matching and binding with a driver.
Whenever an auxiliary_driver is registered, based on the match_name, the
auxiliary_driver's probe() is invoked for the matching devices. The
auxiliary_driver can also be encapsulated inside custom drivers that make the
core device's functionality extensible by adding additional domain-specific ops
as follows:
.. code-block:: c
struct my_ops {
void (*send)(struct auxiliary_device *auxdev);
void (*receive)(struct auxiliary_device *auxdev);
};
struct my_driver {
struct auxiliary_driver auxiliary_drv;
const struct my_ops ops;
};
An example of this type of usage is:
.. code-block:: c
const struct auxiliary_device_id my_auxiliary_id_table[] = {
{ .name = "foo_mod.foo_dev" },
{ },
};
const struct my_ops my_custom_ops = {
.send = my_tx,
.receive = my_rx,
};
const struct my_driver my_drv = {
.auxiliary_drv = {
.name = "myauxiliarydrv",
.id_table = my_auxiliary_id_table,
.probe = my_probe,
.remove = my_remove,
.shutdown = my_shutdown,
},
.ops = my_custom_ops,
};

View File

@ -72,6 +72,7 @@ available subsections can be seen below.
thermal/index
fpga/index
acpi/index
auxiliary_bus
backlight/lp855x-driver.rst
connector
console

View File

@ -1,6 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
menu "Generic Driver Options"
config AUXILIARY_BUS
bool
config UEVENT_HELPER
bool "Support for uevent helper"
help

View File

@ -7,6 +7,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \
attribute_container.o transport_class.o \
topology.o container.o property.o cacheinfo.o \
swnode.o
obj-$(CONFIG_AUXILIARY_BUS) += auxiliary.o
obj-$(CONFIG_DEVTMPFS) += devtmpfs.o
obj-y += power/
obj-$(CONFIG_ISA_BUS_API) += isa.o

274
drivers/base/auxiliary.c Normal file
View File

@ -0,0 +1,274 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2020 Intel Corporation
*
* Please see Documentation/driver-api/auxiliary_bus.rst for more information.
*/
#define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
#include <linux/device.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/string.h>
#include <linux/auxiliary_bus.h>
static const struct auxiliary_device_id *auxiliary_match_id(const struct auxiliary_device_id *id,
const struct auxiliary_device *auxdev)
{
for (; id->name[0]; id++) {
const char *p = strrchr(dev_name(&auxdev->dev), '.');
int match_size;
if (!p)
continue;
match_size = p - dev_name(&auxdev->dev);
/* use dev_name(&auxdev->dev) prefix before last '.' char to match to */
if (strlen(id->name) == match_size &&
!strncmp(dev_name(&auxdev->dev), id->name, match_size))
return id;
}
return NULL;
}
static int auxiliary_match(struct device *dev, struct device_driver *drv)
{
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv);
return !!auxiliary_match_id(auxdrv->id_table, auxdev);
}
static int auxiliary_uevent(struct device *dev, struct kobj_uevent_env *env)
{
const char *name, *p;
name = dev_name(dev);
p = strrchr(name, '.');
return add_uevent_var(env, "MODALIAS=%s%.*s", AUXILIARY_MODULE_PREFIX,
(int)(p - name), name);
}
static const struct dev_pm_ops auxiliary_dev_pm_ops = {
SET_RUNTIME_PM_OPS(pm_generic_runtime_suspend, pm_generic_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_generic_suspend, pm_generic_resume)
};
static int auxiliary_bus_probe(struct device *dev)
{
struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
int ret;
ret = dev_pm_domain_attach(dev, true);
if (ret) {
dev_warn(dev, "Failed to attach to PM Domain : %d\n", ret);
return ret;
}
ret = auxdrv->probe(auxdev, auxiliary_match_id(auxdrv->id_table, auxdev));
if (ret)
dev_pm_domain_detach(dev, true);
return ret;
}
static int auxiliary_bus_remove(struct device *dev)
{
struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
if (auxdrv->remove)
auxdrv->remove(auxdev);
dev_pm_domain_detach(dev, true);
return 0;
}
static void auxiliary_bus_shutdown(struct device *dev)
{
struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);
if (auxdrv->shutdown)
auxdrv->shutdown(auxdev);
}
static struct bus_type auxiliary_bus_type = {
.name = "auxiliary",
.probe = auxiliary_bus_probe,
.remove = auxiliary_bus_remove,
.shutdown = auxiliary_bus_shutdown,
.match = auxiliary_match,
.uevent = auxiliary_uevent,
.pm = &auxiliary_dev_pm_ops,
};
/**
* auxiliary_device_init - check auxiliary_device and initialize
* @auxdev: auxiliary device struct
*
* This is the first step in the two-step process to register an
* auxiliary_device.
*
* When this function returns an error code, then the device_initialize will
* *not* have been performed, and the caller will be responsible to free any
* memory allocated for the auxiliary_device in the error path directly.
*
* It returns 0 on success. On success, the device_initialize has been
* performed. After this point any error unwinding will need to include a call
* to auxiliary_device_uninit(). In this post-initialize error scenario, a call
* to the device's .release callback will be triggered, and all memory clean-up
* is expected to be handled there.
*/
int auxiliary_device_init(struct auxiliary_device *auxdev)
{
struct device *dev = &auxdev->dev;
if (!dev->parent) {
pr_err("auxiliary_device has a NULL dev->parent\n");
return -EINVAL;
}
if (!auxdev->name) {
pr_err("auxiliary_device has a NULL name\n");
return -EINVAL;
}
dev->bus = &auxiliary_bus_type;
device_initialize(&auxdev->dev);
return 0;
}
EXPORT_SYMBOL_GPL(auxiliary_device_init);
/**
* __auxiliary_device_add - add an auxiliary bus device
* @auxdev: auxiliary bus device to add to the bus
* @modname: name of the parent device's driver module
*
* This is the second step in the two-step process to register an
* auxiliary_device.
*
* This function must be called after a successful call to
* auxiliary_device_init(), which will perform the device_initialize. This
* means that if this returns an error code, then a call to
* auxiliary_device_uninit() must be performed so that the .release callback
* will be triggered to free the memory associated with the auxiliary_device.
*
* The expectation is that users will call the "auxiliary_device_add" macro so
* that the caller's KBUILD_MODNAME is automatically inserted for the modname
* parameter. Only if a user requires a custom name would this version be
* called directly.
*/
int __auxiliary_device_add(struct auxiliary_device *auxdev, const char *modname)
{
struct device *dev = &auxdev->dev;
int ret;
if (!modname) {
dev_err(dev, "auxiliary device modname is NULL\n");
return -EINVAL;
}
ret = dev_set_name(dev, "%s.%s.%d", modname, auxdev->name, auxdev->id);
if (ret) {
dev_err(dev, "auxiliary device dev_set_name failed: %d\n", ret);
return ret;
}
ret = device_add(dev);
if (ret)
dev_err(dev, "adding auxiliary device failed!: %d\n", ret);
return ret;
}
EXPORT_SYMBOL_GPL(__auxiliary_device_add);
/**
* auxiliary_find_device - auxiliary device iterator for locating a particular device.
* @start: Device to begin with
* @data: Data to pass to match function
* @match: Callback function to check device
*
* This function returns a reference to a device that is 'found'
* for later use, as determined by the @match callback.
*
* The callback should return 0 if the device doesn't match and non-zero
* if it does. If the callback returns non-zero, this function will
* return to the caller and not iterate over any more devices.
*/
struct auxiliary_device *auxiliary_find_device(struct device *start,
const void *data,
int (*match)(struct device *dev, const void *data))
{
struct device *dev;
dev = bus_find_device(&auxiliary_bus_type, start, data, match);
if (!dev)
return NULL;
return to_auxiliary_dev(dev);
}
EXPORT_SYMBOL_GPL(auxiliary_find_device);
/**
* __auxiliary_driver_register - register a driver for auxiliary bus devices
* @auxdrv: auxiliary_driver structure
* @owner: owning module/driver
* @modname: KBUILD_MODNAME for parent driver
*/
int __auxiliary_driver_register(struct auxiliary_driver *auxdrv,
struct module *owner, const char *modname)
{
if (WARN_ON(!auxdrv->probe) || WARN_ON(!auxdrv->id_table))
return -EINVAL;
if (auxdrv->name)
auxdrv->driver.name = kasprintf(GFP_KERNEL, "%s.%s", modname,
auxdrv->name);
else
auxdrv->driver.name = kasprintf(GFP_KERNEL, "%s", modname);
if (!auxdrv->driver.name)
return -ENOMEM;
auxdrv->driver.owner = owner;
auxdrv->driver.bus = &auxiliary_bus_type;
auxdrv->driver.mod_name = modname;
return driver_register(&auxdrv->driver);
}
EXPORT_SYMBOL_GPL(__auxiliary_driver_register);
/**
* auxiliary_driver_unregister - unregister a driver
* @auxdrv: auxiliary_driver structure
*/
void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv)
{
driver_unregister(&auxdrv->driver);
kfree(auxdrv->driver.name);
}
EXPORT_SYMBOL_GPL(auxiliary_driver_unregister);
static int __init auxiliary_bus_init(void)
{
return bus_register(&auxiliary_bus_type);
}
static void __exit auxiliary_bus_exit(void)
{
bus_unregister(&auxiliary_bus_type);
}
module_init(auxiliary_bus_init);
module_exit(auxiliary_bus_exit);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Auxiliary Bus");
MODULE_AUTHOR("David Ertman <david.m.ertman@intel.com>");
MODULE_AUTHOR("Kiran Patil <kiran.patil@intel.com>");

View File

@ -4,7 +4,7 @@
# subsystems should select the appropriate symbols.
config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM)
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ || REGMAP_SOUNDWIRE || REGMAP_SOUNDWIRE_MBQ || REGMAP_SCCB || REGMAP_I3C || REGMAP_SPI_AVMM)
select IRQ_DOMAIN if REGMAP_IRQ
bool
@ -46,6 +46,10 @@ config REGMAP_SOUNDWIRE
tristate
depends on SOUNDWIRE
config REGMAP_SOUNDWIRE_MBQ
tristate
depends on SOUNDWIRE
config REGMAP_SCCB
tristate
depends on I2C

View File

@ -15,6 +15,7 @@ obj-$(CONFIG_REGMAP_MMIO) += regmap-mmio.o
obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
obj-$(CONFIG_REGMAP_W1) += regmap-w1.o
obj-$(CONFIG_REGMAP_SOUNDWIRE) += regmap-sdw.o
obj-$(CONFIG_REGMAP_SOUNDWIRE_MBQ) += regmap-sdw-mbq.o
obj-$(CONFIG_REGMAP_SCCB) += regmap-sccb.o
obj-$(CONFIG_REGMAP_I3C) += regmap-i3c.o
obj-$(CONFIG_REGMAP_SPI_AVMM) += regmap-spi-avmm.o

View File

@ -0,0 +1,101 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright(c) 2020 Intel Corporation.
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include "internal.h"
static int regmap_sdw_mbq_write(void *context, unsigned int reg, unsigned int val)
{
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
int ret;
ret = sdw_write(slave, SDW_SDCA_MBQ_CTL(reg), (val >> 8) & 0xff);
if (ret < 0)
return ret;
return sdw_write(slave, reg, val & 0xff);
}
static int regmap_sdw_mbq_read(void *context, unsigned int reg, unsigned int *val)
{
struct device *dev = context;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
int read0;
int read1;
read0 = sdw_read(slave, reg);
if (read0 < 0)
return read0;
read1 = sdw_read(slave, SDW_SDCA_MBQ_CTL(reg));
if (read1 < 0)
return read1;
*val = (read1 << 8) | read0;
return 0;
}
static struct regmap_bus regmap_sdw_mbq = {
.reg_read = regmap_sdw_mbq_read,
.reg_write = regmap_sdw_mbq_write,
.reg_format_endian_default = REGMAP_ENDIAN_LITTLE,
.val_format_endian_default = REGMAP_ENDIAN_LITTLE,
};
static int regmap_sdw_mbq_config_check(const struct regmap_config *config)
{
/* MBQ-based controls are only 16-bits for now */
if (config->val_bits != 16)
return -ENOTSUPP;
/* Registers are 32 bits wide */
if (config->reg_bits != 32)
return -ENOTSUPP;
if (config->pad_bits != 0)
return -ENOTSUPP;
return 0;
}
struct regmap *__regmap_init_sdw_mbq(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name)
{
int ret;
ret = regmap_sdw_mbq_config_check(config);
if (ret)
return ERR_PTR(ret);
return __regmap_init(&sdw->dev, &regmap_sdw_mbq,
&sdw->dev, config, lock_key, lock_name);
}
EXPORT_SYMBOL_GPL(__regmap_init_sdw_mbq);
struct regmap *__devm_regmap_init_sdw_mbq(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name)
{
int ret;
ret = regmap_sdw_mbq_config_check(config);
if (ret)
return ERR_PTR(ret);
return __devm_regmap_init(&sdw->dev, &regmap_sdw_mbq,
&sdw->dev, config, lock_key, lock_name);
}
EXPORT_SYMBOL_GPL(__devm_regmap_init_sdw_mbq);
MODULE_DESCRIPTION("Regmap SoundWire MBQ Module");
MODULE_LICENSE("GPL v2");

View File

@ -1424,6 +1424,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
int port_num, stat, ret, count = 0;
unsigned long port;
bool slave_notify = false;
u8 sdca_cascade = 0;
u8 buf, buf2[2], _buf, _buf2[2];
bool parity_check;
bool parity_quirk;
@ -1453,6 +1454,16 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
goto io_err;
}
if (slave->prop.is_sdca) {
ret = sdw_read(slave, SDW_DP0_INT);
if (ret < 0) {
dev_err(slave->bus->dev,
"SDW_DP0_INT read failed:%d\n", ret);
goto io_err;
}
sdca_cascade = ret & SDW_DP0_SDCA_CASCADE;
}
do {
/*
* Check parity, bus clash and Slave (impl defined)
@ -1489,6 +1500,10 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
clear |= SDW_SCP_INT1_IMPL_DEF;
}
/* the SDCA interrupts are cleared in the codec driver .interrupt_callback() */
if (sdca_cascade)
slave_notify = true;
/* Check port 0 - 3 interrupts */
port = buf & SDW_SCP_INT1_PORT0_3;
@ -1526,6 +1541,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
/* Update the Slave driver */
if (slave_notify && slave->ops &&
slave->ops->interrupt_callback) {
slave_intr.sdca_cascade = sdca_cascade;
slave_intr.control_port = clear;
memcpy(slave_intr.port, &port_status,
sizeof(slave_intr.port));
@ -1563,11 +1579,21 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
goto io_err;
}
if (slave->prop.is_sdca) {
ret = sdw_read(slave, SDW_DP0_INT);
if (ret < 0) {
dev_err(slave->bus->dev,
"SDW_DP0_INT read failed:%d\n", ret);
goto io_err;
}
sdca_cascade = ret & SDW_DP0_SDCA_CASCADE;
}
/* Make sure no interrupts are pending */
buf &= _buf;
buf2[0] &= _buf2[0];
buf2[1] &= _buf2[1];
stat = buf || buf2[0] || buf2[1];
stat = buf || buf2[0] || buf2[1] || sdca_cascade;
/*
* Exit loop if Slave is continuously in ALERT state even

View File

@ -37,6 +37,7 @@ static int field##_attribute_alloc(struct device *dev, \
return -ENOMEM; \
dpn_attr->N = N; \
dpn_attr->dir = dir; \
sysfs_attr_init(&dpn_attr->dev_attr.attr); \
dpn_attr->format_string = format_string; \
dpn_attr->dev_attr.attr.name = __stringify(field); \
dpn_attr->dev_attr.attr.mode = 0444; \

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __DT_BINDINGS_ADI_ADAU1977_H__
#define __DT_BINDINGS_ADI_ADAU1977_H__
#define ADAU1977_MICBIAS_5V0 0x0
#define ADAU1977_MICBIAS_5V5 0x1
#define ADAU1977_MICBIAS_6V0 0x2
#define ADAU1977_MICBIAS_6V5 0x3
#define ADAU1977_MICBIAS_7V0 0x4
#define ADAU1977_MICBIAS_7V5 0x5
#define ADAU1977_MICBIAS_8V0 0x6
#define ADAU1977_MICBIAS_8V5 0x7
#define ADAU1977_MICBIAS_9V0 0x8
#endif /* __DT_BINDINGS_ADI_ADAU1977_H__ */

View File

@ -0,0 +1,77 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2019-2020 Intel Corporation
*
* Please see Documentation/driver-api/auxiliary_bus.rst for more information.
*/
#ifndef _AUXILIARY_BUS_H_
#define _AUXILIARY_BUS_H_
#include <linux/device.h>
#include <linux/mod_devicetable.h>
struct auxiliary_device {
struct device dev;
const char *name;
u32 id;
};
struct auxiliary_driver {
int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id);
void (*remove)(struct auxiliary_device *auxdev);
void (*shutdown)(struct auxiliary_device *auxdev);
int (*suspend)(struct auxiliary_device *auxdev, pm_message_t state);
int (*resume)(struct auxiliary_device *auxdev);
const char *name;
struct device_driver driver;
const struct auxiliary_device_id *id_table;
};
static inline struct auxiliary_device *to_auxiliary_dev(struct device *dev)
{
return container_of(dev, struct auxiliary_device, dev);
}
static inline struct auxiliary_driver *to_auxiliary_drv(struct device_driver *drv)
{
return container_of(drv, struct auxiliary_driver, driver);
}
int auxiliary_device_init(struct auxiliary_device *auxdev);
int __auxiliary_device_add(struct auxiliary_device *auxdev, const char *modname);
#define auxiliary_device_add(auxdev) __auxiliary_device_add(auxdev, KBUILD_MODNAME)
static inline void auxiliary_device_uninit(struct auxiliary_device *auxdev)
{
put_device(&auxdev->dev);
}
static inline void auxiliary_device_delete(struct auxiliary_device *auxdev)
{
device_del(&auxdev->dev);
}
int __auxiliary_driver_register(struct auxiliary_driver *auxdrv, struct module *owner,
const char *modname);
#define auxiliary_driver_register(auxdrv) \
__auxiliary_driver_register(auxdrv, THIS_MODULE, KBUILD_MODNAME)
void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv);
/**
* module_auxiliary_driver() - Helper macro for registering an auxiliary driver
* @__auxiliary_driver: auxiliary driver struct
*
* Helper macro for auxiliary drivers which do not do anything special in
* module init/exit. This eliminates a lot of boilerplate. Each module may only
* use this macro once, and calling it replaces module_init() and module_exit()
*/
#define module_auxiliary_driver(__auxiliary_driver) \
module_driver(__auxiliary_driver, auxiliary_driver_register, auxiliary_driver_unregister)
struct auxiliary_device *auxiliary_find_device(struct device *start,
const void *data,
int (*match)(struct device *dev, const void *data));
#endif /* _AUXILIARY_BUS_H_ */

View File

@ -838,4 +838,12 @@ struct mhi_device_id {
kernel_ulong_t driver_data;
};
#define AUXILIARY_NAME_SIZE 32
#define AUXILIARY_MODULE_PREFIX "auxiliary:"
struct auxiliary_device_id {
char name[AUXILIARY_NAME_SIZE];
kernel_ulong_t driver_data;
};
#endif /* LINUX_MOD_DEVICETABLE_H */

View File

@ -1,44 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* ADAU1977/ADAU1978/ADAU1979 driver
*
* Copyright 2014 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#ifndef __LINUX_PLATFORM_DATA_ADAU1977_H__
#define __LINUX_PLATFORM_DATA_ADAU1977_H__
/**
* enum adau1977_micbias - ADAU1977 MICBIAS pin voltage setting
* @ADAU1977_MICBIAS_5V0: MICBIAS is set to 5.0 V
* @ADAU1977_MICBIAS_5V5: MICBIAS is set to 5.5 V
* @ADAU1977_MICBIAS_6V0: MICBIAS is set to 6.0 V
* @ADAU1977_MICBIAS_6V5: MICBIAS is set to 6.5 V
* @ADAU1977_MICBIAS_7V0: MICBIAS is set to 7.0 V
* @ADAU1977_MICBIAS_7V5: MICBIAS is set to 7.5 V
* @ADAU1977_MICBIAS_8V0: MICBIAS is set to 8.0 V
* @ADAU1977_MICBIAS_8V5: MICBIAS is set to 8.5 V
* @ADAU1977_MICBIAS_9V0: MICBIAS is set to 9.0 V
*/
enum adau1977_micbias {
ADAU1977_MICBIAS_5V0 = 0x0,
ADAU1977_MICBIAS_5V5 = 0x1,
ADAU1977_MICBIAS_6V0 = 0x2,
ADAU1977_MICBIAS_6V5 = 0x3,
ADAU1977_MICBIAS_7V0 = 0x4,
ADAU1977_MICBIAS_7V5 = 0x5,
ADAU1977_MICBIAS_8V0 = 0x6,
ADAU1977_MICBIAS_8V5 = 0x7,
ADAU1977_MICBIAS_9V0 = 0x8,
};
/**
* struct adau1977_platform_data - Platform configuration data for the ADAU1977
* @micbias: Specifies the voltage for the MICBIAS pin
*/
struct adau1977_platform_data {
enum adau1977_micbias micbias;
};
#endif

View File

@ -570,6 +570,10 @@ struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name);
struct regmap *__regmap_init_sdw_mbq(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name);
struct regmap *__regmap_init_spi_avmm(struct spi_device *spi,
const struct regmap_config *config,
struct lock_class_key *lock_key,
@ -619,6 +623,10 @@ struct regmap *__devm_regmap_init_sdw(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name);
struct regmap *__devm_regmap_init_sdw_mbq(struct sdw_slave *sdw,
const struct regmap_config *config,
struct lock_class_key *lock_key,
const char *lock_name);
struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
const struct regmap_config *config,
struct lock_class_key *lock_key,
@ -817,6 +825,19 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
__regmap_lockdep_wrapper(__regmap_init_sdw, #config, \
sdw, config)
/**
* regmap_init_sdw_mbq() - Initialise register map
*
* @sdw: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer to
* a struct regmap.
*/
#define regmap_init_sdw_mbq(sdw, config) \
__regmap_lockdep_wrapper(__regmap_init_sdw_mbq, #config, \
sdw, config)
/**
* regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
* to AVMM Bus Bridge
@ -989,6 +1010,20 @@ bool regmap_ac97_default_volatile(struct device *dev, unsigned int reg);
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
sdw, config)
/**
* devm_regmap_init_sdw_mbq() - Initialise managed register map
*
* @sdw: Device that will be interacted with
* @config: Configuration for register map
*
* The return value will be an ERR_PTR() on error or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/
#define devm_regmap_init_sdw_mbq(sdw, config) \
__regmap_lockdep_wrapper(__devm_regmap_init_sdw_mbq, #config, \
sdw, config)
/**
* devm_regmap_init_slimbus() - Initialise managed register map
*

View File

@ -359,6 +359,7 @@ struct sdw_dpn_prop {
* @sink_dpn_prop: Sink Data Port N properties
* @scp_int1_mask: SCP_INT1_MASK desired settings
* @quirks: bitmask identifying deltas from the MIPI specification
* @is_sdca: the Slave supports the SDCA specification
*/
struct sdw_slave_prop {
u32 mipi_revision;
@ -382,6 +383,7 @@ struct sdw_slave_prop {
struct sdw_dpn_prop *sink_dpn_prop;
u8 scp_int1_mask;
u32 quirks;
bool is_sdca;
};
#define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)
@ -479,10 +481,12 @@ struct sdw_slave_id {
/**
* struct sdw_slave_intr_status - Slave interrupt status
* @sdca_cascade: set if the Slave device reports an SDCA interrupt
* @control_port: control port status
* @port: data port status
*/
struct sdw_slave_intr_status {
bool sdca_cascade;
u8 control_port;
u8 port[15];
};

View File

@ -298,4 +298,36 @@
#define SDW_CASC_PORT_MASK_INTSTAT3 1
#define SDW_CASC_PORT_REG_OFFSET_INTSTAT3 2
/*
* v1.2 device - SDCA address mapping
*
* Spec definition
* Bits Contents
* 31 0 (required by addressing range)
* 30:26 0b10000 (Control Prefix)
* 25 0 (Reserved)
* 24:22 Function Number [2:0]
* 21 Entity[6]
* 20:19 Control Selector[5:4]
* 18 0 (Reserved)
* 17:15 Control Number[5:3]
* 14 Next
* 13 MBQ
* 12:7 Entity[5:0]
* 6:3 Control Selector[3:0]
* 2:0 Control Number[2:0]
*/
#define SDW_SDCA_CTL(fun, ent, ctl, ch) (BIT(30) | \
(((fun) & 0x7) << 22) | \
(((ent) & 0x40) << 15) | \
(((ent) & 0x3f) << 7) | \
(((ctl) & 0x30) << 15) | \
(((ctl) & 0x0f) << 3) | \
(((ch) & 0x38) << 12) | \
((ch) & 0x07))
#define SDW_SDCA_MBQ_CTL(reg) ((reg) | BIT(13))
#define SDW_SDCA_NEXT_CTL(reg) ((reg) | BIT(14))
#endif /* __SDW_REGISTERS_H */

View File

@ -0,0 +1,16 @@
/* SPDX-License-Identifier: GPL-2.0
*
* ASoC audio graph card support
*
*/
#ifndef __GRAPH_CARD_H
#define __GRAPH_CARD_H
#include <sound/simple_card_utils.h>
int graph_card_probe(struct snd_soc_card *card);
int graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
#endif /* __GRAPH_CARD_H */

View File

@ -21,6 +21,7 @@ enum {
#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG)
int snd_intel_dsp_driver_probe(struct pci_dev *pci);
int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN]);
#else
@ -29,6 +30,12 @@ static inline int snd_intel_dsp_driver_probe(struct pci_dev *pci)
return SND_INTEL_DSP_DRIVER_ANY;
}
static inline
int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN])
{
return SND_INTEL_DSP_DRIVER_ANY;
}
#endif
#endif

View File

@ -40,6 +40,7 @@ struct rt5682_platform_data {
unsigned int btndet_delay;
unsigned int dmic_clk_rate;
unsigned int dmic_delay;
bool dmic_clk_driving_high;
const char *dai_clk_names[RT5682_DAI_NUM_CLKS];
};

View File

@ -56,6 +56,9 @@ struct asoc_simple_priv {
struct asoc_simple_dai *dais;
struct snd_soc_codec_conf *codec_conf;
struct gpio_desc *pa_gpio;
const struct snd_soc_ops *ops;
unsigned int dpcm_selectable:1;
unsigned int force_dpcm:1;
};
#define simple_priv_to_card(priv) (&(priv)->snd_card)
#define simple_priv_to_props(priv, i) ((priv)->dai_props + (i))

View File

@ -29,12 +29,14 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_jsl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_sdw_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cfl_sdw_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cml_sdw_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_sdw_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[];
/*
* generic table used for HDA codec-based platforms, possibly with

View File

@ -171,4 +171,10 @@ struct snd_soc_acpi_codecs {
u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN];
};
static inline bool snd_soc_acpi_sof_parent(struct device *dev)
{
return dev->parent && dev->parent->driver && dev->parent->driver->name &&
!strcmp(dev->parent->driver->name, "sof-audio-acpi");
}
#endif

View File

@ -220,6 +220,9 @@ struct snd_soc_component {
/* function mark */
struct snd_pcm_substream *mark_module;
struct snd_pcm_substream *mark_open;
struct snd_pcm_substream *mark_hw_params;
struct snd_pcm_substream *mark_trigger;
struct snd_compr_stream *mark_compr_open;
void *mark_pm;
#ifdef CONFIG_DEBUG_FS
@ -443,6 +446,27 @@ int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
struct of_phandle_args *args,
const char **dai_name);
int snd_soc_component_compr_open(struct snd_compr_stream *cstream);
void snd_soc_component_compr_free(struct snd_compr_stream *cstream,
int rollback);
int snd_soc_component_compr_trigger(struct snd_compr_stream *cstream, int cmd);
int snd_soc_component_compr_set_params(struct snd_compr_stream *cstream,
struct snd_compr_params *params);
int snd_soc_component_compr_get_params(struct snd_compr_stream *cstream,
struct snd_codec *params);
int snd_soc_component_compr_get_caps(struct snd_compr_stream *cstream,
struct snd_compr_caps *caps);
int snd_soc_component_compr_get_codec_caps(struct snd_compr_stream *cstream,
struct snd_compr_codec_caps *codec);
int snd_soc_component_compr_ack(struct snd_compr_stream *cstream, size_t bytes);
int snd_soc_component_compr_pointer(struct snd_compr_stream *cstream,
struct snd_compr_tstamp *tstamp);
int snd_soc_component_compr_copy(struct snd_compr_stream *cstream,
char __user *buf, size_t count);
int snd_soc_component_compr_set_metadata(struct snd_compr_stream *cstream,
struct snd_compr_metadata *metadata);
int snd_soc_component_compr_get_metadata(struct snd_compr_stream *cstream,
struct snd_compr_metadata *metadata);
int snd_soc_pcm_component_pointer(struct snd_pcm_substream *substream);
int snd_soc_pcm_component_ioctl(struct snd_pcm_substream *substream,
@ -459,12 +483,11 @@ int snd_soc_pcm_component_new(struct snd_soc_pcm_runtime *rtd);
void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd);
int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream);
int snd_soc_pcm_component_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_component **last);
struct snd_pcm_hw_params *params);
void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_component *last);
int rollback);
int snd_soc_pcm_component_trigger(struct snd_pcm_substream *substream,
int cmd);
int cmd, int rollback);
int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
void *stream);
void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,

View File

@ -72,21 +72,29 @@ struct snd_compr_stream;
#define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
/*
* DAI hardware clock masters.
* DAI hardware clock providers/consumers
*
* This is wrt the codec, the inverse is true for the interface
* i.e. if the codec is clk and FRM master then the interface is
* clk and frame secondary.
* i.e. if the codec is clk and FRM provider then the interface is
* clk and frame consumer.
*/
#define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */
#define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk secondary & FRM master */
#define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame secondary */
#define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM secondary */
#define SND_SOC_DAIFMT_CBP_CFP (1 << 12) /* codec clk provider & frame provider */
#define SND_SOC_DAIFMT_CBC_CFP (2 << 12) /* codec clk consumer & frame provider */
#define SND_SOC_DAIFMT_CBP_CFC (3 << 12) /* codec clk provider & frame consumer */
#define SND_SOC_DAIFMT_CBC_CFC (4 << 12) /* codec clk consumer & frame follower */
#define SND_SOC_DAIFMT_FORMAT_MASK 0x000f
#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
#define SND_SOC_DAIFMT_INV_MASK 0x0f00
#define SND_SOC_DAIFMT_MASTER_MASK 0xf000
/* previous definitions kept for backwards-compatibility, do not use in new contributions */
#define SND_SOC_DAIFMT_CBM_CFM SND_SOC_DAIFMT_CBP_CFP
#define SND_SOC_DAIFMT_CBS_CFM SND_SOC_DAIFMT_CBC_CFP
#define SND_SOC_DAIFMT_CBM_CFS SND_SOC_DAIFMT_CBP_CFC
#define SND_SOC_DAIFMT_CBS_CFS SND_SOC_DAIFMT_CBC_CFC
#define SND_SOC_DAIFMT_FORMAT_MASK 0x000f
#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
#define SND_SOC_DAIFMT_INV_MASK 0x0f00
#define SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK 0xf000
#define SND_SOC_DAIFMT_MASTER_MASK SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK
/*
* Master Clock Directions
@ -149,7 +157,8 @@ int snd_soc_dai_hw_params(struct snd_soc_dai *dai,
struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
void snd_soc_dai_hw_free(struct snd_soc_dai *dai,
struct snd_pcm_substream *substream);
struct snd_pcm_substream *substream,
int rollback);
int snd_soc_dai_startup(struct snd_soc_dai *dai,
struct snd_pcm_substream *substream);
void snd_soc_dai_shutdown(struct snd_soc_dai *dai,
@ -180,14 +189,16 @@ int snd_soc_pcm_dai_probe(struct snd_soc_pcm_runtime *rtd, int order);
int snd_soc_pcm_dai_remove(struct snd_soc_pcm_runtime *rtd, int order);
int snd_soc_pcm_dai_new(struct snd_soc_pcm_runtime *rtd);
int snd_soc_pcm_dai_prepare(struct snd_pcm_substream *substream);
int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd);
int snd_soc_pcm_dai_trigger(struct snd_pcm_substream *substream, int cmd,
int rollback);
int snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream,
int cmd);
int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream);
void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream);
struct snd_compr_stream *cstream,
int rollback);
int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai,
struct snd_compr_stream *cstream, int cmd);
int snd_soc_dai_compr_set_params(struct snd_soc_dai *dai,
@ -390,6 +401,9 @@ struct snd_soc_dai {
/* function mark */
struct snd_pcm_substream *mark_startup;
struct snd_pcm_substream *mark_hw_params;
struct snd_pcm_substream *mark_trigger;
struct snd_compr_stream *mark_compr_startup;
/* bit field */
unsigned int probed:1;

132
include/sound/soc-jack.h Normal file
View File

@ -0,0 +1,132 @@
/* SPDX-License-Identifier: GPL-2.0
*
* soc-jack.h
*
* Copyright (C) 2019 Renesas Electronics Corp.
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#ifndef __SOC_JACK_H
#define __SOC_JACK_H
/**
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
*
* @pin: name of the pin to update
* @mask: bits to check for in reported jack status
* @invert: if non-zero then pin is enabled when status is not reported
* @list: internal list entry
*/
struct snd_soc_jack_pin {
struct list_head list;
const char *pin;
int mask;
bool invert;
};
/**
* struct snd_soc_jack_zone - Describes voltage zones of jack detection
*
* @min_mv: start voltage in mv
* @max_mv: end voltage in mv
* @jack_type: type of jack that is expected for this voltage
* @debounce_time: debounce_time for jack, codec driver should wait for this
* duration before reading the adc for voltages
* @list: internal list entry
*/
struct snd_soc_jack_zone {
unsigned int min_mv;
unsigned int max_mv;
unsigned int jack_type;
unsigned int debounce_time;
struct list_head list;
};
/**
* struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
*
* @gpio: legacy gpio number
* @idx: gpio descriptor index within the function of the GPIO
* consumer device
* @gpiod_dev: GPIO consumer device
* @name: gpio name. Also as connection ID for the GPIO consumer
* device function name lookup
* @report: value to report when jack detected
* @invert: report presence in low state
* @debounce_time: debounce time in ms
* @wake: enable as wake source
* @jack_status_check: callback function which overrides the detection
* to provide more complex checks (eg, reading an
* ADC).
*/
struct snd_soc_jack_gpio {
unsigned int gpio;
unsigned int idx;
struct device *gpiod_dev;
const char *name;
int report;
int invert;
int debounce_time;
bool wake;
/* private: */
struct snd_soc_jack *jack;
struct delayed_work work;
struct notifier_block pm_notifier;
struct gpio_desc *desc;
void *data;
/* public: */
int (*jack_status_check)(void *data);
};
struct snd_soc_jack {
struct mutex mutex;
struct snd_jack *jack;
struct snd_soc_card *card;
struct list_head pins;
int status;
struct blocking_notifier_head notifier;
struct list_head jack_zones;
};
/* Jack reporting */
void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_pin *pins);
void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
struct notifier_block *nb);
void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
struct notifier_block *nb);
int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_zone *zones);
int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
#ifdef CONFIG_GPIOLIB
int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
struct snd_soc_jack *jack,
int count, struct snd_soc_jack_gpio *gpios);
void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
#else
static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
return 0;
}
static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
struct snd_soc_jack *jack,
int count,
struct snd_soc_jack_gpio *gpios)
{
return 0;
}
static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
}
#endif
#endif /* __SOC_JACK_H */

View File

@ -19,11 +19,14 @@ void snd_soc_link_shutdown(struct snd_pcm_substream *substream,
int snd_soc_link_prepare(struct snd_pcm_substream *substream);
int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params);
void snd_soc_link_hw_free(struct snd_pcm_substream *substream);
int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd);
void snd_soc_link_hw_free(struct snd_pcm_substream *substream,
int rollback);
int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd,
int rollback);
int snd_soc_link_compr_startup(struct snd_compr_stream *cstream);
void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream);
void snd_soc_link_compr_shutdown(struct snd_compr_stream *cstream,
int rollback);
int snd_soc_link_compr_set_params(struct snd_compr_stream *cstream);
#endif /* __SOC_LINK_H */

View File

@ -31,9 +31,6 @@ struct snd_soc_dai_driver;
struct snd_soc_dai;
struct snd_soc_dapm_route;
/* object scan be loaded and unloaded in groups with identfying indexes */
#define SND_SOC_TPLG_INDEX_ALL 0 /* ID that matches all FW objects */
/* dynamic object type */
enum snd_soc_dobj_type {
SND_SOC_DOBJ_NONE = 0, /* object is not dynamic */
@ -181,14 +178,8 @@ static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr)
/* Dynamic Object loading and removal for component drivers */
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
struct snd_soc_tplg_ops *ops, const struct firmware *fw,
u32 index);
int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index);
/* Widget removal - widgets also removed wth component API */
void snd_soc_tplg_widget_remove(struct snd_soc_dapm_widget *w);
void snd_soc_tplg_widget_remove_all(struct snd_soc_dapm_context *dapm,
u32 index);
struct snd_soc_tplg_ops *ops, const struct firmware *fw);
int snd_soc_tplg_component_remove(struct snd_soc_component *comp);
/* Binds event handlers to dynamic widgets */
int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,

View File

@ -490,46 +490,6 @@ int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
const struct snd_pcm_hardware *hw);
/* Jack reporting */
void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_pin *pins);
void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
struct notifier_block *nb);
void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
struct notifier_block *nb);
int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_zone *zones);
int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
#ifdef CONFIG_GPIOLIB
int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
struct snd_soc_jack *jack,
int count, struct snd_soc_jack_gpio *gpios);
void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios);
#else
static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
return 0;
}
static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
struct snd_soc_jack *jack,
int count,
struct snd_soc_jack_gpio *gpios)
{
return 0;
}
static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
struct snd_soc_jack_gpio *gpios)
{
}
#endif
struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component);
struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
unsigned int id, unsigned int id_mask);
@ -616,87 +576,6 @@ int snd_soc_get_strobe(struct snd_kcontrol *kcontrol,
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
/**
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
*
* @pin: name of the pin to update
* @mask: bits to check for in reported jack status
* @invert: if non-zero then pin is enabled when status is not reported
* @list: internal list entry
*/
struct snd_soc_jack_pin {
struct list_head list;
const char *pin;
int mask;
bool invert;
};
/**
* struct snd_soc_jack_zone - Describes voltage zones of jack detection
*
* @min_mv: start voltage in mv
* @max_mv: end voltage in mv
* @jack_type: type of jack that is expected for this voltage
* @debounce_time: debounce_time for jack, codec driver should wait for this
* duration before reading the adc for voltages
* @list: internal list entry
*/
struct snd_soc_jack_zone {
unsigned int min_mv;
unsigned int max_mv;
unsigned int jack_type;
unsigned int debounce_time;
struct list_head list;
};
/**
* struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
*
* @gpio: legacy gpio number
* @idx: gpio descriptor index within the function of the GPIO
* consumer device
* @gpiod_dev: GPIO consumer device
* @name: gpio name. Also as connection ID for the GPIO consumer
* device function name lookup
* @report: value to report when jack detected
* @invert: report presence in low state
* @debounce_time: debounce time in ms
* @wake: enable as wake source
* @jack_status_check: callback function which overrides the detection
* to provide more complex checks (eg, reading an
* ADC).
*/
struct snd_soc_jack_gpio {
unsigned int gpio;
unsigned int idx;
struct device *gpiod_dev;
const char *name;
int report;
int invert;
int debounce_time;
bool wake;
/* private: */
struct snd_soc_jack *jack;
struct delayed_work work;
struct notifier_block pm_notifier;
struct gpio_desc *desc;
void *data;
/* public: */
int (*jack_status_check)(void *data);
};
struct snd_soc_jack {
struct mutex mutex;
struct snd_jack *jack;
struct snd_soc_card *card;
struct list_head pins;
int status;
struct blocking_notifier_head notifier;
struct list_head jack_zones;
};
/* SoC PCM stream information */
struct snd_soc_pcm_stream {
const char *stream_name;
@ -1084,6 +963,7 @@ struct snd_soc_card {
unsigned int fully_routed:1;
unsigned int disable_route_checks:1;
unsigned int probed:1;
unsigned int component_chaining:1;
void *drvdata;
};
@ -1161,6 +1041,9 @@ struct snd_soc_pcm_runtime {
/* function mark */
struct snd_pcm_substream *mark_startup;
struct snd_pcm_substream *mark_hw_params;
struct snd_pcm_substream *mark_trigger;
struct snd_compr_stream *mark_compr_startup;
/* bit field */
unsigned int pop_wait:1;
@ -1183,21 +1066,15 @@ struct snd_soc_pcm_runtime {
for ((i) = 0; \
((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
(i)++)
#define for_each_rtd_cpu_dais_rollback(rtd, i, dai) \
for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_cpu(rtd, i));)
#define for_each_rtd_codec_dais(rtd, i, dai) \
for ((i) = 0; \
((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
(i)++)
#define for_each_rtd_codec_dais_rollback(rtd, i, dai) \
for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_codec(rtd, i));)
#define for_each_rtd_dais(rtd, i, dai) \
for ((i) = 0; \
((i) < (rtd)->num_cpus + (rtd)->num_codecs) && \
((dai) = (rtd)->dais[i]); \
(i)++)
#define for_each_rtd_dais_rollback(rtd, i, dai) \
for (; (--(i) >= 0) && ((dai) = (rtd)->dais[i]);)
void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
@ -1418,5 +1295,6 @@ static inline void snd_soc_dapm_mutex_unlock(struct snd_soc_dapm_context *dapm)
#include <sound/soc-component.h>
#include <sound/soc-card.h>
#include <sound/soc-jack.h>
#endif

View File

@ -100,6 +100,8 @@ struct sof_dev_desc {
const struct snd_sof_dsp_ops *ops;
};
int sof_nocodec_setup(struct device *dev,
const struct snd_sof_dsp_ops *ops);
int sof_nocodec_setup(struct device *dev, const struct snd_sof_dsp_ops *ops,
int (*pcm_dai_link_fixup)(struct snd_soc_pcm_runtime *rtd,
struct snd_pcm_hw_params *params));
#endif

View File

@ -34,15 +34,21 @@
#define SOF_DAI_FMT_IB_NF (3 << 8) /**< invert BCLK + nor FRM */
#define SOF_DAI_FMT_IB_IF (4 << 8) /**< invert BCLK + FRM */
#define SOF_DAI_FMT_CBM_CFM (0 << 12) /**< codec clk & FRM master */
#define SOF_DAI_FMT_CBS_CFM (2 << 12) /**< codec clk slave & FRM master */
#define SOF_DAI_FMT_CBM_CFS (3 << 12) /**< codec clk master & frame slave */
#define SOF_DAI_FMT_CBS_CFS (4 << 12) /**< codec clk & FRM slave */
#define SOF_DAI_FMT_CBP_CFP (0 << 12) /**< codec bclk provider & frame provider */
#define SOF_DAI_FMT_CBC_CFP (2 << 12) /**< codec bclk consumer & frame provider */
#define SOF_DAI_FMT_CBP_CFC (3 << 12) /**< codec bclk provider & frame consumer */
#define SOF_DAI_FMT_CBC_CFC (4 << 12) /**< codec bclk consumer & frame consumer */
/* keep old definitions for backwards compatibility */
#define SOF_DAI_FMT_CBM_CFM SOF_DAI_FMT_CBP_CFP
#define SOF_DAI_FMT_CBS_CFM SOF_DAI_FMT_CBC_CFP
#define SOF_DAI_FMT_CBM_CFS SOF_DAI_FMT_CBP_CFC
#define SOF_DAI_FMT_CBS_CFS SOF_DAI_FMT_CBC_CFC
#define SOF_DAI_FMT_FORMAT_MASK 0x000f
#define SOF_DAI_FMT_CLOCK_MASK 0x00f0
#define SOF_DAI_FMT_INV_MASK 0x0f00
#define SOF_DAI_FMT_MASTER_MASK 0xf000
#define SOF_DAI_FMT_CLOCK_PROVIDER_MASK 0xf000
/** \brief Types of DAI */
enum sof_ipc_dai_type {

41
include/sound/sof/debug.h Normal file
View File

@ -0,0 +1,41 @@
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* Copyright(c) 2020 Intel Corporation. All rights reserved.
*
* Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
*/
#ifndef __INCLUDE_SOUND_SOF_DEBUG_H__
#define __INCLUDE_SOUND_SOF_DEBUG_H__
#include <sound/sof/header.h>
/** ABI3.18 */
enum sof_ipc_dbg_mem_zone {
SOF_IPC_MEM_ZONE_SYS = 0, /**< System zone */
SOF_IPC_MEM_ZONE_SYS_RUNTIME = 1, /**< System-runtime zone */
SOF_IPC_MEM_ZONE_RUNTIME = 2, /**< Runtime zone */
SOF_IPC_MEM_ZONE_BUFFER = 3, /**< Buffer zone */
};
/** ABI3.18 */
struct sof_ipc_dbg_mem_usage_elem {
uint32_t zone; /**< see sof_ipc_dbg_mem_zone */
uint32_t id; /**< heap index within zone */
uint32_t used; /**< number of bytes used in zone */
uint32_t free; /**< number of bytes free to use within zone */
uint32_t reserved; /**< for future use */
} __packed;
/** ABI3.18 */
struct sof_ipc_dbg_mem_usage {
struct sof_ipc_reply rhdr; /**< generic IPC reply header */
uint32_t reserved[4]; /**< reserved for future use */
uint32_t num_elems; /**< elems[] counter */
struct sof_ipc_dbg_mem_usage_elem elems[]; /**< memory usage information */
} __packed;
#endif

View File

@ -61,6 +61,8 @@ enum sof_ext_man_elem_type {
SOF_EXT_MAN_ELEM_WINDOW = SOF_IPC_EXT_WINDOW,
SOF_EXT_MAN_ELEM_CC_VERSION = SOF_IPC_EXT_CC_INFO,
SOF_EXT_MAN_ELEM_DBG_ABI = SOF_IPC_EXT_USER_ABI_INFO,
SOF_EXT_MAN_ELEM_CONFIG_DATA = 5, /**< ABI3.17 */
SOF_EXT_MAN_ELEM_PLATFORM_CONFIG_DATA = 6,
};
/* extended manifest element header */
@ -99,4 +101,23 @@ struct ext_man_dbg_abi {
struct sof_ipc_user_abi_version dbg_abi;
} __packed;
/* EXT_MAN_ELEM_CONFIG_DATA elements identificators, ABI3.17 */
enum config_elem_type {
SOF_EXT_MAN_CONFIG_EMPTY = 0,
SOF_EXT_MAN_CONFIG_IPC_MSG_SIZE = 1,
SOF_EXT_MAN_CONFIG_MEMORY_USAGE_SCAN = 2, /**< ABI 3.18 */
};
struct sof_config_elem {
uint32_t token;
uint32_t value;
} __packed;
/* firmware configuration information */
struct sof_ext_man_config_data {
struct sof_ext_man_elem_header hdr;
struct sof_config_elem elems[];
} __packed;
#endif /* __SOF_FIRMWARE_EXT_MANIFEST_H__ */

View File

@ -31,12 +31,12 @@
/* Global Message - Generic */
#define SOF_GLB_TYPE_SHIFT 28
#define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT)
#define SOF_GLB_TYPE_MASK (0xfL << SOF_GLB_TYPE_SHIFT)
#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT)
/* Command Message - Generic */
#define SOF_CMD_TYPE_SHIFT 16
#define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT)
#define SOF_CMD_TYPE_MASK (0xfffL << SOF_CMD_TYPE_SHIFT)
#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT)
/* Global Message Types */
@ -49,9 +49,10 @@
#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U)
#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U)
#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U)
#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU)
#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU)
#define SOF_IPC_GLB_TEST_MSG SOF_GLB_TYPE(0xBU)
#define SOF_IPC_GLB_PROBE SOF_GLB_TYPE(0xCU)
#define SOF_IPC_GLB_DEBUG SOF_GLB_TYPE(0xDU)
/*
* DSP Command Message Types
@ -109,7 +110,7 @@
#define SOF_IPC_PROBE_DMA_ADD SOF_CMD_TYPE(0x003)
#define SOF_IPC_PROBE_DMA_INFO SOF_CMD_TYPE(0x004)
#define SOF_IPC_PROBE_DMA_REMOVE SOF_CMD_TYPE(0x005)
#define SOF_IPC_PROBE_POINT_ADD SOF_CMD_TYPE(0x006)
#define SOF_IPC_PROBE_POINT_ADD SOF_CMD_TYPE(0x006)
#define SOF_IPC_PROBE_POINT_INFO SOF_CMD_TYPE(0x007)
#define SOF_IPC_PROBE_POINT_REMOVE SOF_CMD_TYPE(0x008)
@ -117,9 +118,13 @@
#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)
#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002)
#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003)
#define SOF_IPC_TRACE_FILTER_UPDATE SOF_CMD_TYPE(0x004) /**< ABI3.17 */
/* debug */
#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
#define SOF_IPC_DEBUG_MEM_USAGE SOF_CMD_TYPE(0x001)
/* test */
#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
/* Get message component id */
#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff)

View File

@ -43,6 +43,34 @@ struct sof_ipc_dma_trace_posn {
uint32_t messages; /* total trace messages */
} __packed;
/* Values used in sof_ipc_trace_filter_elem: */
/* bits 6..0 */
#define SOF_IPC_TRACE_FILTER_ELEM_SET_LEVEL 0x01 /**< trace level for selected components */
#define SOF_IPC_TRACE_FILTER_ELEM_BY_UUID 0x02 /**< filter by uuid key */
#define SOF_IPC_TRACE_FILTER_ELEM_BY_PIPE 0x03 /**< filter by pipeline */
#define SOF_IPC_TRACE_FILTER_ELEM_BY_COMP 0x04 /**< filter by component id */
/* bit 7 */
#define SOF_IPC_TRACE_FILTER_ELEM_FIN 0x80 /**< mark last filter in set */
/* bits 31..8: Unused */
/** part of sof_ipc_trace_filter, ABI3.17 */
struct sof_ipc_trace_filter_elem {
uint32_t key; /**< SOF_IPC_TRACE_FILTER_ELEM_ {LEVEL, UUID, COMP, PIPE} */
uint32_t value; /**< element value */
} __packed;
/** Runtime tracing filtration data - SOF_IPC_TRACE_FILTER_UPDATE, ABI3.17 */
struct sof_ipc_trace_filter {
struct sof_ipc_cmd_hdr hdr; /**< IPC command header */
uint32_t elem_cnt; /**< number of entries in elems[] array */
uint32_t reserved[8]; /**< reserved for future usage */
/** variable size array with new filtering settings */
struct sof_ipc_trace_filter_elem elems[];
} __packed;
/*
* Commom debug
*/

View File

@ -7,6 +7,7 @@
#include <linux/ktime.h>
#include <linux/tracepoint.h>
#include <sound/jack.h>
#define DAPM_DIRECT "(direct)"
#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")

View File

@ -170,16 +170,22 @@
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
/* DAI topology BCLK parameter
* For the backwards capability, by default codec is bclk master
* For the backwards capability, by default codec is bclk provider
*/
#define SND_SOC_TPLG_BCLK_CM 0 /* codec is bclk master */
#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */
#define SND_SOC_TPLG_BCLK_CP 0 /* codec is bclk provider */
#define SND_SOC_TPLG_BCLK_CC 1 /* codec is bclk consumer */
/* keep previous definitions for compatibility */
#define SND_SOC_TPLG_BCLK_CM SND_SOC_TPLG_BCLK_CP
#define SND_SOC_TPLG_BCLK_CS SND_SOC_TPLG_BCLK_CC
/* DAI topology FSYNC parameter
* For the backwards capability, by default codec is fsync master
* For the backwards capability, by default codec is fsync provider
*/
#define SND_SOC_TPLG_FSYNC_CM 0 /* codec is fsync master */
#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */
#define SND_SOC_TPLG_FSYNC_CP 0 /* codec is fsync provider */
#define SND_SOC_TPLG_FSYNC_CC 1 /* codec is fsync consumer */
/* keep previous definitions for compatibility */
#define SND_SOC_TPLG_FSYNC_CM SND_SOC_TPLG_FSYNC_CP
#define SND_SOC_TPLG_FSYNC_CS SND_SOC_TPLG_FSYNC_CC
/*
* Block Header.
@ -336,8 +342,8 @@ struct snd_soc_tplg_hw_config {
__u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
__u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */
__u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */
__u8 bclk_provider; /* SND_SOC_TPLG_BCLK_ value */
__u8 fsync_provider; /* SND_SOC_TPLG_FSYNC_ value */
__u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
__le16 reserved; /* for 32bit alignment */
__le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */

View File

@ -26,7 +26,7 @@
/* SOF ABI version major, minor and patch numbers */
#define SOF_ABI_MAJOR 3
#define SOF_ABI_MINOR 17
#define SOF_ABI_MINOR 18
#define SOF_ABI_PATCH 0
/* SOF ABI version number. Format within 32bit word is MMmmmppp */

View File

@ -243,5 +243,8 @@ int main(void)
DEVID(mhi_device_id);
DEVID_FIELD(mhi_device_id, chan);
DEVID(auxiliary_device_id);
DEVID_FIELD(auxiliary_device_id, name);
return 0;
}

View File

@ -1364,6 +1364,13 @@ static int do_mhi_entry(const char *filename, void *symval, char *alias)
{
DEF_FIELD_ADDR(symval, mhi_device_id, chan);
sprintf(alias, MHI_DEVICE_MODALIAS_FMT, *chan);
return 1;
}
static int do_auxiliary_entry(const char *filename, void *symval, char *alias)
{
DEF_FIELD_ADDR(symval, auxiliary_device_id, name);
sprintf(alias, AUXILIARY_MODULE_PREFIX "%s", *name);
return 1;
}
@ -1442,6 +1449,7 @@ static const struct devtable devtable[] = {
{"tee", SIZE_tee_client_device_id, do_tee_entry},
{"wmi", SIZE_wmi_device_id, do_wmi_entry},
{"mhi", SIZE_mhi_device_id, do_mhi_entry},
{"auxiliary", SIZE_auxiliary_device_id, do_auxiliary_entry},
};
/* Create MODULE_ALIAS() statements.

View File

@ -29,6 +29,7 @@ MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=lega
struct config_entry {
u32 flags;
u16 device;
u8 acpi_hid[ACPI_ID_LEN];
const struct dmi_system_id *dmi_table;
};
@ -378,6 +379,20 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
if (pci->vendor != 0x8086)
return SND_INTEL_DSP_DRIVER_ANY;
/*
* Legacy devices don't have a PCI-based DSP and use HDaudio
* for HDMI/DP support, ignore kernel parameter
*/
switch (pci->device) {
case 0x160c: /* Broadwell */
case 0x0a0c: /* Haswell */
case 0x0c0c:
case 0x0d0c:
case 0x0f04: /* Baytrail */
case 0x2284: /* Braswell */
return SND_INTEL_DSP_DRIVER_ANY;
}
if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST)
return dsp_driver;
@ -433,6 +448,102 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
}
EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe);
/*
* configuration table
* - the order of similar ACPI ID entries is important!
* - the first successful match will win
*/
static const struct config_entry acpi_config_table[] = {
/* BayTrail */
#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI)
{
.flags = FLAG_SST,
.acpi_hid = "80860F28",
},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
{
.flags = FLAG_SOF,
.acpi_hid = "80860F28",
},
#endif
/* CherryTrail */
#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI)
{
.flags = FLAG_SST,
.acpi_hid = "808622A8",
},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
{
.flags = FLAG_SOF,
.acpi_hid = "808622A8",
},
#endif
/* Broadwell */
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CATPT)
{
.flags = FLAG_SST,
.acpi_hid = "INT3438"
},
#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BROADWELL)
{
.flags = FLAG_SOF,
.acpi_hid = "INT3438"
},
#endif
/* Haswell - not supported by SOF but added for consistency */
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CATPT)
{
.flags = FLAG_SST,
.acpi_hid = "INT33C8"
},
#endif
};
static const struct config_entry *snd_intel_acpi_dsp_find_config(const u8 acpi_hid[ACPI_ID_LEN],
const struct config_entry *table,
u32 len)
{
for (; len > 0; len--, table++) {
if (memcmp(table->acpi_hid, acpi_hid, ACPI_ID_LEN))
continue;
if (table->dmi_table && !dmi_check_system(table->dmi_table))
continue;
return table;
}
return NULL;
}
int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN])
{
const struct config_entry *cfg;
if (dsp_driver > SND_INTEL_DSP_DRIVER_LEGACY && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST)
return dsp_driver;
if (dsp_driver == SND_INTEL_DSP_DRIVER_LEGACY) {
dev_warn(dev, "dsp_driver parameter %d not supported, using automatic detection\n",
SND_INTEL_DSP_DRIVER_LEGACY);
}
/* find the configuration for the specific device */
cfg = snd_intel_acpi_dsp_find_config(acpi_hid, acpi_config_table,
ARRAY_SIZE(acpi_config_table));
if (!cfg)
return SND_INTEL_DSP_DRIVER_ANY;
if (cfg->flags & FLAG_SST)
return SND_INTEL_DSP_DRIVER_SST;
if (cfg->flags & FLAG_SOF)
return SND_INTEL_DSP_DRIVER_SOF;
return SND_INTEL_DSP_DRIVER_SST;
}
EXPORT_SYMBOL_GPL(snd_intel_acpi_dsp_driver_probe);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Intel DSP config driver");
MODULE_IMPORT_NS(SOUNDWIRE_INTEL_INIT);

View File

@ -1,7 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
config SND_SOC_ADI
tristate "Audio support for Analog Devices reference designs"
depends on MICROBLAZE || ARCH_ZYNQ || COMPILE_TEST
help
Audio support for various reference designs by Analog Devices.

View File

@ -73,8 +73,13 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
da7219_dai_wclk = clk_get(component->dev, "da7219-dai-wclk");
da7219_dai_bclk = clk_get(component->dev, "da7219-dai-bclk");
da7219_dai_wclk = devm_clk_get(component->dev, "da7219-dai-wclk");
if (IS_ERR(da7219_dai_wclk))
return PTR_ERR(da7219_dai_wclk);
da7219_dai_bclk = devm_clk_get(component->dev, "da7219-dai-bclk");
if (IS_ERR(da7219_dai_bclk))
return PTR_ERR(da7219_dai_bclk);
ret = snd_soc_card_jack_new(card, "Headset Jack",
SND_JACK_HEADSET | SND_JACK_LINEOUT |

View File

@ -118,6 +118,10 @@ static int snd_acp3x_probe(struct pci_dev *pci,
int ret, i;
u32 addr, val;
/* Raven device detection */
if (pci->revision != 0x00)
return -ENODEV;
if (pci_enable_device(pci)) {
dev_err(&pci->dev, "pci_enable_device failed\n");
return -ENODEV;
@ -231,9 +235,8 @@ static int snd_acp3x_probe(struct pci_dev *pci,
}
break;
default:
dev_err(&pci->dev, "Invalid ACP audio mode : %d\n", val);
ret = -ENODEV;
goto disable_msi;
dev_info(&pci->dev, "ACP audio mode : %d\n", val);
break;
}
pm_runtime_set_autosuspend_delay(&pci->dev, 2000);
pm_runtime_use_autosuspend(&pci->dev);

View File

@ -6,6 +6,7 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/delay.h>
@ -20,14 +21,13 @@ module_param(acp_power_gating, int, 0644);
MODULE_PARM_DESC(acp_power_gating, "Enable acp power gating");
/**
* dmic_acpi_check = -1 - Checks ACPI method to know DMIC hardware status runtime
* = 0 - Skips the DMIC device creation and returns probe failure
* = 1 - Assumes that platform has DMIC support and skips ACPI
* method check
* dmic_acpi_check = -1 - Use ACPI/DMI method to detect the DMIC hardware presence at runtime
* = 0 - Skip the DMIC device creation and return probe failure
* = 1 - Force DMIC support
*/
static int dmic_acpi_check = ACP_DMIC_AUTO;
module_param(dmic_acpi_check, bint, 0644);
MODULE_PARM_DESC(dmic_acpi_check, "checks Dmic hardware runtime");
MODULE_PARM_DESC(dmic_acpi_check, "Digital microphone presence (-1=auto, 0=none, 1=force)");
struct acp_dev_data {
void __iomem *acp_base;
@ -163,6 +163,17 @@ static int rn_acp_deinit(void __iomem *acp_base)
return 0;
}
static const struct dmi_system_id rn_acp_quirk_table[] = {
{
/* Lenovo IdeaPad Flex 5 14ARE05, IdeaPad 5 15ARE05 */
.matches = {
DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "LNVNB161216"),
}
},
{}
};
static int snd_rn_acp_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
@ -172,10 +183,15 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
acpi_handle handle;
acpi_integer dmic_status;
#endif
const struct dmi_system_id *dmi_id;
unsigned int irqflags;
int ret, index;
u32 addr;
/* Renoir device check */
if (pci->revision != 0x01)
return -ENODEV;
if (pci_enable_device(pci)) {
dev_err(&pci->dev, "pci_enable_device failed\n");
return -ENODEV;
@ -224,7 +240,7 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
handle = ACPI_HANDLE(&pci->dev);
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
if (ACPI_FAILURE(ret)) {
ret = -EINVAL;
ret = -ENODEV;
goto de_init;
}
if (!dmic_status) {
@ -232,6 +248,12 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
goto de_init;
}
#endif
dmi_id = dmi_first_match(rn_acp_quirk_table);
if (dmi_id && !dmi_id->driver_data) {
dev_info(&pci->dev, "ACPI settings override using DMI (ACP mic is not present)");
ret = -ENODEV;
goto de_init;
}
}
adata->res = devm_kzalloc(&pci->dev,

View File

@ -148,6 +148,7 @@ config SND_MCHP_SOC_SPDIFTX
config SND_MCHP_SOC_SPDIFRX
tristate "Microchip ASoC driver for boards using S/PDIF RX"
depends on OF && (ARCH_AT91 || COMPILE_TEST)
depends on COMMON_CLK
select SND_SOC_GENERIC_DMAENGINE_PCM
select REGMAP_MMIO
help

View File

@ -563,8 +563,8 @@ static int atmel_i2s_sama5d2_mck_init(struct atmel_i2s_dev *dev,
err = PTR_ERR(muxclk);
if (err == -EPROBE_DEFER)
return -EPROBE_DEFER;
dev_warn(dev->dev,
"failed to get the I2S clock control: %d\n", err);
dev_dbg(dev->dev,
"failed to get the I2S clock control: %d\n", err);
return 0;
}

View File

@ -797,7 +797,7 @@ static bool bcm2835_i2s_volatile_reg(struct device *dev, unsigned int reg)
return true;
default:
return false;
};
}
}
static bool bcm2835_i2s_precious_reg(struct device *dev, unsigned int reg)
@ -807,7 +807,7 @@ static bool bcm2835_i2s_precious_reg(struct device *dev, unsigned int reg)
return true;
default:
return false;
};
}
}
static const struct regmap_config bcm2835_regmap_config = {

View File

@ -23,6 +23,8 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_AD193X_I2C
imply SND_SOC_AD1980
imply SND_SOC_AD73311
imply SND_SOC_ADAU1372_I2C
imply SND_SOC_ADAU1372_SPI
imply SND_SOC_ADAU1373
imply SND_SOC_ADAU1761_I2C
imply SND_SOC_ADAU1761_SPI
@ -130,6 +132,7 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_MT6358
imply SND_SOC_MT6359
imply SND_SOC_MT6660
imply SND_SOC_NAU8315
imply SND_SOC_NAU8540
imply SND_SOC_NAU8810
imply SND_SOC_NAU8822
@ -177,10 +180,12 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_RT700_SDW
imply SND_SOC_RT711_SDW
imply SND_SOC_RT715_SDW
imply SND_SOC_RT715_SDCA_SDW
imply SND_SOC_RT1308_SDW
imply SND_SOC_SGTL5000
imply SND_SOC_SI476X
imply SND_SOC_SIMPLE_AMPLIFIER
imply SND_SOC_SIMPLE_MUX
imply SND_SOC_SIRF_AUDIO_CODEC
imply SND_SOC_SPDIF
imply SND_SOC_SSM2305
@ -363,6 +368,22 @@ config SND_SOC_AD73311
config SND_SOC_ADAU_UTILS
tristate
config SND_SOC_ADAU1372
tristate
select SND_SOC_ADAU_UTILS
config SND_SOC_ADAU1372_I2C
tristate "Analog Devices ADAU1372 CODEC (I2C)"
depends on I2C
select SND_SOC_ADAU1372
select REGMAP_I2C
config SND_SOC_ADAU1372_SPI
tristate "Analog Devices ADAU1372 CODEC (SPI)"
depends on SPI
select SND_SOC_ADAU1372
select REGMAP_SPI
config SND_SOC_ADAU1373
tristate
depends on I2C
@ -517,7 +538,7 @@ config SND_SOC_AK5558
select REGMAP_I2C
config SND_SOC_ALC5623
tristate "Realtek ALC5623 CODEC"
tristate "Realtek ALC5623 CODEC"
depends on I2C
config SND_SOC_ALC5632
@ -728,7 +749,7 @@ config SND_SOC_JZ4770_CODEC
will be called snd-soc-jz4770-codec.
config SND_SOC_L3
tristate
tristate
config SND_SOC_DA7210
tristate
@ -768,10 +789,10 @@ config SND_SOC_HDMI_CODEC
select HDMI
config SND_SOC_ES7134
tristate "Everest Semi ES7134 CODEC"
tristate "Everest Semi ES7134 CODEC"
config SND_SOC_ES7241
tristate "Everest Semi ES7241 CODEC"
tristate "Everest Semi ES7241 CODEC"
config SND_SOC_ES8316
tristate "Everest Semi ES8316 CODEC"
@ -970,10 +991,10 @@ config SND_SOC_PCM186X_SPI
select REGMAP_SPI
config SND_SOC_PCM3008
tristate
tristate
config SND_SOC_PCM3060
tristate
tristate
config SND_SOC_PCM3060_I2C
tristate "Texas Instruments PCM3060 CODEC - I2C"
@ -1003,7 +1024,7 @@ config SND_SOC_PCM3168A_SPI
select REGMAP_SPI
config SND_SOC_PCM5102A
tristate
tristate "Texas Instruments PCM5102A CODEC"
config SND_SOC_PCM512x
tristate
@ -1216,6 +1237,12 @@ config SND_SOC_RT715_SDW
select SND_SOC_RT715
select REGMAP_SOUNDWIRE
config SND_SOC_RT715_SDCA_SDW
tristate "Realtek RT715 SDCA Codec - SDW"
depends on SOUNDWIRE
select REGMAP_SOUNDWIRE
select REGMAP_SOUNDWIRE_MBQ
#Freescale sgtl5000 codec
config SND_SOC_SGTL5000
tristate "Freescale SGTL5000 CODEC"
@ -1240,6 +1267,10 @@ config SND_SOC_SIMPLE_AMPLIFIER
tristate "Simple Audio Amplifier"
select GPIOLIB
config SND_SOC_SIMPLE_MUX
tristate "Simple Audio Mux"
select GPIOLIB
config SND_SOC_SIRF_AUDIO_CODEC
tristate "SiRF SoC internal audio codec"
select REGMAP_MMIO
@ -1436,7 +1467,7 @@ config SND_SOC_UDA1334
rate) and mute.
config SND_SOC_UDA134X
tristate
tristate
config SND_SOC_UDA1380
tristate
@ -1760,9 +1791,13 @@ config SND_SOC_MT6660
Select N if you don't have MT6660 on board.
Select M to build this as module.
config SND_SOC_NAU8315
tristate "Nuvoton Technology Corporation NAU8315 CODEC"
depends on GPIOLIB
config SND_SOC_NAU8540
tristate "Nuvoton Technology Corporation NAU85L40 CODEC"
depends on I2C
tristate "Nuvoton Technology Corporation NAU85L40 CODEC"
depends on I2C
config SND_SOC_NAU8810
tristate "Nuvoton Technology Corporation NAU88C10 CODEC"
@ -1784,4 +1819,12 @@ config SND_SOC_TPA6130A2
tristate "Texas Instruments TPA6130A2 headphone amplifier"
depends on I2C
config SND_SOC_LPASS_WSA_MACRO
depends on COMMON_CLK
tristate "Qualcomm WSA Macro in LPASS(Low Power Audio SubSystem)"
config SND_SOC_LPASS_VA_MACRO
depends on COMMON_CLK
tristate "Qualcomm VA Macro in LPASS(Low Power Audio SubSystem)"
endmenu

View File

@ -9,6 +9,9 @@ snd-soc-ad193x-i2c-objs := ad193x-i2c.o
snd-soc-ad1980-objs := ad1980.o
snd-soc-ad73311-objs := ad73311.o
snd-soc-adau-utils-objs := adau-utils.o
snd-soc-adau1372-objs := adau1372.o
snd-soc-adau1372-i2c-objs := adau1372-i2c.o
snd-soc-adau1372-spi-objs := adau1372-spi.o
snd-soc-adau1373-objs := adau1373.o
snd-soc-adau1701-objs := adau1701.o
snd-soc-adau17x1-objs := adau17x1.o
@ -103,6 +106,8 @@ snd-soc-l3-objs := l3.o
snd-soc-lm4857-objs := lm4857.o
snd-soc-lm49453-objs := lm49453.o
snd-soc-lochnagar-sc-objs := lochnagar-sc.o
snd-soc-lpass-wsa-macro-objs := lpass-wsa-macro.o
snd-soc-lpass-va-macro-objs := lpass-va-macro.o
snd-soc-madera-objs := madera.o
snd-soc-max9759-objs := max9759.o
snd-soc-max9768-objs := max9768.o
@ -129,6 +134,7 @@ snd-soc-mt6351-objs := mt6351.o
snd-soc-mt6358-objs := mt6358.o
snd-soc-mt6359-objs := mt6359.o
snd-soc-mt6660-objs := mt6660.o
snd-soc-nau8315-objs := nau8315.o
snd-soc-nau8540-objs := nau8540.o
snd-soc-nau8810-objs := nau8810.o
snd-soc-nau8822-objs := nau8822.o
@ -188,6 +194,7 @@ snd-soc-rt5682-i2c-objs := rt5682-i2c.o
snd-soc-rt700-objs := rt700.o rt700-sdw.o
snd-soc-rt711-objs := rt711.o rt711-sdw.o
snd-soc-rt715-objs := rt715.o rt715-sdw.o
snd-soc-rt715-sdca-objs := rt715-sdca.o rt715-sdca-sdw.o
snd-soc-sgtl5000-objs := sgtl5000.o
snd-soc-alc5623-objs := alc5623.o
snd-soc-alc5632-objs := alc5632.o
@ -305,6 +312,8 @@ snd-soc-tpa6130a2-objs := tpa6130a2.o
snd-soc-tas2552-objs := tas2552.o
snd-soc-tas2562-objs := tas2562.o
snd-soc-tas2764-objs := tas2764.o
# Mux
snd-soc-simple-mux-objs := simple-mux.o
obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.o
@ -316,6 +325,9 @@ obj-$(CONFIG_SND_SOC_AD193X_I2C) += snd-soc-ad193x-i2c.o
obj-$(CONFIG_SND_SOC_AD1980) += snd-soc-ad1980.o
obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.o
obj-$(CONFIG_SND_SOC_ADAU_UTILS) += snd-soc-adau-utils.o
obj-$(CONFIG_SND_SOC_ADAU1372) += snd-soc-adau1372.o
obj-$(CONFIG_SND_SOC_ADAU1372_I2C) += snd-soc-adau1372-i2c.o
obj-$(CONFIG_SND_SOC_ADAU1372_SPI) += snd-soc-adau1372-spi.o
obj-$(CONFIG_SND_SOC_ADAU1373) += snd-soc-adau1373.o
obj-$(CONFIG_SND_SOC_ADAU1701) += snd-soc-adau1701.o
obj-$(CONFIG_SND_SOC_ADAU17X1) += snd-soc-adau17x1.o
@ -438,6 +450,7 @@ obj-$(CONFIG_SND_SOC_MT6351) += snd-soc-mt6351.o
obj-$(CONFIG_SND_SOC_MT6358) += snd-soc-mt6358.o
obj-$(CONFIG_SND_SOC_MT6359) += snd-soc-mt6359.o
obj-$(CONFIG_SND_SOC_MT6660) += snd-soc-mt6660.o
obj-$(CONFIG_SND_SOC_NAU8315) += snd-soc-nau8315.o
obj-$(CONFIG_SND_SOC_NAU8540) += snd-soc-nau8540.o
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
obj-$(CONFIG_SND_SOC_NAU8822) += snd-soc-nau8822.o
@ -498,6 +511,7 @@ obj-$(CONFIG_SND_SOC_RT5682_SDW) += snd-soc-rt5682-sdw.o
obj-$(CONFIG_SND_SOC_RT700) += snd-soc-rt700.o
obj-$(CONFIG_SND_SOC_RT711) += snd-soc-rt711.o
obj-$(CONFIG_SND_SOC_RT715) += snd-soc-rt715.o
obj-$(CONFIG_SND_SOC_RT715_SDCA_SDW) += snd-soc-rt715-sdca.o
obj-$(CONFIG_SND_SOC_SGTL5000) += snd-soc-sgtl5000.o
obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o
obj-$(CONFIG_SND_SOC_SIGMADSP_I2C) += snd-soc-sigmadsp-i2c.o
@ -613,3 +627,8 @@ obj-$(CONFIG_SND_SOC_MAX9877) += snd-soc-max9877.o
obj-$(CONFIG_SND_SOC_MAX98504) += snd-soc-max98504.o
obj-$(CONFIG_SND_SOC_SIMPLE_AMPLIFIER) += snd-soc-simple-amplifier.o
obj-$(CONFIG_SND_SOC_TPA6130A2) += snd-soc-tpa6130a2.o
obj-$(CONFIG_SND_SOC_LPASS_WSA_MACRO) += snd-soc-lpass-wsa-macro.o
obj-$(CONFIG_SND_SOC_LPASS_VA_MACRO) += snd-soc-lpass-va-macro.o
# Mux
obj-$(CONFIG_SND_SOC_SIMPLE_MUX) += snd-soc-simple-mux.o

View File

@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Driver for ADAU1372 codec
*
* Copyright 2016 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <sound/soc.h>
#include "adau1372.h"
static int adau1372_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
return adau1372_probe(&client->dev,
devm_regmap_init_i2c(client, &adau1372_regmap_config), NULL);
}
static const struct i2c_device_id adau1372_i2c_ids[] = {
{ "adau1372", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
static struct i2c_driver adau1372_i2c_driver = {
.driver = {
.name = "adau1372",
},
.probe = adau1372_i2c_probe,
.id_table = adau1372_i2c_ids,
};
module_i2c_driver(adau1372_i2c_driver);
MODULE_DESCRIPTION("ASoC ADAU1372 CODEC I2C driver");
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_LICENSE("GPL v2");

View File

@ -0,0 +1,58 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Driver for ADAU1372 codec
*
* Copyright 2016 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <sound/soc.h>
#include "adau1372.h"
static void adau1372_spi_switch_mode(struct device *dev)
{
struct spi_device *spi = to_spi_device(dev);
/*
* To get the device into SPI mode CLATCH has to be pulled low three
* times. Do this by issuing three dummy reads.
*/
spi_w8r8(spi, 0x00);
spi_w8r8(spi, 0x00);
spi_w8r8(spi, 0x00);
}
static int adau1372_spi_probe(struct spi_device *spi)
{
struct regmap_config config;
config = adau1372_regmap_config;
config.read_flag_mask = 0x1;
return adau1372_probe(&spi->dev,
devm_regmap_init_spi(spi, &config), adau1372_spi_switch_mode);
}
static const struct spi_device_id adau1372_spi_id[] = {
{ "adau1372", 0 },
{ }
};
MODULE_DEVICE_TABLE(spi, adau1372_spi_id);
static struct spi_driver adau1372_spi_driver = {
.driver = {
.name = "adau1372",
},
.probe = adau1372_spi_probe,
.id_table = adau1372_spi_id,
};
module_spi_driver(adau1372_spi_driver);
MODULE_DESCRIPTION("ASoC ADAU1372 CODEC SPI driver");
MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
MODULE_LICENSE("GPL v2");

1062
sound/soc/codecs/adau1372.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* ADAU1372 driver
*
* Copyright 2016 Analog Devices Inc.
* Author: Lars-Peter Clausen <lars@metafoo.de>
*/
#ifndef SOUND_SOC_CODECS_ADAU1372_H
#define SOUND_SOC_CODECS_ADAU1372_H
#include <linux/regmap.h>
struct device;
int adau1372_probe(struct device *dev, struct regmap *regmap,
void (*switch_mode)(struct device *dev));
extern const struct regmap_config adau1372_regmap_config;
#endif

View File

@ -12,7 +12,6 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_data/adau1977.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
@ -24,6 +23,8 @@
#include <sound/soc.h>
#include <sound/tlv.h>
#include <dt-bindings/sound/adi,adau1977.h>
#include "adau1977.h"
#define ADAU1977_REG_POWER 0x00
@ -881,13 +882,9 @@ static const struct snd_soc_component_driver adau1977_component_driver = {
static int adau1977_setup_micbias(struct adau1977 *adau1977)
{
struct adau1977_platform_data *pdata = adau1977->dev->platform_data;
unsigned int micbias;
if (pdata)
micbias = pdata->micbias;
else if (device_property_read_u32(adau1977->dev, "adi,micbias",
&micbias))
if (device_property_read_u32(adau1977->dev, "adi,micbias", &micbias))
micbias = ADAU1977_MICBIAS_8V5;
if (micbias > ADAU1977_MICBIAS_9V0) {

View File

@ -373,6 +373,7 @@ static int adav80x_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
case SND_SOC_DAIFMT_CBM_CFM:
capture |= ADAV80X_CAPTURE_MODE_MASTER;
playback |= ADAV80X_PLAYBACK_MODE_MASTER;
break;
case SND_SOC_DAIFMT_CBS_CFS:
break;
default:

View File

@ -404,11 +404,13 @@ static int ak4118_i2c_probe(struct i2c_client *i2c,
&soc_component_drv_ak4118, &ak4118_dai, 1);
}
#ifdef CONFIG_OF
static const struct of_device_id ak4118_of_match[] = {
{ .compatible = "asahi-kasei,ak4118", },
{}
};
MODULE_DEVICE_TABLE(of, ak4118_of_match);
#endif
static const struct i2c_device_id ak4118_id_table[] = {
{ "ak4118", 0 },

View File

@ -415,7 +415,7 @@ static int ak5558_i2c_remove(struct i2c_client *i2c)
return 0;
}
static const struct of_device_id ak5558_i2c_dt_ids[] = {
static const struct of_device_id ak5558_i2c_dt_ids[] __maybe_unused = {
{ .compatible = "asahi-kasei,ak5558"},
{ }
};

View File

@ -1068,11 +1068,13 @@ static const struct i2c_device_id alc5623_i2c_table[] = {
};
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
#ifdef CONFIG_OF
static const struct of_device_id alc5623_of_match[] = {
{ .compatible = "realtek,alc5623", },
{ }
};
MODULE_DEVICE_TABLE(of, alc5623_of_match);
#endif
/* i2c codec control layer */
static struct i2c_driver alc5623_i2c_driver = {

View File

@ -1167,11 +1167,13 @@ static const struct i2c_device_id alc5632_i2c_table[] = {
};
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
#ifdef CONFIG_OF
static const struct of_device_id alc5632_of_match[] = {
{ .compatible = "realtek,alc5632", },
{ }
};
MODULE_DEVICE_TABLE(of, alc5632_of_match);
#endif
/* i2c codec control layer */
static struct i2c_driver alc5632_i2c_driver = {

View File

@ -1034,6 +1034,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
priv->out_down_delay++;
break;
}
break;
default:
break;
}

View File

@ -222,7 +222,7 @@ static int bd28623_probe(struct platform_device *pdev)
&soc_dai_bd, 1);
}
static const struct of_device_id bd28623_of_match[] = {
static const struct of_device_id bd28623_of_match[] __maybe_unused = {
{ .compatible = "rohm,bd28623", },
{}
};

View File

@ -332,7 +332,7 @@ static int i2s_rx_event(struct snd_soc_dapm_widget *w,
snd_soc_dapm_to_component(w->dapm);
struct cros_ec_codec_priv *priv =
snd_soc_component_get_drvdata(component);
struct ec_param_ec_codec_i2s_rx p;
struct ec_param_ec_codec_i2s_rx p = {};
switch (event) {
case SND_SOC_DAPM_PRE_PMU:

View File

@ -944,6 +944,7 @@ static int cs42l52_beep_event(struct input_dev *dev, unsigned int type,
case SND_BELL:
if (hz)
hz = 261;
break;
case SND_TONE:
break;
default:

View File

@ -1008,6 +1008,7 @@ static int cs42l56_beep_event(struct input_dev *dev, unsigned int type,
case SND_BELL:
if (hz)
hz = 261;
break;
case SND_TONE:
break;
default:

View File

@ -201,6 +201,7 @@ static int cs47l92_outclk_ev(struct snd_soc_dapm_widget *w,
default:
break;
}
break;
default:
break;
}

View File

@ -1579,7 +1579,7 @@ static struct snd_soc_dai_driver soc_codec_cx2072x_dai[] = {
.id = CX2072X_DAI_DSP,
.probe = cx2072x_dsp_dai_probe,
.playback = {
.stream_name = "Playback",
.stream_name = "DSP Playback",
.channels_min = 2,
.channels_max = 2,
.rates = CX2072X_RATES_DSP,
@ -1591,7 +1591,7 @@ static struct snd_soc_dai_driver soc_codec_cx2072x_dai[] = {
.name = "cx2072x-aec",
.id = 3,
.capture = {
.stream_name = "Capture",
.stream_name = "AEC Capture",
.channels_min = 2,
.channels_max = 2,
.rates = CX2072X_RATES_DSP,

View File

@ -2278,12 +2278,14 @@ static irqreturn_t da7218_irq_thread(int irq, void *data)
* DT
*/
#ifdef CONFIG_OF
static const struct of_device_id da7218_of_match[] = {
{ .compatible = "dlg,da7217", .data = (void *) DA7217_DEV_ID },
{ .compatible = "dlg,da7218", .data = (void *) DA7218_DEV_ID },
{ }
};
MODULE_DEVICE_TABLE(of, da7218_of_match);
#endif
static inline int da7218_of_get_id(struct device *dev)
{

View File

@ -1702,11 +1702,13 @@ static struct snd_soc_dai_driver da7219_dai = {
* DT/ACPI
*/
#ifdef CONFIG_OF
static const struct of_device_id da7219_of_match[] = {
{ .compatible = "dlg,da7219", },
{ }
};
MODULE_DEVICE_TABLE(of, da7219_of_match);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id da7219_acpi_match[] = {

Some files were not shown because too many files have changed in this diff Show More