Merge tag 'sound-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
"Lots of changes (slightly more code increase than usual) at this time,
while most of code changes are ASoC driver-specific.
Here are some highlights:
Core:
- The new auxiliary bus implementation for Intel DSP, which will be
used by other drivers as well
- Lots of ASoC core cleanups and refactoring
- UBSAN and KCSAN fixes in rawmidi, sequencer and a few others
- Compress-offload API enhancement for the pause during draining
HD- and USB-audio:
- Enhancements of the USB-audio implicit feedback support, including
better full-duplex operations
- Continued CA0132 improvements and fixes
- A few new quirk entries, HDMI audio fixes
ASoC:
- Support for boot time selection of Intel DSP firmware, which should
help distros/users testing new stuff more easily; the kconfig was
moved to boot time option, too
- Some basic DPCM support in audio graph card
- Removal of old pre-DT Freescale drivers
- 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"
* tag 'sound-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (445 commits)
ALSA: pcm: oss: Fix potential out-of-bounds shift
ALSA: usb-audio: Fix potential out-of-bounds shift
ALSA: hda/ca0132 - Add ZxR surround DAC setup.
ALSA: hda/ca0132 - Add 8051 PLL write helper functions.
ALSA: hda/hdmi: packet buffer index must be set before reading value
ASoC: SOF: imx: update kernel-doc description
ASoC: mediatek: mt8183: delete some unreachable code
ASoC: mediatek: mt8183: add PM ops to machine drivers
ASoC: topology: Fix wrong size check
ASoC: topology: Add missing size check
ASoC: SOF: Intel: hda: fix the condition passed to sof_dev_dbg_or_err
ASoC: SOF: modify the SOF_DBG flags
ASoC: SOF: Intel: hda: remove duplicated status dump
ASoC: rt1015p: delay 300ms after SDB pulling high for calibration
ASoC: rt1015p: move SDB control from trigger to DAPM
ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
ALSA: usb-audio: Fix control 'access overflow' errors from chmap
ALSA: hda/hdmi: always print pin NIDs as hexadecimal
ALSA: hda/realtek - Add supported for more Lenovo ALC285 Headset Button
ALSA: hda/ca0132 - Remove now unnecessary DSP setup functions.
...
This commit is contained in:
@@ -199,8 +199,6 @@ patternProperties:
|
|||||||
description:
|
description:
|
||||||
From common IIO binding. Used to pipe external sigma delta
|
From common IIO binding. Used to pipe external sigma delta
|
||||||
modulator or internal ADC output to DFSDM channel.
|
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:
|
required:
|
||||||
- io-channels
|
- io-channels
|
||||||
@@ -235,6 +233,10 @@ patternProperties:
|
|||||||
description: child node
|
description: child node
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
|
compatible:
|
||||||
|
enum:
|
||||||
|
- st,stm32h7-dfsdm-dai
|
||||||
|
|
||||||
"#sound-dai-cells":
|
"#sound-dai-cells":
|
||||||
const: 0
|
const: 0
|
||||||
|
|
||||||
@@ -244,6 +246,7 @@ patternProperties:
|
|||||||
modulator or internal ADC output to DFSDM channel.
|
modulator or internal ADC output to DFSDM channel.
|
||||||
|
|
||||||
required:
|
required:
|
||||||
|
- compatible
|
||||||
- "#sound-dai-cells"
|
- "#sound-dai-cells"
|
||||||
- io-channels
|
- io-channels
|
||||||
|
|
||||||
|
|||||||
67
Documentation/devicetree/bindings/sound/adi,adau1372.yaml
Normal file
67
Documentation/devicetree/bindings/sound/adi,adau1372.yaml
Normal 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>;
|
||||||
|
};
|
||||||
|
...
|
||||||
|
|
||||||
@@ -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 = <®ulator>;
|
|
||||||
DVDD-supply = <®ulator_digital>;
|
|
||||||
|
|
||||||
adi,micbias = <3>;
|
|
||||||
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
|
||||||
};
|
|
||||||
|
|
||||||
adau1977_i2c: adau1977@11 {
|
|
||||||
compatible = "adi,adau1977";
|
|
||||||
reg = <0x11>;
|
|
||||||
|
|
||||||
AVDD-supply = <®ulator>;
|
|
||||||
DVDD-supply = <®ulator_digital>;
|
|
||||||
|
|
||||||
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
|
||||||
};
|
|
||||||
92
Documentation/devicetree/bindings/sound/adi,adau1977.yaml
Normal file
92
Documentation/devicetree/bindings/sound/adi,adau1977.yaml
Normal 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 = <®ulator>;
|
||||||
|
DVDD-supply = <®ulator_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 = <®ulator>;
|
||||||
|
DVDD-supply = <®ulator_digital>;
|
||||||
|
|
||||||
|
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -24,6 +24,7 @@ properties:
|
|||||||
- items:
|
- items:
|
||||||
- const: allwinner,sun50i-a64-i2s
|
- const: allwinner,sun50i-a64-i2s
|
||||||
- const: allwinner,sun8i-h3-i2s
|
- const: allwinner,sun8i-h3-i2s
|
||||||
|
- const: allwinner,sun50i-h6-i2s
|
||||||
|
|
||||||
reg:
|
reg:
|
||||||
maxItems: 1
|
maxItems: 1
|
||||||
@@ -59,6 +60,7 @@ allOf:
|
|||||||
- allwinner,sun8i-a83t-i2s
|
- allwinner,sun8i-a83t-i2s
|
||||||
- allwinner,sun8i-h3-i2s
|
- allwinner,sun8i-h3-i2s
|
||||||
- allwinner,sun50i-a64-codec-i2s
|
- allwinner,sun50i-a64-codec-i2s
|
||||||
|
- allwinner,sun50i-h6-i2s
|
||||||
|
|
||||||
then:
|
then:
|
||||||
required:
|
required:
|
||||||
@@ -68,7 +70,9 @@ allOf:
|
|||||||
properties:
|
properties:
|
||||||
compatible:
|
compatible:
|
||||||
contains:
|
contains:
|
||||||
const: allwinner,sun8i-a83t-i2s
|
enum:
|
||||||
|
- allwinner,sun8i-a83t-i2s
|
||||||
|
- allwinner,sun8i-h3-i2s
|
||||||
|
|
||||||
then:
|
then:
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
@@ -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>;
|
|
||||||
...
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -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>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -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
|
||||||
45
Documentation/devicetree/bindings/sound/audio-graph.yaml
Normal file
45
Documentation/devicetree/bindings/sound/audio-graph.yaml
Normal 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
|
||||||
66
Documentation/devicetree/bindings/sound/fsl,aud2htx.yaml
Normal file
66
Documentation/devicetree/bindings/sound/fsl,aud2htx.yaml
Normal 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>;
|
||||||
|
};
|
||||||
@@ -20,6 +20,7 @@ properties:
|
|||||||
- fsl,imx35-spdif
|
- fsl,imx35-spdif
|
||||||
- fsl,vf610-spdif
|
- fsl,vf610-spdif
|
||||||
- fsl,imx6sx-spdif
|
- fsl,imx6sx-spdif
|
||||||
|
- fsl,imx8qm-spdif
|
||||||
|
|
||||||
reg:
|
reg:
|
||||||
maxItems: 1
|
maxItems: 1
|
||||||
|
|||||||
104
Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
Normal file
104
Documentation/devicetree/bindings/sound/fsl,xcvr.yaml
Normal 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>;
|
||||||
|
};
|
||||||
@@ -40,6 +40,8 @@ The compatible list for this generic sound card currently:
|
|||||||
|
|
||||||
"fsl,imx-audio-tlv320aic32x4"
|
"fsl,imx-audio-tlv320aic32x4"
|
||||||
|
|
||||||
|
"fsl,imx-audio-si476x"
|
||||||
|
|
||||||
Required properties:
|
Required properties:
|
||||||
|
|
||||||
- compatible : Contains one of entries in the compatible list.
|
- compatible : Contains one of entries in the compatible list.
|
||||||
|
|||||||
@@ -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>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
52
Documentation/devicetree/bindings/sound/imx-audio-hdmi.yaml
Normal file
52
Documentation/devicetree/bindings/sound/imx-audio-hdmi.yaml
Normal 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;
|
||||||
|
};
|
||||||
@@ -9,6 +9,9 @@ title: Marvel SSPA Digital Audio Interface Bindings
|
|||||||
maintainers:
|
maintainers:
|
||||||
- Lubomir Rintel <lkundrak@v3.sk>
|
- Lubomir Rintel <lkundrak@v3.sk>
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: audio-graph-port.yaml#
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
$nodename:
|
$nodename:
|
||||||
pattern: "^audio-controller(@.*)?$"
|
pattern: "^audio-controller(@.*)?$"
|
||||||
@@ -58,29 +61,9 @@ properties:
|
|||||||
type: object
|
type: object
|
||||||
|
|
||||||
properties:
|
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:
|
dai-format:
|
||||||
$ref: /schemas/types.yaml#/definitions/string
|
|
||||||
description: The digital audio format
|
|
||||||
const: i2s
|
const: i2s
|
||||||
|
|
||||||
required:
|
|
||||||
- remote-endpoint
|
|
||||||
|
|
||||||
required:
|
|
||||||
- endpoint
|
|
||||||
|
|
||||||
additionalProperties: false
|
|
||||||
|
|
||||||
required:
|
required:
|
||||||
- "#sound-dai-cells"
|
- "#sound-dai-cells"
|
||||||
- compatible
|
- compatible
|
||||||
@@ -112,8 +95,6 @@ examples:
|
|||||||
port {
|
port {
|
||||||
endpoint {
|
endpoint {
|
||||||
remote-endpoint = <&rt5631_0>;
|
remote-endpoint = <&rt5631_0>;
|
||||||
frame-master;
|
|
||||||
bitclock-master;
|
|
||||||
dai-format = "i2s";
|
dai-format = "i2s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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>;
|
||||||
|
};
|
||||||
|
|
||||||
|
...
|
||||||
18
Documentation/devicetree/bindings/sound/nau8315.txt
Normal file
18
Documentation/devicetree/bindings/sound/nau8315.txt
Normal 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>;
|
||||||
|
};
|
||||||
@@ -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";
|
|
||||||
};
|
|
||||||
112
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
Normal file
112
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml
Normal 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";
|
||||||
|
};
|
||||||
|
|
||||||
|
...
|
||||||
@@ -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>;
|
||||||
|
};
|
||||||
@@ -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";
|
||||||
|
};
|
||||||
159
Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
Normal file
159
Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
Normal 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 = <<9611_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>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -253,523 +253,3 @@ This is example of TDM 6ch.
|
|||||||
Driver can automatically switches TDM <-> stereo mode in this case.
|
Driver can automatically switches TDM <-> stereo mode in this case.
|
||||||
|
|
||||||
see "Example: simple sound card for TDM"
|
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>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|||||||
447
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Normal file
447
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Normal 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>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -44,6 +44,8 @@ Optional properties:
|
|||||||
- realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
|
- realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
|
||||||
the particular DMIC.
|
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:
|
Pins on the device (for linking into audio routes) for RT5682:
|
||||||
|
|
||||||
* DMIC L1
|
* DMIC L1
|
||||||
|
|||||||
@@ -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>;
|
||||||
|
};
|
||||||
@@ -13,13 +13,11 @@ definitions:
|
|||||||
|
|
||||||
frame-master:
|
frame-master:
|
||||||
description: Indicates dai-link frame master.
|
description: Indicates dai-link frame master.
|
||||||
$ref: /schemas/types.yaml#/definitions/phandle-array
|
$ref: /schemas/types.yaml#/definitions/phandle
|
||||||
maxItems: 1
|
|
||||||
|
|
||||||
bitclock-master:
|
bitclock-master:
|
||||||
description: Indicates dai-link bit clock master
|
description: Indicates dai-link bit clock master
|
||||||
$ref: /schemas/types.yaml#/definitions/phandle-array
|
$ref: /schemas/types.yaml#/definitions/phandle
|
||||||
maxItems: 1
|
|
||||||
|
|
||||||
frame-inversion:
|
frame-inversion:
|
||||||
description: dai-link uses frame clock inversion
|
description: dai-link uses frame clock inversion
|
||||||
|
|||||||
@@ -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>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -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>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
200
Documentation/devicetree/bindings/sound/st,stm32-sai.yaml
Normal file
200
Documentation/devicetree/bindings/sound/st,stm32-sai.yaml
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
...
|
||||||
@@ -2227,6 +2227,11 @@ quirk_alias
|
|||||||
Quirk alias list, pass strings like ``0123abcd:5678beef``, which
|
Quirk alias list, pass strings like ``0123abcd:5678beef``, which
|
||||||
applies the existing quirk for the device 5678:beef to a new
|
applies the existing quirk for the device 5678:beef to a new
|
||||||
device 0123:abcd.
|
device 0123:abcd.
|
||||||
|
implicit_fb
|
||||||
|
Apply the generic implicit feedback sync mode. When this is set
|
||||||
|
and the playback stream sync mode is ASYNC, the driver tries to
|
||||||
|
tie an adjacent ASYNC capture stream as the implicit feedback
|
||||||
|
source.
|
||||||
use_vmalloc
|
use_vmalloc
|
||||||
Use vmalloc() for allocations of the PCM buffers (default: yes).
|
Use vmalloc() for allocations of the PCM buffers (default: yes).
|
||||||
For architectures with non-coherent memory like ARM or MIPS, the
|
For architectures with non-coherent memory like ARM or MIPS, the
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# subsystems should select the appropriate symbols.
|
# subsystems should select the appropriate symbols.
|
||||||
|
|
||||||
config REGMAP
|
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
|
select IRQ_DOMAIN if REGMAP_IRQ
|
||||||
bool
|
bool
|
||||||
|
|
||||||
@@ -46,6 +46,10 @@ config REGMAP_SOUNDWIRE
|
|||||||
tristate
|
tristate
|
||||||
depends on SOUNDWIRE
|
depends on SOUNDWIRE
|
||||||
|
|
||||||
|
config REGMAP_SOUNDWIRE_MBQ
|
||||||
|
tristate
|
||||||
|
depends on SOUNDWIRE
|
||||||
|
|
||||||
config REGMAP_SCCB
|
config REGMAP_SCCB
|
||||||
tristate
|
tristate
|
||||||
depends on I2C
|
depends on I2C
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ obj-$(CONFIG_REGMAP_MMIO) += regmap-mmio.o
|
|||||||
obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
|
obj-$(CONFIG_REGMAP_IRQ) += regmap-irq.o
|
||||||
obj-$(CONFIG_REGMAP_W1) += regmap-w1.o
|
obj-$(CONFIG_REGMAP_W1) += regmap-w1.o
|
||||||
obj-$(CONFIG_REGMAP_SOUNDWIRE) += regmap-sdw.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_SCCB) += regmap-sccb.o
|
||||||
obj-$(CONFIG_REGMAP_I3C) += regmap-i3c.o
|
obj-$(CONFIG_REGMAP_I3C) += regmap-i3c.o
|
||||||
obj-$(CONFIG_REGMAP_SPI_AVMM) += regmap-spi-avmm.o
|
obj-$(CONFIG_REGMAP_SPI_AVMM) += regmap-spi-avmm.o
|
||||||
|
|||||||
101
drivers/base/regmap/regmap-sdw-mbq.c
Normal file
101
drivers/base/regmap/regmap-sdw-mbq.c
Normal 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, ®map_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, ®map_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");
|
||||||
@@ -1424,6 +1424,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
|
|||||||
int port_num, stat, ret, count = 0;
|
int port_num, stat, ret, count = 0;
|
||||||
unsigned long port;
|
unsigned long port;
|
||||||
bool slave_notify = false;
|
bool slave_notify = false;
|
||||||
|
u8 sdca_cascade = 0;
|
||||||
u8 buf, buf2[2], _buf, _buf2[2];
|
u8 buf, buf2[2], _buf, _buf2[2];
|
||||||
bool parity_check;
|
bool parity_check;
|
||||||
bool parity_quirk;
|
bool parity_quirk;
|
||||||
@@ -1453,6 +1454,16 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
|
|||||||
goto io_err;
|
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 {
|
do {
|
||||||
/*
|
/*
|
||||||
* Check parity, bus clash and Slave (impl defined)
|
* 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;
|
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 */
|
/* Check port 0 - 3 interrupts */
|
||||||
port = buf & SDW_SCP_INT1_PORT0_3;
|
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 */
|
/* Update the Slave driver */
|
||||||
if (slave_notify && slave->ops &&
|
if (slave_notify && slave->ops &&
|
||||||
slave->ops->interrupt_callback) {
|
slave->ops->interrupt_callback) {
|
||||||
|
slave_intr.sdca_cascade = sdca_cascade;
|
||||||
slave_intr.control_port = clear;
|
slave_intr.control_port = clear;
|
||||||
memcpy(slave_intr.port, &port_status,
|
memcpy(slave_intr.port, &port_status,
|
||||||
sizeof(slave_intr.port));
|
sizeof(slave_intr.port));
|
||||||
@@ -1563,11 +1579,21 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave)
|
|||||||
goto io_err;
|
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 */
|
/* Make sure no interrupts are pending */
|
||||||
buf &= _buf;
|
buf &= _buf;
|
||||||
buf2[0] &= _buf2[0];
|
buf2[0] &= _buf2[0];
|
||||||
buf2[1] &= _buf2[1];
|
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
|
* Exit loop if Slave is continuously in ALERT state even
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ static int field##_attribute_alloc(struct device *dev, \
|
|||||||
return -ENOMEM; \
|
return -ENOMEM; \
|
||||||
dpn_attr->N = N; \
|
dpn_attr->N = N; \
|
||||||
dpn_attr->dir = dir; \
|
dpn_attr->dir = dir; \
|
||||||
|
sysfs_attr_init(&dpn_attr->dev_attr.attr); \
|
||||||
dpn_attr->format_string = format_string; \
|
dpn_attr->format_string = format_string; \
|
||||||
dpn_attr->dev_attr.attr.name = __stringify(field); \
|
dpn_attr->dev_attr.attr.name = __stringify(field); \
|
||||||
dpn_attr->dev_attr.attr.mode = 0444; \
|
dpn_attr->dev_attr.attr.mode = 0444; \
|
||||||
|
|||||||
15
include/dt-bindings/sound/adi,adau1977.h
Normal file
15
include/dt-bindings/sound/adi,adau1977.h
Normal 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__ */
|
||||||
@@ -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
|
|
||||||
@@ -570,6 +570,10 @@ struct regmap *__regmap_init_sdw(struct sdw_slave *sdw,
|
|||||||
const struct regmap_config *config,
|
const struct regmap_config *config,
|
||||||
struct lock_class_key *lock_key,
|
struct lock_class_key *lock_key,
|
||||||
const char *lock_name);
|
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,
|
struct regmap *__regmap_init_spi_avmm(struct spi_device *spi,
|
||||||
const struct regmap_config *config,
|
const struct regmap_config *config,
|
||||||
struct lock_class_key *lock_key,
|
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,
|
const struct regmap_config *config,
|
||||||
struct lock_class_key *lock_key,
|
struct lock_class_key *lock_key,
|
||||||
const char *lock_name);
|
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,
|
struct regmap *__devm_regmap_init_slimbus(struct slim_device *slimbus,
|
||||||
const struct regmap_config *config,
|
const struct regmap_config *config,
|
||||||
struct lock_class_key *lock_key,
|
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, \
|
__regmap_lockdep_wrapper(__regmap_init_sdw, #config, \
|
||||||
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
|
* regmap_init_spi_avmm() - Initialize register map for Intel SPI Slave
|
||||||
* to AVMM Bus Bridge
|
* 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, \
|
__regmap_lockdep_wrapper(__devm_regmap_init_sdw, #config, \
|
||||||
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
|
* devm_regmap_init_slimbus() - Initialise managed register map
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -359,6 +359,7 @@ struct sdw_dpn_prop {
|
|||||||
* @sink_dpn_prop: Sink Data Port N properties
|
* @sink_dpn_prop: Sink Data Port N properties
|
||||||
* @scp_int1_mask: SCP_INT1_MASK desired settings
|
* @scp_int1_mask: SCP_INT1_MASK desired settings
|
||||||
* @quirks: bitmask identifying deltas from the MIPI specification
|
* @quirks: bitmask identifying deltas from the MIPI specification
|
||||||
|
* @is_sdca: the Slave supports the SDCA specification
|
||||||
*/
|
*/
|
||||||
struct sdw_slave_prop {
|
struct sdw_slave_prop {
|
||||||
u32 mipi_revision;
|
u32 mipi_revision;
|
||||||
@@ -382,6 +383,7 @@ struct sdw_slave_prop {
|
|||||||
struct sdw_dpn_prop *sink_dpn_prop;
|
struct sdw_dpn_prop *sink_dpn_prop;
|
||||||
u8 scp_int1_mask;
|
u8 scp_int1_mask;
|
||||||
u32 quirks;
|
u32 quirks;
|
||||||
|
bool is_sdca;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SDW_SLAVE_QUIRKS_INVALID_INITIAL_PARITY BIT(0)
|
#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
|
* struct sdw_slave_intr_status - Slave interrupt status
|
||||||
|
* @sdca_cascade: set if the Slave device reports an SDCA interrupt
|
||||||
* @control_port: control port status
|
* @control_port: control port status
|
||||||
* @port: data port status
|
* @port: data port status
|
||||||
*/
|
*/
|
||||||
struct sdw_slave_intr_status {
|
struct sdw_slave_intr_status {
|
||||||
|
bool sdca_cascade;
|
||||||
u8 control_port;
|
u8 control_port;
|
||||||
u8 port[15];
|
u8 port[15];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -298,4 +298,36 @@
|
|||||||
#define SDW_CASC_PORT_MASK_INTSTAT3 1
|
#define SDW_CASC_PORT_MASK_INTSTAT3 1
|
||||||
#define SDW_CASC_PORT_REG_OFFSET_INTSTAT3 2
|
#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 */
|
#endif /* __SDW_REGISTERS_H */
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ struct snd_compr_runtime {
|
|||||||
* @metadata_set: metadata set flag, true when set
|
* @metadata_set: metadata set flag, true when set
|
||||||
* @next_track: has userspace signal next track transition, true when set
|
* @next_track: has userspace signal next track transition, true when set
|
||||||
* @partial_drain: undergoing partial_drain for stream, true when set
|
* @partial_drain: undergoing partial_drain for stream, true when set
|
||||||
|
* @pause_in_draining: paused during draining state, true when set
|
||||||
* @private_data: pointer to DSP private data
|
* @private_data: pointer to DSP private data
|
||||||
* @dma_buffer: allocated buffer if any
|
* @dma_buffer: allocated buffer if any
|
||||||
*/
|
*/
|
||||||
@@ -80,6 +81,7 @@ struct snd_compr_stream {
|
|||||||
bool metadata_set;
|
bool metadata_set;
|
||||||
bool next_track;
|
bool next_track;
|
||||||
bool partial_drain;
|
bool partial_drain;
|
||||||
|
bool pause_in_draining;
|
||||||
void *private_data;
|
void *private_data;
|
||||||
struct snd_dma_buffer dma_buffer;
|
struct snd_dma_buffer dma_buffer;
|
||||||
};
|
};
|
||||||
@@ -142,6 +144,7 @@ struct snd_compr_ops {
|
|||||||
* @direction: Playback or capture direction
|
* @direction: Playback or capture direction
|
||||||
* @lock: device lock
|
* @lock: device lock
|
||||||
* @device: device id
|
* @device: device id
|
||||||
|
* @use_pause_in_draining: allow pause in draining, true when set
|
||||||
*/
|
*/
|
||||||
struct snd_compr {
|
struct snd_compr {
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -152,6 +155,7 @@ struct snd_compr {
|
|||||||
unsigned int direction;
|
unsigned int direction;
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
int device;
|
int device;
|
||||||
|
bool use_pause_in_draining;
|
||||||
#ifdef CONFIG_SND_VERBOSE_PROCFS
|
#ifdef CONFIG_SND_VERBOSE_PROCFS
|
||||||
/* private: */
|
/* private: */
|
||||||
char id[64];
|
char id[64];
|
||||||
@@ -166,6 +170,18 @@ int snd_compress_deregister(struct snd_compr *device);
|
|||||||
int snd_compress_new(struct snd_card *card, int device,
|
int snd_compress_new(struct snd_card *card, int device,
|
||||||
int type, const char *id, struct snd_compr *compr);
|
int type, const char *id, struct snd_compr *compr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* snd_compr_use_pause_in_draining - Allow pause and resume in draining state
|
||||||
|
* @substream: compress substream to set
|
||||||
|
*
|
||||||
|
* Allow pause and resume in draining state.
|
||||||
|
* Only HW driver supports this transition can call this API.
|
||||||
|
*/
|
||||||
|
static inline void snd_compr_use_pause_in_draining(struct snd_compr_stream *substream)
|
||||||
|
{
|
||||||
|
substream->device->use_pause_in_draining = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* dsp driver callback apis
|
/* dsp driver callback apis
|
||||||
* For playback: driver should call snd_compress_fragment_elapsed() to let the
|
* For playback: driver should call snd_compress_fragment_elapsed() to let the
|
||||||
* framework know that a fragment has been consumed from the ring buffer
|
* framework know that a fragment has been consumed from the ring buffer
|
||||||
|
|||||||
16
include/sound/graph_card.h
Normal file
16
include/sound/graph_card.h
Normal 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 */
|
||||||
@@ -344,7 +344,7 @@ snd_hda_get_num_conns(struct hda_codec *codec, hda_nid_t nid)
|
|||||||
#define snd_hda_get_raw_connections(codec, nid, list, max_conns) \
|
#define snd_hda_get_raw_connections(codec, nid, list, max_conns) \
|
||||||
snd_hdac_get_connections(&(codec)->core, nid, list, max_conns)
|
snd_hdac_get_connections(&(codec)->core, nid, list, max_conns)
|
||||||
#define snd_hda_get_num_raw_conns(codec, nid) \
|
#define snd_hda_get_num_raw_conns(codec, nid) \
|
||||||
snd_hdac_get_connections(&(codec)->core, nid, NULL, 0);
|
snd_hdac_get_connections(&(codec)->core, nid, NULL, 0)
|
||||||
|
|
||||||
int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
|
int snd_hda_get_conn_list(struct hda_codec *codec, hda_nid_t nid,
|
||||||
const hda_nid_t **listp);
|
const hda_nid_t **listp);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ enum {
|
|||||||
#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG)
|
#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG)
|
||||||
|
|
||||||
int snd_intel_dsp_driver_probe(struct pci_dev *pci);
|
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
|
#else
|
||||||
|
|
||||||
@@ -29,6 +30,12 @@ static inline int snd_intel_dsp_driver_probe(struct pci_dev *pci)
|
|||||||
return SND_INTEL_DSP_DRIVER_ANY;
|
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
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ struct rt5682_platform_data {
|
|||||||
unsigned int btndet_delay;
|
unsigned int btndet_delay;
|
||||||
unsigned int dmic_clk_rate;
|
unsigned int dmic_clk_rate;
|
||||||
unsigned int dmic_delay;
|
unsigned int dmic_delay;
|
||||||
|
bool dmic_clk_driving_high;
|
||||||
|
|
||||||
const char *dai_clk_names[RT5682_DAI_NUM_CLKS];
|
const char *dai_clk_names[RT5682_DAI_NUM_CLKS];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ struct asoc_simple_priv {
|
|||||||
struct asoc_simple_dai *dais;
|
struct asoc_simple_dai *dais;
|
||||||
struct snd_soc_codec_conf *codec_conf;
|
struct snd_soc_codec_conf *codec_conf;
|
||||||
struct gpio_desc *pa_gpio;
|
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_card(priv) (&(priv)->snd_card)
|
||||||
#define simple_priv_to_props(priv, i) ((priv)->dai_props + (i))
|
#define simple_priv_to_props(priv, i) ((priv)->dai_props + (i))
|
||||||
|
|||||||
@@ -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_tgl_machines[];
|
||||||
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_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_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_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_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_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_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_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
|
* generic table used for HDA codec-based platforms, possibly with
|
||||||
|
|||||||
@@ -171,4 +171,10 @@ struct snd_soc_acpi_codecs {
|
|||||||
u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN];
|
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
|
#endif
|
||||||
|
|||||||
@@ -220,6 +220,9 @@ struct snd_soc_component {
|
|||||||
/* function mark */
|
/* function mark */
|
||||||
struct snd_pcm_substream *mark_module;
|
struct snd_pcm_substream *mark_module;
|
||||||
struct snd_pcm_substream *mark_open;
|
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;
|
void *mark_pm;
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#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,
|
int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
|
||||||
struct of_phandle_args *args,
|
struct of_phandle_args *args,
|
||||||
const char **dai_name);
|
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_pointer(struct snd_pcm_substream *substream);
|
||||||
int snd_soc_pcm_component_ioctl(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);
|
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_prepare(struct snd_pcm_substream *substream);
|
||||||
int snd_soc_pcm_component_hw_params(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_pcm_hw_params *params);
|
||||||
struct snd_soc_component **last);
|
|
||||||
void snd_soc_pcm_component_hw_free(struct snd_pcm_substream *substream,
|
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 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,
|
int snd_soc_pcm_component_pm_runtime_get(struct snd_soc_pcm_runtime *rtd,
|
||||||
void *stream);
|
void *stream);
|
||||||
void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
|
void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
|
||||||
|
|||||||
@@ -72,21 +72,29 @@ struct snd_compr_stream;
|
|||||||
#define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */
|
#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
|
* 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
|
* i.e. if the codec is clk and FRM provider then the interface is
|
||||||
* clk and frame secondary.
|
* clk and frame consumer.
|
||||||
*/
|
*/
|
||||||
#define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */
|
#define SND_SOC_DAIFMT_CBP_CFP (1 << 12) /* codec clk provider & frame provider */
|
||||||
#define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk secondary & FRM master */
|
#define SND_SOC_DAIFMT_CBC_CFP (2 << 12) /* codec clk consumer & frame provider */
|
||||||
#define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame secondary */
|
#define SND_SOC_DAIFMT_CBP_CFC (3 << 12) /* codec clk provider & frame consumer */
|
||||||
#define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM secondary */
|
#define SND_SOC_DAIFMT_CBC_CFC (4 << 12) /* codec clk consumer & frame follower */
|
||||||
|
|
||||||
|
/* 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_FORMAT_MASK 0x000f
|
||||||
#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
|
#define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0
|
||||||
#define SND_SOC_DAIFMT_INV_MASK 0x0f00
|
#define SND_SOC_DAIFMT_INV_MASK 0x0f00
|
||||||
#define SND_SOC_DAIFMT_MASTER_MASK 0xf000
|
#define SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK 0xf000
|
||||||
|
|
||||||
|
#define SND_SOC_DAIFMT_MASTER_MASK SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Master Clock Directions
|
* 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_substream *substream,
|
||||||
struct snd_pcm_hw_params *params);
|
struct snd_pcm_hw_params *params);
|
||||||
void snd_soc_dai_hw_free(struct snd_soc_dai *dai,
|
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,
|
int snd_soc_dai_startup(struct snd_soc_dai *dai,
|
||||||
struct snd_pcm_substream *substream);
|
struct snd_pcm_substream *substream);
|
||||||
void snd_soc_dai_shutdown(struct snd_soc_dai *dai,
|
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_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_new(struct snd_soc_pcm_runtime *rtd);
|
||||||
int snd_soc_pcm_dai_prepare(struct snd_pcm_substream *substream);
|
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 snd_soc_pcm_dai_bespoke_trigger(struct snd_pcm_substream *substream,
|
||||||
int cmd);
|
int cmd);
|
||||||
|
|
||||||
int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
|
int snd_soc_dai_compr_startup(struct snd_soc_dai *dai,
|
||||||
struct snd_compr_stream *cstream);
|
struct snd_compr_stream *cstream);
|
||||||
void snd_soc_dai_compr_shutdown(struct snd_soc_dai *dai,
|
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,
|
int snd_soc_dai_compr_trigger(struct snd_soc_dai *dai,
|
||||||
struct snd_compr_stream *cstream, int cmd);
|
struct snd_compr_stream *cstream, int cmd);
|
||||||
int snd_soc_dai_compr_set_params(struct snd_soc_dai *dai,
|
int snd_soc_dai_compr_set_params(struct snd_soc_dai *dai,
|
||||||
@@ -390,6 +401,9 @@ struct snd_soc_dai {
|
|||||||
|
|
||||||
/* function mark */
|
/* function mark */
|
||||||
struct snd_pcm_substream *mark_startup;
|
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 */
|
/* bit field */
|
||||||
unsigned int probed:1;
|
unsigned int probed:1;
|
||||||
|
|||||||
132
include/sound/soc-jack.h
Normal file
132
include/sound/soc-jack.h
Normal 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 */
|
||||||
@@ -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_prepare(struct snd_pcm_substream *substream);
|
||||||
int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
|
int snd_soc_link_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params);
|
struct snd_pcm_hw_params *params);
|
||||||
void snd_soc_link_hw_free(struct snd_pcm_substream *substream);
|
void snd_soc_link_hw_free(struct snd_pcm_substream *substream,
|
||||||
int snd_soc_link_trigger(struct snd_pcm_substream *substream, int cmd);
|
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);
|
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);
|
int snd_soc_link_compr_set_params(struct snd_compr_stream *cstream);
|
||||||
|
|
||||||
#endif /* __SOC_LINK_H */
|
#endif /* __SOC_LINK_H */
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ struct snd_soc_dai_driver;
|
|||||||
struct snd_soc_dai;
|
struct snd_soc_dai;
|
||||||
struct snd_soc_dapm_route;
|
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 */
|
/* dynamic object type */
|
||||||
enum snd_soc_dobj_type {
|
enum snd_soc_dobj_type {
|
||||||
SND_SOC_DOBJ_NONE = 0, /* object is not dynamic */
|
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 */
|
/* Dynamic Object loading and removal for component drivers */
|
||||||
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
|
int snd_soc_tplg_component_load(struct snd_soc_component *comp,
|
||||||
struct snd_soc_tplg_ops *ops, const struct firmware *fw,
|
struct snd_soc_tplg_ops *ops, const struct firmware *fw);
|
||||||
u32 index);
|
int snd_soc_tplg_component_remove(struct snd_soc_component *comp);
|
||||||
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);
|
|
||||||
|
|
||||||
/* Binds event handlers to dynamic widgets */
|
/* Binds event handlers to dynamic widgets */
|
||||||
int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,
|
int snd_soc_tplg_widget_bind_event(struct snd_soc_dapm_widget *w,
|
||||||
|
|||||||
@@ -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,
|
int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
|
||||||
const struct snd_pcm_hardware *hw);
|
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_alloc_ac97_component(struct snd_soc_component *component);
|
||||||
struct snd_ac97 *snd_soc_new_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);
|
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,
|
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
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 */
|
/* SoC PCM stream information */
|
||||||
struct snd_soc_pcm_stream {
|
struct snd_soc_pcm_stream {
|
||||||
const char *stream_name;
|
const char *stream_name;
|
||||||
@@ -1084,6 +963,7 @@ struct snd_soc_card {
|
|||||||
unsigned int fully_routed:1;
|
unsigned int fully_routed:1;
|
||||||
unsigned int disable_route_checks:1;
|
unsigned int disable_route_checks:1;
|
||||||
unsigned int probed:1;
|
unsigned int probed:1;
|
||||||
|
unsigned int component_chaining:1;
|
||||||
|
|
||||||
void *drvdata;
|
void *drvdata;
|
||||||
};
|
};
|
||||||
@@ -1161,6 +1041,9 @@ struct snd_soc_pcm_runtime {
|
|||||||
|
|
||||||
/* function mark */
|
/* function mark */
|
||||||
struct snd_pcm_substream *mark_startup;
|
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 */
|
/* bit field */
|
||||||
unsigned int pop_wait:1;
|
unsigned int pop_wait:1;
|
||||||
@@ -1183,21 +1066,15 @@ struct snd_soc_pcm_runtime {
|
|||||||
for ((i) = 0; \
|
for ((i) = 0; \
|
||||||
((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
|
((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
|
||||||
(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) \
|
#define for_each_rtd_codec_dais(rtd, i, dai) \
|
||||||
for ((i) = 0; \
|
for ((i) = 0; \
|
||||||
((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
|
((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
|
||||||
(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) \
|
#define for_each_rtd_dais(rtd, i, dai) \
|
||||||
for ((i) = 0; \
|
for ((i) = 0; \
|
||||||
((i) < (rtd)->num_cpus + (rtd)->num_codecs) && \
|
((i) < (rtd)->num_cpus + (rtd)->num_codecs) && \
|
||||||
((dai) = (rtd)->dais[i]); \
|
((dai) = (rtd)->dais[i]); \
|
||||||
(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);
|
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-component.h>
|
||||||
#include <sound/soc-card.h>
|
#include <sound/soc-card.h>
|
||||||
|
#include <sound/soc-jack.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ struct sof_dev_desc {
|
|||||||
const struct snd_sof_dsp_ops *ops;
|
const struct snd_sof_dsp_ops *ops;
|
||||||
};
|
};
|
||||||
|
|
||||||
int sof_nocodec_setup(struct device *dev,
|
int sof_nocodec_setup(struct device *dev, const struct snd_sof_dsp_ops *ops,
|
||||||
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
|
#endif
|
||||||
|
|||||||
@@ -34,15 +34,21 @@
|
|||||||
#define SOF_DAI_FMT_IB_NF (3 << 8) /**< invert BCLK + nor FRM */
|
#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_IB_IF (4 << 8) /**< invert BCLK + FRM */
|
||||||
|
|
||||||
#define SOF_DAI_FMT_CBM_CFM (0 << 12) /**< codec clk & FRM master */
|
#define SOF_DAI_FMT_CBP_CFP (0 << 12) /**< codec bclk provider & frame provider */
|
||||||
#define SOF_DAI_FMT_CBS_CFM (2 << 12) /**< codec clk slave & FRM master */
|
#define SOF_DAI_FMT_CBC_CFP (2 << 12) /**< codec bclk consumer & frame provider */
|
||||||
#define SOF_DAI_FMT_CBM_CFS (3 << 12) /**< codec clk master & frame slave */
|
#define SOF_DAI_FMT_CBP_CFC (3 << 12) /**< codec bclk provider & frame consumer */
|
||||||
#define SOF_DAI_FMT_CBS_CFS (4 << 12) /**< codec clk & FRM slave */
|
#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_FORMAT_MASK 0x000f
|
||||||
#define SOF_DAI_FMT_CLOCK_MASK 0x00f0
|
#define SOF_DAI_FMT_CLOCK_MASK 0x00f0
|
||||||
#define SOF_DAI_FMT_INV_MASK 0x0f00
|
#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 */
|
/** \brief Types of DAI */
|
||||||
enum sof_ipc_dai_type {
|
enum sof_ipc_dai_type {
|
||||||
|
|||||||
41
include/sound/sof/debug.h
Normal file
41
include/sound/sof/debug.h
Normal 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
|
||||||
@@ -61,6 +61,8 @@ enum sof_ext_man_elem_type {
|
|||||||
SOF_EXT_MAN_ELEM_WINDOW = SOF_IPC_EXT_WINDOW,
|
SOF_EXT_MAN_ELEM_WINDOW = SOF_IPC_EXT_WINDOW,
|
||||||
SOF_EXT_MAN_ELEM_CC_VERSION = SOF_IPC_EXT_CC_INFO,
|
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_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 */
|
/* extended manifest element header */
|
||||||
@@ -99,4 +101,23 @@ struct ext_man_dbg_abi {
|
|||||||
struct sof_ipc_user_abi_version dbg_abi;
|
struct sof_ipc_user_abi_version dbg_abi;
|
||||||
} __packed;
|
} __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__ */
|
#endif /* __SOF_FIRMWARE_EXT_MANIFEST_H__ */
|
||||||
|
|||||||
@@ -31,12 +31,12 @@
|
|||||||
|
|
||||||
/* Global Message - Generic */
|
/* Global Message - Generic */
|
||||||
#define SOF_GLB_TYPE_SHIFT 28
|
#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)
|
#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT)
|
||||||
|
|
||||||
/* Command Message - Generic */
|
/* Command Message - Generic */
|
||||||
#define SOF_CMD_TYPE_SHIFT 16
|
#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)
|
#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT)
|
||||||
|
|
||||||
/* Global Message Types */
|
/* Global Message Types */
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
#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_TEST_MSG SOF_GLB_TYPE(0xBU)
|
||||||
#define SOF_IPC_GLB_PROBE SOF_GLB_TYPE(0xCU)
|
#define SOF_IPC_GLB_PROBE SOF_GLB_TYPE(0xCU)
|
||||||
|
#define SOF_IPC_GLB_DEBUG SOF_GLB_TYPE(0xDU)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DSP Command Message Types
|
* DSP Command Message Types
|
||||||
@@ -117,8 +118,12 @@
|
|||||||
#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001)
|
#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_POSITION SOF_CMD_TYPE(0x002)
|
||||||
#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003)
|
#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003)
|
||||||
|
#define SOF_IPC_TRACE_FILTER_UPDATE SOF_CMD_TYPE(0x004) /**< ABI3.17 */
|
||||||
|
|
||||||
/* debug */
|
/* debug */
|
||||||
|
#define SOF_IPC_DEBUG_MEM_USAGE SOF_CMD_TYPE(0x001)
|
||||||
|
|
||||||
|
/* test */
|
||||||
#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
|
#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001)
|
||||||
|
|
||||||
/* Get message component id */
|
/* Get message component id */
|
||||||
|
|||||||
@@ -43,6 +43,34 @@ struct sof_ipc_dma_trace_posn {
|
|||||||
uint32_t messages; /* total trace messages */
|
uint32_t messages; /* total trace messages */
|
||||||
} __packed;
|
} __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
|
* Commom debug
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <linux/ktime.h>
|
#include <linux/ktime.h>
|
||||||
#include <linux/tracepoint.h>
|
#include <linux/tracepoint.h>
|
||||||
|
#include <sound/jack.h>
|
||||||
|
|
||||||
#define DAPM_DIRECT "(direct)"
|
#define DAPM_DIRECT "(direct)"
|
||||||
#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
|
#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
|
||||||
|
|||||||
@@ -170,16 +170,22 @@
|
|||||||
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
|
#define SND_SOC_TPLG_LNK_FLGBIT_VOICE_WAKEUP (1 << 3)
|
||||||
|
|
||||||
/* DAI topology BCLK parameter
|
/* 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_CP 0 /* codec is bclk provider */
|
||||||
#define SND_SOC_TPLG_BCLK_CS 1 /* codec is bclk slave */
|
#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
|
/* 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_CP 0 /* codec is fsync provider */
|
||||||
#define SND_SOC_TPLG_FSYNC_CS 1 /* codec is fsync slave */
|
#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.
|
* Block Header.
|
||||||
@@ -336,8 +342,8 @@ struct snd_soc_tplg_hw_config {
|
|||||||
__u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
|
__u8 clock_gated; /* SND_SOC_TPLG_DAI_CLK_GATE_ value */
|
||||||
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
|
__u8 invert_bclk; /* 1 for inverted BCLK, 0 for normal */
|
||||||
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
|
__u8 invert_fsync; /* 1 for inverted frame clock, 0 for normal */
|
||||||
__u8 bclk_master; /* SND_SOC_TPLG_BCLK_ value */
|
__u8 bclk_provider; /* SND_SOC_TPLG_BCLK_ value */
|
||||||
__u8 fsync_master; /* SND_SOC_TPLG_FSYNC_ value */
|
__u8 fsync_provider; /* SND_SOC_TPLG_FSYNC_ value */
|
||||||
__u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
|
__u8 mclk_direction; /* SND_SOC_TPLG_MCLK_ value */
|
||||||
__le16 reserved; /* for 32bit alignment */
|
__le16 reserved; /* for 32bit alignment */
|
||||||
__le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
|
__le32 mclk_rate; /* MCLK or SYSCLK freqency in Hz */
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/* SOF ABI version major, minor and patch numbers */
|
/* SOF ABI version major, minor and patch numbers */
|
||||||
#define SOF_ABI_MAJOR 3
|
#define SOF_ABI_MAJOR 3
|
||||||
#define SOF_ABI_MINOR 17
|
#define SOF_ABI_MINOR 18
|
||||||
#define SOF_ABI_PATCH 0
|
#define SOF_ABI_PATCH 0
|
||||||
|
|
||||||
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
|
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
|
||||||
|
|||||||
@@ -709,11 +709,22 @@ static int snd_compr_pause(struct snd_compr_stream *stream)
|
|||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (stream->runtime->state != SNDRV_PCM_STATE_RUNNING)
|
switch (stream->runtime->state) {
|
||||||
return -EPERM;
|
case SNDRV_PCM_STATE_RUNNING:
|
||||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
|
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
|
||||||
if (!retval)
|
if (!retval)
|
||||||
stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
|
stream->runtime->state = SNDRV_PCM_STATE_PAUSED;
|
||||||
|
break;
|
||||||
|
case SNDRV_PCM_STATE_DRAINING:
|
||||||
|
if (!stream->device->use_pause_in_draining)
|
||||||
|
return -EPERM;
|
||||||
|
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_PUSH);
|
||||||
|
if (!retval)
|
||||||
|
stream->pause_in_draining = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,11 +732,22 @@ static int snd_compr_resume(struct snd_compr_stream *stream)
|
|||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (stream->runtime->state != SNDRV_PCM_STATE_PAUSED)
|
switch (stream->runtime->state) {
|
||||||
return -EPERM;
|
case SNDRV_PCM_STATE_PAUSED:
|
||||||
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
|
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
|
||||||
if (!retval)
|
if (!retval)
|
||||||
stream->runtime->state = SNDRV_PCM_STATE_RUNNING;
|
stream->runtime->state = SNDRV_PCM_STATE_RUNNING;
|
||||||
|
break;
|
||||||
|
case SNDRV_PCM_STATE_DRAINING:
|
||||||
|
if (!stream->pause_in_draining)
|
||||||
|
return -EPERM;
|
||||||
|
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_PAUSE_RELEASE);
|
||||||
|
if (!retval)
|
||||||
|
stream->pause_in_draining = false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -768,6 +790,7 @@ static int snd_compr_stop(struct snd_compr_stream *stream)
|
|||||||
/* clear flags and stop any drain wait */
|
/* clear flags and stop any drain wait */
|
||||||
stream->partial_drain = false;
|
stream->partial_drain = false;
|
||||||
stream->metadata_set = false;
|
stream->metadata_set = false;
|
||||||
|
stream->pause_in_draining = false;
|
||||||
snd_compr_drain_notify(stream);
|
snd_compr_drain_notify(stream);
|
||||||
stream->runtime->total_bytes_available = 0;
|
stream->runtime->total_bytes_available = 0;
|
||||||
stream->runtime->total_bytes_transferred = 0;
|
stream->runtime->total_bytes_transferred = 0;
|
||||||
|
|||||||
@@ -1935,11 +1935,15 @@ static int snd_pcm_oss_set_subdivide(struct snd_pcm_oss_file *pcm_oss_file, int
|
|||||||
static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream, unsigned int val)
|
static int snd_pcm_oss_set_fragment1(struct snd_pcm_substream *substream, unsigned int val)
|
||||||
{
|
{
|
||||||
struct snd_pcm_runtime *runtime;
|
struct snd_pcm_runtime *runtime;
|
||||||
|
int fragshift;
|
||||||
|
|
||||||
runtime = substream->runtime;
|
runtime = substream->runtime;
|
||||||
if (runtime->oss.subdivision || runtime->oss.fragshift)
|
if (runtime->oss.subdivision || runtime->oss.fragshift)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
runtime->oss.fragshift = val & 0xffff;
|
fragshift = val & 0xffff;
|
||||||
|
if (fragshift >= 31)
|
||||||
|
return -EINVAL;
|
||||||
|
runtime->oss.fragshift = fragshift;
|
||||||
runtime->oss.maxfrags = (val >> 16) & 0xffff;
|
runtime->oss.maxfrags = (val >> 16) & 0xffff;
|
||||||
if (runtime->oss.fragshift < 4) /* < 16 */
|
if (runtime->oss.fragshift < 4) /* < 16 */
|
||||||
runtime->oss.fragshift = 4;
|
runtime->oss.fragshift = 4;
|
||||||
|
|||||||
@@ -95,11 +95,21 @@ static inline unsigned short snd_rawmidi_file_flags(struct file *file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int snd_rawmidi_ready(struct snd_rawmidi_substream *substream)
|
static inline bool __snd_rawmidi_ready(struct snd_rawmidi_runtime *runtime)
|
||||||
|
{
|
||||||
|
return runtime->avail >= runtime->avail_min;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool snd_rawmidi_ready(struct snd_rawmidi_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_rawmidi_runtime *runtime = substream->runtime;
|
struct snd_rawmidi_runtime *runtime = substream->runtime;
|
||||||
|
unsigned long flags;
|
||||||
|
bool ready;
|
||||||
|
|
||||||
return runtime->avail >= runtime->avail_min;
|
spin_lock_irqsave(&runtime->lock, flags);
|
||||||
|
ready = __snd_rawmidi_ready(runtime);
|
||||||
|
spin_unlock_irqrestore(&runtime->lock, flags);
|
||||||
|
return ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substream,
|
static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substream,
|
||||||
@@ -1019,7 +1029,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
|
|||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
if (runtime->event)
|
if (runtime->event)
|
||||||
schedule_work(&runtime->event_work);
|
schedule_work(&runtime->event_work);
|
||||||
else if (snd_rawmidi_ready(substream))
|
else if (__snd_rawmidi_ready(runtime))
|
||||||
wake_up(&runtime->sleep);
|
wake_up(&runtime->sleep);
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&runtime->lock, flags);
|
spin_unlock_irqrestore(&runtime->lock, flags);
|
||||||
@@ -1098,7 +1108,7 @@ static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t coun
|
|||||||
result = 0;
|
result = 0;
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
spin_lock_irq(&runtime->lock);
|
spin_lock_irq(&runtime->lock);
|
||||||
while (!snd_rawmidi_ready(substream)) {
|
while (!__snd_rawmidi_ready(runtime)) {
|
||||||
wait_queue_entry_t wait;
|
wait_queue_entry_t wait;
|
||||||
|
|
||||||
if ((file->f_flags & O_NONBLOCK) != 0 || result > 0) {
|
if ((file->f_flags & O_NONBLOCK) != 0 || result > 0) {
|
||||||
@@ -1115,9 +1125,11 @@ static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t coun
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
if (signal_pending(current))
|
if (signal_pending(current))
|
||||||
return result > 0 ? result : -ERESTARTSYS;
|
return result > 0 ? result : -ERESTARTSYS;
|
||||||
if (!runtime->avail)
|
|
||||||
return result > 0 ? result : -EIO;
|
|
||||||
spin_lock_irq(&runtime->lock);
|
spin_lock_irq(&runtime->lock);
|
||||||
|
if (!runtime->avail) {
|
||||||
|
spin_unlock_irq(&runtime->lock);
|
||||||
|
return result > 0 ? result : -EIO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irq(&runtime->lock);
|
spin_unlock_irq(&runtime->lock);
|
||||||
count1 = snd_rawmidi_kernel_read1(substream,
|
count1 = snd_rawmidi_kernel_read1(substream,
|
||||||
@@ -1255,7 +1267,7 @@ int __snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int coun
|
|||||||
runtime->avail += count;
|
runtime->avail += count;
|
||||||
substream->bytes += count;
|
substream->bytes += count;
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
if (runtime->drain || snd_rawmidi_ready(substream))
|
if (runtime->drain || __snd_rawmidi_ready(runtime))
|
||||||
wake_up(&runtime->sleep);
|
wake_up(&runtime->sleep);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
@@ -1444,9 +1456,11 @@ static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf,
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
if (signal_pending(current))
|
if (signal_pending(current))
|
||||||
return result > 0 ? result : -ERESTARTSYS;
|
return result > 0 ? result : -ERESTARTSYS;
|
||||||
if (!runtime->avail && !timeout)
|
|
||||||
return result > 0 ? result : -EIO;
|
|
||||||
spin_lock_irq(&runtime->lock);
|
spin_lock_irq(&runtime->lock);
|
||||||
|
if (!runtime->avail && !timeout) {
|
||||||
|
spin_unlock_irq(&runtime->lock);
|
||||||
|
return result > 0 ? result : -EIO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irq(&runtime->lock);
|
spin_unlock_irq(&runtime->lock);
|
||||||
count1 = snd_rawmidi_kernel_write1(substream, buf, NULL, count);
|
count1 = snd_rawmidi_kernel_write1(substream, buf, NULL, count);
|
||||||
@@ -1526,6 +1540,7 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
|
|||||||
struct snd_rawmidi *rmidi;
|
struct snd_rawmidi *rmidi;
|
||||||
struct snd_rawmidi_substream *substream;
|
struct snd_rawmidi_substream *substream;
|
||||||
struct snd_rawmidi_runtime *runtime;
|
struct snd_rawmidi_runtime *runtime;
|
||||||
|
unsigned long buffer_size, avail, xruns;
|
||||||
|
|
||||||
rmidi = entry->private_data;
|
rmidi = entry->private_data;
|
||||||
snd_iprintf(buffer, "%s\n\n", rmidi->name);
|
snd_iprintf(buffer, "%s\n\n", rmidi->name);
|
||||||
@@ -1544,13 +1559,16 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
|
|||||||
" Owner PID : %d\n",
|
" Owner PID : %d\n",
|
||||||
pid_vnr(substream->pid));
|
pid_vnr(substream->pid));
|
||||||
runtime = substream->runtime;
|
runtime = substream->runtime;
|
||||||
|
spin_lock_irq(&runtime->lock);
|
||||||
|
buffer_size = runtime->buffer_size;
|
||||||
|
avail = runtime->avail;
|
||||||
|
spin_unlock_irq(&runtime->lock);
|
||||||
snd_iprintf(buffer,
|
snd_iprintf(buffer,
|
||||||
" Mode : %s\n"
|
" Mode : %s\n"
|
||||||
" Buffer size : %lu\n"
|
" Buffer size : %lu\n"
|
||||||
" Avail : %lu\n",
|
" Avail : %lu\n",
|
||||||
runtime->oss ? "OSS compatible" : "native",
|
runtime->oss ? "OSS compatible" : "native",
|
||||||
(unsigned long) runtime->buffer_size,
|
buffer_size, avail);
|
||||||
(unsigned long) runtime->avail);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1568,13 +1586,16 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
|
|||||||
" Owner PID : %d\n",
|
" Owner PID : %d\n",
|
||||||
pid_vnr(substream->pid));
|
pid_vnr(substream->pid));
|
||||||
runtime = substream->runtime;
|
runtime = substream->runtime;
|
||||||
|
spin_lock_irq(&runtime->lock);
|
||||||
|
buffer_size = runtime->buffer_size;
|
||||||
|
avail = runtime->avail;
|
||||||
|
xruns = runtime->xruns;
|
||||||
|
spin_unlock_irq(&runtime->lock);
|
||||||
snd_iprintf(buffer,
|
snd_iprintf(buffer,
|
||||||
" Buffer size : %lu\n"
|
" Buffer size : %lu\n"
|
||||||
" Avail : %lu\n"
|
" Avail : %lu\n"
|
||||||
" Overruns : %lu\n",
|
" Overruns : %lu\n",
|
||||||
(unsigned long) runtime->buffer_size,
|
buffer_size, avail, xruns);
|
||||||
(unsigned long) runtime->avail,
|
|
||||||
(unsigned long) runtime->xruns);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,6 @@ static int seq_free_client1(struct snd_seq_client *client)
|
|||||||
snd_seq_delete_all_ports(client);
|
snd_seq_delete_all_ports(client);
|
||||||
snd_seq_queue_client_leave(client->number);
|
snd_seq_queue_client_leave(client->number);
|
||||||
snd_use_lock_sync(&client->use_lock);
|
snd_use_lock_sync(&client->use_lock);
|
||||||
snd_seq_queue_client_termination(client->number);
|
|
||||||
if (client->pool)
|
if (client->pool)
|
||||||
snd_seq_pool_delete(&client->pool);
|
snd_seq_pool_delete(&client->pool);
|
||||||
spin_lock_irq(&clients_lock);
|
spin_lock_irq(&clients_lock);
|
||||||
|
|||||||
@@ -537,33 +537,6 @@ int snd_seq_queue_is_used(int queueid, int client)
|
|||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
/*----------------------------------------------------------------*/
|
||||||
|
|
||||||
/* notification that client has left the system -
|
|
||||||
* stop the timer on all queues owned by this client
|
|
||||||
*/
|
|
||||||
void snd_seq_queue_client_termination(int client)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
int i;
|
|
||||||
struct snd_seq_queue *q;
|
|
||||||
bool matched;
|
|
||||||
|
|
||||||
for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) {
|
|
||||||
if ((q = queueptr(i)) == NULL)
|
|
||||||
continue;
|
|
||||||
spin_lock_irqsave(&q->owner_lock, flags);
|
|
||||||
matched = (q->owner == client);
|
|
||||||
if (matched)
|
|
||||||
q->klocked = 1;
|
|
||||||
spin_unlock_irqrestore(&q->owner_lock, flags);
|
|
||||||
if (matched) {
|
|
||||||
if (q->timer->running)
|
|
||||||
snd_seq_timer_stop(q->timer);
|
|
||||||
snd_seq_timer_reset(q->timer);
|
|
||||||
}
|
|
||||||
queuefree(q);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* final stage notification -
|
/* final stage notification -
|
||||||
* remove cells for no longer exist client (for non-owned queue)
|
* remove cells for no longer exist client (for non-owned queue)
|
||||||
* or delete this queue (for owned queue)
|
* or delete this queue (for owned queue)
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ struct snd_seq_queue {
|
|||||||
|
|
||||||
struct snd_seq_timer *timer; /* time keeper for this queue */
|
struct snd_seq_timer *timer; /* time keeper for this queue */
|
||||||
int owner; /* client that 'owns' the timer */
|
int owner; /* client that 'owns' the timer */
|
||||||
unsigned int locked:1, /* timer is only accesibble by owner if set */
|
bool locked; /* timer is only accesibble by owner if set */
|
||||||
klocked:1, /* kernel lock (after START) */
|
bool klocked; /* kernel lock (after START) */
|
||||||
check_again:1,
|
bool check_again; /* concurrent access happened during check */
|
||||||
check_blocked:1;
|
bool check_blocked; /* queue being checked */
|
||||||
|
|
||||||
unsigned int flags; /* status flags */
|
unsigned int flags; /* status flags */
|
||||||
unsigned int info_flags; /* info for sync */
|
unsigned int info_flags; /* info for sync */
|
||||||
@@ -59,9 +59,6 @@ struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int f
|
|||||||
/* delete queue (destructor) */
|
/* delete queue (destructor) */
|
||||||
int snd_seq_queue_delete(int client, int queueid);
|
int snd_seq_queue_delete(int client, int queueid);
|
||||||
|
|
||||||
/* notification that client has left the system */
|
|
||||||
void snd_seq_queue_client_termination(int client);
|
|
||||||
|
|
||||||
/* final stage */
|
/* final stage */
|
||||||
void snd_seq_queue_client_leave(int client);
|
void snd_seq_queue_client_leave(int client);
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ struct loopback_cable {
|
|||||||
unsigned int running;
|
unsigned int running;
|
||||||
unsigned int pause;
|
unsigned int pause;
|
||||||
/* timer specific */
|
/* timer specific */
|
||||||
struct loopback_ops *ops;
|
const struct loopback_ops *ops;
|
||||||
/* If sound timer is used */
|
/* If sound timer is used */
|
||||||
struct {
|
struct {
|
||||||
int stream;
|
int stream;
|
||||||
@@ -1021,7 +1021,7 @@ static int loopback_jiffies_timer_open(struct loopback_pcm *dpcm)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct loopback_ops loopback_jiffies_timer_ops = {
|
static const struct loopback_ops loopback_jiffies_timer_ops = {
|
||||||
.open = loopback_jiffies_timer_open,
|
.open = loopback_jiffies_timer_open,
|
||||||
.start = loopback_jiffies_timer_start,
|
.start = loopback_jiffies_timer_start,
|
||||||
.stop = loopback_jiffies_timer_stop,
|
.stop = loopback_jiffies_timer_stop,
|
||||||
@@ -1172,7 +1172,7 @@ exit:
|
|||||||
/* stop_sync() is not required for sound timer because it does not need to be
|
/* stop_sync() is not required for sound timer because it does not need to be
|
||||||
* restarted in loopback_prepare() on Xrun recovery
|
* restarted in loopback_prepare() on Xrun recovery
|
||||||
*/
|
*/
|
||||||
static struct loopback_ops loopback_snd_timer_ops = {
|
static const struct loopback_ops loopback_snd_timer_ops = {
|
||||||
.open = loopback_snd_timer_open,
|
.open = loopback_snd_timer_open,
|
||||||
.start = loopback_snd_timer_start,
|
.start = loopback_snd_timer_start,
|
||||||
.stop = loopback_snd_timer_stop,
|
.stop = loopback_snd_timer_stop,
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ static int pcspkr_input_event(struct input_dev *dev, unsigned int type,
|
|||||||
case SND_BELL:
|
case SND_BELL:
|
||||||
if (value)
|
if (value)
|
||||||
value = 1000;
|
value = 1000;
|
||||||
|
break;
|
||||||
case SND_TONE:
|
case SND_TONE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ static inline bool amdtp_stream_wait_callback(struct amdtp_stream *s,
|
|||||||
unsigned int timeout)
|
unsigned int timeout)
|
||||||
{
|
{
|
||||||
return wait_event_timeout(s->callback_wait,
|
return wait_event_timeout(s->callback_wait,
|
||||||
s->callbacked == true,
|
s->callbacked,
|
||||||
msecs_to_jiffies(timeout)) > 0;
|
msecs_to_jiffies(timeout)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=lega
|
|||||||
struct config_entry {
|
struct config_entry {
|
||||||
u32 flags;
|
u32 flags;
|
||||||
u16 device;
|
u16 device;
|
||||||
|
u8 acpi_hid[ACPI_ID_LEN];
|
||||||
const struct dmi_system_id *dmi_table;
|
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)
|
if (pci->vendor != 0x8086)
|
||||||
return SND_INTEL_DSP_DRIVER_ANY;
|
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)
|
if (dsp_driver > 0 && dsp_driver <= SND_INTEL_DSP_DRIVER_LAST)
|
||||||
return dsp_driver;
|
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);
|
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_LICENSE("GPL v2");
|
||||||
MODULE_DESCRIPTION("Intel DSP config driver");
|
MODULE_DESCRIPTION("Intel DSP config driver");
|
||||||
MODULE_IMPORT_NS(SOUNDWIRE_INTEL_INIT);
|
MODULE_IMPORT_NS(SOUNDWIRE_INTEL_INIT);
|
||||||
|
|||||||
@@ -506,6 +506,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
|
|||||||
} else {
|
} else {
|
||||||
runtime->hw.rate_max = 15000;
|
runtime->hw.rate_max = 15000;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -894,8 +894,8 @@ static int snd_emu10k1x_create(struct snd_card *card,
|
|||||||
|
|
||||||
if ((err = pci_enable_device(pci)) < 0)
|
if ((err = pci_enable_device(pci)) < 0)
|
||||||
return err;
|
return err;
|
||||||
if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 ||
|
|
||||||
pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) {
|
if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(28)) < 0) {
|
||||||
dev_err(card->dev, "error to set 28bit mask DMA\n");
|
dev_err(card->dev, "error to set 28bit mask DMA\n");
|
||||||
pci_disable_device(pci);
|
pci_disable_device(pci);
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|||||||
@@ -1803,7 +1803,7 @@ int snd_hda_codec_reset(struct hda_codec *codec)
|
|||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
/* OK, let it free */
|
/* OK, let it free */
|
||||||
snd_hdac_device_unregister(&codec->core);
|
device_release_driver(hda_codec_dev(codec));
|
||||||
|
|
||||||
/* allow device access again */
|
/* allow device access again */
|
||||||
snd_hda_unlock_devices(bus);
|
snd_hda_unlock_devices(bus);
|
||||||
|
|||||||
@@ -679,6 +679,38 @@ static void print_gpio(struct snd_info_buffer *buffer,
|
|||||||
print_nid_array(buffer, codec, nid, &codec->nids);
|
print_nid_array(buffer, codec, nid, &codec->nids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_codec *codec,
|
||||||
|
hda_nid_t nid, int dev_num)
|
||||||
|
{
|
||||||
|
int c, conn_len, curr, dev_id_saved;
|
||||||
|
hda_nid_t *conn;
|
||||||
|
|
||||||
|
conn_len = snd_hda_get_num_raw_conns(codec, nid);
|
||||||
|
if (conn_len <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
conn = kmalloc_array(conn_len, sizeof(hda_nid_t), GFP_KERNEL);
|
||||||
|
if (!conn)
|
||||||
|
return;
|
||||||
|
|
||||||
|
dev_id_saved = snd_hda_get_dev_select(codec, nid);
|
||||||
|
|
||||||
|
snd_hda_set_dev_select(codec, nid, dev_num);
|
||||||
|
curr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
|
||||||
|
if (snd_hda_get_raw_connections(codec, nid, conn, conn_len) < 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
for (c = 0; c < conn_len; c++) {
|
||||||
|
snd_iprintf(buffer, " 0x%02x", conn[c]);
|
||||||
|
if (c == curr)
|
||||||
|
snd_iprintf(buffer, "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
kfree(conn);
|
||||||
|
snd_hda_set_dev_select(codec, nid, dev_id_saved);
|
||||||
|
}
|
||||||
|
|
||||||
static void print_device_list(struct snd_info_buffer *buffer,
|
static void print_device_list(struct snd_info_buffer *buffer,
|
||||||
struct hda_codec *codec, hda_nid_t nid)
|
struct hda_codec *codec, hda_nid_t nid)
|
||||||
{
|
{
|
||||||
@@ -702,10 +734,14 @@ static void print_device_list(struct snd_info_buffer *buffer,
|
|||||||
snd_iprintf(buffer, " ");
|
snd_iprintf(buffer, " ");
|
||||||
|
|
||||||
snd_iprintf(buffer,
|
snd_iprintf(buffer,
|
||||||
"Dev %02d: PD = %d, ELDV = %d, IA = %d\n", i,
|
"Dev %02d: PD = %d, ELDV = %d, IA = %d, Connections [", i,
|
||||||
!!(dev_list[i] & AC_DE_PD),
|
!!(dev_list[i] & AC_DE_PD),
|
||||||
!!(dev_list[i] & AC_DE_ELDV),
|
!!(dev_list[i] & AC_DE_ELDV),
|
||||||
!!(dev_list[i] & AC_DE_IA));
|
!!(dev_list[i] & AC_DE_IA));
|
||||||
|
|
||||||
|
print_dpmst_connections(buffer, codec, nid, i);
|
||||||
|
|
||||||
|
snd_iprintf(buffer, " ]\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ static int reconfig_codec(struct hda_codec *codec)
|
|||||||
"The codec is being used, can't reconfigure.\n");
|
"The codec is being used, can't reconfigure.\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
err = snd_hda_codec_configure(codec);
|
err = device_reprobe(hda_codec_dev(codec));
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto error;
|
goto error;
|
||||||
err = snd_card_register(codec->card);
|
err = snd_card_register(codec->card);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -78,6 +78,7 @@ struct hdmi_spec_per_pin {
|
|||||||
int pcm_idx; /* which pcm is attached. -1 means no pcm is attached */
|
int pcm_idx; /* which pcm is attached. -1 means no pcm is attached */
|
||||||
int repoll_count;
|
int repoll_count;
|
||||||
bool setup; /* the stream has been set up by prepare callback */
|
bool setup; /* the stream has been set up by prepare callback */
|
||||||
|
bool silent_stream;
|
||||||
int channels; /* current number of channels */
|
int channels; /* current number of channels */
|
||||||
bool non_pcm;
|
bool non_pcm;
|
||||||
bool chmap_set; /* channel-map override by ALSA API? */
|
bool chmap_set; /* channel-map override by ALSA API? */
|
||||||
@@ -252,7 +253,7 @@ static int pin_id_to_pin_index(struct hda_codec *codec,
|
|||||||
return pin_idx;
|
return pin_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
codec_warn(codec, "HDMI: pin nid %d not registered\n", pin_nid);
|
codec_warn(codec, "HDMI: pin NID 0x%x not registered\n", pin_nid);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,7 +313,7 @@ static int cvt_nid_to_cvt_index(struct hda_codec *codec, hda_nid_t cvt_nid)
|
|||||||
if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid)
|
if (get_cvt(spec, cvt_idx)->cvt_nid == cvt_nid)
|
||||||
return cvt_idx;
|
return cvt_idx;
|
||||||
|
|
||||||
codec_warn(codec, "HDMI: cvt nid %d not registered\n", cvt_nid);
|
codec_warn(codec, "HDMI: cvt NID 0x%x not registered\n", cvt_nid);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -637,11 +638,11 @@ static bool hdmi_infoframe_uptodate(struct hda_codec *codec, hda_nid_t pin_nid,
|
|||||||
u8 val;
|
u8 val;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
|
||||||
if (snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_DIP_XMIT, 0)
|
if (snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_HDMI_DIP_XMIT, 0)
|
||||||
!= AC_DIPXMIT_BEST)
|
!= AC_DIPXMIT_BEST)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
hdmi_set_dip_index(codec, pin_nid, 0x0, 0x0);
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
val = snd_hda_codec_read(codec, pin_nid, 0,
|
val = snd_hda_codec_read(codec, pin_nid, 0,
|
||||||
AC_VERB_GET_HDMI_DIP_DATA, 0);
|
AC_VERB_GET_HDMI_DIP_DATA, 0);
|
||||||
@@ -686,8 +687,7 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec,
|
|||||||
dp_ai->CC02_CT47 = active_channels - 1;
|
dp_ai->CC02_CT47 = active_channels - 1;
|
||||||
dp_ai->CA = ca;
|
dp_ai->CA = ca;
|
||||||
} else {
|
} else {
|
||||||
codec_dbg(codec, "HDMI: unknown connection type at pin %d\n",
|
codec_dbg(codec, "HDMI: unknown connection type at pin NID 0x%x\n", pin_nid);
|
||||||
pin_nid);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -700,10 +700,8 @@ static void hdmi_pin_setup_infoframe(struct hda_codec *codec,
|
|||||||
*/
|
*/
|
||||||
if (!hdmi_infoframe_uptodate(codec, pin_nid, ai.bytes,
|
if (!hdmi_infoframe_uptodate(codec, pin_nid, ai.bytes,
|
||||||
sizeof(ai))) {
|
sizeof(ai))) {
|
||||||
codec_dbg(codec,
|
codec_dbg(codec, "%s: pin NID=0x%x channels=%d ca=0x%02x\n",
|
||||||
"hdmi_pin_setup_infoframe: pin=%d channels=%d ca=0x%02x\n",
|
__func__, pin_nid, active_channels, ca);
|
||||||
pin_nid,
|
|
||||||
active_channels, ca);
|
|
||||||
hdmi_stop_infoframe_trans(codec, pin_nid);
|
hdmi_stop_infoframe_trans(codec, pin_nid);
|
||||||
hdmi_fill_audio_infoframe(codec, pin_nid,
|
hdmi_fill_audio_infoframe(codec, pin_nid,
|
||||||
ai.bytes, sizeof(ai));
|
ai.bytes, sizeof(ai));
|
||||||
@@ -795,7 +793,7 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res,
|
|||||||
jack->jack_dirty = 1;
|
jack->jack_dirty = 1;
|
||||||
|
|
||||||
codec_dbg(codec,
|
codec_dbg(codec,
|
||||||
"HDMI hot plug event: Codec=%d Pin=%d Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n",
|
"HDMI hot plug event: Codec=%d NID=0x%x Device=%d Inactive=%d Presence_Detect=%d ELD_Valid=%d\n",
|
||||||
codec->addr, jack->nid, jack->dev_id, !!(res & AC_UNSOL_RES_IA),
|
codec->addr, jack->nid, jack->dev_id, !!(res & AC_UNSOL_RES_IA),
|
||||||
!!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
|
!!(res & AC_UNSOL_RES_PD), !!(res & AC_UNSOL_RES_ELDV));
|
||||||
|
|
||||||
@@ -873,7 +871,7 @@ static void haswell_verify_D0(struct hda_codec *codec,
|
|||||||
msleep(40);
|
msleep(40);
|
||||||
pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
|
pwr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_POWER_STATE, 0);
|
||||||
pwr = (pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT;
|
pwr = (pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT;
|
||||||
codec_dbg(codec, "Haswell HDMI audio: Power for pin 0x%x is now D%d\n", nid, pwr);
|
codec_dbg(codec, "Haswell HDMI audio: Power for NID 0x%x is now D%d\n", nid, pwr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -979,6 +977,13 @@ static int hdmi_choose_cvt(struct hda_codec *codec,
|
|||||||
else
|
else
|
||||||
per_pin = get_pin(spec, pin_idx);
|
per_pin = get_pin(spec, pin_idx);
|
||||||
|
|
||||||
|
if (per_pin && per_pin->silent_stream) {
|
||||||
|
cvt_idx = cvt_nid_to_cvt_index(codec, per_pin->cvt_nid);
|
||||||
|
if (cvt_id)
|
||||||
|
*cvt_id = cvt_idx;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dynamically assign converter to stream */
|
/* Dynamically assign converter to stream */
|
||||||
for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) {
|
for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) {
|
||||||
per_cvt = get_cvt(spec, cvt_idx);
|
per_cvt = get_cvt(spec, cvt_idx);
|
||||||
@@ -1113,7 +1118,7 @@ static void intel_not_share_assigned_cvt(struct hda_codec *codec,
|
|||||||
per_cvt = get_cvt(spec, cvt_idx);
|
per_cvt = get_cvt(spec, cvt_idx);
|
||||||
if (!per_cvt->assigned) {
|
if (!per_cvt->assigned) {
|
||||||
codec_dbg(codec,
|
codec_dbg(codec,
|
||||||
"choose cvt %d for pin nid %d\n",
|
"choose cvt %d for pin NID 0x%x\n",
|
||||||
cvt_idx, nid);
|
cvt_idx, nid);
|
||||||
snd_hda_codec_write_cache(codec, nid, 0,
|
snd_hda_codec_write_cache(codec, nid, 0,
|
||||||
AC_VERB_SET_CONNECT_SEL,
|
AC_VERB_SET_CONNECT_SEL,
|
||||||
@@ -1312,7 +1317,7 @@ static int hdmi_read_pin_conn(struct hda_codec *codec, int pin_idx)
|
|||||||
|
|
||||||
if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) {
|
if (!(get_wcaps(codec, pin_nid) & AC_WCAP_CONN_LIST)) {
|
||||||
codec_warn(codec,
|
codec_warn(codec,
|
||||||
"HDMI: pin %d wcaps %#x does not support connection list\n",
|
"HDMI: pin NID 0x%x wcaps %#x does not support connection list\n",
|
||||||
pin_nid, get_wcaps(codec, pin_nid));
|
pin_nid, get_wcaps(codec, pin_nid));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -1627,7 +1632,7 @@ static void hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
|
|||||||
eld->eld_valid = false;
|
eld->eld_valid = false;
|
||||||
|
|
||||||
codec_dbg(codec,
|
codec_dbg(codec,
|
||||||
"HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n",
|
"HDMI status: Codec=%d NID=0x%x Presence_Detect=%d ELD_Valid=%d\n",
|
||||||
codec->addr, pin_nid, eld->monitor_present, eld->eld_valid);
|
codec->addr, pin_nid, eld->monitor_present, eld->eld_valid);
|
||||||
|
|
||||||
if (eld->eld_valid) {
|
if (eld->eld_valid) {
|
||||||
@@ -1642,30 +1647,95 @@ static void hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin,
|
|||||||
snd_hda_power_down_pm(codec);
|
snd_hda_power_down_pm(codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define I915_SILENT_RATE 48000
|
||||||
|
#define I915_SILENT_CHANNELS 2
|
||||||
|
#define I915_SILENT_FORMAT SNDRV_PCM_FORMAT_S16_LE
|
||||||
|
#define I915_SILENT_FORMAT_BITS 16
|
||||||
|
#define I915_SILENT_FMT_MASK 0xf
|
||||||
|
|
||||||
static void silent_stream_enable(struct hda_codec *codec,
|
static void silent_stream_enable(struct hda_codec *codec,
|
||||||
struct hdmi_spec_per_pin *per_pin)
|
struct hdmi_spec_per_pin *per_pin)
|
||||||
{
|
{
|
||||||
unsigned int newval, oldval;
|
struct hdmi_spec *spec = codec->spec;
|
||||||
|
struct hdmi_spec_per_cvt *per_cvt;
|
||||||
codec_dbg(codec, "hdmi: enabling silent stream for NID %d\n",
|
int cvt_idx, pin_idx, err;
|
||||||
per_pin->pin_nid);
|
unsigned int format;
|
||||||
|
|
||||||
mutex_lock(&per_pin->lock);
|
mutex_lock(&per_pin->lock);
|
||||||
|
|
||||||
if (!per_pin->channels)
|
if (per_pin->setup) {
|
||||||
per_pin->channels = 2;
|
codec_dbg(codec, "hdmi: PCM already open, no silent stream\n");
|
||||||
|
goto unlock_out;
|
||||||
|
}
|
||||||
|
|
||||||
oldval = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
|
pin_idx = pin_id_to_pin_index(codec, per_pin->pin_nid, per_pin->dev_id);
|
||||||
AC_VERB_GET_CONV, 0);
|
err = hdmi_choose_cvt(codec, pin_idx, &cvt_idx);
|
||||||
newval = (oldval & 0xF0) | 0xF;
|
if (err) {
|
||||||
snd_hda_codec_write(codec, per_pin->pin_nid, 0,
|
codec_err(codec, "hdmi: no free converter to enable silent mode\n");
|
||||||
AC_VERB_SET_CHANNEL_STREAMID, newval);
|
goto unlock_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
per_cvt = get_cvt(spec, cvt_idx);
|
||||||
|
per_cvt->assigned = 1;
|
||||||
|
per_pin->cvt_nid = per_cvt->cvt_nid;
|
||||||
|
per_pin->silent_stream = true;
|
||||||
|
|
||||||
|
codec_dbg(codec, "hdmi: enabling silent stream pin-NID=0x%x cvt-NID=0x%x\n",
|
||||||
|
per_pin->pin_nid, per_cvt->cvt_nid);
|
||||||
|
|
||||||
|
snd_hda_set_dev_select(codec, per_pin->pin_nid, per_pin->dev_id);
|
||||||
|
snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0,
|
||||||
|
AC_VERB_SET_CONNECT_SEL,
|
||||||
|
per_pin->mux_idx);
|
||||||
|
|
||||||
|
/* configure unused pins to choose other converters */
|
||||||
|
pin_cvt_fixup(codec, per_pin, 0);
|
||||||
|
|
||||||
|
snd_hdac_sync_audio_rate(&codec->core, per_pin->pin_nid,
|
||||||
|
per_pin->dev_id, I915_SILENT_RATE);
|
||||||
|
|
||||||
|
/* trigger silent stream generation in hw */
|
||||||
|
format = snd_hdac_calc_stream_format(I915_SILENT_RATE, I915_SILENT_CHANNELS,
|
||||||
|
I915_SILENT_FORMAT, I915_SILENT_FORMAT_BITS, 0);
|
||||||
|
snd_hda_codec_setup_stream(codec, per_pin->cvt_nid,
|
||||||
|
I915_SILENT_FMT_MASK, I915_SILENT_FMT_MASK, format);
|
||||||
|
usleep_range(100, 200);
|
||||||
|
snd_hda_codec_setup_stream(codec, per_pin->cvt_nid, I915_SILENT_FMT_MASK, 0, format);
|
||||||
|
|
||||||
|
per_pin->channels = I915_SILENT_CHANNELS;
|
||||||
hdmi_setup_audio_infoframe(codec, per_pin, per_pin->non_pcm);
|
hdmi_setup_audio_infoframe(codec, per_pin, per_pin->non_pcm);
|
||||||
|
|
||||||
|
unlock_out:
|
||||||
mutex_unlock(&per_pin->lock);
|
mutex_unlock(&per_pin->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void silent_stream_disable(struct hda_codec *codec,
|
||||||
|
struct hdmi_spec_per_pin *per_pin)
|
||||||
|
{
|
||||||
|
struct hdmi_spec *spec = codec->spec;
|
||||||
|
struct hdmi_spec_per_cvt *per_cvt;
|
||||||
|
int cvt_idx;
|
||||||
|
|
||||||
|
mutex_lock(&per_pin->lock);
|
||||||
|
if (!per_pin->silent_stream)
|
||||||
|
goto unlock_out;
|
||||||
|
|
||||||
|
codec_dbg(codec, "HDMI: disable silent stream on pin-NID=0x%x cvt-NID=0x%x\n",
|
||||||
|
per_pin->pin_nid, per_pin->cvt_nid);
|
||||||
|
|
||||||
|
cvt_idx = cvt_nid_to_cvt_index(codec, per_pin->cvt_nid);
|
||||||
|
if (cvt_idx >= 0 && cvt_idx < spec->num_cvts) {
|
||||||
|
per_cvt = get_cvt(spec, cvt_idx);
|
||||||
|
per_cvt->assigned = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
per_pin->cvt_nid = 0;
|
||||||
|
per_pin->silent_stream = false;
|
||||||
|
|
||||||
|
unlock_out:
|
||||||
|
mutex_unlock(&spec->pcm_lock);
|
||||||
|
}
|
||||||
|
|
||||||
/* update ELD and jack state via audio component */
|
/* update ELD and jack state via audio component */
|
||||||
static void sync_eld_via_acomp(struct hda_codec *codec,
|
static void sync_eld_via_acomp(struct hda_codec *codec,
|
||||||
struct hdmi_spec_per_pin *per_pin)
|
struct hdmi_spec_per_pin *per_pin)
|
||||||
@@ -1701,6 +1771,7 @@ static void sync_eld_via_acomp(struct hda_codec *codec,
|
|||||||
pm_ret);
|
pm_ret);
|
||||||
silent_stream_enable(codec, per_pin);
|
silent_stream_enable(codec, per_pin);
|
||||||
} else if (monitor_prev && !monitor_next) {
|
} else if (monitor_prev && !monitor_next) {
|
||||||
|
silent_stream_disable(codec, per_pin);
|
||||||
pm_ret = snd_hda_power_down_pm(codec);
|
pm_ret = snd_hda_power_down_pm(codec);
|
||||||
if (pm_ret < 0)
|
if (pm_ret < 0)
|
||||||
codec_err(codec,
|
codec_err(codec,
|
||||||
@@ -2721,7 +2792,7 @@ static int intel_pin2port(void *audio_ptr, int pin_nid)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
codec_info(codec, "Can't find the HDMI/DP port for pin %d\n", pin_nid);
|
codec_info(codec, "Can't find the HDMI/DP port for pin NID 0x%x\n", pin_nid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3104,6 +3104,7 @@ static void alc_disable_headset_jack_key(struct hda_codec *codec)
|
|||||||
case 0x10ec0215:
|
case 0x10ec0215:
|
||||||
case 0x10ec0225:
|
case 0x10ec0225:
|
||||||
case 0x10ec0285:
|
case 0x10ec0285:
|
||||||
|
case 0x10ec0287:
|
||||||
case 0x10ec0295:
|
case 0x10ec0295:
|
||||||
case 0x10ec0289:
|
case 0x10ec0289:
|
||||||
case 0x10ec0299:
|
case 0x10ec0299:
|
||||||
@@ -3130,6 +3131,7 @@ static void alc_enable_headset_jack_key(struct hda_codec *codec)
|
|||||||
case 0x10ec0215:
|
case 0x10ec0215:
|
||||||
case 0x10ec0225:
|
case 0x10ec0225:
|
||||||
case 0x10ec0285:
|
case 0x10ec0285:
|
||||||
|
case 0x10ec0287:
|
||||||
case 0x10ec0295:
|
case 0x10ec0295:
|
||||||
case 0x10ec0289:
|
case 0x10ec0289:
|
||||||
case 0x10ec0299:
|
case 0x10ec0299:
|
||||||
@@ -7956,6 +7958,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
||||||
SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
SND_PCI_QUIRK(0x1043, 0x11c0, "ASUS X556UR", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
||||||
|
SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
|
SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
|
SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
|
SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC),
|
||||||
@@ -7976,6 +7979,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
|
SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
||||||
|
SND_PCI_QUIRK(0x1043, 0x125e, "ASUS Q524UQK", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
|
SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
|
SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
|
||||||
SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
|
SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
|
||||||
@@ -8573,11 +8577,20 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
|
|||||||
{0x12, 0x90a60130},
|
{0x12, 0x90a60130},
|
||||||
{0x19, 0x03a11020},
|
{0x19, 0x03a11020},
|
||||||
{0x21, 0x0321101f}),
|
{0x21, 0x0321101f}),
|
||||||
|
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_NO_BASS_SPK_HEADSET_JACK,
|
||||||
|
{0x14, 0x90170110},
|
||||||
|
{0x19, 0x04a11040},
|
||||||
|
{0x21, 0x04211020}),
|
||||||
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
|
SND_HDA_PIN_QUIRK(0x10ec0285, 0x17aa, "Lenovo", ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
|
||||||
{0x12, 0x90a60130},
|
{0x12, 0x90a60130},
|
||||||
{0x14, 0x90170110},
|
{0x14, 0x90170110},
|
||||||
{0x19, 0x04a11040},
|
{0x19, 0x04a11040},
|
||||||
{0x21, 0x04211020}),
|
{0x21, 0x04211020}),
|
||||||
|
SND_HDA_PIN_QUIRK(0x10ec0287, 0x17aa, "Lenovo", ALC285_FIXUP_THINKPAD_HEADSET_JACK,
|
||||||
|
{0x14, 0x90170110},
|
||||||
|
{0x17, 0x90170111},
|
||||||
|
{0x19, 0x03a11030},
|
||||||
|
{0x21, 0x03211020}),
|
||||||
SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
|
SND_HDA_PIN_QUIRK(0x10ec0286, 0x1025, "Acer", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE,
|
||||||
{0x12, 0x90a60130},
|
{0x12, 0x90a60130},
|
||||||
{0x17, 0x90170110},
|
{0x17, 0x90170110},
|
||||||
|
|||||||
@@ -468,7 +468,6 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
|
|||||||
return 32000;
|
return 32000;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
switch (n) { /* supporting the CS8412 */
|
switch (n) { /* supporting the CS8412 */
|
||||||
|
|||||||
@@ -2286,7 +2286,6 @@ static int hdspm_get_wc_sample_rate(struct hdspm *hdspm)
|
|||||||
case AIO:
|
case AIO:
|
||||||
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
|
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
|
||||||
return (status >> 16) & 0xF;
|
return (status >> 16) & 0xF;
|
||||||
break;
|
|
||||||
case AES32:
|
case AES32:
|
||||||
status = hdspm_read(hdspm, HDSPM_statusRegister);
|
status = hdspm_read(hdspm, HDSPM_statusRegister);
|
||||||
return (status >> HDSPM_AES32_wcFreq_bit) & 0xF;
|
return (status >> HDSPM_AES32_wcFreq_bit) & 0xF;
|
||||||
@@ -2312,7 +2311,6 @@ static int hdspm_get_tco_sample_rate(struct hdspm *hdspm)
|
|||||||
case AIO:
|
case AIO:
|
||||||
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
|
status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);
|
||||||
return (status >> 20) & 0xF;
|
return (status >> 20) & 0xF;
|
||||||
break;
|
|
||||||
case AES32:
|
case AES32:
|
||||||
status = hdspm_read(hdspm, HDSPM_statusRegister);
|
status = hdspm_read(hdspm, HDSPM_statusRegister);
|
||||||
return (status >> 1) & 0xF;
|
return (status >> 1) & 0xF;
|
||||||
@@ -2338,7 +2336,6 @@ static int hdspm_get_sync_in_sample_rate(struct hdspm *hdspm)
|
|||||||
case AIO:
|
case AIO:
|
||||||
status = hdspm_read(hdspm, HDSPM_RD_STATUS_2);
|
status = hdspm_read(hdspm, HDSPM_RD_STATUS_2);
|
||||||
return (status >> 12) & 0xF;
|
return (status >> 12) & 0xF;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2358,7 +2355,6 @@ static int hdspm_get_aes_sample_rate(struct hdspm *hdspm, int index)
|
|||||||
case AES32:
|
case AES32:
|
||||||
timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
|
timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
|
||||||
return (timecode >> (4*index)) & 0xF;
|
return (timecode >> (4*index)) & 0xF;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3845,7 +3841,6 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
|
||||||
|
|
||||||
case MADI:
|
case MADI:
|
||||||
status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
|
status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
|
||||||
@@ -3856,7 +3851,6 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
|
||||||
|
|
||||||
case RayDAT:
|
case RayDAT:
|
||||||
case AIO:
|
case AIO:
|
||||||
@@ -3868,8 +3862,6 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm)
|
|||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MADIface:
|
case MADIface:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -6321,6 +6313,7 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep *hw, struct file *file,
|
|||||||
(statusregister & HDSPM_RX_64ch) ? 1 : 0;
|
(statusregister & HDSPM_RX_64ch) ? 1 : 0;
|
||||||
/* TODO: Mac driver sets it when f_s>48kHz */
|
/* TODO: Mac driver sets it when f_s>48kHz */
|
||||||
status.card_specific.madi.frame_format = 0;
|
status.card_specific.madi.frame_format = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -732,34 +732,27 @@ static inline int rme9652_spdif_sample_rate(struct snd_rme9652 *s)
|
|||||||
switch (rme9652_decode_spdif_rate(rate_bits)) {
|
switch (rme9652_decode_spdif_rate(rate_bits)) {
|
||||||
case 0x7:
|
case 0x7:
|
||||||
return 32000;
|
return 32000;
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x6:
|
case 0x6:
|
||||||
return 44100;
|
return 44100;
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x5:
|
case 0x5:
|
||||||
return 48000;
|
return 48000;
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x4:
|
case 0x4:
|
||||||
return 88200;
|
return 88200;
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x3:
|
case 0x3:
|
||||||
return 96000;
|
return 96000;
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x0:
|
case 0x0:
|
||||||
return 64000;
|
return 64000;
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dev_err(s->card->dev,
|
dev_err(s->card->dev,
|
||||||
"%s: unknown S/PDIF input rate (bits = 0x%x)\n",
|
"%s: unknown S/PDIF input rate (bits = 0x%x)\n",
|
||||||
s->card_name, rate_bits);
|
s->card_name, rate_bits);
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -896,11 +896,6 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
|
|||||||
u64 lpar_addr, lpar_size;
|
u64 lpar_addr, lpar_size;
|
||||||
static u64 dummy_mask;
|
static u64 dummy_mask;
|
||||||
|
|
||||||
if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)))
|
|
||||||
return -ENODEV;
|
|
||||||
if (WARN_ON(dev->match_id != PS3_MATCH_ID_SOUND))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
the_card.ps3_dev = dev;
|
the_card.ps3_dev = dev;
|
||||||
|
|
||||||
ret = ps3_open_hv_device(dev);
|
ret = ps3_open_hv_device(dev);
|
||||||
@@ -1053,8 +1048,6 @@ static int snd_ps3_driver_remove(struct ps3_system_bus_device *dev)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
pr_info("%s:start id=%d\n", __func__, dev->match_id);
|
pr_info("%s:start id=%d\n", __func__, dev->match_id);
|
||||||
if (dev->match_id != PS3_MATCH_ID_SOUND)
|
|
||||||
return -ENXIO;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ctl and preallocate buffer will be freed in
|
* ctl and preallocate buffer will be freed in
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
config SND_SOC_ADI
|
config SND_SOC_ADI
|
||||||
tristate "Audio support for Analog Devices reference designs"
|
tristate "Audio support for Analog Devices reference designs"
|
||||||
depends on MICROBLAZE || ARCH_ZYNQ || COMPILE_TEST
|
|
||||||
help
|
help
|
||||||
Audio support for various reference designs by Analog Devices.
|
Audio support for various reference designs by Analog Devices.
|
||||||
|
|
||||||
|
|||||||
@@ -73,8 +73,13 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
da7219_dai_wclk = clk_get(component->dev, "da7219-dai-wclk");
|
da7219_dai_wclk = devm_clk_get(component->dev, "da7219-dai-wclk");
|
||||||
da7219_dai_bclk = clk_get(component->dev, "da7219-dai-bclk");
|
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",
|
ret = snd_soc_card_jack_new(card, "Headset Jack",
|
||||||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ static int snd_acp3x_probe(struct pci_dev *pci,
|
|||||||
int ret, i;
|
int ret, i;
|
||||||
u32 addr, val;
|
u32 addr, val;
|
||||||
|
|
||||||
|
/* Raven device detection */
|
||||||
|
if (pci->revision != 0x00)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
if (pci_enable_device(pci)) {
|
if (pci_enable_device(pci)) {
|
||||||
dev_err(&pci->dev, "pci_enable_device failed\n");
|
dev_err(&pci->dev, "pci_enable_device failed\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@@ -231,9 +235,8 @@ static int snd_acp3x_probe(struct pci_dev *pci,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(&pci->dev, "Invalid ACP audio mode : %d\n", val);
|
dev_info(&pci->dev, "ACP audio mode : %d\n", val);
|
||||||
ret = -ENODEV;
|
break;
|
||||||
goto disable_msi;
|
|
||||||
}
|
}
|
||||||
pm_runtime_set_autosuspend_delay(&pci->dev, 2000);
|
pm_runtime_set_autosuspend_delay(&pci->dev, 2000);
|
||||||
pm_runtime_use_autosuspend(&pci->dev);
|
pm_runtime_use_autosuspend(&pci->dev);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
#include <linux/acpi.h>
|
#include <linux/acpi.h>
|
||||||
|
#include <linux/dmi.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/delay.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");
|
MODULE_PARM_DESC(acp_power_gating, "Enable acp power gating");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dmic_acpi_check = -1 - Checks ACPI method to know DMIC hardware status runtime
|
* dmic_acpi_check = -1 - Use ACPI/DMI method to detect the DMIC hardware presence at runtime
|
||||||
* = 0 - Skips the DMIC device creation and returns probe failure
|
* = 0 - Skip the DMIC device creation and return probe failure
|
||||||
* = 1 - Assumes that platform has DMIC support and skips ACPI
|
* = 1 - Force DMIC support
|
||||||
* method check
|
|
||||||
*/
|
*/
|
||||||
static int dmic_acpi_check = ACP_DMIC_AUTO;
|
static int dmic_acpi_check = ACP_DMIC_AUTO;
|
||||||
module_param(dmic_acpi_check, bint, 0644);
|
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 {
|
struct acp_dev_data {
|
||||||
void __iomem *acp_base;
|
void __iomem *acp_base;
|
||||||
@@ -163,6 +163,17 @@ static int rn_acp_deinit(void __iomem *acp_base)
|
|||||||
return 0;
|
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,
|
static int snd_rn_acp_probe(struct pci_dev *pci,
|
||||||
const struct pci_device_id *pci_id)
|
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_handle handle;
|
||||||
acpi_integer dmic_status;
|
acpi_integer dmic_status;
|
||||||
#endif
|
#endif
|
||||||
|
const struct dmi_system_id *dmi_id;
|
||||||
unsigned int irqflags;
|
unsigned int irqflags;
|
||||||
int ret, index;
|
int ret, index;
|
||||||
u32 addr;
|
u32 addr;
|
||||||
|
|
||||||
|
/* Renoir device check */
|
||||||
|
if (pci->revision != 0x01)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
if (pci_enable_device(pci)) {
|
if (pci_enable_device(pci)) {
|
||||||
dev_err(&pci->dev, "pci_enable_device failed\n");
|
dev_err(&pci->dev, "pci_enable_device failed\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
@@ -224,7 +240,7 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
|
|||||||
handle = ACPI_HANDLE(&pci->dev);
|
handle = ACPI_HANDLE(&pci->dev);
|
||||||
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
|
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
|
||||||
if (ACPI_FAILURE(ret)) {
|
if (ACPI_FAILURE(ret)) {
|
||||||
ret = -EINVAL;
|
ret = -ENODEV;
|
||||||
goto de_init;
|
goto de_init;
|
||||||
}
|
}
|
||||||
if (!dmic_status) {
|
if (!dmic_status) {
|
||||||
@@ -232,6 +248,12 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
|
|||||||
goto de_init;
|
goto de_init;
|
||||||
}
|
}
|
||||||
#endif
|
#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,
|
adata->res = devm_kzalloc(&pci->dev,
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ config SND_MCHP_SOC_SPDIFTX
|
|||||||
config SND_MCHP_SOC_SPDIFRX
|
config SND_MCHP_SOC_SPDIFRX
|
||||||
tristate "Microchip ASoC driver for boards using S/PDIF RX"
|
tristate "Microchip ASoC driver for boards using S/PDIF RX"
|
||||||
depends on OF && (ARCH_AT91 || COMPILE_TEST)
|
depends on OF && (ARCH_AT91 || COMPILE_TEST)
|
||||||
|
depends on COMMON_CLK
|
||||||
select SND_SOC_GENERIC_DMAENGINE_PCM
|
select SND_SOC_GENERIC_DMAENGINE_PCM
|
||||||
select REGMAP_MMIO
|
select REGMAP_MMIO
|
||||||
help
|
help
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ static int atmel_i2s_sama5d2_mck_init(struct atmel_i2s_dev *dev,
|
|||||||
err = PTR_ERR(muxclk);
|
err = PTR_ERR(muxclk);
|
||||||
if (err == -EPROBE_DEFER)
|
if (err == -EPROBE_DEFER)
|
||||||
return -EPROBE_DEFER;
|
return -EPROBE_DEFER;
|
||||||
dev_warn(dev->dev,
|
dev_dbg(dev->dev,
|
||||||
"failed to get the I2S clock control: %d\n", err);
|
"failed to get the I2S clock control: %d\n", err);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -797,7 +797,7 @@ static bool bcm2835_i2s_volatile_reg(struct device *dev, unsigned int reg)
|
|||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool bcm2835_i2s_precious_reg(struct device *dev, unsigned int reg)
|
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;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct regmap_config bcm2835_regmap_config = {
|
static const struct regmap_config bcm2835_regmap_config = {
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ config SND_SOC_ALL_CODECS
|
|||||||
imply SND_SOC_AD193X_I2C
|
imply SND_SOC_AD193X_I2C
|
||||||
imply SND_SOC_AD1980
|
imply SND_SOC_AD1980
|
||||||
imply SND_SOC_AD73311
|
imply SND_SOC_AD73311
|
||||||
|
imply SND_SOC_ADAU1372_I2C
|
||||||
|
imply SND_SOC_ADAU1372_SPI
|
||||||
imply SND_SOC_ADAU1373
|
imply SND_SOC_ADAU1373
|
||||||
imply SND_SOC_ADAU1761_I2C
|
imply SND_SOC_ADAU1761_I2C
|
||||||
imply SND_SOC_ADAU1761_SPI
|
imply SND_SOC_ADAU1761_SPI
|
||||||
@@ -130,6 +132,7 @@ config SND_SOC_ALL_CODECS
|
|||||||
imply SND_SOC_MT6358
|
imply SND_SOC_MT6358
|
||||||
imply SND_SOC_MT6359
|
imply SND_SOC_MT6359
|
||||||
imply SND_SOC_MT6660
|
imply SND_SOC_MT6660
|
||||||
|
imply SND_SOC_NAU8315
|
||||||
imply SND_SOC_NAU8540
|
imply SND_SOC_NAU8540
|
||||||
imply SND_SOC_NAU8810
|
imply SND_SOC_NAU8810
|
||||||
imply SND_SOC_NAU8822
|
imply SND_SOC_NAU8822
|
||||||
@@ -177,10 +180,12 @@ config SND_SOC_ALL_CODECS
|
|||||||
imply SND_SOC_RT700_SDW
|
imply SND_SOC_RT700_SDW
|
||||||
imply SND_SOC_RT711_SDW
|
imply SND_SOC_RT711_SDW
|
||||||
imply SND_SOC_RT715_SDW
|
imply SND_SOC_RT715_SDW
|
||||||
|
imply SND_SOC_RT715_SDCA_SDW
|
||||||
imply SND_SOC_RT1308_SDW
|
imply SND_SOC_RT1308_SDW
|
||||||
imply SND_SOC_SGTL5000
|
imply SND_SOC_SGTL5000
|
||||||
imply SND_SOC_SI476X
|
imply SND_SOC_SI476X
|
||||||
imply SND_SOC_SIMPLE_AMPLIFIER
|
imply SND_SOC_SIMPLE_AMPLIFIER
|
||||||
|
imply SND_SOC_SIMPLE_MUX
|
||||||
imply SND_SOC_SIRF_AUDIO_CODEC
|
imply SND_SOC_SIRF_AUDIO_CODEC
|
||||||
imply SND_SOC_SPDIF
|
imply SND_SOC_SPDIF
|
||||||
imply SND_SOC_SSM2305
|
imply SND_SOC_SSM2305
|
||||||
@@ -363,6 +368,22 @@ config SND_SOC_AD73311
|
|||||||
config SND_SOC_ADAU_UTILS
|
config SND_SOC_ADAU_UTILS
|
||||||
tristate
|
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
|
config SND_SOC_ADAU1373
|
||||||
tristate
|
tristate
|
||||||
depends on I2C
|
depends on I2C
|
||||||
@@ -1003,7 +1024,7 @@ config SND_SOC_PCM3168A_SPI
|
|||||||
select REGMAP_SPI
|
select REGMAP_SPI
|
||||||
|
|
||||||
config SND_SOC_PCM5102A
|
config SND_SOC_PCM5102A
|
||||||
tristate
|
tristate "Texas Instruments PCM5102A CODEC"
|
||||||
|
|
||||||
config SND_SOC_PCM512x
|
config SND_SOC_PCM512x
|
||||||
tristate
|
tristate
|
||||||
@@ -1216,6 +1237,12 @@ config SND_SOC_RT715_SDW
|
|||||||
select SND_SOC_RT715
|
select SND_SOC_RT715
|
||||||
select REGMAP_SOUNDWIRE
|
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
|
#Freescale sgtl5000 codec
|
||||||
config SND_SOC_SGTL5000
|
config SND_SOC_SGTL5000
|
||||||
tristate "Freescale SGTL5000 CODEC"
|
tristate "Freescale SGTL5000 CODEC"
|
||||||
@@ -1240,6 +1267,10 @@ config SND_SOC_SIMPLE_AMPLIFIER
|
|||||||
tristate "Simple Audio Amplifier"
|
tristate "Simple Audio Amplifier"
|
||||||
select GPIOLIB
|
select GPIOLIB
|
||||||
|
|
||||||
|
config SND_SOC_SIMPLE_MUX
|
||||||
|
tristate "Simple Audio Mux"
|
||||||
|
select GPIOLIB
|
||||||
|
|
||||||
config SND_SOC_SIRF_AUDIO_CODEC
|
config SND_SOC_SIRF_AUDIO_CODEC
|
||||||
tristate "SiRF SoC internal audio codec"
|
tristate "SiRF SoC internal audio codec"
|
||||||
select REGMAP_MMIO
|
select REGMAP_MMIO
|
||||||
@@ -1760,6 +1791,10 @@ config SND_SOC_MT6660
|
|||||||
Select N if you don't have MT6660 on board.
|
Select N if you don't have MT6660 on board.
|
||||||
Select M to build this as module.
|
Select M to build this as module.
|
||||||
|
|
||||||
|
config SND_SOC_NAU8315
|
||||||
|
tristate "Nuvoton Technology Corporation NAU8315 CODEC"
|
||||||
|
depends on GPIOLIB
|
||||||
|
|
||||||
config SND_SOC_NAU8540
|
config SND_SOC_NAU8540
|
||||||
tristate "Nuvoton Technology Corporation NAU85L40 CODEC"
|
tristate "Nuvoton Technology Corporation NAU85L40 CODEC"
|
||||||
depends on I2C
|
depends on I2C
|
||||||
@@ -1784,4 +1819,12 @@ config SND_SOC_TPA6130A2
|
|||||||
tristate "Texas Instruments TPA6130A2 headphone amplifier"
|
tristate "Texas Instruments TPA6130A2 headphone amplifier"
|
||||||
depends on I2C
|
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
|
endmenu
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ snd-soc-ad193x-i2c-objs := ad193x-i2c.o
|
|||||||
snd-soc-ad1980-objs := ad1980.o
|
snd-soc-ad1980-objs := ad1980.o
|
||||||
snd-soc-ad73311-objs := ad73311.o
|
snd-soc-ad73311-objs := ad73311.o
|
||||||
snd-soc-adau-utils-objs := adau-utils.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-adau1373-objs := adau1373.o
|
||||||
snd-soc-adau1701-objs := adau1701.o
|
snd-soc-adau1701-objs := adau1701.o
|
||||||
snd-soc-adau17x1-objs := adau17x1.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-lm4857-objs := lm4857.o
|
||||||
snd-soc-lm49453-objs := lm49453.o
|
snd-soc-lm49453-objs := lm49453.o
|
||||||
snd-soc-lochnagar-sc-objs := lochnagar-sc.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-madera-objs := madera.o
|
||||||
snd-soc-max9759-objs := max9759.o
|
snd-soc-max9759-objs := max9759.o
|
||||||
snd-soc-max9768-objs := max9768.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-mt6358-objs := mt6358.o
|
||||||
snd-soc-mt6359-objs := mt6359.o
|
snd-soc-mt6359-objs := mt6359.o
|
||||||
snd-soc-mt6660-objs := mt6660.o
|
snd-soc-mt6660-objs := mt6660.o
|
||||||
|
snd-soc-nau8315-objs := nau8315.o
|
||||||
snd-soc-nau8540-objs := nau8540.o
|
snd-soc-nau8540-objs := nau8540.o
|
||||||
snd-soc-nau8810-objs := nau8810.o
|
snd-soc-nau8810-objs := nau8810.o
|
||||||
snd-soc-nau8822-objs := nau8822.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-rt700-objs := rt700.o rt700-sdw.o
|
||||||
snd-soc-rt711-objs := rt711.o rt711-sdw.o
|
snd-soc-rt711-objs := rt711.o rt711-sdw.o
|
||||||
snd-soc-rt715-objs := rt715.o rt715-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-sgtl5000-objs := sgtl5000.o
|
||||||
snd-soc-alc5623-objs := alc5623.o
|
snd-soc-alc5623-objs := alc5623.o
|
||||||
snd-soc-alc5632-objs := alc5632.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-tas2552-objs := tas2552.o
|
||||||
snd-soc-tas2562-objs := tas2562.o
|
snd-soc-tas2562-objs := tas2562.o
|
||||||
snd-soc-tas2764-objs := tas2764.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_88PM860X) += snd-soc-88pm860x.o
|
||||||
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.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_AD1980) += snd-soc-ad1980.o
|
||||||
obj-$(CONFIG_SND_SOC_AD73311) += snd-soc-ad73311.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_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_ADAU1373) += snd-soc-adau1373.o
|
||||||
obj-$(CONFIG_SND_SOC_ADAU1701) += snd-soc-adau1701.o
|
obj-$(CONFIG_SND_SOC_ADAU1701) += snd-soc-adau1701.o
|
||||||
obj-$(CONFIG_SND_SOC_ADAU17X1) += snd-soc-adau17x1.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_MT6358) += snd-soc-mt6358.o
|
||||||
obj-$(CONFIG_SND_SOC_MT6359) += snd-soc-mt6359.o
|
obj-$(CONFIG_SND_SOC_MT6359) += snd-soc-mt6359.o
|
||||||
obj-$(CONFIG_SND_SOC_MT6660) += snd-soc-mt6660.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_NAU8540) += snd-soc-nau8540.o
|
||||||
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
|
obj-$(CONFIG_SND_SOC_NAU8810) += snd-soc-nau8810.o
|
||||||
obj-$(CONFIG_SND_SOC_NAU8822) += snd-soc-nau8822.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_RT700) += snd-soc-rt700.o
|
||||||
obj-$(CONFIG_SND_SOC_RT711) += snd-soc-rt711.o
|
obj-$(CONFIG_SND_SOC_RT711) += snd-soc-rt711.o
|
||||||
obj-$(CONFIG_SND_SOC_RT715) += snd-soc-rt715.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_SGTL5000) += snd-soc-sgtl5000.o
|
||||||
obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o
|
obj-$(CONFIG_SND_SOC_SIGMADSP) += snd-soc-sigmadsp.o
|
||||||
obj-$(CONFIG_SND_SOC_SIGMADSP_I2C) += snd-soc-sigmadsp-i2c.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_MAX98504) += snd-soc-max98504.o
|
||||||
obj-$(CONFIG_SND_SOC_SIMPLE_AMPLIFIER) += snd-soc-simple-amplifier.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_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
|
||||||
|
|||||||
40
sound/soc/codecs/adau1372-i2c.c
Normal file
40
sound/soc/codecs/adau1372-i2c.c
Normal 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");
|
||||||
58
sound/soc/codecs/adau1372-spi.c
Normal file
58
sound/soc/codecs/adau1372-spi.c
Normal 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
1062
sound/soc/codecs/adau1372.c
Normal file
File diff suppressed because it is too large
Load Diff
21
sound/soc/codecs/adau1372.h
Normal file
21
sound/soc/codecs/adau1372.h
Normal 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
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user