ASoC: Updates for v5.19
This is quite a big update, partly due to the addition of some larger drivers (more of which is to follow since at least the AVS driver is still a work in progress) and partly due to Charles' work sorting out our handling of endianness. As has been the case recently it's much more about drivers than the core. - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs. - Initial stages of Intel AVS driver merge. - Introduction of v4 IPC mechanism for SOF. - TDM mode support for AK4613. - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780 -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmKLf5EACgkQJNaLcl1U h9ASqAf/YnwbFP919ree/DEKUDCNc4klUH5M4JOexXbZlZDqxKYRGZjoLuiwX/PQ Au/xOjGEvm3Yg5/g5c8YFVNcIkv1O8VclRkV59oIxlBwKmQeTKvq+lOmlel2l1wZ XOmvHjE46wxH1N1cLwL6KkX0YDn59orSZGYZRpfLjL61y6LQWsLNU0tY6AWCRATB Llnrbu+DYgCsYNTEOOOY5s4V+4LkQm8TLdft91Va7mBdkPPRFoXRO0HGcVBqbkoN 7pf2mrjrLAWL9yuA8FlrgJbHq58DF9WGe5uEU7qlVL1zw46ClgIM0ABxPOdNdjV2 Wzb1jI7GmztgQNxlR9BcJB0kxAj9vA== =oD5l -----END PGP SIGNATURE----- Merge tag 'asoc-v5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.19 This is quite a big update, partly due to the addition of some larger drivers (more of which is to follow since at least the AVS driver is still a work in progress) and partly due to Charles' work sorting out our handling of endianness. As has been the case recently it's much more about drivers than the core. - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs. - Initial stages of Intel AVS driver merge. - Introduction of v4 IPC mechanism for SOF. - TDM mode support for AK4613. - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780
This commit is contained in:
commit
0163717ed5
|
@ -0,0 +1,105 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/dsp/mediatek,mt8195-dsp.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Mediatek mt8195 DSP core
|
||||
|
||||
maintainers:
|
||||
- YC Hung <yc.hung@mediatek.com>
|
||||
|
||||
description: |
|
||||
Some boards from mt8195 contain a DSP core used for
|
||||
advanced pre- and post- audio processing.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: mediatek,mt8195-dsp
|
||||
|
||||
reg:
|
||||
items:
|
||||
- description: Address and size of the DSP Cfg registers
|
||||
- description: Address and size of the DSP SRAM
|
||||
|
||||
reg-names:
|
||||
items:
|
||||
- const: cfg
|
||||
- const: sram
|
||||
|
||||
clocks:
|
||||
items:
|
||||
- description: mux for audio dsp clock
|
||||
- description: 26M clock
|
||||
- description: mux for audio dsp local bus
|
||||
- description: default audio dsp local bus clock source
|
||||
- description: clock gate for audio dsp clock
|
||||
- description: mux for audio dsp access external bus
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: adsp_sel
|
||||
- const: clk26m_ck
|
||||
- const: audio_local_bus
|
||||
- const: mainpll_d7_d2
|
||||
- const: scp_adsp_audiodsp
|
||||
- const: audio_h
|
||||
|
||||
power-domains:
|
||||
maxItems: 1
|
||||
|
||||
mboxes:
|
||||
items:
|
||||
- description: ipc reply between host and audio DSP.
|
||||
- description: ipc request between host and audio DSP.
|
||||
|
||||
mbox-names:
|
||||
items:
|
||||
- const: mbox0
|
||||
- const: mbox1
|
||||
|
||||
memory-region:
|
||||
items:
|
||||
- description: dma buffer between host and DSP.
|
||||
- description: DSP system memory.
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- reg-names
|
||||
- clocks
|
||||
- clock-names
|
||||
- memory-region
|
||||
- power-domains
|
||||
- mbox-names
|
||||
- mboxes
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
dsp@10803000 {
|
||||
compatible = "mediatek,mt8195-dsp";
|
||||
reg = <0x10803000 0x1000>,
|
||||
<0x10840000 0x40000>;
|
||||
reg-names = "cfg", "sram";
|
||||
clocks = <&topckgen 10>, //CLK_TOP_ADSP
|
||||
<&clk26m>,
|
||||
<&topckgen 107>, //CLK_TOP_AUDIO_LOCAL_BUS
|
||||
<&topckgen 136>, //CLK_TOP_MAINPLL_D7_D2
|
||||
<&scp_adsp 0>, //CLK_SCP_ADSP_AUDIODSP
|
||||
<&topckgen 34>; //CLK_TOP_AUDIO_H
|
||||
clock-names = "adsp_sel",
|
||||
"clk26m_ck",
|
||||
"audio_local_bus",
|
||||
"mainpll_d7_d2",
|
||||
"scp_adsp_audiodsp",
|
||||
"audio_h";
|
||||
memory-region = <&adsp_dma_mem_reserved>,
|
||||
<&adsp_mem_reserved>;
|
||||
power-domains = <&spm 6>; //MT8195_POWER_DOMAIN_ADSP
|
||||
mbox-names = "mbox0", "mbox1";
|
||||
mboxes = <&adsp_mailbox0>, <&adsp_mailbox1>;
|
||||
};
|
|
@ -0,0 +1,79 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/adi,max98396.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Analog Devices MAX98396 Speaker Amplifier Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- Ryan Lee <ryans.lee@analog.com>
|
||||
|
||||
description:
|
||||
The MAX98396 is a mono Class-DG speaker amplifier with I/V sense.
|
||||
The device provides a PCM interface for audio data and a standard
|
||||
I2C interface for control data communication.
|
||||
The MAX98397 is a variant of MAX98396 with wide input supply range.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- adi,max98396
|
||||
- adi,max98397
|
||||
reg:
|
||||
maxItems: 1
|
||||
description: I2C address of the device.
|
||||
|
||||
adi,vmon-slot-no:
|
||||
description: slot number of the voltage sense monitor
|
||||
$ref: "/schemas/types.yaml#/definitions/uint32"
|
||||
minimum: 0
|
||||
maximum: 15
|
||||
default: 0
|
||||
|
||||
adi,imon-slot-no:
|
||||
description: slot number of the current sense monitor
|
||||
$ref: "/schemas/types.yaml#/definitions/uint32"
|
||||
minimum: 0
|
||||
maximum: 15
|
||||
default: 0
|
||||
|
||||
adi,spkfb-slot-no:
|
||||
description: slot number of speaker DSP monitor
|
||||
$ref: "/schemas/types.yaml#/definitions/uint32"
|
||||
minimum: 0
|
||||
maximum: 15
|
||||
default: 0
|
||||
|
||||
adi,interleave-mode:
|
||||
description:
|
||||
For cases where a single combined channel for the I/V sense data
|
||||
is not sufficient, the device can also be configured to share
|
||||
a single data output channel on alternating frames.
|
||||
In this configuration, the current and voltage data will be frame
|
||||
interleaved on a single output channel.
|
||||
type: boolean
|
||||
|
||||
reset-gpios:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
max98396: amplifier@39 {
|
||||
compatible = "adi,max98396";
|
||||
reg = <0x39>;
|
||||
adi,vmon-slot-no = <0>;
|
||||
adi,imon-slot-no = <1>;
|
||||
reset-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,75 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/cirrus,cs35l45.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Cirrus Logic CS35L45 Speaker Amplifier
|
||||
|
||||
maintainers:
|
||||
- Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
|
||||
- Richard Fitzgerald <rf@opensource.cirrus.com>
|
||||
|
||||
description: |
|
||||
CS35L45 is a Boosted Mono Class D Amplifier with DSP
|
||||
Speaker Protection and Adaptive Battery Management.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- cirrus,cs35l45
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
|
||||
reset-gpios:
|
||||
maxItems: 1
|
||||
|
||||
vdd-a-supply:
|
||||
description: voltage regulator phandle for the VDD_A supply
|
||||
|
||||
vdd-batt-supply:
|
||||
description: voltage regulator phandle for the VDD_BATT supply
|
||||
|
||||
spi-max-frequency:
|
||||
maximum: 5000000
|
||||
|
||||
cirrus,asp-sdout-hiz-ctrl:
|
||||
description:
|
||||
Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
|
||||
configuration for SDOUT pin of amplifier. Logical OR of
|
||||
CS35L45_ASP_TX_HIZ_xxx values.
|
||||
$ref: "/schemas/types.yaml#/definitions/uint32"
|
||||
minimum: 0
|
||||
maximum: 3
|
||||
default: 2
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- "#sound-dai-cells"
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/sound/cs35l45.h>
|
||||
spi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cs35l45: cs35l45@2 {
|
||||
#sound-dai-cells = <1>;
|
||||
compatible = "cirrus,cs35l45";
|
||||
reg = <2>;
|
||||
spi-max-frequency = <5000000>;
|
||||
vdd-a-supply = <&dummy_vreg>;
|
||||
vdd-batt-supply = <&dummy_vreg>;
|
||||
reset-gpios = <&gpio 110 0>;
|
||||
cirrus,asp-sdout-hiz-ctrl = <(CS35L45_ASP_TX_HIZ_UNUSED |
|
||||
CS35L45_ASP_TX_HIZ_DISABLED)>;
|
||||
};
|
||||
};
|
|
@ -6,6 +6,7 @@ microphone bitstream in a configurable output sampling rate.
|
|||
Required properties:
|
||||
|
||||
- compatible : Compatible list, contains "fsl,imx8mm-micfil"
|
||||
or "fsl,imx8mp-micfil"
|
||||
|
||||
- reg : Offset and length of the register set for the device.
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ properties:
|
|||
minimum: 1
|
||||
maximum: 8388607
|
||||
|
||||
reset-gpios:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
@ -37,6 +40,7 @@ additionalProperties: false
|
|||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
@ -45,5 +49,6 @@ examples:
|
|||
reg = <0x38>;
|
||||
maxim,temperature_calib = <1024>;
|
||||
maxim,r0_calib = <100232>;
|
||||
reset-gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -18,6 +18,7 @@ properties:
|
|||
enum:
|
||||
- mediatek,mt8192_mt6359_rt1015_rt5682
|
||||
- mediatek,mt8192_mt6359_rt1015p_rt5682
|
||||
- mediatek,mt8192_mt6359_rt1015p_rt5682s
|
||||
|
||||
mediatek,platform:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
|
@ -27,11 +28,33 @@ properties:
|
|||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description: The phandle of HDMI codec.
|
||||
|
||||
headset-codec:
|
||||
type: object
|
||||
properties:
|
||||
sound-dai:
|
||||
$ref: /schemas/types.yaml#/definitions/phandle
|
||||
required:
|
||||
- sound-dai
|
||||
|
||||
speaker-codecs:
|
||||
type: object
|
||||
properties:
|
||||
sound-dai:
|
||||
minItems: 1
|
||||
maxItems: 2
|
||||
items:
|
||||
maxItems: 1
|
||||
$ref: /schemas/types.yaml#/definitions/phandle-array
|
||||
required:
|
||||
- sound-dai
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- mediatek,platform
|
||||
- headset-codec
|
||||
- speaker-codecs
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
@ -44,6 +67,15 @@ examples:
|
|||
"aud_clk_mosi_on";
|
||||
pinctrl-0 = <&aud_clk_mosi_off>;
|
||||
pinctrl-1 = <&aud_clk_mosi_on>;
|
||||
|
||||
headset-codec {
|
||||
sound-dai = <&rt5682>;
|
||||
};
|
||||
|
||||
speaker-codecs {
|
||||
sound-dai = <&rt1015_l>,
|
||||
<&rt1015_r>;
|
||||
};
|
||||
};
|
||||
|
||||
...
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/mt8195-mt6359-rt1011-rt5682.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Mediatek MT8195 with MT6359, RT1011 and RT5682 ASoC sound card driver
|
||||
|
||||
maintainers:
|
||||
- Trevor Wu <trevor.wu@mediatek.com>
|
||||
|
||||
description:
|
||||
This binding describes the MT8195 sound card with RT1011 and RT5682.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: mediatek,mt8195_mt6359_rt1011_rt5682
|
||||
|
||||
model:
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
||||
description: User specified audio sound card name
|
||||
|
||||
mediatek,platform:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description: The phandle of MT8195 ASoC platform.
|
||||
|
||||
mediatek,dptx-codec:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description: The phandle of MT8195 Display Port Tx codec node.
|
||||
|
||||
mediatek,hdmi-codec:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description: The phandle of MT8195 HDMI codec node.
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- mediatek,platform
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
||||
sound: mt8195-sound {
|
||||
compatible = "mediatek,mt8195_mt6359_rt1011_rt5682";
|
||||
mediatek,platform = <&afe>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&aud_pins_default>;
|
||||
};
|
||||
|
||||
...
|
|
@ -1,10 +1,10 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/mt8195-mt6359-rt1019-rt5682.yaml#
|
||||
$id: http://devicetree.org/schemas/sound/mt8195-mt6359.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Mediatek MT8195 with MT6359, RT1019 and RT5682 ASoC sound card driver
|
||||
title: MediaTek MT8195 ASoC sound card driver
|
||||
|
||||
maintainers:
|
||||
- Trevor Wu <trevor.wu@mediatek.com>
|
||||
|
@ -14,7 +14,10 @@ description:
|
|||
|
||||
properties:
|
||||
compatible:
|
||||
const: mediatek,mt8195_mt6359_rt1019_rt5682
|
||||
enum:
|
||||
- mediatek,mt8195_mt6359_rt1019_rt5682
|
||||
- mediatek,mt8195_mt6359_rt1011_rt5682
|
||||
- mediatek,mt8195_mt6359_max98390_rt5682
|
||||
|
||||
model:
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
|
@ -0,0 +1,81 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/nvidia,tegra186-asrc.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Tegra186 ASRC Device Tree Bindings
|
||||
|
||||
description: |
|
||||
Asynchronous Sample Rate Converter (ASRC) converts the sampling frequency
|
||||
of the input signal from one frequency to another. It can handle over a
|
||||
wide range of sample rate ratios (freq_in/freq_out) from 1:24 to 24:1.
|
||||
ASRC has two modes of operation. One where ratio can be programmed in SW
|
||||
and the other where it gets the information from ratio estimator module.
|
||||
|
||||
It supports sample rate conversions in the range of 8 to 192 kHz and
|
||||
supports 6 streams upto 12 total channels. The input data size can be
|
||||
16, 24 and 32 bits.
|
||||
|
||||
maintainers:
|
||||
- Jon Hunter <jonathanh@nvidia.com>
|
||||
- Mohan Kumar <mkumard@nvidia.com>
|
||||
- Sameer Pujar <spujar@nvidia.com>
|
||||
|
||||
allOf:
|
||||
- $ref: name-prefix.yaml#
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
pattern: "^asrc@[0-9a-f]*$"
|
||||
|
||||
compatible:
|
||||
oneOf:
|
||||
- const: nvidia,tegra186-asrc
|
||||
- items:
|
||||
- enum:
|
||||
- nvidia,tegra234-asrc
|
||||
- nvidia,tegra194-asrc
|
||||
- const: nvidia,tegra186-asrc
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
sound-name-prefix:
|
||||
pattern: "^ASRC[1-9]$"
|
||||
|
||||
ports:
|
||||
$ref: /schemas/graph.yaml#/properties/ports
|
||||
description: |
|
||||
ASRC has seven input ports and six output ports. Accordingly ACIF
|
||||
(Audio Client Interfaces) port nodes are defined to represent the
|
||||
ASRC inputs (port 0 to 6) and outputs (port 7 to 12). These are
|
||||
connected to corresponding ports on AHUB (Audio Hub). Additional
|
||||
input (port 6) is for receiving ratio information from estimator.
|
||||
|
||||
patternProperties:
|
||||
'^port@[0-6]':
|
||||
$ref: audio-graph-port.yaml#
|
||||
unevaluatedProperties: false
|
||||
description: ASRC ACIF input ports
|
||||
'^port@[7-9]|1[1-2]':
|
||||
$ref: audio-graph-port.yaml#
|
||||
unevaluatedProperties: false
|
||||
description: ASRC ACIF output ports
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
|
||||
asrc@2910000 {
|
||||
compatible = "nvidia,tegra186-asrc";
|
||||
reg = <0x2910000 0x2000>;
|
||||
sound-name-prefix = "ASRC1";
|
||||
};
|
||||
|
||||
...
|
|
@ -106,6 +106,10 @@ patternProperties:
|
|||
type: object
|
||||
$ref: nvidia,tegra210-mixer.yaml#
|
||||
|
||||
'^asrc@[0-9a-f]+$':
|
||||
type: object
|
||||
$ref: nvidia,tegra186-asrc.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
|
|
@ -38,8 +38,8 @@ properties:
|
|||
maxItems: 7
|
||||
|
||||
clock-names:
|
||||
minItems: 3
|
||||
maxItems: 7
|
||||
minItems: 1
|
||||
maxItems: 10
|
||||
|
||||
interrupts:
|
||||
minItems: 2
|
||||
|
@ -62,6 +62,9 @@ properties:
|
|||
power-domains:
|
||||
maxItems: 1
|
||||
|
||||
power-domain-names:
|
||||
maxItems: 1
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
|
||||
|
@ -192,15 +195,19 @@ allOf:
|
|||
oneOf:
|
||||
- items: #for I2S
|
||||
- const: aon_cc_audio_hm_h
|
||||
- const: audio_cc_ext_mclk0
|
||||
- const: core_cc_sysnoc_mport_core
|
||||
- const: core_cc_ext_if0_ibit
|
||||
- const: core_cc_ext_if1_ibit
|
||||
- items: #for Soundwire
|
||||
- const: aon_cc_audio_hm_h
|
||||
- const: audio_cc_codec_mem
|
||||
- const: audio_cc_codec_mem0
|
||||
- const: audio_cc_codec_mem1
|
||||
- const: audio_cc_codec_mem2
|
||||
- const: aon_cc_va_mem0
|
||||
- items: #for HDMI
|
||||
- const: aon_cc_audio_hm_h
|
||||
- const: core_cc_sysnoc_mport_core
|
||||
|
||||
reg-names:
|
||||
anyOf:
|
||||
|
@ -228,6 +235,10 @@ allOf:
|
|||
- const: lpass-irq-hdmi
|
||||
- const: lpass-irq-vaif
|
||||
- const: lpass-irq-rxtxif
|
||||
power-domain-names:
|
||||
allOf:
|
||||
- items:
|
||||
- const: lcx
|
||||
|
||||
required:
|
||||
- iommus
|
||||
|
|
|
@ -28,12 +28,17 @@ properties:
|
|||
maxItems: 5
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: macro
|
||||
- const: dcodec
|
||||
- const: fsgen
|
||||
oneOf:
|
||||
- items: #for ADSP based platforms
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: macro
|
||||
- const: dcodec
|
||||
- const: fsgen
|
||||
- items: #for ADSP bypass based platforms
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: fsgen
|
||||
|
||||
clock-output-names:
|
||||
items:
|
||||
|
|
|
@ -28,12 +28,17 @@ properties:
|
|||
maxItems: 5
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: macro
|
||||
- const: dcodec
|
||||
- const: fsgen
|
||||
oneOf:
|
||||
- items: #for ADSP based platforms
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: macro
|
||||
- const: dcodec
|
||||
- const: fsgen
|
||||
- items: #for ADSP bypass based platforms
|
||||
- const: mclk
|
||||
- const: npl
|
||||
- const: fsgen
|
||||
|
||||
clock-output-names:
|
||||
items:
|
||||
|
|
|
@ -28,10 +28,13 @@ properties:
|
|||
maxItems: 3
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: mclk
|
||||
- const: core
|
||||
- const: dcodec
|
||||
oneOf:
|
||||
- items: #for ADSP based platforms
|
||||
- const: mclk
|
||||
- const: core
|
||||
- const: dcodec
|
||||
- items: #for ADSP bypass based platforms
|
||||
- const: mclk
|
||||
|
||||
clock-output-names:
|
||||
items:
|
||||
|
|
|
@ -36,6 +36,9 @@ properties:
|
|||
vdd-io-supply:
|
||||
description: A reference to the 1.8V I/O supply
|
||||
|
||||
vdd-mic-bias-supply:
|
||||
description: A reference to the 3.8V mic bias supply
|
||||
|
||||
qcom,tx-device:
|
||||
$ref: /schemas/types.yaml#/definitions/phandle-array
|
||||
description: A reference to Soundwire tx device phandle
|
||||
|
|
|
@ -25,6 +25,9 @@ properties:
|
|||
0 means shut down; 1 means power on.
|
||||
maxItems: 1
|
||||
|
||||
"#sound-dai-cells":
|
||||
const: 0
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ Optional properties:
|
|||
|
||||
- realtek,dmic-clk-driving-high : Set the high driving of the DMIC clock out.
|
||||
|
||||
- #sound-dai-cells: Should be set to '<0>'.
|
||||
|
||||
Pins on the device (for linking into audio routes) for RT5682:
|
||||
|
||||
* DMIC L1
|
||||
|
|
|
@ -1,25 +1,26 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
# Copyright (C) 2020 Texas Instruments Incorporated
|
||||
# Copyright (C) 2020-2022 Texas Instruments Incorporated
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: "http://devicetree.org/schemas/sound/tas2764.yaml#"
|
||||
$id: "http://devicetree.org/schemas/sound/tas27xx.yaml#"
|
||||
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
|
||||
|
||||
title: Texas Instruments TAS2764 Smart PA
|
||||
title: Texas Instruments TAS2764/TAS2780 Smart PA
|
||||
|
||||
maintainers:
|
||||
- Dan Murphy <dmurphy@ti.com>
|
||||
- Shenghao Ding <shenghao-ding@ti.com>
|
||||
|
||||
description: |
|
||||
The TAS2764 is a mono, digital input Class-D audio amplifier optimized for
|
||||
efficiently driving high peak power into small loudspeakers.
|
||||
Integrated speaker voltage and current sense provides for
|
||||
real time monitoring of loudspeaker behavior.
|
||||
The TAS2764/TAS2780 is a mono, digital input Class-D audio amplifier
|
||||
optimized for efficiently driving high peak power into small
|
||||
loudspeakers. Integrated speaker voltage and current sense provides
|
||||
for real time monitoring of loudspeaker behavior.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- ti,tas2764
|
||||
- ti,tas2780
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
|
@ -0,0 +1,97 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/wlf,wm8731.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Wolfson Microelectromics WM8731 audio CODEC
|
||||
|
||||
maintainers:
|
||||
- patches@opensource.cirrus.com
|
||||
|
||||
description: |
|
||||
Wolfson Microelectronics WM8731 audio CODEC
|
||||
|
||||
Pins on the device (for linking into audio routes):
|
||||
* LOUT: Left Channel Line Output
|
||||
* ROUT: Right Channel Line Output
|
||||
* LHPOUT: Left Channel Headphone Output
|
||||
* RHPOUT: Right Channel Headphone Output
|
||||
* LLINEIN: Left Channel Line Input
|
||||
* RLINEIN: Right Channel Line Input
|
||||
* MICIN: Microphone Input
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- wlf,wm8731
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
"#sound-dai-cells":
|
||||
const: 0
|
||||
|
||||
clocks:
|
||||
description: Clock provider for MCLK pin.
|
||||
maxItems: 1
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: mclk
|
||||
|
||||
AVDD-supply:
|
||||
description: Analog power supply regulator on the AVDD pin.
|
||||
|
||||
HPVDD-supply:
|
||||
description: Headphone power supply regulator on the HPVDD pin.
|
||||
|
||||
DBVDD-supply:
|
||||
description: Digital buffer supply regulator for the DBVDD pin.
|
||||
|
||||
DCVDD-supply:
|
||||
description: Digital core supply regulator for the DCVDD pin.
|
||||
|
||||
spi-max-frequency: true
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- reg
|
||||
- compatible
|
||||
- AVDD-supply
|
||||
- HPVDD-supply
|
||||
- DBVDD-supply
|
||||
- DCVDD-supply
|
||||
|
||||
examples:
|
||||
- |
|
||||
spi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
wm8731_i2c: codec@0 {
|
||||
compatible = "wlf,wm8731";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <12500000>;
|
||||
|
||||
AVDD-supply = <&avdd_reg>;
|
||||
HPVDD-supply = <&hpvdd_reg>;
|
||||
DCVDD-supply = <&dcvdd_reg>;
|
||||
DBVDD-supply = <&dbvdd_reg>;
|
||||
};
|
||||
};
|
||||
- |
|
||||
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
wm8731_spi: codec@1b {
|
||||
compatible = "wlf,wm8731";
|
||||
reg = <0x1b>;
|
||||
|
||||
AVDD-supply = <&avdd_reg>;
|
||||
HPVDD-supply = <&hpvdd_reg>;
|
||||
DCVDD-supply = <&dcvdd_reg>;
|
||||
DBVDD-supply = <&dbvdd_reg>;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,57 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/wlf,wm8940.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Wolfson WM8940 Codec Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- patches@opensource.cirrus.com
|
||||
|
||||
properties:
|
||||
'#sound-dai-cells':
|
||||
const: 0
|
||||
|
||||
compatible:
|
||||
const: wlf,wm8940
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
spi-max-frequency:
|
||||
maximum: 526000
|
||||
|
||||
required:
|
||||
- '#sound-dai-cells'
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
spi {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
codec@0 {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "wlf,wm8940";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
- |
|
||||
i2c {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
codec@1a {
|
||||
#sound-dai-cells = <0>;
|
||||
compatible = "wlf,wm8940";
|
||||
reg = <0x1a>;
|
||||
};
|
||||
};
|
||||
|
||||
...
|
|
@ -1,27 +0,0 @@
|
|||
WM8731 audio CODEC
|
||||
|
||||
This device supports both I2C and SPI (configured with pin strapping
|
||||
on the board).
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "wlf,wm8731"
|
||||
|
||||
- reg : the I2C address of the device for I2C, the chip select
|
||||
number for SPI.
|
||||
|
||||
Example:
|
||||
|
||||
wm8731: codec@1a {
|
||||
compatible = "wlf,wm8731";
|
||||
reg = <0x1a>;
|
||||
};
|
||||
|
||||
Available audio endpoints for an audio-routing table:
|
||||
* LOUT: Left Channel Line Output
|
||||
* ROUT: Right Channel Line Output
|
||||
* LHPOUT: Left Channel Headphone Output
|
||||
* RHPOUT: Right Channel Headphone Output
|
||||
* LLINEIN: Left Channel Line Input
|
||||
* RLINEIN: Right Channel Line Input
|
||||
* MICIN: Microphone Input
|
|
@ -4688,10 +4688,12 @@ CIRRUS LOGIC AUDIO CODEC DRIVERS
|
|||
M: James Schulman <james.schulman@cirrus.com>
|
||||
M: David Rhodes <david.rhodes@cirrus.com>
|
||||
M: Lucas Tanure <tanureal@opensource.cirrus.com>
|
||||
M: Richard Fitzgerald <rf@opensource.cirrus.com>
|
||||
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
|
||||
L: patches@opensource.cirrus.com
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/sound/cirrus,cs*
|
||||
F: include/dt-bindings/sound/cs*
|
||||
F: sound/pci/hda/cs*
|
||||
F: sound/soc/codecs/cs*
|
||||
|
||||
|
|
|
@ -211,7 +211,8 @@ CONFIG_SND_ATMEL_SOC_WM8904=m
|
|||
CONFIG_SND_AT91_SOC_SAM9X5_WM8731=m
|
||||
CONFIG_SND_KIRKWOOD_SOC=y
|
||||
CONFIG_SND_SOC_ALC5623=y
|
||||
CONFIG_SND_SOC_WM8731=y
|
||||
CONFIG_SND_SOC_WM8731_I2C=y
|
||||
CONFIG_SND_SOC_WM8731_SPI=y
|
||||
CONFIG_SND_SIMPLE_CARD=y
|
||||
CONFIG_HID_DRAGONRISE=y
|
||||
CONFIG_HID_GYRATION=y
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <linux/of_dma.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
|
||||
#include "dmaengine.h"
|
||||
#define IMXDMA_MAX_CHAN_DESCRIPTORS 16
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/iopoll.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
@ -35,7 +36,7 @@
|
|||
#include <linux/workqueue.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
|
||||
|
@ -73,6 +74,7 @@
|
|||
#define SDMA_CHNENBL0_IMX35 0x200
|
||||
#define SDMA_CHNENBL0_IMX31 0x080
|
||||
#define SDMA_CHNPRI_0 0x100
|
||||
#define SDMA_DONE0_CONFIG 0x1000
|
||||
|
||||
/*
|
||||
* Buffer descriptor status values.
|
||||
|
@ -180,6 +182,12 @@
|
|||
BIT(DMA_MEM_TO_DEV) | \
|
||||
BIT(DMA_DEV_TO_DEV))
|
||||
|
||||
#define SDMA_WATERMARK_LEVEL_N_FIFOS GENMASK(15, 12)
|
||||
#define SDMA_WATERMARK_LEVEL_SW_DONE BIT(23)
|
||||
|
||||
#define SDMA_DONE0_CONFIG_DONE_SEL BIT(7)
|
||||
#define SDMA_DONE0_CONFIG_DONE_DIS BIT(6)
|
||||
|
||||
/**
|
||||
* struct sdma_script_start_addrs - SDMA script start pointers
|
||||
*
|
||||
|
@ -441,6 +449,9 @@ struct sdma_channel {
|
|||
struct work_struct terminate_worker;
|
||||
struct list_head terminated;
|
||||
bool is_ram_script;
|
||||
unsigned int n_fifos_src;
|
||||
unsigned int n_fifos_dst;
|
||||
bool sw_done;
|
||||
};
|
||||
|
||||
#define IMX_DMA_SG_LOOP BIT(0)
|
||||
|
@ -778,6 +789,14 @@ static void sdma_event_enable(struct sdma_channel *sdmac, unsigned int event)
|
|||
val = readl_relaxed(sdma->regs + chnenbl);
|
||||
__set_bit(channel, &val);
|
||||
writel_relaxed(val, sdma->regs + chnenbl);
|
||||
|
||||
/* Set SDMA_DONEx_CONFIG is sw_done enabled */
|
||||
if (sdmac->sw_done) {
|
||||
val = readl_relaxed(sdma->regs + SDMA_DONE0_CONFIG);
|
||||
val |= SDMA_DONE0_CONFIG_DONE_SEL;
|
||||
val &= ~SDMA_DONE0_CONFIG_DONE_DIS;
|
||||
writel_relaxed(val, sdma->regs + SDMA_DONE0_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
static void sdma_event_disable(struct sdma_channel *sdmac, unsigned int event)
|
||||
|
@ -940,7 +959,7 @@ static irqreturn_t sdma_int_handler(int irq, void *dev_id)
|
|||
/*
|
||||
* sets the pc of SDMA script according to the peripheral type
|
||||
*/
|
||||
static void sdma_get_pc(struct sdma_channel *sdmac,
|
||||
static int sdma_get_pc(struct sdma_channel *sdmac,
|
||||
enum sdma_peripheral_type peripheral_type)
|
||||
{
|
||||
struct sdma_engine *sdma = sdmac->sdma;
|
||||
|
@ -1038,14 +1057,22 @@ static void sdma_get_pc(struct sdma_channel *sdmac,
|
|||
case IMX_DMATYPE_IPU_MEMORY:
|
||||
emi_2_per = sdma->script_addrs->ext_mem_2_ipu_addr;
|
||||
break;
|
||||
default:
|
||||
case IMX_DMATYPE_MULTI_SAI:
|
||||
per_2_emi = sdma->script_addrs->sai_2_mcu_addr;
|
||||
emi_2_per = sdma->script_addrs->mcu_2_sai_addr;
|
||||
break;
|
||||
default:
|
||||
dev_err(sdma->dev, "Unsupported transfer type %d\n",
|
||||
peripheral_type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
sdmac->pc_from_device = per_2_emi;
|
||||
sdmac->pc_to_device = emi_2_per;
|
||||
sdmac->device_to_device = per_2_per;
|
||||
sdmac->pc_to_pc = emi_2_emi;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sdma_load_context(struct sdma_channel *sdmac)
|
||||
|
@ -1210,9 +1237,26 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac)
|
|||
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_CONT;
|
||||
}
|
||||
|
||||
static void sdma_set_watermarklevel_for_sais(struct sdma_channel *sdmac)
|
||||
{
|
||||
unsigned int n_fifos;
|
||||
|
||||
if (sdmac->sw_done)
|
||||
sdmac->watermark_level |= SDMA_WATERMARK_LEVEL_SW_DONE;
|
||||
|
||||
if (sdmac->direction == DMA_DEV_TO_MEM)
|
||||
n_fifos = sdmac->n_fifos_src;
|
||||
else
|
||||
n_fifos = sdmac->n_fifos_dst;
|
||||
|
||||
sdmac->watermark_level |=
|
||||
FIELD_PREP(SDMA_WATERMARK_LEVEL_N_FIFOS, n_fifos);
|
||||
}
|
||||
|
||||
static int sdma_config_channel(struct dma_chan *chan)
|
||||
{
|
||||
struct sdma_channel *sdmac = to_sdma_chan(chan);
|
||||
int ret;
|
||||
|
||||
sdma_disable_channel(chan);
|
||||
|
||||
|
@ -1233,7 +1277,9 @@ static int sdma_config_channel(struct dma_chan *chan)
|
|||
break;
|
||||
}
|
||||
|
||||
sdma_get_pc(sdmac, sdmac->peripheral_type);
|
||||
ret = sdma_get_pc(sdmac, sdmac->peripheral_type);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if ((sdmac->peripheral_type != IMX_DMATYPE_MEMORY) &&
|
||||
(sdmac->peripheral_type != IMX_DMATYPE_DSP)) {
|
||||
|
@ -1243,6 +1289,10 @@ static int sdma_config_channel(struct dma_chan *chan)
|
|||
sdmac->peripheral_type == IMX_DMATYPE_ASRC)
|
||||
sdma_set_watermarklevel_for_p2p(sdmac);
|
||||
} else {
|
||||
if (sdmac->peripheral_type ==
|
||||
IMX_DMATYPE_MULTI_SAI)
|
||||
sdma_set_watermarklevel_for_sais(sdmac);
|
||||
|
||||
__set_bit(sdmac->event_id0, sdmac->event_mask);
|
||||
}
|
||||
|
||||
|
@ -1349,7 +1399,9 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan)
|
|||
mem_data.dma_request2 = 0;
|
||||
data = &mem_data;
|
||||
|
||||
sdma_get_pc(sdmac, IMX_DMATYPE_MEMORY);
|
||||
ret = sdma_get_pc(sdmac, IMX_DMATYPE_MEMORY);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (data->priority) {
|
||||
|
@ -1698,9 +1750,23 @@ static int sdma_config(struct dma_chan *chan,
|
|||
struct dma_slave_config *dmaengine_cfg)
|
||||
{
|
||||
struct sdma_channel *sdmac = to_sdma_chan(chan);
|
||||
struct sdma_engine *sdma = sdmac->sdma;
|
||||
|
||||
memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg));
|
||||
|
||||
if (dmaengine_cfg->peripheral_config) {
|
||||
struct sdma_peripheral_config *sdmacfg = dmaengine_cfg->peripheral_config;
|
||||
if (dmaengine_cfg->peripheral_size != sizeof(struct sdma_peripheral_config)) {
|
||||
dev_err(sdma->dev, "Invalid peripheral size %zu, expected %zu\n",
|
||||
dmaengine_cfg->peripheral_size,
|
||||
sizeof(struct sdma_peripheral_config));
|
||||
return -EINVAL;
|
||||
}
|
||||
sdmac->n_fifos_src = sdmacfg->n_fifos_src;
|
||||
sdmac->n_fifos_dst = sdmacfg->n_fifos_dst;
|
||||
sdmac->sw_done = sdmacfg->sw_done;
|
||||
}
|
||||
|
||||
/* Set ENBLn earlier to make sure dma request triggered after that */
|
||||
if (sdmac->event_id0 >= sdmac->sdma->drvdata->num_events)
|
||||
return -EINVAL;
|
||||
|
|
|
@ -203,6 +203,15 @@ config INTEL_STRATIX10_RSU
|
|||
|
||||
Say Y here if you want Intel RSU support.
|
||||
|
||||
config MTK_ADSP_IPC
|
||||
tristate "MTK ADSP IPC Protocol driver"
|
||||
depends on MTK_ADSP_MBOX
|
||||
help
|
||||
Say yes here to add support for the MediaTek ADSP IPC
|
||||
between host AP (Linux) and the firmware running on ADSP.
|
||||
ADSP exists on some mtk processors.
|
||||
Client might use shared memory to exchange information with ADSP.
|
||||
|
||||
config QCOM_SCM
|
||||
tristate
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ obj-$(CONFIG_INTEL_STRATIX10_RSU) += stratix10-rsu.o
|
|||
obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
|
||||
obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
|
||||
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
|
||||
obj-$(CONFIG_MTK_ADSP_IPC) += mtk-adsp-ipc.o
|
||||
obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
|
||||
obj-$(CONFIG_FW_CFG_SYSFS) += qemu_fw_cfg.o
|
||||
obj-$(CONFIG_QCOM_SCM) += qcom-scm.o
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (c) 2022 MediaTek Corporation. All rights reserved.
|
||||
* Author: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
|
||||
*/
|
||||
|
||||
#include <linux/firmware/mediatek/mtk-adsp-ipc.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/*
|
||||
* mtk_adsp_ipc_send - send ipc cmd to MTK ADSP
|
||||
*
|
||||
* @ipc: ADSP IPC handle
|
||||
* @idx: index of the mailbox channel
|
||||
* @msg: IPC cmd (reply or request)
|
||||
*
|
||||
* Returns zero for success from mbox_send_message
|
||||
* negative value for error
|
||||
*/
|
||||
int mtk_adsp_ipc_send(struct mtk_adsp_ipc *ipc, unsigned int idx, uint32_t msg)
|
||||
{
|
||||
struct mtk_adsp_chan *adsp_chan;
|
||||
int ret;
|
||||
|
||||
if (idx >= MTK_ADSP_MBOX_NUM)
|
||||
return -EINVAL;
|
||||
|
||||
adsp_chan = &ipc->chans[idx];
|
||||
ret = mbox_send_message(adsp_chan->ch, &msg);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_adsp_ipc_send);
|
||||
|
||||
/*
|
||||
* mtk_adsp_ipc_recv - recv callback used by MTK ADSP mailbox
|
||||
*
|
||||
* @c: mbox client
|
||||
* @msg: message received
|
||||
*
|
||||
* Users of ADSP IPC will need to privde handle_reply and handle_request
|
||||
* callbacks.
|
||||
*/
|
||||
static void mtk_adsp_ipc_recv(struct mbox_client *c, void *msg)
|
||||
{
|
||||
struct mtk_adsp_chan *chan = container_of(c, struct mtk_adsp_chan, cl);
|
||||
struct device *dev = c->dev;
|
||||
|
||||
switch (chan->idx) {
|
||||
case MTK_ADSP_MBOX_REPLY:
|
||||
chan->ipc->ops->handle_reply(chan->ipc);
|
||||
break;
|
||||
case MTK_ADSP_MBOX_REQUEST:
|
||||
chan->ipc->ops->handle_request(chan->ipc);
|
||||
break;
|
||||
default:
|
||||
dev_err(dev, "wrong mbox chan %d\n", chan->idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int mtk_adsp_ipc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct mtk_adsp_ipc *adsp_ipc;
|
||||
struct mtk_adsp_chan *adsp_chan;
|
||||
struct mbox_client *cl;
|
||||
char *chan_name;
|
||||
int ret;
|
||||
int i, j;
|
||||
|
||||
device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
|
||||
|
||||
adsp_ipc = devm_kzalloc(dev, sizeof(*adsp_ipc), GFP_KERNEL);
|
||||
if (!adsp_ipc)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < MTK_ADSP_MBOX_NUM; i++) {
|
||||
chan_name = kasprintf(GFP_KERNEL, "mbox%d", i);
|
||||
if (!chan_name) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
adsp_chan = &adsp_ipc->chans[i];
|
||||
cl = &adsp_chan->cl;
|
||||
cl->dev = dev->parent;
|
||||
cl->tx_block = false;
|
||||
cl->knows_txdone = false;
|
||||
cl->tx_prepare = NULL;
|
||||
cl->rx_callback = mtk_adsp_ipc_recv;
|
||||
|
||||
adsp_chan->ipc = adsp_ipc;
|
||||
adsp_chan->idx = i;
|
||||
adsp_chan->ch = mbox_request_channel_byname(cl, chan_name);
|
||||
if (IS_ERR(adsp_chan->ch)) {
|
||||
ret = PTR_ERR(adsp_chan->ch);
|
||||
if (ret != -EPROBE_DEFER)
|
||||
dev_err(dev, "Failed to request mbox chan %d ret %d\n",
|
||||
i, ret);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
dev_dbg(dev, "request mbox chan %s\n", chan_name);
|
||||
kfree(chan_name);
|
||||
}
|
||||
|
||||
adsp_ipc->dev = dev;
|
||||
dev_set_drvdata(dev, adsp_ipc);
|
||||
dev_dbg(dev, "MTK ADSP IPC initialized\n");
|
||||
|
||||
return 0;
|
||||
|
||||
out_free:
|
||||
kfree(chan_name);
|
||||
out:
|
||||
for (j = 0; j < i; j++) {
|
||||
adsp_chan = &adsp_ipc->chans[j];
|
||||
mbox_free_channel(adsp_chan->ch);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mtk_adsp_ipc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mtk_adsp_ipc *adsp_ipc = dev_get_drvdata(&pdev->dev);
|
||||
struct mtk_adsp_chan *adsp_chan;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MTK_ADSP_MBOX_NUM; i++) {
|
||||
adsp_chan = &adsp_ipc->chans[i];
|
||||
mbox_free_channel(adsp_chan->ch);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver mtk_adsp_ipc_driver = {
|
||||
.driver = {
|
||||
.name = "mtk-adsp-ipc",
|
||||
},
|
||||
.probe = mtk_adsp_ipc_probe,
|
||||
.remove = mtk_adsp_ipc_remove,
|
||||
};
|
||||
builtin_platform_driver(mtk_adsp_ipc_driver);
|
||||
|
||||
MODULE_AUTHOR("Allen-KH Cheng <allen-kh.cheng@mediatek.com>");
|
||||
MODULE_DESCRIPTION("MTK ADSP IPC Driver");
|
||||
MODULE_LICENSE("GPL");
|
|
@ -39,7 +39,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <linux/platform_data/mmc-mxcmmc.h>
|
||||
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
|
||||
#define DRIVER_NAME "mxc-mmc"
|
||||
#define MXCMCI_TIMEOUT_MS 10000
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <linux/of_device.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spi/spi.h>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <linux/of_device.h>
|
||||
#include <linux/property.h>
|
||||
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
|
||||
#define DRIVER_NAME "spi_imx"
|
||||
|
||||
|
|
|
@ -702,8 +702,9 @@ static int gbaudio_init_jack(struct gbaudio_module_info *module,
|
|||
|
||||
headset->pin = module->jack_name;
|
||||
headset->mask = module->jack_mask;
|
||||
ret = snd_soc_card_jack_new(card, module->jack_name, module->jack_mask,
|
||||
&module->headset.jack, headset, 1);
|
||||
ret = snd_soc_card_jack_new_pins(card, module->jack_name,
|
||||
module->jack_mask,
|
||||
&module->headset.jack, headset, 1);
|
||||
if (ret) {
|
||||
dev_err(module->dev, "Failed to create new jack\n");
|
||||
return ret;
|
||||
|
@ -725,9 +726,10 @@ static int gbaudio_init_jack(struct gbaudio_module_info *module,
|
|||
|
||||
button->pin = module->button_name;
|
||||
button->mask = module->button_mask;
|
||||
ret = snd_soc_card_jack_new(card, module->button_name,
|
||||
module->button_mask, &module->button.jack,
|
||||
button, 1);
|
||||
ret = snd_soc_card_jack_new_pins(card, module->button_name,
|
||||
module->button_mask,
|
||||
&module->button.jack,
|
||||
button, 1);
|
||||
if (ret) {
|
||||
dev_err(module->dev, "Failed to create button jack\n");
|
||||
goto free_jacks;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <linux/dma-mapping.h>
|
||||
|
||||
#include <asm/irq.h>
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
|
||||
#include "serial_mctrl_gpio.h"
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <linux/dma/ipu-dma.h>
|
||||
#include <linux/backlight.h>
|
||||
|
||||
#include <linux/platform_data/dma-imx.h>
|
||||
#include <linux/dma/imx-dma.h>
|
||||
#include <linux/platform_data/video-mx3fb.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/*
|
||||
* cs35l45.h -- CS35L45 ALSA SoC audio driver DT bindings header
|
||||
*
|
||||
* Copyright 2022 Cirrus Logic, Inc.
|
||||
*/
|
||||
|
||||
#ifndef DT_CS35L45_H
|
||||
#define DT_CS35L45_H
|
||||
|
||||
/*
|
||||
* cirrus,asp-sdout-hiz-ctrl
|
||||
*
|
||||
* TX_HIZ_UNUSED: TX pin high-impedance during unused slots.
|
||||
* TX_HIZ_DISABLED: TX pin high-impedance when all channels disabled.
|
||||
*/
|
||||
#define CS35L45_ASP_TX_HIZ_UNUSED 0x1
|
||||
#define CS35L45_ASP_TX_HIZ_DISABLED 0x2
|
||||
|
||||
#endif /* DT_CS35L45_H */
|
|
@ -3,8 +3,8 @@
|
|||
* Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_MXC_DMA_H__
|
||||
#define __ASM_ARCH_MXC_DMA_H__
|
||||
#ifndef __LINUX_DMA_IMX_H
|
||||
#define __LINUX_DMA_IMX_H
|
||||
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/device.h>
|
||||
|
@ -39,6 +39,7 @@ enum sdma_peripheral_type {
|
|||
IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */
|
||||
IMX_DMATYPE_ASRC_SP, /* Shared ASRC */
|
||||
IMX_DMATYPE_SAI, /* SAI */
|
||||
IMX_DMATYPE_MULTI_SAI, /* MULTI FIFOs For Audio */
|
||||
};
|
||||
|
||||
enum imx_dma_prio {
|
||||
|
@ -65,4 +66,23 @@ static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
|
|||
!strcmp(chan->device->dev->driver->name, "imx-dma");
|
||||
}
|
||||
|
||||
#endif
|
||||
/**
|
||||
* struct sdma_peripheral_config - SDMA config for audio
|
||||
* @n_fifos_src: Number of FIFOs for recording
|
||||
* @n_fifos_dst: Number of FIFOs for playback
|
||||
* @sw_done: Use software done. Needed for PDM (micfil)
|
||||
*
|
||||
* Some i.MX Audio devices (SAI, micfil) have multiple successive FIFO
|
||||
* registers. For multichannel recording/playback the SAI/micfil have
|
||||
* one FIFO register per channel and the SDMA engine has to read/write
|
||||
* the next channel from/to the next register and wrap around to the
|
||||
* first register when all channels are handled. The number of active
|
||||
* channels must be communicated to the SDMA engine using this struct.
|
||||
*/
|
||||
struct sdma_peripheral_config {
|
||||
int n_fifos_src;
|
||||
int n_fifos_dst;
|
||||
bool sw_done;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_DMA_IMX_H */
|
|
@ -68,36 +68,36 @@ struct cs_dsp_alg_region {
|
|||
|
||||
/**
|
||||
* struct cs_dsp_coeff_ctl - Describes a coefficient control
|
||||
* @list: List node for internal use
|
||||
* @dsp: DSP instance associated with this control
|
||||
* @cache: Cached value of the control
|
||||
* @fw_name: Name of the firmware
|
||||
* @subname: Name of the control parsed from the WMFW
|
||||
* @subname_len: Length of subname
|
||||
* @alg_region: Logical region associated with this control
|
||||
* @dsp: DSP instance associated with this control
|
||||
* @enabled: Flag indicating whether control is enabled
|
||||
* @list: List node for internal use
|
||||
* @cache: Cached value of the control
|
||||
* @offset: Offset of control within alg_region in words
|
||||
* @len: Length of the cached value in bytes
|
||||
* @set: Flag indicating the value has been written by the user
|
||||
* @flags: Bitfield of WMFW_CTL_FLAG_ control flags defined in wmfw.h
|
||||
* @type: One of the WMFW_CTL_TYPE_ control types defined in wmfw.h
|
||||
* @flags: Bitfield of WMFW_CTL_FLAG_ control flags defined in wmfw.h
|
||||
* @set: Flag indicating the value has been written by the user
|
||||
* @enabled: Flag indicating whether control is enabled
|
||||
* @alg_region: Logical region associated with this control
|
||||
* @priv: For use by the client
|
||||
*/
|
||||
struct cs_dsp_coeff_ctl {
|
||||
struct list_head list;
|
||||
struct cs_dsp *dsp;
|
||||
void *cache;
|
||||
const char *fw_name;
|
||||
/* Subname is needed to match with firmware */
|
||||
const char *subname;
|
||||
unsigned int subname_len;
|
||||
struct cs_dsp_alg_region alg_region;
|
||||
struct cs_dsp *dsp;
|
||||
unsigned int enabled:1;
|
||||
struct list_head list;
|
||||
void *cache;
|
||||
unsigned int offset;
|
||||
size_t len;
|
||||
unsigned int set:1;
|
||||
unsigned int flags;
|
||||
unsigned int type;
|
||||
unsigned int flags;
|
||||
unsigned int set:1;
|
||||
unsigned int enabled:1;
|
||||
struct cs_dsp_alg_region alg_region;
|
||||
|
||||
void *priv;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (c) 2022 MediaTek Inc.
|
||||
*/
|
||||
|
||||
#ifndef MTK_ADSP_IPC_H
|
||||
#define MTK_ADSP_IPC_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/mailbox_controller.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
|
||||
#define MTK_ADSP_IPC_REQ 0
|
||||
#define MTK_ADSP_IPC_RSP 1
|
||||
#define MTK_ADSP_IPC_OP_REQ 0x1
|
||||
#define MTK_ADSP_IPC_OP_RSP 0x2
|
||||
|
||||
enum {
|
||||
MTK_ADSP_MBOX_REPLY,
|
||||
MTK_ADSP_MBOX_REQUEST,
|
||||
MTK_ADSP_MBOX_NUM,
|
||||
};
|
||||
|
||||
struct mtk_adsp_ipc;
|
||||
|
||||
struct mtk_adsp_ipc_ops {
|
||||
void (*handle_reply)(struct mtk_adsp_ipc *ipc);
|
||||
void (*handle_request)(struct mtk_adsp_ipc *ipc);
|
||||
};
|
||||
|
||||
struct mtk_adsp_chan {
|
||||
struct mtk_adsp_ipc *ipc;
|
||||
struct mbox_client cl;
|
||||
struct mbox_chan *ch;
|
||||
char *name;
|
||||
int idx;
|
||||
};
|
||||
|
||||
struct mtk_adsp_ipc {
|
||||
struct mtk_adsp_chan chans[MTK_ADSP_MBOX_NUM];
|
||||
struct device *dev;
|
||||
struct mtk_adsp_ipc_ops *ops;
|
||||
void *private_data;
|
||||
};
|
||||
|
||||
static inline void mtk_adsp_ipc_set_data(struct mtk_adsp_ipc *ipc, void *data)
|
||||
{
|
||||
if (!ipc)
|
||||
return;
|
||||
|
||||
ipc->private_data = data;
|
||||
}
|
||||
|
||||
static inline void *mtk_adsp_ipc_get_data(struct mtk_adsp_ipc *ipc)
|
||||
{
|
||||
if (!ipc)
|
||||
return NULL;
|
||||
|
||||
return ipc->private_data;
|
||||
}
|
||||
|
||||
int mtk_adsp_ipc_send(struct mtk_adsp_ipc *ipc, unsigned int idx, uint32_t op);
|
||||
|
||||
#endif /* MTK_ADSP_IPC_H */
|
|
@ -537,7 +537,6 @@
|
|||
|
||||
#define CS35L41_MAX_CACHE_REG 36
|
||||
#define CS35L41_OTP_SIZE_WORDS 32
|
||||
#define CS35L41_NUM_OTP_ELEM 100
|
||||
|
||||
#define CS35L41_NUM_SUPPLIES 2
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ enum {
|
|||
SND_INTEL_DSP_DRIVER_LEGACY,
|
||||
SND_INTEL_DSP_DRIVER_SST,
|
||||
SND_INTEL_DSP_DRIVER_SOF,
|
||||
SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF
|
||||
SND_INTEL_DSP_DRIVER_AVS,
|
||||
SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_AVS
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG)
|
||||
|
|
|
@ -25,8 +25,6 @@ enum nhlt_device_type {
|
|||
NHLT_DEVICE_INVALID
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
|
||||
|
||||
struct wav_fmt {
|
||||
u16 fmt_tag;
|
||||
u16 channels;
|
||||
|
@ -126,6 +124,8 @@ enum {
|
|||
NHLT_MIC_ARRAY_VENDOR_DEFINED = 0xf,
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
|
||||
|
||||
struct nhlt_acpi_table *intel_nhlt_init(struct device *dev);
|
||||
|
||||
void intel_nhlt_free(struct nhlt_acpi_table *addr);
|
||||
|
@ -143,8 +143,6 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
|
|||
|
||||
#else
|
||||
|
||||
struct nhlt_acpi_table;
|
||||
|
||||
static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
@ -156,6 +156,7 @@ struct snd_soc_acpi_link_adr {
|
|||
* @links: array of link _ADR descriptors, null terminated.
|
||||
* @drv_name: machine driver name
|
||||
* @fw_filename: firmware file name. Used when SOF is not enabled.
|
||||
* @tplg_filename: topology file name. Used when SOF is not enabled.
|
||||
* @board: board name
|
||||
* @machine_quirk: pointer to quirk, usually based on DMI information when
|
||||
* ACPI ID alone is not sufficient, wrong or misleading
|
||||
|
@ -174,6 +175,7 @@ struct snd_soc_acpi_mach {
|
|||
const struct snd_soc_acpi_link_adr *links;
|
||||
const char *drv_name;
|
||||
const char *fw_filename;
|
||||
const char *tplg_filename;
|
||||
const char *board;
|
||||
struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);
|
||||
const void *quirk_data;
|
||||
|
|
|
@ -16,8 +16,11 @@ enum snd_soc_card_subclass {
|
|||
struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
|
||||
const char *name);
|
||||
int snd_soc_card_jack_new(struct snd_soc_card *card, const char *id, int type,
|
||||
struct snd_soc_jack *jack,
|
||||
struct snd_soc_jack_pin *pins, unsigned int num_pins);
|
||||
struct snd_soc_jack *jack);
|
||||
int snd_soc_card_jack_new_pins(struct snd_soc_card *card, const char *id,
|
||||
int type, struct snd_soc_jack *jack,
|
||||
struct snd_soc_jack_pin *pins,
|
||||
unsigned int num_pins);
|
||||
|
||||
int snd_soc_card_suspend_pre(struct snd_soc_card *card);
|
||||
int snd_soc_card_suspend_post(struct snd_soc_card *card);
|
||||
|
|
|
@ -169,6 +169,15 @@ struct snd_soc_component_driver {
|
|||
unsigned int idle_bias_on:1;
|
||||
unsigned int suspend_bias_off:1;
|
||||
unsigned int use_pmdown_time:1; /* care pmdown_time at stop */
|
||||
/*
|
||||
* Indicates that the component does not care about the endianness of
|
||||
* PCM audio data and the core will ensure that both LE and BE variants
|
||||
* of each used format are present. Typically this is because the
|
||||
* component sits behind a bus that abstracts away the endian of the
|
||||
* original data, ie. one for which the transmission endian is defined
|
||||
* (I2S/SLIMbus/SoundWire), or the concept of endian doesn't exist (PDM,
|
||||
* analogue).
|
||||
*/
|
||||
unsigned int endianness:1;
|
||||
unsigned int non_legacy_dai_naming:1;
|
||||
|
||||
|
|
|
@ -103,6 +103,8 @@ struct snd_soc_dpcm_runtime {
|
|||
int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
|
||||
|
||||
int be_start; /* refcount protected by BE stream pcm lock */
|
||||
int be_pause; /* refcount protected by BE stream pcm lock */
|
||||
bool fe_pause; /* used to track STOP after PAUSE */
|
||||
};
|
||||
|
||||
#define for_each_dpcm_fe(be, stream, _dpcm) \
|
||||
|
|
|
@ -176,6 +176,8 @@
|
|||
.get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \
|
||||
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
|
||||
xmin, xmax, xsign_bit, xinvert) }
|
||||
#define SOC_SINGLE_S_TLV(xname, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \
|
||||
SOC_DOUBLE_R_S_TLV(xname, xreg, xreg, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array)
|
||||
#define SOC_SINGLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \
|
||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
|
||||
|
@ -280,6 +282,23 @@
|
|||
.get = xhandler_get, .put = xhandler_put, \
|
||||
.private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \
|
||||
xmax, xinvert) }
|
||||
#define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \
|
||||
xsign_bit, xinvert, xhandler_get, xhandler_put, \
|
||||
tlv_array) \
|
||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
|
||||
SNDRV_CTL_ELEM_ACCESS_READWRITE, \
|
||||
.tlv.p = (tlv_array), \
|
||||
.info = snd_soc_info_volsw, \
|
||||
.get = xhandler_get, .put = xhandler_put, \
|
||||
.private_value = SOC_DOUBLE_R_S_VALUE(reg_left, reg_right, xshift, \
|
||||
xmin, xmax, xsign_bit, xinvert) }
|
||||
#define SOC_SINGLE_S_EXT_TLV(xname, xreg, xshift, xmin, xmax, \
|
||||
xsign_bit, xinvert, xhandler_get, xhandler_put, \
|
||||
tlv_array) \
|
||||
SOC_DOUBLE_R_S_EXT_TLV(xname, xreg, xreg, xshift, xmin, xmax, \
|
||||
xsign_bit, xinvert, xhandler_get, xhandler_put, \
|
||||
tlv_array)
|
||||
#define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \
|
||||
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
|
||||
.info = snd_soc_info_bool_ext, \
|
||||
|
@ -485,6 +504,8 @@ int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
|
|||
int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
|
||||
int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
|
||||
int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
|
||||
int snd_soc_tdm_params_to_bclk(struct snd_pcm_hw_params *params,
|
||||
int tdm_width, int tdm_slots, int slot_multiple);
|
||||
|
||||
/* set runtime hw params */
|
||||
int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream,
|
||||
|
@ -1238,7 +1259,7 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
|
|||
const char *propname);
|
||||
int snd_soc_of_parse_aux_devs(struct snd_soc_card *card, const char *propname);
|
||||
|
||||
unsigned int snd_soc_daifmt_clock_provider_fliped(unsigned int dai_fmt);
|
||||
unsigned int snd_soc_daifmt_clock_provider_flipped(unsigned int dai_fmt);
|
||||
unsigned int snd_soc_daifmt_clock_provider_from_bitmap(unsigned int bit_frame);
|
||||
|
||||
unsigned int snd_soc_daifmt_parse_format(struct device_node *np, const char *prefix);
|
||||
|
@ -1263,6 +1284,10 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
|
|||
struct device_node *of_node,
|
||||
struct snd_soc_dai_link *dai_link);
|
||||
void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
|
||||
int snd_soc_of_get_dai_link_cpus(struct device *dev,
|
||||
struct device_node *of_node,
|
||||
struct snd_soc_dai_link *dai_link);
|
||||
void snd_soc_of_put_dai_link_cpus(struct snd_soc_dai_link *dai_link);
|
||||
|
||||
int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
|
||||
struct snd_soc_dai_link *dai_link);
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <sound/soc-acpi.h>
|
||||
|
||||
struct snd_sof_dsp_ops;
|
||||
struct snd_sof_dev;
|
||||
|
||||
/**
|
||||
* enum sof_fw_state - DSP firmware state definitions
|
||||
|
@ -47,6 +48,13 @@ enum sof_dsp_power_states {
|
|||
SOF_DSP_PM_D3,
|
||||
};
|
||||
|
||||
/* Definitions for multiple IPCs */
|
||||
enum sof_ipc_type {
|
||||
SOF_IPC,
|
||||
SOF_INTEL_IPC4,
|
||||
SOF_IPC_TYPE_COUNT
|
||||
};
|
||||
|
||||
/*
|
||||
* SOF Platform data.
|
||||
*/
|
||||
|
@ -83,6 +91,8 @@ struct snd_sof_pdata {
|
|||
const struct snd_soc_acpi_mach *machine;
|
||||
|
||||
void *hw_pdata;
|
||||
|
||||
enum sof_ipc_type ipc_type;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -115,14 +125,19 @@ struct sof_dev_desc {
|
|||
/* defaults for no codec mode */
|
||||
const char *nocodec_tplg_filename;
|
||||
|
||||
/* information on supported IPCs */
|
||||
unsigned int ipc_supported_mask;
|
||||
enum sof_ipc_type ipc_default;
|
||||
|
||||
/* defaults paths for firmware and topology files */
|
||||
const char *default_fw_path;
|
||||
const char *default_tplg_path;
|
||||
const char *default_fw_path[SOF_IPC_TYPE_COUNT];
|
||||
const char *default_tplg_path[SOF_IPC_TYPE_COUNT];
|
||||
|
||||
/* default firmware name */
|
||||
const char *default_fw_filename;
|
||||
const char *default_fw_filename[SOF_IPC_TYPE_COUNT];
|
||||
|
||||
const struct snd_sof_dsp_ops *ops;
|
||||
struct snd_sof_dsp_ops *ops;
|
||||
int (*ops_init)(struct snd_sof_dev *sdev);
|
||||
};
|
||||
|
||||
int sof_dai_get_mclk(struct snd_soc_pcm_runtime *rtd);
|
||||
|
|
|
@ -0,0 +1,119 @@
|
|||
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) 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) 2022 Intel Corporation. All rights reserved.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Extended manifest is a place to store metadata about firmware, known during
|
||||
* compilation time - for example firmware version or used compiler.
|
||||
* Given information are read on host side before firmware startup.
|
||||
* This part of output binary is not signed.
|
||||
*/
|
||||
|
||||
#ifndef __SOF_FIRMWARE_EXT_MANIFEST4_H__
|
||||
#define __SOF_FIRMWARE_EXT_MANIFEST4_H__
|
||||
|
||||
#include <linux/uuid.h>
|
||||
|
||||
/* In ASCII $AE1 */
|
||||
#define SOF_EXT_MAN4_MAGIC_NUMBER 0x31454124
|
||||
|
||||
#define MAX_MODULE_NAME_LEN 8
|
||||
#define MAX_FW_BINARY_NAME 8
|
||||
#define DEFAULT_HASH_SHA256_LEN 32
|
||||
#define SOF_MAN4_FW_HDR_OFFSET 0x2000
|
||||
#define SOF_MAN4_FW_HDR_OFFSET_CAVS_1_5 0x284
|
||||
|
||||
/*********************************************************************
|
||||
* extended manifest (struct sof_ext_manifest4_hdr)
|
||||
*-------------------
|
||||
* css_manifest hdr
|
||||
*-------------------
|
||||
* offset reserved for future
|
||||
*-------------------
|
||||
* fw_hdr (struct sof_man4_fw_binary_header)
|
||||
*-------------------
|
||||
* module_entry[0] (struct sof_man4_module)
|
||||
*-------------------
|
||||
* module_entry[1]
|
||||
*-------------------
|
||||
* ...
|
||||
*-------------------
|
||||
* module_entry[n]
|
||||
*-------------------
|
||||
* module_config[0] (struct sof_man4_module_config)
|
||||
*-------------------
|
||||
* module_config[1]
|
||||
*-------------------
|
||||
* ...
|
||||
*-------------------
|
||||
* module_config[m]
|
||||
*-------------------
|
||||
* FW content
|
||||
*-------------------
|
||||
*********************************************************************/
|
||||
|
||||
struct sof_ext_manifest4_hdr {
|
||||
uint32_t id;
|
||||
uint32_t len; /* length of extension manifest */
|
||||
uint16_t version_major; /* header version */
|
||||
uint16_t version_minor;
|
||||
uint32_t num_module_entries;
|
||||
} __packed;
|
||||
|
||||
struct sof_man4_fw_binary_header {
|
||||
/* This part must be unchanged to be backward compatible with SPT-LP ROM */
|
||||
uint32_t id;
|
||||
uint32_t len; /* sizeof(sof_man4_fw_binary_header) in bytes */
|
||||
uint8_t name[MAX_FW_BINARY_NAME];
|
||||
uint32_t preload_page_count; /* number of pages of preloaded image */
|
||||
uint32_t fw_image_flags;
|
||||
uint32_t feature_mask;
|
||||
uint16_t major_version; /* Firmware version */
|
||||
uint16_t minor_version;
|
||||
uint16_t hotfix_version;
|
||||
uint16_t build_version;
|
||||
uint32_t num_module_entries;
|
||||
|
||||
/* This part may change to contain any additional data for BaseFw that is skipped by ROM */
|
||||
uint32_t hw_buf_base_addr;
|
||||
uint32_t hw_buf_length;
|
||||
uint32_t load_offset; /* This value is used by ROM */
|
||||
} __packed;
|
||||
|
||||
struct sof_man4_segment_desc {
|
||||
uint32_t flags;
|
||||
uint32_t v_base_addr;
|
||||
uint32_t file_offset;
|
||||
} __packed;
|
||||
|
||||
struct sof_man4_module {
|
||||
uint32_t id;
|
||||
uint8_t name[MAX_MODULE_NAME_LEN];
|
||||
guid_t uuid;
|
||||
uint32_t type;
|
||||
uint8_t hash[DEFAULT_HASH_SHA256_LEN];
|
||||
uint32_t entry_point;
|
||||
uint16_t cfg_offset;
|
||||
uint16_t cfg_count;
|
||||
uint32_t affinity_mask;
|
||||
uint16_t instance_max_count;
|
||||
uint16_t instance_stack_size;
|
||||
struct sof_man4_segment_desc segments[3];
|
||||
} __packed;
|
||||
|
||||
struct sof_man4_module_config {
|
||||
uint32_t par[4]; /* module parameters */
|
||||
uint32_t is_bytes; /* actual size of instance .bss (bytes) */
|
||||
uint32_t cps; /* cycles per second */
|
||||
uint32_t ibs; /* input buffer size (bytes) */
|
||||
uint32_t obs; /* output buffer size (bytes) */
|
||||
uint32_t module_flags; /* flags, reserved for future use */
|
||||
uint32_t cpc; /* cycles per single run */
|
||||
uint32_t obls; /* output block size, reserved for future use */
|
||||
} __packed;
|
||||
|
||||
#endif /* __SOF_FIRMWARE_EXT_MANIFEST4_H__ */
|
|
@ -0,0 +1,460 @@
|
|||
/* 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) 2022 Intel Corporation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __INCLUDE_SOUND_SOF_IPC4_HEADER_H__
|
||||
#define __INCLUDE_SOUND_SOF_IPC4_HEADER_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <uapi/sound/sof/abi.h>
|
||||
|
||||
/* maximum message size for mailbox Tx/Rx */
|
||||
#define SOF_IPC4_MSG_MAX_SIZE 4096
|
||||
|
||||
/** \addtogroup sof_uapi uAPI
|
||||
* SOF uAPI specification.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct sof_ipc4_msg - Placeholder of an IPC4 message
|
||||
* @header_u64: IPC4 header as single u64 number
|
||||
* @primary: Primary, mandatory part of the header
|
||||
* @extension: Extended part of the header, if not used it should be
|
||||
* set to 0
|
||||
* @data_size: Size of data in bytes pointed by @data_ptr
|
||||
* @data_ptr: Pointer to the optional payload of a message
|
||||
*/
|
||||
struct sof_ipc4_msg {
|
||||
union {
|
||||
u64 header_u64;
|
||||
struct {
|
||||
u32 primary;
|
||||
u32 extension;
|
||||
};
|
||||
};
|
||||
|
||||
size_t data_size;
|
||||
void *data_ptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sof_ipc4_tuple - Generic type/ID and parameter tuple
|
||||
* @type: type/ID
|
||||
* @size: size of the @value array in bytes
|
||||
* @value: value for the given type
|
||||
*/
|
||||
struct sof_ipc4_tuple {
|
||||
uint32_t type;
|
||||
uint32_t size;
|
||||
uint32_t value[];
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* IPC4 messages have two 32 bit identifier made up as follows :-
|
||||
*
|
||||
* header - msg type, msg id, msg direction ...
|
||||
* extension - extra params such as msg data size in mailbox
|
||||
*
|
||||
* These are sent at the start of the IPC message in the mailbox. Messages
|
||||
* should not be sent in the doorbell (special exceptions for firmware).
|
||||
*/
|
||||
|
||||
/*
|
||||
* IPC4 primary header bit allocation for messages
|
||||
* bit 0-23: message type specific
|
||||
* bit 24-28: type: enum sof_ipc4_global_msg if target is SOF_IPC4_FW_GEN_MSG
|
||||
* enum sof_ipc4_module_type if target is SOF_IPC4_MODULE_MSG
|
||||
* bit 29: response - sof_ipc4_msg_dir
|
||||
* bit 30: target - enum sof_ipc4_msg_target
|
||||
* bit 31: reserved, unused
|
||||
*/
|
||||
|
||||
/* Value of target field - must fit into 1 bit */
|
||||
enum sof_ipc4_msg_target {
|
||||
/* Global FW message */
|
||||
SOF_IPC4_FW_GEN_MSG,
|
||||
|
||||
/* Module message */
|
||||
SOF_IPC4_MODULE_MSG
|
||||
};
|
||||
|
||||
/* Value of type field - must fit into 5 bits */
|
||||
enum sof_ipc4_global_msg {
|
||||
SOF_IPC4_GLB_BOOT_CONFIG,
|
||||
SOF_IPC4_GLB_ROM_CONTROL,
|
||||
SOF_IPC4_GLB_IPCGATEWAY_CMD,
|
||||
|
||||
/* 3 .. 12: RESERVED - do not use */
|
||||
|
||||
SOF_IPC4_GLB_PERF_MEASUREMENTS_CMD = 13,
|
||||
SOF_IPC4_GLB_CHAIN_DMA,
|
||||
|
||||
SOF_IPC4_GLB_LOAD_MULTIPLE_MODULES,
|
||||
SOF_IPC4_GLB_UNLOAD_MULTIPLE_MODULES,
|
||||
|
||||
/* pipeline settings */
|
||||
SOF_IPC4_GLB_CREATE_PIPELINE,
|
||||
SOF_IPC4_GLB_DELETE_PIPELINE,
|
||||
SOF_IPC4_GLB_SET_PIPELINE_STATE,
|
||||
SOF_IPC4_GLB_GET_PIPELINE_STATE,
|
||||
SOF_IPC4_GLB_GET_PIPELINE_CONTEXT_SIZE,
|
||||
SOF_IPC4_GLB_SAVE_PIPELINE,
|
||||
SOF_IPC4_GLB_RESTORE_PIPELINE,
|
||||
|
||||
/* Loads library (using Code Load or HD/A Host Output DMA) */
|
||||
SOF_IPC4_GLB_LOAD_LIBRARY,
|
||||
|
||||
/* 25: RESERVED - do not use */
|
||||
|
||||
SOF_IPC4_GLB_INTERNAL_MESSAGE = 26,
|
||||
|
||||
/* Notification (FW to SW driver) */
|
||||
SOF_IPC4_GLB_NOTIFICATION,
|
||||
|
||||
/* 28 .. 31: RESERVED - do not use */
|
||||
|
||||
SOF_IPC4_GLB_TYPE_LAST,
|
||||
};
|
||||
|
||||
/* Value of response field - must fit into 1 bit */
|
||||
enum sof_ipc4_msg_dir {
|
||||
SOF_IPC4_MSG_REQUEST,
|
||||
SOF_IPC4_MSG_REPLY,
|
||||
};
|
||||
|
||||
enum sof_ipc4_pipeline_state {
|
||||
SOF_IPC4_PIPE_INVALID_STATE,
|
||||
SOF_IPC4_PIPE_UNINITIALIZED,
|
||||
SOF_IPC4_PIPE_RESET,
|
||||
SOF_IPC4_PIPE_PAUSED,
|
||||
SOF_IPC4_PIPE_RUNNING,
|
||||
SOF_IPC4_PIPE_EOS
|
||||
};
|
||||
|
||||
/* Generic message fields (bit 24-30) */
|
||||
|
||||
/* encoded to header's msg_tgt field */
|
||||
#define SOF_IPC4_MSG_TARGET_SHIFT 30
|
||||
#define SOF_IPC4_MSG_TARGET_MASK BIT(30)
|
||||
#define SOF_IPC4_MSG_TARGET(x) ((x) << SOF_IPC4_MSG_TARGET_SHIFT)
|
||||
#define SOF_IPC4_MSG_IS_MODULE_MSG(x) ((x) & SOF_IPC4_MSG_TARGET_MASK ? 1 : 0)
|
||||
|
||||
/* encoded to header's rsp field */
|
||||
#define SOF_IPC4_MSG_DIR_SHIFT 29
|
||||
#define SOF_IPC4_MSG_DIR_MASK BIT(29)
|
||||
#define SOF_IPC4_MSG_DIR(x) ((x) << SOF_IPC4_MSG_DIR_SHIFT)
|
||||
|
||||
/* encoded to header's type field */
|
||||
#define SOF_IPC4_MSG_TYPE_SHIFT 24
|
||||
#define SOF_IPC4_MSG_TYPE_MASK GENMASK(28, 24)
|
||||
#define SOF_IPC4_MSG_TYPE_SET(x) (((x) << SOF_IPC4_MSG_TYPE_SHIFT) & \
|
||||
SOF_IPC4_MSG_TYPE_MASK)
|
||||
#define SOF_IPC4_MSG_TYPE_GET(x) (((x) & SOF_IPC4_MSG_TYPE_MASK) >> \
|
||||
SOF_IPC4_MSG_TYPE_SHIFT)
|
||||
|
||||
/* Global message type specific field definitions */
|
||||
|
||||
/* pipeline creation ipc msg */
|
||||
#define SOF_IPC4_GLB_PIPE_INSTANCE_SHIFT 16
|
||||
#define SOF_IPC4_GLB_PIPE_INSTANCE_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_GLB_PIPE_INSTANCE_ID(x) ((x) << SOF_IPC4_GLB_PIPE_INSTANCE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_GLB_PIPE_PRIORITY_SHIFT 11
|
||||
#define SOF_IPC4_GLB_PIPE_PRIORITY_MASK GENMASK(15, 11)
|
||||
#define SOF_IPC4_GLB_PIPE_PRIORITY(x) ((x) << SOF_IPC4_GLB_PIPE_PRIORITY_SHIFT)
|
||||
|
||||
#define SOF_IPC4_GLB_PIPE_MEM_SIZE_SHIFT 0
|
||||
#define SOF_IPC4_GLB_PIPE_MEM_SIZE_MASK GENMASK(10, 0)
|
||||
#define SOF_IPC4_GLB_PIPE_MEM_SIZE(x) ((x) << SOF_IPC4_GLB_PIPE_MEM_SIZE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_GLB_PIPE_EXT_LP_SHIFT 0
|
||||
#define SOF_IPC4_GLB_PIPE_EXT_LP_MASK BIT(0)
|
||||
#define SOF_IPC4_GLB_PIPE_EXT_LP(x) ((x) << SOF_IPC4_GLB_PIPE_EXT_LP_SHIFT)
|
||||
|
||||
/* pipeline set state ipc msg */
|
||||
#define SOF_IPC4_GLB_PIPE_STATE_ID_SHIFT 16
|
||||
#define SOF_IPC4_GLB_PIPE_STATE_ID_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_GLB_PIPE_STATE_ID(x) ((x) << SOF_IPC4_GLB_PIPE_STATE_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_GLB_PIPE_STATE_SHIFT 0
|
||||
#define SOF_IPC4_GLB_PIPE_STATE_MASK GENMASK(15, 0)
|
||||
#define SOF_IPC4_GLB_PIPE_STATE(x) ((x) << SOF_IPC4_GLB_PIPE_STATE_SHIFT)
|
||||
|
||||
enum sof_ipc4_channel_config {
|
||||
/* one channel only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_MONO,
|
||||
/* L & R. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_STEREO,
|
||||
/* L, R & LFE; PCM only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_2_POINT_1,
|
||||
/* L, C & R; MP3 & AAC only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_3_POINT_0,
|
||||
/* L, C, R & LFE; PCM only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_3_POINT_1,
|
||||
/* L, R, Ls & Rs; PCM only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_QUATRO,
|
||||
/* L, C, R & Cs; MP3 & AAC only. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_4_POINT_0,
|
||||
/* L, C, R, Ls & Rs. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_5_POINT_0,
|
||||
/* L, C, R, Ls, Rs & LFE. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_5_POINT_1,
|
||||
/* one channel replicated in two. */
|
||||
SOF_IPC4_CHANNEL_CONFIG_DUAL_MONO,
|
||||
/* Stereo (L,R) in 4 slots, 1st stream: [ L, R, -, - ] */
|
||||
SOF_IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_0,
|
||||
/* Stereo (L,R) in 4 slots, 2nd stream: [ -, -, L, R ] */
|
||||
SOF_IPC4_CHANNEL_CONFIG_I2S_DUAL_STEREO_1,
|
||||
/* L, C, R, Ls, Rs & LFE., LS, RS */
|
||||
SOF_IPC4_CHANNEL_CONFIG_7_POINT_1,
|
||||
};
|
||||
|
||||
enum sof_ipc4_interleaved_style {
|
||||
SOF_IPC4_CHANNELS_INTERLEAVED,
|
||||
SOF_IPC4_CHANNELS_NONINTERLEAVED,
|
||||
};
|
||||
|
||||
enum sof_ipc4_sample_type {
|
||||
SOF_IPC4_MSB_INTEGER, /* integer with Most Significant Byte first */
|
||||
SOF_IPC4_LSB_INTEGER, /* integer with Least Significant Byte first */
|
||||
};
|
||||
|
||||
struct sof_ipc4_audio_format {
|
||||
uint32_t sampling_frequency;
|
||||
uint32_t bit_depth;
|
||||
uint32_t ch_map;
|
||||
uint32_t ch_cfg; /* sof_ipc4_channel_config */
|
||||
uint32_t interleaving_style;
|
||||
uint32_t fmt_cfg; /* channels_count valid_bit_depth s_type */
|
||||
} __packed __aligned(4);
|
||||
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT_SHIFT 0
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT_MASK GENMASK(7, 0)
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT(x) \
|
||||
((x) & SOF_IPC4_AUDIO_FORMAT_CFG_CHANNELS_COUNT_MASK)
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH_SHIFT 8
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH_MASK GENMASK(15, 8)
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH(x) \
|
||||
(((x) & SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH_MASK) >> \
|
||||
SOF_IPC4_AUDIO_FORMAT_CFG_V_BIT_DEPTH_SHIFT)
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_SAMPLE_TYPE_SHIFT 16
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_SAMPLE_TYPE_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_AUDIO_FORMAT_CFG_SAMPLE_TYPE(x) \
|
||||
(((x) & SOF_IPC4_AUDIO_FORMAT_CFG_SAMPLE_TYPE_MASK) >> \
|
||||
SOF_IPC4_AUDIO_FORMAT_CFG_SAMPLE_TYPE_SHIFT)
|
||||
|
||||
/* Module message type specific field definitions */
|
||||
|
||||
enum sof_ipc4_module_type {
|
||||
SOF_IPC4_MOD_INIT_INSTANCE,
|
||||
SOF_IPC4_MOD_CONFIG_GET,
|
||||
SOF_IPC4_MOD_CONFIG_SET,
|
||||
SOF_IPC4_MOD_LARGE_CONFIG_GET,
|
||||
SOF_IPC4_MOD_LARGE_CONFIG_SET,
|
||||
SOF_IPC4_MOD_BIND,
|
||||
SOF_IPC4_MOD_UNBIND,
|
||||
SOF_IPC4_MOD_SET_DX,
|
||||
SOF_IPC4_MOD_SET_D0IX,
|
||||
SOF_IPC4_MOD_ENTER_MODULE_RESTORE,
|
||||
SOF_IPC4_MOD_EXIT_MODULE_RESTORE,
|
||||
SOF_IPC4_MOD_DELETE_INSTANCE,
|
||||
|
||||
SOF_IPC4_MOD_TYPE_LAST,
|
||||
};
|
||||
|
||||
struct sof_ipc4_base_module_cfg {
|
||||
uint32_t cpc; /* the max count of Cycles Per Chunk processing */
|
||||
uint32_t ibs; /* input Buffer Size (in bytes) */
|
||||
uint32_t obs; /* output Buffer Size (in bytes) */
|
||||
uint32_t is_pages; /* number of physical pages used */
|
||||
struct sof_ipc4_audio_format audio_fmt;
|
||||
} __packed __aligned(4);
|
||||
|
||||
/* common module ipc msg */
|
||||
#define SOF_IPC4_MOD_INSTANCE_SHIFT 16
|
||||
#define SOF_IPC4_MOD_INSTANCE_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_MOD_INSTANCE(x) ((x) << SOF_IPC4_MOD_INSTANCE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_ID_SHIFT 0
|
||||
#define SOF_IPC4_MOD_ID_MASK GENMASK(15, 0)
|
||||
#define SOF_IPC4_MOD_ID(x) ((x) << SOF_IPC4_MOD_ID_SHIFT)
|
||||
|
||||
/* init module ipc msg */
|
||||
#define SOF_IPC4_MOD_EXT_PARAM_SIZE_SHIFT 0
|
||||
#define SOF_IPC4_MOD_EXT_PARAM_SIZE_MASK GENMASK(15, 0)
|
||||
#define SOF_IPC4_MOD_EXT_PARAM_SIZE(x) ((x) << SOF_IPC4_MOD_EXT_PARAM_SIZE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_PPL_ID_SHIFT 16
|
||||
#define SOF_IPC4_MOD_EXT_PPL_ID_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_MOD_EXT_PPL_ID(x) ((x) << SOF_IPC4_MOD_EXT_PPL_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_CORE_ID_SHIFT 24
|
||||
#define SOF_IPC4_MOD_EXT_CORE_ID_MASK GENMASK(27, 24)
|
||||
#define SOF_IPC4_MOD_EXT_CORE_ID(x) ((x) << SOF_IPC4_MOD_EXT_CORE_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_DOMAIN_SHIFT 28
|
||||
#define SOF_IPC4_MOD_EXT_DOMAIN_MASK BIT(28)
|
||||
#define SOF_IPC4_MOD_EXT_DOMAIN(x) ((x) << SOF_IPC4_MOD_EXT_DOMAIN_SHIFT)
|
||||
|
||||
/* bind/unbind module ipc msg */
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_ID_SHIFT 0
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_ID_MASK GENMASK(15, 0)
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_ID(x) ((x) << SOF_IPC4_MOD_EXT_DST_MOD_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_INSTANCE_SHIFT 16
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_INSTANCE_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_INSTANCE(x) ((x) << SOF_IPC4_MOD_EXT_DST_MOD_INSTANCE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_QUEUE_ID_SHIFT 24
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_QUEUE_ID_MASK GENMASK(26, 24)
|
||||
#define SOF_IPC4_MOD_EXT_DST_MOD_QUEUE_ID(x) ((x) << SOF_IPC4_MOD_EXT_DST_MOD_QUEUE_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_SRC_MOD_QUEUE_ID_SHIFT 27
|
||||
#define SOF_IPC4_MOD_EXT_SRC_MOD_QUEUE_ID_MASK GENMASK(29, 27)
|
||||
#define SOF_IPC4_MOD_EXT_SRC_MOD_QUEUE_ID(x) ((x) << SOF_IPC4_MOD_EXT_SRC_MOD_QUEUE_ID_SHIFT)
|
||||
|
||||
#define MOD_ENABLE_LOG 6
|
||||
#define MOD_SYSTEM_TIME 20
|
||||
|
||||
/* set module large config */
|
||||
#define SOF_IPC4_MOD_EXT_MSG_SIZE_SHIFT 0
|
||||
#define SOF_IPC4_MOD_EXT_MSG_SIZE_MASK GENMASK(19, 0)
|
||||
#define SOF_IPC4_MOD_EXT_MSG_SIZE(x) ((x) << SOF_IPC4_MOD_EXT_MSG_SIZE_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_MSG_PARAM_ID_SHIFT 20
|
||||
#define SOF_IPC4_MOD_EXT_MSG_PARAM_ID_MASK GENMASK(27, 20)
|
||||
#define SOF_IPC4_MOD_EXT_MSG_PARAM_ID(x) ((x) << SOF_IPC4_MOD_EXT_MSG_PARAM_ID_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_MSG_LAST_BLOCK_SHIFT 28
|
||||
#define SOF_IPC4_MOD_EXT_MSG_LAST_BLOCK_MASK BIT(28)
|
||||
#define SOF_IPC4_MOD_EXT_MSG_LAST_BLOCK(x) ((x) << SOF_IPC4_MOD_EXT_MSG_LAST_BLOCK_SHIFT)
|
||||
|
||||
#define SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK_SHIFT 29
|
||||
#define SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK_MASK BIT(29)
|
||||
#define SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK(x) ((x) << SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK_SHIFT)
|
||||
|
||||
/* Init instance messagees */
|
||||
#define SOF_IPC4_MOD_INIT_BASEFW_MOD_ID 0
|
||||
#define SOF_IPC4_MOD_INIT_BASEFW_INSTANCE_ID 0
|
||||
|
||||
enum sof_ipc4_base_fw_params {
|
||||
SOF_IPC4_FW_PARAM_ENABLE_LOGS = 6,
|
||||
SOF_IPC4_FW_PARAM_FW_CONFIG,
|
||||
SOF_IPC4_FW_PARAM_HW_CONFIG_GET,
|
||||
SOF_IPC4_FW_PARAM_MODULES_INFO_GET,
|
||||
SOF_IPC4_FW_PARAM_LIBRARIES_INFO_GET = 16,
|
||||
SOF_IPC4_FW_PARAM_SYSTEM_TIME = 20,
|
||||
};
|
||||
|
||||
enum sof_ipc4_fw_config_params {
|
||||
SOF_IPC4_FW_CFG_FW_VERSION,
|
||||
SOF_IPC4_FW_CFG_MEMORY_RECLAIMED,
|
||||
SOF_IPC4_FW_CFG_SLOW_CLOCK_FREQ_HZ,
|
||||
SOF_IPC4_FW_CFG_FAST_CLOCK_FREQ_HZ,
|
||||
SOF_IPC4_FW_CFG_DMA_BUFFER_CONFIG,
|
||||
SOF_IPC4_FW_CFG_ALH_SUPPORT_LEVEL,
|
||||
SOF_IPC4_FW_CFG_DL_MAILBOX_BYTES,
|
||||
SOF_IPC4_FW_CFG_UL_MAILBOX_BYTES,
|
||||
SOF_IPC4_FW_CFG_TRACE_LOG_BYTES,
|
||||
SOF_IPC4_FW_CFG_MAX_PPL_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_ASTATE_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_MODULE_PIN_COUNT,
|
||||
SOF_IPC4_FW_CFG_MODULES_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_MOD_INST_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_LL_TASKS_PER_PRI_COUNT,
|
||||
SOF_IPC4_FW_CFG_LL_PRI_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_DP_TASKS_COUNT,
|
||||
SOF_IPC4_FW_CFG_MAX_LIBS_COUNT,
|
||||
SOF_IPC4_FW_CFG_SCHEDULER_CONFIG,
|
||||
SOF_IPC4_FW_CFG_XTAL_FREQ_HZ,
|
||||
SOF_IPC4_FW_CFG_CLOCKS_CONFIG,
|
||||
SOF_IPC4_FW_CFG_RESERVED,
|
||||
SOF_IPC4_FW_CFG_POWER_GATING_POLICY,
|
||||
SOF_IPC4_FW_CFG_ASSERT_MODE,
|
||||
};
|
||||
|
||||
struct sof_ipc4_fw_version {
|
||||
uint16_t major;
|
||||
uint16_t minor;
|
||||
uint16_t hotfix;
|
||||
uint16_t build;
|
||||
} __packed;
|
||||
|
||||
/* Reply messages */
|
||||
|
||||
/*
|
||||
* IPC4 primary header bit allocation for replies
|
||||
* bit 0-23: status
|
||||
* bit 24-28: type: enum sof_ipc4_global_msg if target is SOF_IPC4_FW_GEN_MSG
|
||||
* enum sof_ipc4_module_type if target is SOF_IPC4_MODULE_MSG
|
||||
* bit 29: response - sof_ipc4_msg_dir
|
||||
* bit 30: target - enum sof_ipc4_msg_target
|
||||
* bit 31: reserved, unused
|
||||
*/
|
||||
|
||||
#define SOF_IPC4_REPLY_STATUS GENMASK(23, 0)
|
||||
|
||||
/* Notification messages */
|
||||
|
||||
/*
|
||||
* IPC4 primary header bit allocation for notifications
|
||||
* bit 0-15: notification type specific
|
||||
* bit 16-23: enum sof_ipc4_notification_type
|
||||
* bit 24-28: SOF_IPC4_GLB_NOTIFICATION
|
||||
* bit 29: response - sof_ipc4_msg_dir
|
||||
* bit 30: target - enum sof_ipc4_msg_target
|
||||
* bit 31: reserved, unused
|
||||
*/
|
||||
|
||||
#define SOF_IPC4_MSG_IS_NOTIFICATION(x) (SOF_IPC4_MSG_TYPE_GET(x) == \
|
||||
SOF_IPC4_GLB_NOTIFICATION)
|
||||
|
||||
#define SOF_IPC4_NOTIFICATION_TYPE_SHIFT 16
|
||||
#define SOF_IPC4_NOTIFICATION_TYPE_MASK GENMASK(23, 16)
|
||||
#define SOF_IPC4_NOTIFICATION_TYPE_GET(x) (((x) & SOF_IPC4_NOTIFICATION_TYPE_MASK) >> \
|
||||
SOF_IPC4_NOTIFICATION_TYPE_SHIFT)
|
||||
|
||||
/* Value of notification type field - must fit into 8 bits */
|
||||
enum sof_ipc4_notification_type {
|
||||
/* Phrase detected (notification from WoV module) */
|
||||
SOF_IPC4_NOTIFY_PHRASE_DETECTED = 4,
|
||||
/* Event from a resource (pipeline or module instance) */
|
||||
SOF_IPC4_NOTIFY_RESOURCE_EVENT,
|
||||
/* Debug log buffer status changed */
|
||||
SOF_IPC4_NOTIFY_LOG_BUFFER_STATUS,
|
||||
/* Timestamp captured at the link */
|
||||
SOF_IPC4_NOTIFY_TIMESTAMP_CAPTURED,
|
||||
/* FW complete initialization */
|
||||
SOF_IPC4_NOTIFY_FW_READY,
|
||||
/* Audio classifier result (ACA) */
|
||||
SOF_IPC4_NOTIFY_FW_AUD_CLASS_RESULT,
|
||||
/* Exception caught by DSP FW */
|
||||
SOF_IPC4_NOTIFY_EXCEPTION_CAUGHT,
|
||||
/* 11 is skipped by the existing cavs firmware */
|
||||
/* Custom module notification */
|
||||
SOF_IPC4_NOTIFY_MODULE_NOTIFICATION = 12,
|
||||
/* 13 is reserved - do not use */
|
||||
/* Probe notify data available */
|
||||
SOF_IPC4_NOTIFY_PROBE_DATA_AVAILABLE = 14,
|
||||
/* AM module notifications */
|
||||
SOF_IPC4_NOTIFY_ASYNC_MSG_SRVC_MESSAGE,
|
||||
|
||||
SOF_IPC4_NOTIFY_TYPE_LAST,
|
||||
};
|
||||
|
||||
struct sof_ipc4_notify_resource_data {
|
||||
uint32_t resource_type;
|
||||
uint32_t resource_id;
|
||||
uint32_t event_type;
|
||||
uint32_t reserved;
|
||||
uint32_t data[6];
|
||||
} __packed __aligned(4);
|
||||
|
||||
/** @}*/
|
||||
|
||||
#endif
|
|
@ -85,8 +85,9 @@ struct sof_ipc_stream_params {
|
|||
|
||||
uint32_t host_period_bytes;
|
||||
uint16_t no_stream_position; /**< 1 means don't send stream position */
|
||||
uint8_t cont_update_posn; /**< 1 means continuous update stream position */
|
||||
|
||||
uint16_t reserved[3];
|
||||
uint8_t reserved[5];
|
||||
uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */
|
||||
} __packed;
|
||||
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright(c) 2021 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* Authors: Cezary Rojewski <cezary.rojewski@intel.com>
|
||||
* Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
|
||||
*/
|
||||
|
||||
#ifndef __UAPI_SOUND_INTEL_AVS_TOKENS_H
|
||||
#define __UAPI_SOUND_INTEL_AVS_TOKENS_H
|
||||
|
||||
enum avs_tplg_token {
|
||||
/* struct avs_tplg */
|
||||
AVS_TKN_MANIFEST_NAME_STRING = 1,
|
||||
AVS_TKN_MANIFEST_VERSION_U32 = 2,
|
||||
AVS_TKN_MANIFEST_NUM_LIBRARIES_U32 = 3,
|
||||
AVS_TKN_MANIFEST_NUM_AFMTS_U32 = 4,
|
||||
AVS_TKN_MANIFEST_NUM_MODCFGS_BASE_U32 = 5,
|
||||
AVS_TKN_MANIFEST_NUM_MODCFGS_EXT_U32 = 6,
|
||||
AVS_TKN_MANIFEST_NUM_PPLCFGS_U32 = 7,
|
||||
AVS_TKN_MANIFEST_NUM_BINDINGS_U32 = 8,
|
||||
|
||||
/* struct avs_tplg_library */
|
||||
AVS_TKN_LIBRARY_ID_U32 = 101,
|
||||
AVS_TKN_LIBRARY_NAME_STRING = 102,
|
||||
|
||||
/* struct avs_audio_format */
|
||||
AVS_TKN_AFMT_ID_U32 = 201,
|
||||
AVS_TKN_AFMT_SAMPLE_RATE_U32 = 202,
|
||||
AVS_TKN_AFMT_BIT_DEPTH_U32 = 203,
|
||||
AVS_TKN_AFMT_CHANNEL_MAP_U32 = 204,
|
||||
AVS_TKN_AFMT_CHANNEL_CFG_U32 = 205,
|
||||
AVS_TKN_AFMT_INTERLEAVING_U32 = 206,
|
||||
AVS_TKN_AFMT_NUM_CHANNELS_U32 = 207,
|
||||
AVS_TKN_AFMT_VALID_BIT_DEPTH_U32 = 208,
|
||||
AVS_TKN_AFMT_SAMPLE_TYPE_U32 = 209,
|
||||
|
||||
/* struct avs_tplg_modcfg_base */
|
||||
AVS_TKN_MODCFG_BASE_ID_U32 = 301,
|
||||
AVS_TKN_MODCFG_BASE_CPC_U32 = 302,
|
||||
AVS_TKN_MODCFG_BASE_IBS_U32 = 303,
|
||||
AVS_TKN_MODCFG_BASE_OBS_U32 = 304,
|
||||
AVS_TKN_MODCFG_BASE_PAGES_U32 = 305,
|
||||
|
||||
/* struct avs_tplg_modcfg_ext */
|
||||
AVS_TKN_MODCFG_EXT_ID_U32 = 401,
|
||||
AVS_TKN_MODCFG_EXT_TYPE_UUID = 402,
|
||||
AVS_TKN_MODCFG_CPR_OUT_AFMT_ID_U32 = 403,
|
||||
AVS_TKN_MODCFG_CPR_FEATURE_MASK_U32 = 404,
|
||||
AVS_TKN_MODCFG_CPR_DMA_TYPE_U32 = 405,
|
||||
AVS_TKN_MODCFG_CPR_DMABUFF_SIZE_U32 = 406,
|
||||
AVS_TKN_MODCFG_CPR_VINDEX_U8 = 407,
|
||||
AVS_TKN_MODCFG_CPR_BLOB_FMT_ID_U32 = 408,
|
||||
AVS_TKN_MODCFG_MICSEL_OUT_AFMT_ID_U32 = 409,
|
||||
AVS_TKN_MODCFG_INTELWOV_CPC_LP_MODE_U32 = 410,
|
||||
AVS_TKN_MODCFG_SRC_OUT_FREQ_U32 = 411,
|
||||
AVS_TKN_MODCFG_MUX_REF_AFMT_ID_U32 = 412,
|
||||
AVS_TKN_MODCFG_MUX_OUT_AFMT_ID_U32 = 413,
|
||||
AVS_TKN_MODCFG_AEC_REF_AFMT_ID_U32 = 414,
|
||||
AVS_TKN_MODCFG_AEC_OUT_AFMT_ID_U32 = 415,
|
||||
AVS_TKN_MODCFG_AEC_CPC_LP_MODE_U32 = 416,
|
||||
AVS_TKN_MODCFG_ASRC_OUT_FREQ_U32 = 417,
|
||||
AVS_TKN_MODCFG_ASRC_MODE_U8 = 418,
|
||||
AVS_TKN_MODCFG_ASRC_DISABLE_JITTER_U8 = 419,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_OUT_CHAN_CFG_U32 = 420,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_SELECT_U32 = 421,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_0_S32 = 422,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_1_S32 = 423,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_2_S32 = 424,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_3_S32 = 425,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_4_S32 = 426,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_5_S32 = 427,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_6_S32 = 428,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_COEFF_7_S32 = 429,
|
||||
AVS_TKN_MODCFG_UPDOWN_MIX_CHAN_MAP_U32 = 430,
|
||||
AVS_TKN_MODCFG_EXT_NUM_INPUT_PINS_U16 = 431,
|
||||
AVS_TKN_MODCFG_EXT_NUM_OUTPUT_PINS_U16 = 432,
|
||||
|
||||
/* struct avs_tplg_pplcfg */
|
||||
AVS_TKN_PPLCFG_ID_U32 = 1401,
|
||||
AVS_TKN_PPLCFG_REQ_SIZE_U16 = 1402,
|
||||
AVS_TKN_PPLCFG_PRIORITY_U8 = 1403,
|
||||
AVS_TKN_PPLCFG_LOW_POWER_BOOL = 1404,
|
||||
AVS_TKN_PPLCFG_ATTRIBUTES_U16 = 1405,
|
||||
AVS_TKN_PPLCFG_TRIGGER_U32 = 1406,
|
||||
|
||||
/* struct avs_tplg_binding */
|
||||
AVS_TKN_BINDING_ID_U32 = 1501,
|
||||
AVS_TKN_BINDING_TARGET_TPLG_NAME_STRING = 1502,
|
||||
AVS_TKN_BINDING_TARGET_PATH_TMPL_ID_U32 = 1503,
|
||||
AVS_TKN_BINDING_TARGET_PPL_ID_U32 = 1504,
|
||||
AVS_TKN_BINDING_TARGET_MOD_ID_U32 = 1505,
|
||||
AVS_TKN_BINDING_TARGET_MOD_PIN_U8 = 1506,
|
||||
AVS_TKN_BINDING_MOD_ID_U32 = 1507,
|
||||
AVS_TKN_BINDING_MOD_PIN_U8 = 1508,
|
||||
AVS_TKN_BINDING_IS_SINK_U8 = 1509,
|
||||
|
||||
/* struct avs_tplg_pipeline */
|
||||
AVS_TKN_PPL_ID_U32 = 1601,
|
||||
AVS_TKN_PPL_PPLCFG_ID_U32 = 1602,
|
||||
AVS_TKN_PPL_NUM_BINDING_IDS_U32 = 1603,
|
||||
AVS_TKN_PPL_BINDING_ID_U32 = 1604,
|
||||
|
||||
/* struct avs_tplg_module */
|
||||
AVS_TKN_MOD_ID_U32 = 1701,
|
||||
AVS_TKN_MOD_MODCFG_BASE_ID_U32 = 1702,
|
||||
AVS_TKN_MOD_IN_AFMT_ID_U32 = 1703,
|
||||
AVS_TKN_MOD_CORE_ID_U8 = 1704,
|
||||
AVS_TKN_MOD_PROC_DOMAIN_U8 = 1705,
|
||||
AVS_TKN_MOD_MODCFG_EXT_ID_U32 = 1706,
|
||||
|
||||
/* struct avs_tplg_path_template */
|
||||
AVS_TKN_PATH_TMPL_ID_U32 = 1801,
|
||||
|
||||
/* struct avs_tplg_path */
|
||||
AVS_TKN_PATH_ID_U32 = 1901,
|
||||
AVS_TKN_PATH_FE_FMT_ID_U32 = 1902,
|
||||
AVS_TKN_PATH_BE_FMT_ID_U32 = 1903,
|
||||
|
||||
/* struct avs_tplg_pin_format */
|
||||
AVS_TKN_PIN_FMT_INDEX_U32 = 2201,
|
||||
AVS_TKN_PIN_FMT_IOBS_U32 = 2202,
|
||||
AVS_TKN_PIN_FMT_AFMT_ID_U32 = 2203,
|
||||
};
|
||||
|
||||
#endif
|
|
@ -26,8 +26,8 @@
|
|||
|
||||
/* SOF ABI version major, minor and patch numbers */
|
||||
#define SOF_ABI_MAJOR 3
|
||||
#define SOF_ABI_MINOR 19
|
||||
#define SOF_ABI_PATCH 1
|
||||
#define SOF_ABI_MINOR 21
|
||||
#define SOF_ABI_PATCH 0
|
||||
|
||||
/* SOF ABI version number. Format within 32bit word is MMmmmppp */
|
||||
#define SOF_ABI_MAJOR_SHIFT 24
|
||||
|
|
|
@ -14,7 +14,7 @@ menuconfig SND_SOC
|
|||
|
||||
If you want ASoC support, you should say Y here and also to the
|
||||
specific driver for your SoC platform below.
|
||||
|
||||
|
||||
ASoC provides power efficient ALSA support for embedded battery powered
|
||||
SoC based systems like PDA's, Phones and Personal Media Players.
|
||||
|
||||
|
@ -55,6 +55,13 @@ config SND_SOC_TOPOLOGY_KUNIT_TEST
|
|||
userspace applications such as pulseaudio, to prevent unnecessary
|
||||
problems.
|
||||
|
||||
config SND_SOC_UTILS_KUNIT_TEST
|
||||
tristate "KUnit tests for SoC utils"
|
||||
depends on KUNIT
|
||||
default KUNIT_ALL_TESTS
|
||||
help
|
||||
If you want to perform tests on ALSA SoC utils library say Y here.
|
||||
|
||||
config SND_SOC_ACPI
|
||||
tristate
|
||||
|
||||
|
|
|
@ -12,6 +12,11 @@ ifneq ($(CONFIG_SND_SOC_TOPOLOGY_KUNIT_TEST),)
|
|||
obj-$(CONFIG_SND_SOC_TOPOLOGY_KUNIT_TEST) := soc-topology-test.o
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_SND_SOC_UTILS_KUNIT_TEST),)
|
||||
# snd-soc-test-objs := soc-utils-test.o
|
||||
obj-$(CONFIG_SND_SOC_UTILS_KUNIT_TEST) := soc-utils-test.o
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM),)
|
||||
snd-soc-core-objs += soc-generic-dmaengine-pcm.o
|
||||
endif
|
||||
|
|
|
@ -71,7 +71,7 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&cz_jack, NULL, 0);
|
||||
&cz_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
@ -151,7 +151,7 @@ static int cz_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&cz_jack, NULL, 0);
|
||||
&cz_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
|
|
@ -80,7 +80,7 @@ static int cz_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&cz_jack, NULL, 0);
|
||||
&cz_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
|
|
@ -42,7 +42,7 @@ config SND_AMD_ASOC_RENOIR
|
|||
|
||||
config SND_SOC_AMD_MACH_COMMON
|
||||
tristate
|
||||
depends on X86 && PCI && I2C && GPIOLIB
|
||||
depends on X86 && PCI && I2C
|
||||
select CLK_FIXED_FCH
|
||||
select SND_SOC_RT5682_I2C
|
||||
select SND_SOC_DMIC
|
||||
|
@ -54,14 +54,14 @@ config SND_SOC_AMD_MACH_COMMON
|
|||
|
||||
config SND_SOC_AMD_LEGACY_MACH
|
||||
tristate "AMD Legacy Machine Driver Support"
|
||||
depends on X86 && PCI && I2C && GPIOLIB
|
||||
depends on X86 && PCI && I2C
|
||||
select SND_SOC_AMD_MACH_COMMON
|
||||
help
|
||||
This option enables legacy sound card support for ACP audio.
|
||||
|
||||
config SND_SOC_AMD_SOF_MACH
|
||||
tristate "AMD SOF Machine Driver Support"
|
||||
depends on X86 && PCI && I2C && GPIOLIB
|
||||
depends on X86 && PCI && I2C
|
||||
select SND_SOC_AMD_MACH_COMMON
|
||||
help
|
||||
This option enables SOF sound card support for ACP audio.
|
||||
|
|
|
@ -27,7 +27,6 @@ static struct acp_card_drvdata rt5682_rt1019_data = {
|
|||
.hs_codec_id = RT5682,
|
||||
.amp_codec_id = RT1019,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_GB,
|
||||
};
|
||||
|
||||
static struct acp_card_drvdata rt5682s_max_data = {
|
||||
|
@ -37,7 +36,6 @@ static struct acp_card_drvdata rt5682s_max_data = {
|
|||
.hs_codec_id = RT5682S,
|
||||
.amp_codec_id = MAX98360A,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
|
||||
};
|
||||
|
||||
static struct acp_card_drvdata rt5682s_rt1019_data = {
|
||||
|
@ -47,7 +45,6 @@ static struct acp_card_drvdata rt5682s_rt1019_data = {
|
|||
.hs_codec_id = RT5682S,
|
||||
.amp_codec_id = RT1019,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new acp_controls[] = {
|
||||
|
@ -62,16 +59,15 @@ static const struct snd_kcontrol_new acp_controls[] = {
|
|||
static const struct snd_soc_dapm_widget acp_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphone Jack", NULL),
|
||||
SND_SOC_DAPM_MIC("Headset Mic", NULL),
|
||||
SND_SOC_DAPM_SPK("Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Left Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Right Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Left Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Right Spk", NULL),
|
||||
};
|
||||
|
||||
static int acp_asoc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
unsigned int spkr_gpio;
|
||||
int ret;
|
||||
|
||||
if (!pdev->id_entry)
|
||||
|
@ -89,20 +85,9 @@ static int acp_asoc_probe(struct platform_device *pdev)
|
|||
card->controls = acp_controls;
|
||||
card->num_controls = ARRAY_SIZE(acp_controls);
|
||||
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
|
||||
spkr_gpio = ((struct acp_card_drvdata *)(card->drvdata))->gpio_spkr_en;
|
||||
|
||||
acp_legacy_dai_links_create(card);
|
||||
|
||||
if (gpio_is_valid(spkr_gpio)) {
|
||||
ret = devm_gpio_request(dev, spkr_gpio, "spkren");
|
||||
if (ret) {
|
||||
dev_err(dev, "(%s) gpio request failed: %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
gpio_direction_output(spkr_gpio, 0);
|
||||
}
|
||||
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev,
|
||||
|
@ -131,6 +116,7 @@ static const struct platform_device_id board_ids[] = {
|
|||
};
|
||||
static struct platform_driver acp_asoc_audio = {
|
||||
.driver = {
|
||||
.pm = &snd_soc_pm_ops,
|
||||
.name = "acp_mach",
|
||||
},
|
||||
.probe = acp_asoc_probe,
|
||||
|
|
|
@ -71,31 +71,6 @@ static const struct snd_soc_dapm_route rt5682_map[] = {
|
|||
{ "IN1P", NULL, "Headset Mic" },
|
||||
};
|
||||
|
||||
int event_spkr_handler(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *k, int event)
|
||||
{
|
||||
struct snd_soc_dapm_context *dapm = w->dapm;
|
||||
struct snd_soc_card *card = dapm->card;
|
||||
struct acp_card_drvdata *drvdata = snd_soc_card_get_drvdata(card);
|
||||
|
||||
if (!gpio_is_valid(drvdata->gpio_spkr_en))
|
||||
return 0;
|
||||
|
||||
switch (event) {
|
||||
case SND_SOC_DAPM_POST_PMU:
|
||||
gpio_set_value(drvdata->gpio_spkr_en, 1);
|
||||
break;
|
||||
case SND_SOC_DAPM_PRE_PMD:
|
||||
gpio_set_value(drvdata->gpio_spkr_en, 0);
|
||||
break;
|
||||
default:
|
||||
dev_warn(card->dev, "%s invalid setting\n", __func__);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(event_spkr_handler, SND_SOC_AMD_MACH);
|
||||
|
||||
/* Define card ops for RT5682 CODEC */
|
||||
static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
||||
{
|
||||
|
@ -145,7 +120,7 @@ static int acp_card_rt5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&pco_jack, NULL, 0);
|
||||
&pco_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
@ -266,7 +241,7 @@ static int acp_card_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&pco_jack, NULL, 0);
|
||||
&pco_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
|
|
@ -17,11 +17,6 @@
|
|||
#include <linux/input.h>
|
||||
#include <linux/module.h>
|
||||
#include <sound/soc.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
||||
#define EN_SPKR_GPIO_GB 0x11F
|
||||
#define EN_SPKR_GPIO_NONE -EINVAL
|
||||
|
||||
enum be_id {
|
||||
HEADSET_BE_ID = 0,
|
||||
|
@ -54,11 +49,9 @@ struct acp_card_drvdata {
|
|||
unsigned int dai_fmt;
|
||||
struct clk *wclk;
|
||||
struct clk *bclk;
|
||||
unsigned int gpio_spkr_en;
|
||||
};
|
||||
|
||||
int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
|
||||
int acp_legacy_dai_links_create(struct snd_soc_card *card);
|
||||
int event_spkr_handler(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *k, int event);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,6 @@ static struct acp_card_drvdata sof_rt5682_rt1019_data = {
|
|||
.hs_codec_id = RT5682,
|
||||
.amp_codec_id = RT1019,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_GB,
|
||||
};
|
||||
|
||||
static struct acp_card_drvdata sof_rt5682_max_data = {
|
||||
|
@ -37,7 +36,6 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
|
|||
.hs_codec_id = RT5682,
|
||||
.amp_codec_id = MAX98360A,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
|
||||
};
|
||||
|
||||
static struct acp_card_drvdata sof_rt5682s_rt1019_data = {
|
||||
|
@ -56,7 +54,6 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
|
|||
.hs_codec_id = RT5682S,
|
||||
.amp_codec_id = MAX98360A,
|
||||
.dmic_codec_id = DMIC,
|
||||
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
|
||||
};
|
||||
|
||||
static const struct snd_kcontrol_new acp_controls[] = {
|
||||
|
@ -70,16 +67,15 @@ static const struct snd_kcontrol_new acp_controls[] = {
|
|||
static const struct snd_soc_dapm_widget acp_widgets[] = {
|
||||
SND_SOC_DAPM_HP("Headphone Jack", NULL),
|
||||
SND_SOC_DAPM_MIC("Headset Mic", NULL),
|
||||
SND_SOC_DAPM_SPK("Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Left Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Right Spk", event_spkr_handler),
|
||||
SND_SOC_DAPM_SPK("Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Left Spk", NULL),
|
||||
SND_SOC_DAPM_SPK("Right Spk", NULL),
|
||||
};
|
||||
|
||||
static int acp_sof_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
unsigned int spkr_gpio;
|
||||
int ret;
|
||||
|
||||
if (!pdev->id_entry)
|
||||
|
@ -97,20 +93,9 @@ static int acp_sof_probe(struct platform_device *pdev)
|
|||
card->controls = acp_controls;
|
||||
card->num_controls = ARRAY_SIZE(acp_controls);
|
||||
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
|
||||
spkr_gpio = ((struct acp_card_drvdata *)(card->drvdata))->gpio_spkr_en;
|
||||
|
||||
acp_sofdsp_dai_links_create(card);
|
||||
|
||||
if (gpio_is_valid(spkr_gpio)) {
|
||||
ret = devm_gpio_request(dev, spkr_gpio, "spkren");
|
||||
if (ret) {
|
||||
dev_err(dev, "(%s) gpio request failed: %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
gpio_direction_output(spkr_gpio, 0);
|
||||
}
|
||||
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev,
|
||||
|
@ -144,6 +129,7 @@ static const struct platform_device_id board_ids[] = {
|
|||
static struct platform_driver acp_asoc_audio = {
|
||||
.driver = {
|
||||
.name = "sof_mach",
|
||||
.pm = &snd_soc_pm_ops,
|
||||
},
|
||||
.probe = acp_sof_probe,
|
||||
.id_table = board_ids,
|
||||
|
|
|
@ -90,7 +90,7 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
|
|||
SND_JACK_HEADSET | SND_JACK_LINEOUT |
|
||||
SND_JACK_BTN_0 | SND_JACK_BTN_1 |
|
||||
SND_JACK_BTN_2 | SND_JACK_BTN_3,
|
||||
&pco_jack, NULL, 0);
|
||||
&pco_jack);
|
||||
if (ret) {
|
||||
dev_err(card->dev, "HP jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
|
|
@ -17,10 +17,8 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
|
@ -61,10 +59,10 @@ static int acp5x_8821_init(struct snd_soc_pcm_runtime *rtd)
|
|||
* Headset buttons map to the google Reference headset.
|
||||
* These can be configured by userspace.
|
||||
*/
|
||||
ret = snd_soc_card_jack_new(card, "Headset Jack",
|
||||
SND_JACK_HEADSET | SND_JACK_BTN_0,
|
||||
&vg_headset, acp5x_nau8821_jack_pins,
|
||||
ARRAY_SIZE(acp5x_nau8821_jack_pins));
|
||||
ret = snd_soc_card_jack_new_pins(card, "Headset Jack",
|
||||
SND_JACK_HEADSET | SND_JACK_BTN_0,
|
||||
&vg_headset, acp5x_nau8821_jack_pins,
|
||||
ARRAY_SIZE(acp5x_nau8821_jack_pins));
|
||||
if (ret) {
|
||||
dev_err(rtd->dev, "Headset Jack creation failed %d\n", ret);
|
||||
return ret;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <sound/pcm_params.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/acpi.h>
|
||||
|
||||
#include "acp6x.h"
|
||||
|
||||
|
@ -45,108 +46,126 @@ static struct snd_soc_card acp6x_card = {
|
|||
|
||||
static const struct dmi_system_id yc_acp_quirk_table[] = {
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D2"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D3"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D4"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D5"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CF"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CG"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CR"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21AW"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21AX"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21BN"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21BQ"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CH"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CK"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21CL"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D8"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "21D9"),
|
||||
|
@ -157,18 +176,33 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
|||
|
||||
static int acp6x_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct dmi_system_id *dmi_id;
|
||||
struct acp6x_pdm *machine = NULL;
|
||||
struct snd_soc_card *card;
|
||||
struct acpi_device *adev;
|
||||
int ret;
|
||||
const struct dmi_system_id *dmi_id;
|
||||
|
||||
/* check the parent device's firmware node has _DSD or not */
|
||||
adev = ACPI_COMPANION(pdev->dev.parent);
|
||||
if (adev) {
|
||||
const union acpi_object *obj;
|
||||
|
||||
if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
|
||||
obj->integer.value == 1)
|
||||
platform_set_drvdata(pdev, &acp6x_card);
|
||||
}
|
||||
|
||||
/* check for any DMI overrides */
|
||||
dmi_id = dmi_first_match(yc_acp_quirk_table);
|
||||
if (!dmi_id)
|
||||
if (dmi_id)
|
||||
platform_set_drvdata(pdev, dmi_id->driver_data);
|
||||
|
||||
card = platform_get_drvdata(pdev);
|
||||
if (!card)
|
||||
return -ENODEV;
|
||||
card = &acp6x_card;
|
||||
dev_info(&pdev->dev, "Enabling ACP DMIC support via %s", dmi_id ? "DMI" : "ACPI");
|
||||
acp6x_card.dev = &pdev->dev;
|
||||
|
||||
platform_set_drvdata(pdev, card);
|
||||
snd_soc_card_set_drvdata(card, machine);
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
if (ret) {
|
||||
|
|
|
@ -154,9 +154,14 @@ static int snd_acp6x_probe(struct pci_dev *pci,
|
|||
|
||||
irqflags = IRQF_SHARED;
|
||||
/* Yellow Carp device check */
|
||||
if (pci->revision != 0x60)
|
||||
switch (pci->revision) {
|
||||
case 0x60:
|
||||
case 0x6f:
|
||||
break;
|
||||
default:
|
||||
dev_err(&pci->dev, "acp6x pci device not found\n");
|
||||
return -ENODEV;
|
||||
|
||||
}
|
||||
if (pci_enable_device(pci)) {
|
||||
dev_err(&pci->dev, "pci_enable_device failed\n");
|
||||
return -ENODEV;
|
||||
|
|
|
@ -42,9 +42,9 @@ config SND_ATMEL_SOC_SSC_DMA
|
|||
config SND_AT91_SOC_SAM9G20_WM8731
|
||||
tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board"
|
||||
depends on ARCH_AT91 || COMPILE_TEST
|
||||
depends on ATMEL_SSC && SND_SOC_I2C_AND_SPI
|
||||
depends on ATMEL_SSC && I2C
|
||||
select SND_ATMEL_SOC_SSC_PDC
|
||||
select SND_SOC_WM8731
|
||||
select SND_SOC_WM8731_I2C
|
||||
help
|
||||
Say Y if you want to add support for SoC audio on WM8731-based
|
||||
AT91sam9g20 evaluation board.
|
||||
|
|
|
@ -458,7 +458,6 @@ static const struct snd_soc_component_driver atmel_classd_cpu_dai_component = {
|
|||
.num_controls = ARRAY_SIZE(atmel_classd_snd_controls),
|
||||
.idle_bias_on = 1,
|
||||
.use_pmdown_time = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* ASoC sound card */
|
||||
|
|
|
@ -481,7 +481,6 @@ static const struct snd_soc_component_driver atmel_pdmic_cpu_dai_component = {
|
|||
.num_controls = ARRAY_SIZE(atmel_pdmic_snd_controls),
|
||||
.idle_bias_on = 1,
|
||||
.use_pmdown_time = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* ASoC sound card */
|
||||
|
|
|
@ -127,8 +127,8 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
|
|||
|
||||
ret = atmel_ssc_set_audio(0);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "ssc channel is not valid\n");
|
||||
return -EINVAL;
|
||||
dev_err(&pdev->dev, "ssc channel is not valid: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
card->dev = &pdev->dev;
|
||||
|
@ -148,7 +148,8 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
|
|||
codec_np = of_parse_phandle(np, "atmel,audio-codec", 0);
|
||||
if (!codec_np) {
|
||||
dev_err(&pdev->dev, "codec info missing\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
at91sam9g20ek_dai.codecs->of_node = codec_np;
|
||||
|
||||
|
@ -159,7 +160,8 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
|
|||
if (!cpu_np) {
|
||||
dev_err(&pdev->dev, "dai and pcm info missing\n");
|
||||
of_node_put(codec_np);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
at91sam9g20ek_dai.cpus->of_node = cpu_np;
|
||||
at91sam9g20ek_dai.platforms->of_node = cpu_np;
|
||||
|
@ -169,10 +171,12 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
|
|||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "snd_soc_register_card() failed\n");
|
||||
dev_err_probe(&pdev->dev, ret,
|
||||
"snd_soc_register_card() failed: %d\n", ret);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
|
||||
err:
|
||||
atmel_ssc_put_audio(0);
|
||||
|
|
|
@ -58,7 +58,7 @@ config SND_SOC_DB1200
|
|||
select SND_SOC_AC97_CODEC
|
||||
select SND_SOC_WM9712
|
||||
select SND_SOC_AU1XPSC_I2S
|
||||
select SND_SOC_WM8731
|
||||
select SND_SOC_WM8731_I2C
|
||||
help
|
||||
Select this option to enable audio (AC97 and I2S) on the
|
||||
Alchemy/AMD/RMI/NetLogic Db1200, Db1550 and Db1300 evaluation boards.
|
||||
|
|
|
@ -65,6 +65,8 @@ config SND_SOC_ALL_CODECS
|
|||
imply SND_SOC_CS35L36
|
||||
imply SND_SOC_CS35L41_SPI
|
||||
imply SND_SOC_CS35L41_I2C
|
||||
imply SND_SOC_CS35L45_I2C
|
||||
imply SND_SOC_CS35L45_SPI
|
||||
imply SND_SOC_CS42L42
|
||||
imply SND_SOC_CS42L51_I2C
|
||||
imply SND_SOC_CS42L52
|
||||
|
@ -127,6 +129,7 @@ config SND_SOC_ALL_CODECS
|
|||
imply SND_SOC_MAX98373_I2C
|
||||
imply SND_SOC_MAX98373_SDW
|
||||
imply SND_SOC_MAX98390
|
||||
imply SND_SOC_MAX98396
|
||||
imply SND_SOC_MAX9850
|
||||
imply SND_SOC_MAX9860
|
||||
imply SND_SOC_MAX9759
|
||||
|
@ -168,6 +171,7 @@ config SND_SOC_ALL_CODECS
|
|||
imply SND_SOC_RT1011
|
||||
imply SND_SOC_RT1015
|
||||
imply SND_SOC_RT1015P
|
||||
imply SND_SOC_RT1016
|
||||
imply SND_SOC_RT1019
|
||||
imply SND_SOC_RT1305
|
||||
imply SND_SOC_RT1308
|
||||
|
@ -265,7 +269,8 @@ config SND_SOC_ALL_CODECS
|
|||
imply SND_SOC_WM8711
|
||||
imply SND_SOC_WM8727
|
||||
imply SND_SOC_WM8728
|
||||
imply SND_SOC_WM8731
|
||||
imply SND_SOC_WM8731_I2C
|
||||
imply SND_SOC_WM8731_SPI
|
||||
imply SND_SOC_WM8737
|
||||
imply SND_SOC_WM8741
|
||||
imply SND_SOC_WM8750
|
||||
|
@ -655,6 +660,34 @@ config SND_SOC_CS35L41_I2C
|
|||
select SND_SOC_CS35L41
|
||||
select REGMAP_I2C
|
||||
|
||||
config SND_SOC_CS35L45_TABLES
|
||||
tristate
|
||||
|
||||
config SND_SOC_CS35L45
|
||||
tristate
|
||||
|
||||
config SND_SOC_CS35L45_SPI
|
||||
tristate "Cirrus Logic CS35L45 CODEC (SPI)"
|
||||
depends on SPI_MASTER
|
||||
select REGMAP
|
||||
select REGMAP_SPI
|
||||
select SND_SOC_CS35L45_TABLES
|
||||
select SND_SOC_CS35L45
|
||||
help
|
||||
Enable support for Cirrus Logic CS35L45 smart speaker amplifier
|
||||
with SPI control.
|
||||
|
||||
config SND_SOC_CS35L45_I2C
|
||||
tristate "Cirrus Logic CS35L45 CODEC (I2C)"
|
||||
depends on I2C
|
||||
select REGMAP
|
||||
select REGMAP_I2C
|
||||
select SND_SOC_CS35L45_TABLES
|
||||
select SND_SOC_CS35L45
|
||||
help
|
||||
Enable support for Cirrus Logic CS35L45 smart speaker amplifier
|
||||
with I2C control.
|
||||
|
||||
config SND_SOC_CS42L42
|
||||
tristate "Cirrus Logic CS42L42 CODEC"
|
||||
depends on I2C
|
||||
|
@ -953,7 +986,6 @@ config SND_SOC_MAX98095
|
|||
|
||||
config SND_SOC_MAX98357A
|
||||
tristate "Maxim MAX98357A CODEC"
|
||||
depends on GPIOLIB
|
||||
|
||||
config SND_SOC_MAX98371
|
||||
tristate
|
||||
|
@ -1015,6 +1047,15 @@ config SND_SOC_MAX98390
|
|||
tristate "Maxim Integrated MAX98390 Speaker Amplifier"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_MAX98396
|
||||
tristate "Analog Devices MAX98396 Speaker Amplifier"
|
||||
depends on I2C
|
||||
help
|
||||
Enable support for Analog Devices MAX98396 audio
|
||||
amplifier. The device provides a PCM interface for
|
||||
audio data and a standard I2C interface for control
|
||||
data communication.
|
||||
|
||||
config SND_SOC_MAX9850
|
||||
tristate
|
||||
depends on I2C
|
||||
|
@ -1213,7 +1254,10 @@ config SND_SOC_RT1015
|
|||
|
||||
config SND_SOC_RT1015P
|
||||
tristate
|
||||
depends on GPIOLIB
|
||||
|
||||
config SND_SOC_RT1016
|
||||
tristate
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_RT1019
|
||||
tristate
|
||||
|
@ -1753,8 +1797,19 @@ config SND_SOC_WM8728
|
|||
depends on SND_SOC_I2C_AND_SPI
|
||||
|
||||
config SND_SOC_WM8731
|
||||
tristate "Wolfson Microelectronics WM8731 CODEC"
|
||||
depends on SND_SOC_I2C_AND_SPI
|
||||
tristate
|
||||
|
||||
config SND_SOC_WM8731_I2C
|
||||
tristate "Wolfson Microelectronics WM8731 CODEC with I2C"
|
||||
depends on I2C
|
||||
select REGMAP
|
||||
select SND_SOC_WM8731
|
||||
|
||||
config SND_SOC_WM8731_SPI
|
||||
tristate "Wolfson Microelectronics WM8731 CODEC with SPI"
|
||||
depends on SPI
|
||||
select REGMAP
|
||||
select SND_SOC_WM8731
|
||||
|
||||
config SND_SOC_WM8737
|
||||
tristate "Wolfson Microelectronics WM8737 ADC"
|
||||
|
@ -1811,7 +1866,7 @@ config SND_SOC_WM8904
|
|||
depends on I2C
|
||||
|
||||
config SND_SOC_WM8940
|
||||
tristate
|
||||
tristate "Wolfson Microelectronics WM8940 codec"
|
||||
depends on I2C
|
||||
|
||||
config SND_SOC_WM8955
|
||||
|
|
|
@ -60,6 +60,10 @@ snd-soc-cs35l41-lib-objs := cs35l41-lib.o
|
|||
snd-soc-cs35l41-objs := cs35l41.o
|
||||
snd-soc-cs35l41-spi-objs := cs35l41-spi.o
|
||||
snd-soc-cs35l41-i2c-objs := cs35l41-i2c.o
|
||||
snd-soc-cs35l45-tables-objs := cs35l45-tables.o
|
||||
snd-soc-cs35l45-objs := cs35l45.o
|
||||
snd-soc-cs35l45-spi-objs := cs35l45-spi.o
|
||||
snd-soc-cs35l45-i2c-objs := cs35l45-i2c.o
|
||||
snd-soc-cs42l42-objs := cs42l42.o
|
||||
snd-soc-cs42l51-objs := cs42l51.o
|
||||
snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
|
||||
|
@ -135,6 +139,7 @@ snd-soc-max98373-objs := max98373.o
|
|||
snd-soc-max98373-i2c-objs := max98373-i2c.o
|
||||
snd-soc-max98373-sdw-objs := max98373-sdw.o
|
||||
snd-soc-max98390-objs := max98390.o
|
||||
snd-soc-max98396-objs := max98396.o
|
||||
snd-soc-max9850-objs := max9850.o
|
||||
snd-soc-max9860-objs := max9860.o
|
||||
snd-soc-mc13783-objs := mc13783.o
|
||||
|
@ -181,6 +186,7 @@ snd-soc-rl6347a-objs := rl6347a.o
|
|||
snd-soc-rt1011-objs := rt1011.o
|
||||
snd-soc-rt1015-objs := rt1015.o
|
||||
snd-soc-rt1015p-objs := rt1015p.o
|
||||
snd-soc-rt1016-objs := rt1016.o
|
||||
snd-soc-rt1019-objs := rt1019.o
|
||||
snd-soc-rt1305-objs := rt1305.o
|
||||
snd-soc-rt1308-objs := rt1308.o
|
||||
|
@ -290,6 +296,8 @@ snd-soc-wm8711-objs := wm8711.o
|
|||
snd-soc-wm8727-objs := wm8727.o
|
||||
snd-soc-wm8728-objs := wm8728.o
|
||||
snd-soc-wm8731-objs := wm8731.o
|
||||
snd-soc-wm8731-i2c-objs := wm8731-i2c.o
|
||||
snd-soc-wm8731-spi-objs := wm8731-spi.o
|
||||
snd-soc-wm8737-objs := wm8737.o
|
||||
snd-soc-wm8741-objs := wm8741.o
|
||||
snd-soc-wm8750-objs := wm8750.o
|
||||
|
@ -404,6 +412,10 @@ obj-$(CONFIG_SND_SOC_CS35L41) += snd-soc-cs35l41.o
|
|||
obj-$(CONFIG_SND_SOC_CS35L41_LIB) += snd-soc-cs35l41-lib.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L41_SPI) += snd-soc-cs35l41-spi.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L41_I2C) += snd-soc-cs35l41-i2c.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L45_TABLES) += snd-soc-cs35l45-tables.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L45) += snd-soc-cs35l45.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L45_SPI) += snd-soc-cs35l45-spi.o
|
||||
obj-$(CONFIG_SND_SOC_CS35L45_I2C) += snd-soc-cs35l45-i2c.o
|
||||
obj-$(CONFIG_SND_SOC_CS42L42) += snd-soc-cs42l42.o
|
||||
obj-$(CONFIG_SND_SOC_CS42L51) += snd-soc-cs42l51.o
|
||||
obj-$(CONFIG_SND_SOC_CS42L51_I2C) += snd-soc-cs42l51-i2c.o
|
||||
|
@ -474,6 +486,7 @@ obj-$(CONFIG_SND_SOC_MAX98373) += snd-soc-max98373.o
|
|||
obj-$(CONFIG_SND_SOC_MAX98373_I2C) += snd-soc-max98373-i2c.o
|
||||
obj-$(CONFIG_SND_SOC_MAX98373_SDW) += snd-soc-max98373-sdw.o
|
||||
obj-$(CONFIG_SND_SOC_MAX98390) += snd-soc-max98390.o
|
||||
obj-$(CONFIG_SND_SOC_MAX98396) += snd-soc-max98396.o
|
||||
obj-$(CONFIG_SND_SOC_MAX9850) += snd-soc-max9850.o
|
||||
obj-$(CONFIG_SND_SOC_MAX9860) += snd-soc-max9860.o
|
||||
obj-$(CONFIG_SND_SOC_MC13783) += snd-soc-mc13783.o
|
||||
|
@ -520,6 +533,7 @@ obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o
|
|||
obj-$(CONFIG_SND_SOC_RT1011) += snd-soc-rt1011.o
|
||||
obj-$(CONFIG_SND_SOC_RT1015) += snd-soc-rt1015.o
|
||||
obj-$(CONFIG_SND_SOC_RT1015P) += snd-soc-rt1015p.o
|
||||
obj-$(CONFIG_SND_SOC_RT1016) += snd-soc-rt1016.o
|
||||
obj-$(CONFIG_SND_SOC_RT1019) += snd-soc-rt1019.o
|
||||
obj-$(CONFIG_SND_SOC_RT1305) += snd-soc-rt1305.o
|
||||
obj-$(CONFIG_SND_SOC_RT1308) += snd-soc-rt1308.o
|
||||
|
@ -632,6 +646,8 @@ obj-$(CONFIG_SND_SOC_WM8711) += snd-soc-wm8711.o
|
|||
obj-$(CONFIG_SND_SOC_WM8727) += snd-soc-wm8727.o
|
||||
obj-$(CONFIG_SND_SOC_WM8728) += snd-soc-wm8728.o
|
||||
obj-$(CONFIG_SND_SOC_WM8731) += snd-soc-wm8731.o
|
||||
obj-$(CONFIG_SND_SOC_WM8731_I2C) += snd-soc-wm8731-i2c.o
|
||||
obj-$(CONFIG_SND_SOC_WM8731_SPI) += snd-soc-wm8731-spi.o
|
||||
obj-$(CONFIG_SND_SOC_WM8737) += snd-soc-wm8737.o
|
||||
obj-$(CONFIG_SND_SOC_WM8741) += snd-soc-wm8741.o
|
||||
obj-$(CONFIG_SND_SOC_WM8750) += snd-soc-wm8750.o
|
||||
|
|
|
@ -20,10 +20,10 @@ static const struct i2c_device_id ad193x_id[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ad193x_id);
|
||||
|
||||
static int ad193x_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int ad193x_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct regmap_config config;
|
||||
const struct i2c_device_id *id = i2c_match_id(ad193x_id, client);
|
||||
|
||||
config = ad193x_regmap_config;
|
||||
config.val_bits = 8;
|
||||
|
@ -38,7 +38,7 @@ static struct i2c_driver ad193x_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "ad193x",
|
||||
},
|
||||
.probe = ad193x_i2c_probe,
|
||||
.probe_new = ad193x_i2c_probe,
|
||||
.id_table = ad193x_id,
|
||||
};
|
||||
module_i2c_driver(ad193x_i2c_driver);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "adau1372.h"
|
||||
|
||||
static int adau1372_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
static int adau1372_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
return adau1372_probe(&client->dev,
|
||||
devm_regmap_init_i2c(client, &adau1372_regmap_config), NULL);
|
||||
|
@ -30,7 +30,7 @@ static struct i2c_driver adau1372_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "adau1372",
|
||||
},
|
||||
.probe = adau1372_i2c_probe,
|
||||
.probe_new = adau1372_i2c_probe,
|
||||
.id_table = adau1372_i2c_ids,
|
||||
};
|
||||
module_i2c_driver(adau1372_i2c_driver);
|
||||
|
|
|
@ -859,6 +859,7 @@ static const struct snd_soc_component_driver adau1372_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(adau1372_dapm_widgets),
|
||||
.dapm_routes = adau1372_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(adau1372_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct snd_soc_dai_ops adau1372_dai_ops = {
|
||||
|
|
|
@ -1473,8 +1473,7 @@ static const struct snd_soc_component_driver adau1373_component_driver = {
|
|||
.non_legacy_dai_naming = 1,
|
||||
};
|
||||
|
||||
static int adau1373_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int adau1373_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct adau1373 *adau1373;
|
||||
int ret;
|
||||
|
@ -1508,7 +1507,7 @@ static struct i2c_driver adau1373_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "adau1373",
|
||||
},
|
||||
.probe = adau1373_i2c_probe,
|
||||
.probe_new = adau1373_i2c_probe,
|
||||
.id_table = adau1373_i2c_id,
|
||||
};
|
||||
|
||||
|
|
|
@ -785,8 +785,7 @@ static const struct regmap_config adau1701_regmap = {
|
|||
.reg_read = adau1701_reg_read,
|
||||
};
|
||||
|
||||
static int adau1701_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int adau1701_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct adau1701 *adau1701;
|
||||
struct device *dev = &client->dev;
|
||||
|
@ -878,7 +877,7 @@ static struct i2c_driver adau1701_i2c_driver = {
|
|||
.name = "adau1701",
|
||||
.of_match_table = of_match_ptr(adau1701_dt_ids),
|
||||
},
|
||||
.probe = adau1701_i2c_probe,
|
||||
.probe_new = adau1701_i2c_probe,
|
||||
.id_table = adau1701_i2c_id,
|
||||
};
|
||||
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
|
||||
#include "adau1761.h"
|
||||
|
||||
static int adau1761_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static const struct i2c_device_id adau1761_i2c_ids[];
|
||||
|
||||
static int adau1761_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct regmap_config config;
|
||||
const struct i2c_device_id *id = i2c_match_id(adau1761_i2c_ids, client);
|
||||
|
||||
config = adau1761_regmap_config;
|
||||
config.val_bits = 8;
|
||||
|
@ -59,7 +61,7 @@ static struct i2c_driver adau1761_i2c_driver = {
|
|||
.name = "adau1761",
|
||||
.of_match_table = of_match_ptr(adau1761_i2c_dt_ids),
|
||||
},
|
||||
.probe = adau1761_i2c_probe,
|
||||
.probe_new = adau1761_i2c_probe,
|
||||
.remove = adau1761_i2c_remove,
|
||||
.id_table = adau1761_i2c_ids,
|
||||
};
|
||||
|
|
|
@ -556,8 +556,6 @@ static const struct snd_soc_dapm_route adau1761_dapm_routes[] = {
|
|||
{ "Left DAC", NULL, "Interpolator Resync Clock" },
|
||||
{ "Right DAC", NULL, "Interpolator Resync Clock" },
|
||||
|
||||
{ "DSP", NULL, "Digital Clock 0" },
|
||||
|
||||
{ "Slew Clock", NULL, "Digital Clock 0" },
|
||||
{ "Right Playback Mixer", NULL, "Slew Clock" },
|
||||
{ "Left Playback Mixer", NULL, "Slew Clock" },
|
||||
|
@ -569,6 +567,56 @@ static const struct snd_soc_dapm_route adau1761_dapm_routes[] = {
|
|||
{ "Digital Clock 1", NULL, "SYSCLK" },
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_route adau1761_dapm_dsp_routes[] = {
|
||||
{ "DSP", NULL, "Digital Clock 0" },
|
||||
};
|
||||
|
||||
static int adau1761_compatibility_probe(struct device *dev)
|
||||
{
|
||||
struct adau *adau = dev_get_drvdata(dev);
|
||||
struct regmap *regmap = adau->regmap;
|
||||
int val, ret = 0;
|
||||
|
||||
/* Only consider compatibility mode when ADAU1361 was specified. */
|
||||
if (adau->type != ADAU1361)
|
||||
return 0;
|
||||
|
||||
regcache_cache_bypass(regmap, true);
|
||||
|
||||
/*
|
||||
* This will enable the core clock and bypass the PLL,
|
||||
* so that we can access the registers for probing purposes
|
||||
* (without having to set up the PLL).
|
||||
*/
|
||||
regmap_write(regmap, ADAU17X1_CLOCK_CONTROL,
|
||||
ADAU17X1_CLOCK_CONTROL_SYSCLK_EN);
|
||||
|
||||
/*
|
||||
* ADAU17X1_SERIAL_SAMPLING_RATE doesn't exist in non-DSP chips;
|
||||
* reading it results in zero at all times, and write is a no-op.
|
||||
* Use this register to probe for ADAU1761.
|
||||
*/
|
||||
regmap_write(regmap, ADAU17X1_SERIAL_SAMPLING_RATE, 1);
|
||||
ret = regmap_read(regmap, ADAU17X1_SERIAL_SAMPLING_RATE, &val);
|
||||
if (ret)
|
||||
goto exit;
|
||||
if (val != 1)
|
||||
goto exit;
|
||||
regmap_write(regmap, ADAU17X1_SERIAL_SAMPLING_RATE, 0);
|
||||
ret = regmap_read(regmap, ADAU17X1_SERIAL_SAMPLING_RATE, &val);
|
||||
if (ret)
|
||||
goto exit;
|
||||
if (val != 0)
|
||||
goto exit;
|
||||
|
||||
adau->type = ADAU1761_AS_1361;
|
||||
exit:
|
||||
/* Disable core clock after probing. */
|
||||
regmap_write(regmap, ADAU17X1_CLOCK_CONTROL, 0);
|
||||
regcache_cache_bypass(regmap, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int adau1761_set_bias_level(struct snd_soc_component *component,
|
||||
enum snd_soc_bias_level level)
|
||||
{
|
||||
|
@ -823,7 +871,11 @@ static int adau1761_component_probe(struct snd_soc_component *component)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (adau->type == ADAU1761) {
|
||||
/*
|
||||
* If we've got an ADAU1761, or an ADAU1761 operating as an
|
||||
* ADAU1361, we need these non-DSP related DAPM widgets and routes.
|
||||
*/
|
||||
if (adau->type == ADAU1761 || adau->type == ADAU1761_AS_1361) {
|
||||
ret = snd_soc_dapm_new_controls(dapm, adau1761_dapm_widgets,
|
||||
ARRAY_SIZE(adau1761_dapm_widgets));
|
||||
if (ret)
|
||||
|
@ -834,7 +886,29 @@ static int adau1761_component_probe(struct snd_soc_component *component)
|
|||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* These routes are DSP related and only used when we have a
|
||||
* bona fide ADAU1761.
|
||||
*/
|
||||
if (adau->type == ADAU1761) {
|
||||
ret = snd_soc_dapm_add_routes(dapm, adau1761_dapm_dsp_routes,
|
||||
ARRAY_SIZE(adau1761_dapm_dsp_routes));
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
/*
|
||||
* In the ADAU1761, by default, the AIF is routed to the DSP, whereas
|
||||
* for the ADAU1361, the AIF is permanently routed to the ADC and DAC.
|
||||
* Thus, if we have an ADAU1761 masquerading as an ADAU1361,
|
||||
* we need to explicitly route the AIF to the ADC and DAC.
|
||||
* For the ADAU1761, this is normally done by set_tdm_slot, but this
|
||||
* function is not necessarily called during stream setup, so set up
|
||||
* the compatible AIF routings here from the start.
|
||||
*/
|
||||
if (adau->type == ADAU1761_AS_1361) {
|
||||
regmap_write(adau->regmap, ADAU17X1_SERIAL_INPUT_ROUTE, 0x01);
|
||||
regmap_write(adau->regmap, ADAU17X1_SERIAL_OUTPUT_ROUTE, 0x01);
|
||||
}
|
||||
ret = adau17x1_add_routes(component);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -919,6 +993,10 @@ int adau1761_probe(struct device *dev, struct regmap *regmap,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = adau1761_compatibility_probe(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Enable cache only mode as we could miss writes before bias level
|
||||
* reaches standby and the core clock is enabled */
|
||||
regcache_cache_only(regmap, true);
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
|
||||
#include "adau1781.h"
|
||||
|
||||
static int adau1781_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static const struct i2c_device_id adau1781_i2c_ids[];
|
||||
|
||||
static int adau1781_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct regmap_config config;
|
||||
const struct i2c_device_id *id = i2c_match_id(adau1781_i2c_ids, client);
|
||||
|
||||
config = adau1781_regmap_config;
|
||||
config.val_bits = 8;
|
||||
|
@ -55,7 +57,7 @@ static struct i2c_driver adau1781_i2c_driver = {
|
|||
.name = "adau1781",
|
||||
.of_match_table = of_match_ptr(adau1781_i2c_dt_ids),
|
||||
},
|
||||
.probe = adau1781_i2c_probe,
|
||||
.probe_new = adau1781_i2c_probe,
|
||||
.remove = adau1781_i2c_remove,
|
||||
.id_table = adau1781_i2c_ids,
|
||||
};
|
||||
|
|
|
@ -334,6 +334,17 @@ static bool adau17x1_has_dsp(struct adau *adau)
|
|||
}
|
||||
}
|
||||
|
||||
/* Chip has a DSP but we're pretending it doesn't. */
|
||||
static bool adau17x1_has_disused_dsp(struct adau *adau)
|
||||
{
|
||||
switch (adau->type) {
|
||||
case ADAU1761_AS_1361:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static bool adau17x1_has_safeload(struct adau *adau)
|
||||
{
|
||||
switch (adau->type) {
|
||||
|
@ -516,10 +527,11 @@ static int adau17x1_hw_params(struct snd_pcm_substream *substream,
|
|||
|
||||
regmap_update_bits(adau->regmap, ADAU17X1_CONVERTER0,
|
||||
ADAU17X1_CONVERTER0_CONVSR_MASK, div);
|
||||
if (adau17x1_has_dsp(adau)) {
|
||||
|
||||
if (adau17x1_has_dsp(adau) || adau17x1_has_disused_dsp(adau))
|
||||
regmap_write(adau->regmap, ADAU17X1_SERIAL_SAMPLING_RATE, div);
|
||||
if (adau17x1_has_dsp(adau))
|
||||
regmap_write(adau->regmap, ADAU17X1_DSP_SAMPLING_RATE, dsp_div);
|
||||
}
|
||||
|
||||
if (adau->sigmadsp) {
|
||||
ret = adau17x1_setup_firmware(component, params_rate(params));
|
||||
|
@ -663,7 +675,7 @@ static int adau17x1_set_dai_tdm_slot(struct snd_soc_dai *dai,
|
|||
|
||||
switch (slot_width * slots) {
|
||||
case 32:
|
||||
if (adau->type == ADAU1761)
|
||||
if (adau->type == ADAU1761 || adau->type == ADAU1761_AS_1361)
|
||||
return -EINVAL;
|
||||
|
||||
ser_ctrl1 = ADAU17X1_SERIAL_PORT1_BCLK32;
|
||||
|
@ -738,7 +750,7 @@ static int adau17x1_set_dai_tdm_slot(struct snd_soc_dai *dai,
|
|||
regmap_update_bits(adau->regmap, ADAU17X1_SERIAL_PORT1,
|
||||
ADAU17X1_SERIAL_PORT1_BCLK_MASK, ser_ctrl1);
|
||||
|
||||
if (!adau17x1_has_dsp(adau))
|
||||
if (!adau17x1_has_dsp(adau) && !adau17x1_has_disused_dsp(adau))
|
||||
return 0;
|
||||
|
||||
if (adau->dsp_bypass[SNDRV_PCM_STREAM_PLAYBACK]) {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
enum adau17x1_type {
|
||||
ADAU1361,
|
||||
ADAU1761,
|
||||
ADAU1761_AS_1361,
|
||||
ADAU1381,
|
||||
ADAU1781,
|
||||
};
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
|
||||
#include "adau1977.h"
|
||||
|
||||
static int adau1977_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static const struct i2c_device_id adau1977_i2c_ids[];
|
||||
|
||||
static int adau1977_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct regmap_config config;
|
||||
const struct i2c_device_id *id = i2c_match_id(adau1977_i2c_ids, client);
|
||||
|
||||
config = adau1977_regmap_config;
|
||||
config.val_bits = 8;
|
||||
|
@ -40,7 +42,7 @@ static struct i2c_driver adau1977_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "adau1977",
|
||||
},
|
||||
.probe = adau1977_i2c_probe,
|
||||
.probe_new = adau1977_i2c_probe,
|
||||
.id_table = adau1977_i2c_ids,
|
||||
};
|
||||
module_i2c_driver(adau1977_i2c_driver);
|
||||
|
|
|
@ -48,8 +48,7 @@ static const struct regmap_config adau7118_regmap_config = {
|
|||
.volatile_reg = adau7118_volatile,
|
||||
};
|
||||
|
||||
static int adau7118_probe_i2c(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int adau7118_probe_i2c(struct i2c_client *i2c)
|
||||
{
|
||||
struct regmap *map;
|
||||
|
||||
|
@ -79,7 +78,7 @@ static struct i2c_driver adau7118_driver = {
|
|||
.name = "adau7118",
|
||||
.of_match_table = adau7118_of_match,
|
||||
},
|
||||
.probe = adau7118_probe_i2c,
|
||||
.probe_new = adau7118_probe_i2c,
|
||||
.id_table = adau7118_id,
|
||||
};
|
||||
module_i2c_driver(adau7118_driver);
|
||||
|
|
|
@ -19,8 +19,7 @@ static const struct i2c_device_id adav803_id[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(i2c, adav803_id);
|
||||
|
||||
static int adav803_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int adav803_probe(struct i2c_client *client)
|
||||
{
|
||||
return adav80x_bus_probe(&client->dev,
|
||||
devm_regmap_init_i2c(client, &adav80x_regmap_config));
|
||||
|
@ -30,7 +29,7 @@ static struct i2c_driver adav803_driver = {
|
|||
.driver = {
|
||||
.name = "adav803",
|
||||
},
|
||||
.probe = adav803_probe,
|
||||
.probe_new = adav803_probe,
|
||||
.id_table = adav803_id,
|
||||
};
|
||||
module_i2c_driver(adav803_driver);
|
||||
|
|
|
@ -356,8 +356,7 @@ static const struct regmap_config ak4118_regmap = {
|
|||
.max_register = AK4118_REG_MAX - 1,
|
||||
};
|
||||
|
||||
static int ak4118_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int ak4118_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct ak4118_priv *ak4118;
|
||||
int ret;
|
||||
|
@ -416,7 +415,7 @@ static struct i2c_driver ak4118_i2c_driver = {
|
|||
.of_match_table = of_match_ptr(ak4118_of_match),
|
||||
},
|
||||
.id_table = ak4118_id_table,
|
||||
.probe = ak4118_i2c_probe,
|
||||
.probe_new = ak4118_i2c_probe,
|
||||
};
|
||||
|
||||
module_i2c_driver(ak4118_i2c_driver);
|
||||
|
|
|
@ -405,8 +405,7 @@ static const struct snd_soc_component_driver soc_component_dev_ak4535 = {
|
|||
.non_legacy_dai_naming = 1,
|
||||
};
|
||||
|
||||
static int ak4535_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int ak4535_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct ak4535_priv *ak4535;
|
||||
int ret;
|
||||
|
@ -441,7 +440,7 @@ static struct i2c_driver ak4535_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "ak4535",
|
||||
},
|
||||
.probe = ak4535_i2c_probe,
|
||||
.probe_new = ak4535_i2c_probe,
|
||||
.id_table = ak4535_i2c_id,
|
||||
};
|
||||
|
||||
|
|
|
@ -10,11 +10,97 @@
|
|||
// Based on ak4535.c by Richard Purdie
|
||||
// Based on wm8753.c by Liam Girdwood
|
||||
|
||||
/*
|
||||
* +-------+
|
||||
* |AK4613 |
|
||||
* SDTO1 <-| |
|
||||
* | |
|
||||
* SDTI1 ->| |
|
||||
* SDTI2 ->| |
|
||||
* SDTI3 ->| |
|
||||
* +-------+
|
||||
*
|
||||
* +---+
|
||||
* clk | |___________________________________________...
|
||||
*
|
||||
* [TDM512]
|
||||
* SDTO1 [L1][R1][L2][R2]
|
||||
* SDTI1 [L1][R1][L2][R2][L3][R3][L4][R4][L5][R5][L6][R6]
|
||||
*
|
||||
* [TDM256]
|
||||
* SDTO1 [L1][R1][L2][R2]
|
||||
* SDTI1 [L1][R1][L2][R2][L3][R3][L4][R4]
|
||||
* SDTI2 [L5][R5][L6][R6]
|
||||
*
|
||||
* [TDM128]
|
||||
* SDTO1 [L1][R1][L2][R2]
|
||||
* SDTI1 [L1][R1][L2][R2]
|
||||
* SDTI2 [L3][R3][L4][R4]
|
||||
* SDTI3 [L5][R5][L6][R6]
|
||||
*
|
||||
* [STEREO]
|
||||
* Playback 2ch : SDTI1
|
||||
* Capture 2ch : SDTO1
|
||||
*
|
||||
* [TDM512]
|
||||
* Playback 12ch : SDTI1
|
||||
* Capture 4ch : SDTO1
|
||||
*
|
||||
* [TDM256]
|
||||
* Playback 12ch : SDTI1 + SDTI2
|
||||
* Playback 8ch : SDTI1
|
||||
* Capture 4ch : SDTO1
|
||||
*
|
||||
* [TDM128]
|
||||
* Playback 12ch : SDTI1 + SDTI2 + SDTI3
|
||||
* Playback 8ch : SDTI1 + SDTI2
|
||||
* Playback 4ch : SDTI1
|
||||
* Capture 4ch : SDTO1
|
||||
*
|
||||
*
|
||||
* !!! NOTE !!!
|
||||
*
|
||||
* Renesas is the only user of ak4613 on upstream so far,
|
||||
* but the chip connection is like below.
|
||||
* Thus, Renesas can't test all connection case.
|
||||
* Tested TDM is very limited.
|
||||
*
|
||||
* +-----+ +-----------+
|
||||
* | SoC | | AK4613 |
|
||||
* | |<-----|SDTO1 IN1|<-- Mic
|
||||
* | | | IN2|
|
||||
* | | | |
|
||||
* | |----->|SDTI1 OUT1|--> Headphone
|
||||
* +-----+ |SDTI2 OUT2|
|
||||
* |SDTI3 OUT3|
|
||||
* | OUT4|
|
||||
* | OUT5|
|
||||
* | OUT6|
|
||||
* +-----------+
|
||||
*
|
||||
* Renesas SoC can handle [2, 6,8] channels.
|
||||
* Ak4613 can handle [2,4, 8,12] channels.
|
||||
*
|
||||
* Because of above HW connection and available channels number,
|
||||
* Renesas could test are ...
|
||||
*
|
||||
* [STEREO] Playback 2ch : SDTI1
|
||||
* Capture 2ch : SDTO1
|
||||
* [TDM256] Playback 8ch : SDTI1 (*)
|
||||
*
|
||||
* (*) it used 8ch data between SoC <-> AK4613 on TDM256 mode,
|
||||
* but could confirm is only first 2ch because only 1
|
||||
* Headphone is connected.
|
||||
*
|
||||
* see
|
||||
* AK4613_ENABLE_TDM_TEST
|
||||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/of_graph.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <sound/soc.h>
|
||||
|
@ -78,29 +164,74 @@
|
|||
/* OCTRL */
|
||||
#define OCTRL_MASK (0x3F)
|
||||
|
||||
struct ak4613_formats {
|
||||
unsigned int width;
|
||||
unsigned int fmt;
|
||||
};
|
||||
/*
|
||||
* configs
|
||||
*
|
||||
* 0x000000BA
|
||||
*
|
||||
* B : AK4613_CONFIG_SDTI_x
|
||||
* A : AK4613_CONFIG_MODE_x
|
||||
*/
|
||||
#define AK4613_CONFIG_SET(priv, x) priv->configs |= AK4613_CONFIG_##x
|
||||
#define AK4613_CONFIG_GET(priv, x) (priv->configs & AK4613_CONFIG_##x##_MASK)
|
||||
|
||||
/*
|
||||
* AK4613_CONFIG_SDTI_x
|
||||
*
|
||||
* It indicates how many SDTIx is connected.
|
||||
*/
|
||||
#define AK4613_CONFIG_SDTI_MASK (0xF << 4)
|
||||
#define AK4613_CONFIG_SDTI(x) (((x) & 0xF) << 4)
|
||||
#define AK4613_CONFIG_SDTI_set(priv, x) AK4613_CONFIG_SET(priv, SDTI(x))
|
||||
#define AK4613_CONFIG_SDTI_get(priv) ((AK4613_CONFIG_GET(priv, SDTI) >> 4) & 0xF)
|
||||
|
||||
/*
|
||||
* AK4613_CONFIG_MODE_x
|
||||
*
|
||||
* Same as Ctrl1 :: TDM1/TDM0
|
||||
* No shift is requested
|
||||
* see
|
||||
* AK4613_CTRL1_TO_MODE()
|
||||
* Table 11/12/13/14
|
||||
*/
|
||||
#define AK4613_CONFIG_MODE_MASK (0xF)
|
||||
#define AK4613_CONFIG_MODE_STEREO (0x0)
|
||||
#define AK4613_CONFIG_MODE_TDM512 (0x1)
|
||||
#define AK4613_CONFIG_MODE_TDM256 (0x2)
|
||||
#define AK4613_CONFIG_MODE_TDM128 (0x3)
|
||||
|
||||
/*
|
||||
* !!!! FIXME !!!!
|
||||
*
|
||||
* Because of testable HW limitation, TDM256 8ch TDM was only tested.
|
||||
* This driver uses AK4613_ENABLE_TDM_TEST instead of new DT property so far.
|
||||
* Don't hesitate to update driver, you don't need to care compatible
|
||||
* with Renesas.
|
||||
*
|
||||
* #define AK4613_ENABLE_TDM_TEST
|
||||
*/
|
||||
|
||||
struct ak4613_interface {
|
||||
struct ak4613_formats capture;
|
||||
struct ak4613_formats playback;
|
||||
unsigned int width;
|
||||
unsigned int fmt;
|
||||
u8 dif;
|
||||
};
|
||||
|
||||
struct ak4613_priv {
|
||||
struct mutex lock;
|
||||
const struct ak4613_interface *iface;
|
||||
struct snd_pcm_hw_constraint_list constraint;
|
||||
struct snd_pcm_hw_constraint_list constraint_rates;
|
||||
struct snd_pcm_hw_constraint_list constraint_channels;
|
||||
struct work_struct dummy_write_work;
|
||||
struct snd_soc_component *component;
|
||||
unsigned int rate;
|
||||
unsigned int sysclk;
|
||||
|
||||
unsigned int fmt;
|
||||
unsigned int configs;
|
||||
int cnt;
|
||||
u8 ctrl1;
|
||||
u8 oc;
|
||||
u8 ic;
|
||||
int cnt;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -137,14 +268,24 @@ static const struct reg_default ak4613_reg[] = {
|
|||
{ 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 },
|
||||
};
|
||||
|
||||
#define AUDIO_IFACE_TO_VAL(fmts) ((fmts - ak4613_iface) << 3)
|
||||
#define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt }
|
||||
/*
|
||||
* CTRL1 register
|
||||
* see
|
||||
* Table 11/12/13/14
|
||||
*/
|
||||
#define AUDIO_IFACE(_dif, _width, _fmt) \
|
||||
{ \
|
||||
.dif = _dif, \
|
||||
.width = _width, \
|
||||
.fmt = SND_SOC_DAIFMT_##_fmt,\
|
||||
}
|
||||
static const struct ak4613_interface ak4613_iface[] = {
|
||||
/* capture */ /* playback */
|
||||
/* [0] - [2] are not supported */
|
||||
[3] = { AUDIO_IFACE(24, LEFT_J), AUDIO_IFACE(24, LEFT_J) },
|
||||
[4] = { AUDIO_IFACE(24, I2S), AUDIO_IFACE(24, I2S) },
|
||||
/* It doesn't support asymmetric format */
|
||||
|
||||
AUDIO_IFACE(0x03, 24, LEFT_J),
|
||||
AUDIO_IFACE(0x04, 24, I2S),
|
||||
};
|
||||
#define AK4613_CTRL1_TO_MODE(priv) ((priv)->ctrl1 >> 6) /* AK4613_CONFIG_MODE_x */
|
||||
|
||||
static const struct regmap_config ak4613_regmap_cfg = {
|
||||
.reg_bits = 8,
|
||||
|
@ -250,13 +391,14 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream,
|
|||
priv->cnt = 0;
|
||||
}
|
||||
if (!priv->cnt)
|
||||
priv->iface = NULL;
|
||||
priv->ctrl1 = 0;
|
||||
mutex_unlock(&priv->lock);
|
||||
}
|
||||
|
||||
static void ak4613_hw_constraints(struct ak4613_priv *priv,
|
||||
struct snd_pcm_runtime *runtime)
|
||||
struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
static const unsigned int ak4613_rates[] = {
|
||||
32000,
|
||||
44100,
|
||||
|
@ -267,10 +409,36 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv,
|
|||
176400,
|
||||
192000,
|
||||
};
|
||||
struct snd_pcm_hw_constraint_list *constraint = &priv->constraint;
|
||||
#define AK4613_CHANNEL_2 0
|
||||
#define AK4613_CHANNEL_4 1
|
||||
#define AK4613_CHANNEL_8 2
|
||||
#define AK4613_CHANNEL_12 3
|
||||
#define AK4613_CHANNEL_NONE -1
|
||||
static const unsigned int ak4613_channels[] = {
|
||||
[AK4613_CHANNEL_2] = 2,
|
||||
[AK4613_CHANNEL_4] = 4,
|
||||
[AK4613_CHANNEL_8] = 8,
|
||||
[AK4613_CHANNEL_12] = 12,
|
||||
};
|
||||
#define MODE_MAX 4
|
||||
#define SDTx_MAX 4
|
||||
#define MASK(x) (1 << AK4613_CHANNEL_##x)
|
||||
static const int mask_list[MODE_MAX][SDTx_MAX] = {
|
||||
/* SDTO SDTIx1 SDTIx2 SDTIx3 */
|
||||
[AK4613_CONFIG_MODE_STEREO] = { MASK(2), MASK(2), MASK(2), MASK(2)},
|
||||
[AK4613_CONFIG_MODE_TDM512] = { MASK(4), MASK(12), MASK(12), MASK(12)},
|
||||
[AK4613_CONFIG_MODE_TDM256] = { MASK(4), MASK(8), MASK(8)|MASK(12), MASK(8)|MASK(12)},
|
||||
[AK4613_CONFIG_MODE_TDM128] = { MASK(4), MASK(4), MASK(4)|MASK(8), MASK(4)|MASK(8)|MASK(12)},
|
||||
};
|
||||
struct snd_pcm_hw_constraint_list *constraint;
|
||||
unsigned int mask;
|
||||
unsigned int mode;
|
||||
unsigned int fs;
|
||||
int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
int sdti_num;
|
||||
int i;
|
||||
|
||||
constraint = &priv->constraint_rates;
|
||||
constraint->list = ak4613_rates;
|
||||
constraint->mask = 0;
|
||||
constraint->count = 0;
|
||||
|
@ -296,6 +464,41 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv,
|
|||
|
||||
snd_pcm_hw_constraint_list(runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_RATE, constraint);
|
||||
|
||||
|
||||
sdti_num = AK4613_CONFIG_SDTI_get(priv);
|
||||
if (WARN_ON(sdti_num >= SDTx_MAX))
|
||||
return;
|
||||
|
||||
if (priv->cnt) {
|
||||
/*
|
||||
* If it was already working,
|
||||
* the constraint is same as working mode.
|
||||
*/
|
||||
mode = AK4613_CTRL1_TO_MODE(priv);
|
||||
mask = 0; /* no default */
|
||||
} else {
|
||||
/*
|
||||
* It is not yet working,
|
||||
* the constraint is based on board configs.
|
||||
* STEREO mask is default
|
||||
*/
|
||||
mode = AK4613_CONFIG_GET(priv, MODE);
|
||||
mask = mask_list[AK4613_CONFIG_MODE_STEREO][is_play * sdti_num];
|
||||
}
|
||||
|
||||
if (WARN_ON(mode >= MODE_MAX))
|
||||
return;
|
||||
|
||||
/* add each mode mask */
|
||||
mask |= mask_list[mode][is_play * sdti_num];
|
||||
|
||||
constraint = &priv->constraint_channels;
|
||||
constraint->list = ak4613_channels;
|
||||
constraint->mask = mask;
|
||||
constraint->count = sizeof(ak4613_channels);
|
||||
snd_pcm_hw_constraint_list(runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_CHANNELS, constraint);
|
||||
}
|
||||
|
||||
static int ak4613_dai_startup(struct snd_pcm_substream *substream,
|
||||
|
@ -304,9 +507,10 @@ static int ak4613_dai_startup(struct snd_pcm_substream *substream,
|
|||
struct snd_soc_component *component = dai->component;
|
||||
struct ak4613_priv *priv = snd_soc_component_get_drvdata(component);
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
ak4613_hw_constraints(priv, substream);
|
||||
priv->cnt++;
|
||||
|
||||
ak4613_hw_constraints(priv, substream->runtime);
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -322,13 +526,13 @@ static int ak4613_dai_set_sysclk(struct snd_soc_dai *codec_dai,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int format)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct ak4613_priv *priv = snd_soc_component_get_drvdata(component);
|
||||
unsigned int fmt;
|
||||
|
||||
fmt &= SND_SOC_DAIFMT_FORMAT_MASK;
|
||||
|
||||
fmt = format & SND_SOC_DAIFMT_FORMAT_MASK;
|
||||
switch (fmt) {
|
||||
case SND_SOC_DAIFMT_LEFT_J:
|
||||
case SND_SOC_DAIFMT_I2S:
|
||||
|
@ -338,40 +542,34 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
fmt = format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK;
|
||||
switch (fmt) {
|
||||
case SND_SOC_DAIFMT_CBC_CFC:
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* SUPPORTME
|
||||
*
|
||||
* "clock provider" is not yet supperted
|
||||
*/
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool ak4613_dai_fmt_matching(const struct ak4613_interface *iface,
|
||||
int is_play,
|
||||
unsigned int fmt, unsigned int width)
|
||||
{
|
||||
const struct ak4613_formats *fmts;
|
||||
|
||||
fmts = (is_play) ? &iface->playback : &iface->capture;
|
||||
|
||||
if (fmts->fmt != fmt)
|
||||
return false;
|
||||
|
||||
if (fmts->width != width)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
|
||||
struct snd_pcm_hw_params *params,
|
||||
struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct ak4613_priv *priv = snd_soc_component_get_drvdata(component);
|
||||
const struct ak4613_interface *iface;
|
||||
struct device *dev = component->dev;
|
||||
unsigned int width = params_width(params);
|
||||
unsigned int fmt = priv->fmt;
|
||||
unsigned int rate;
|
||||
int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
int i, ret;
|
||||
u8 fmt_ctrl, ctrl2;
|
||||
u8 ctrl2;
|
||||
|
||||
rate = params_rate(params);
|
||||
switch (rate) {
|
||||
|
@ -397,40 +595,51 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
|
|||
/*
|
||||
* FIXME
|
||||
*
|
||||
* It doesn't support TDM at this point
|
||||
* It doesn't have full TDM suppert yet
|
||||
*/
|
||||
fmt_ctrl = NO_FMT;
|
||||
ret = -EINVAL;
|
||||
iface = NULL;
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
if (priv->iface) {
|
||||
if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width))
|
||||
iface = priv->iface;
|
||||
} else {
|
||||
for (i = ARRAY_SIZE(ak4613_iface) - 1; i >= 0; i--) {
|
||||
if (!ak4613_dai_fmt_matching(ak4613_iface + i,
|
||||
is_play,
|
||||
fmt, width))
|
||||
continue;
|
||||
iface = ak4613_iface + i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((priv->iface == NULL) ||
|
||||
(priv->iface == iface)) {
|
||||
priv->iface = iface;
|
||||
if (priv->cnt > 1) {
|
||||
/*
|
||||
* If it was already working, use current priv->ctrl1
|
||||
*/
|
||||
ret = 0;
|
||||
} else {
|
||||
/*
|
||||
* It is not yet working,
|
||||
*/
|
||||
unsigned int channel = params_channels(params);
|
||||
u8 tdm;
|
||||
|
||||
/* STEREO or TDM */
|
||||
if (channel == 2)
|
||||
tdm = AK4613_CONFIG_MODE_STEREO;
|
||||
else
|
||||
tdm = AK4613_CONFIG_GET(priv, MODE);
|
||||
|
||||
for (i = ARRAY_SIZE(ak4613_iface) - 1; i >= 0; i--) {
|
||||
const struct ak4613_interface *iface = ak4613_iface + i;
|
||||
|
||||
if ((iface->fmt == fmt) && (iface->width == width)) {
|
||||
/*
|
||||
* Ctrl1
|
||||
* | D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 |
|
||||
* |TDM1|TDM0|DIF2|DIF1|DIF0|ATS1|ATS0|SMUTE|
|
||||
* < tdm > < iface->dif >
|
||||
*/
|
||||
priv->ctrl1 = (tdm << 6) | (iface->dif << 3);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
if (ret < 0)
|
||||
goto hw_params_end;
|
||||
|
||||
fmt_ctrl = AUDIO_IFACE_TO_VAL(iface);
|
||||
|
||||
snd_soc_component_update_bits(component, CTRL1, FMT_MASK, fmt_ctrl);
|
||||
snd_soc_component_update_bits(component, CTRL1, FMT_MASK, priv->ctrl1);
|
||||
snd_soc_component_update_bits(component, CTRL2, DFS_MASK, ctrl2);
|
||||
|
||||
snd_soc_component_update_bits(component, ICTRL, ICTRL_MASK, priv->ic);
|
||||
|
@ -574,14 +783,14 @@ static struct snd_soc_dai_driver ak4613_dai = {
|
|||
.playback = {
|
||||
.stream_name = "Playback",
|
||||
.channels_min = 2,
|
||||
.channels_max = 2,
|
||||
.channels_max = 12,
|
||||
.rates = AK4613_PCM_RATE,
|
||||
.formats = AK4613_PCM_FMTBIT,
|
||||
},
|
||||
.capture = {
|
||||
.stream_name = "Capture",
|
||||
.channels_min = 2,
|
||||
.channels_max = 2,
|
||||
.channels_max = 4,
|
||||
.rates = AK4613_PCM_RATE,
|
||||
.formats = AK4613_PCM_FMTBIT,
|
||||
},
|
||||
|
@ -626,6 +835,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
|
|||
{
|
||||
struct device_node *np = dev->of_node;
|
||||
char prop[32];
|
||||
int sdti_num;
|
||||
int i;
|
||||
|
||||
/* Input 1 - 2 */
|
||||
|
@ -641,10 +851,32 @@ static void ak4613_parse_of(struct ak4613_priv *priv,
|
|||
if (!of_get_property(np, prop, NULL))
|
||||
priv->oc |= 1 << i;
|
||||
}
|
||||
|
||||
/*
|
||||
* enable TDM256 test
|
||||
*
|
||||
* !!! FIXME !!!
|
||||
*
|
||||
* It should be configured by DT or other way
|
||||
* if it was full supported.
|
||||
* But it is using ifdef style for now for test
|
||||
* purpose.
|
||||
*/
|
||||
#if defined(AK4613_ENABLE_TDM_TEST)
|
||||
AK4613_CONFIG_SET(priv, MODE_TDM256);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* connected STDI
|
||||
*/
|
||||
sdti_num = of_graph_get_endpoint_count(np);
|
||||
if (WARN_ON((sdti_num > 3) || (sdti_num < 1)))
|
||||
return;
|
||||
|
||||
AK4613_CONFIG_SDTI_set(priv, sdti_num);
|
||||
}
|
||||
|
||||
static int ak4613_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int ak4613_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct device *dev = &i2c->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
|
@ -655,8 +887,11 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
|
|||
regmap_cfg = NULL;
|
||||
if (np)
|
||||
regmap_cfg = of_device_get_match_data(dev);
|
||||
else
|
||||
else {
|
||||
const struct i2c_device_id *id =
|
||||
i2c_match_id(ak4613_i2c_id, i2c);
|
||||
regmap_cfg = (const struct regmap_config *)id->driver_data;
|
||||
}
|
||||
|
||||
if (!regmap_cfg)
|
||||
return -EINVAL;
|
||||
|
@ -667,7 +902,7 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
|
|||
|
||||
ak4613_parse_of(priv, dev);
|
||||
|
||||
priv->iface = NULL;
|
||||
priv->ctrl1 = 0;
|
||||
priv->cnt = 0;
|
||||
priv->sysclk = 0;
|
||||
INIT_WORK(&priv->dummy_write_work, ak4613_dummy_write);
|
||||
|
@ -694,7 +929,7 @@ static struct i2c_driver ak4613_i2c_driver = {
|
|||
.name = "ak4613-codec",
|
||||
.of_match_table = ak4613_of_match,
|
||||
},
|
||||
.probe = ak4613_i2c_probe,
|
||||
.probe_new = ak4613_i2c_probe,
|
||||
.remove = ak4613_i2c_remove,
|
||||
.id_table = ak4613_i2c_id,
|
||||
};
|
||||
|
|
|
@ -548,8 +548,7 @@ static const struct regmap_config ak4641_regmap = {
|
|||
.cache_type = REGCACHE_RBTREE,
|
||||
};
|
||||
|
||||
static int ak4641_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static int ak4641_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct ak4641_platform_data *pdata = i2c->dev.platform_data;
|
||||
struct ak4641_priv *ak4641;
|
||||
|
@ -632,7 +631,7 @@ static struct i2c_driver ak4641_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "ak4641",
|
||||
},
|
||||
.probe = ak4641_i2c_probe,
|
||||
.probe_new = ak4641_i2c_probe,
|
||||
.remove = ak4641_i2c_remove,
|
||||
.id_table = ak4641_i2c_id,
|
||||
};
|
||||
|
|
|
@ -630,8 +630,8 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev)
|
|||
#endif
|
||||
|
||||
static const struct of_device_id ak4642_of_match[];
|
||||
static int ak4642_i2c_probe(struct i2c_client *i2c,
|
||||
const struct i2c_device_id *id)
|
||||
static const struct i2c_device_id ak4642_i2c_id[];
|
||||
static int ak4642_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct device *dev = &i2c->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
|
@ -651,6 +651,8 @@ static int ak4642_i2c_probe(struct i2c_client *i2c,
|
|||
if (of_id)
|
||||
drvdata = of_id->data;
|
||||
} else {
|
||||
const struct i2c_device_id *id =
|
||||
i2c_match_id(ak4642_i2c_id, i2c);
|
||||
drvdata = (const struct ak4642_drvdata *)id->driver_data;
|
||||
}
|
||||
|
||||
|
@ -697,7 +699,7 @@ static struct i2c_driver ak4642_i2c_driver = {
|
|||
.name = "ak4642-codec",
|
||||
.of_match_table = ak4642_of_match,
|
||||
},
|
||||
.probe = ak4642_i2c_probe,
|
||||
.probe_new = ak4642_i2c_probe,
|
||||
.id_table = ak4642_i2c_id,
|
||||
};
|
||||
|
||||
|
|
|
@ -629,8 +629,7 @@ static const struct regmap_config ak4671_regmap = {
|
|||
.cache_type = REGCACHE_RBTREE,
|
||||
};
|
||||
|
||||
static int ak4671_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int ak4671_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct regmap *regmap;
|
||||
int ret;
|
||||
|
@ -657,7 +656,7 @@ static struct i2c_driver ak4671_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "ak4671-codec",
|
||||
},
|
||||
.probe = ak4671_i2c_probe,
|
||||
.probe_new = ak4671_i2c_probe,
|
||||
.id_table = ak4671_i2c_id,
|
||||
};
|
||||
|
||||
|
|
|
@ -968,14 +968,21 @@ static const struct regmap_config alc5623_regmap = {
|
|||
.cache_type = REGCACHE_RBTREE,
|
||||
};
|
||||
|
||||
static const struct i2c_device_id alc5623_i2c_table[] = {
|
||||
{"alc5621", 0x21},
|
||||
{"alc5622", 0x22},
|
||||
{"alc5623", 0x23},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
|
||||
|
||||
/*
|
||||
* ALC5623 2 wire address is determined by A1 pin
|
||||
* state during powerup.
|
||||
* low = 0x1a
|
||||
* high = 0x1b
|
||||
*/
|
||||
static int alc5623_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int alc5623_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct alc5623_platform_data *pdata;
|
||||
struct alc5623_priv *alc5623;
|
||||
|
@ -983,6 +990,7 @@ static int alc5623_i2c_probe(struct i2c_client *client,
|
|||
unsigned int vid1, vid2;
|
||||
int ret;
|
||||
u32 val32;
|
||||
const struct i2c_device_id *id;
|
||||
|
||||
alc5623 = devm_kzalloc(&client->dev, sizeof(struct alc5623_priv),
|
||||
GFP_KERNEL);
|
||||
|
@ -1009,6 +1017,8 @@ static int alc5623_i2c_probe(struct i2c_client *client,
|
|||
}
|
||||
vid2 >>= 8;
|
||||
|
||||
id = i2c_match_id(alc5623_i2c_table, client);
|
||||
|
||||
if ((vid1 != 0x10ec) || (vid2 != id->driver_data)) {
|
||||
dev_err(&client->dev, "unknown or wrong codec\n");
|
||||
dev_err(&client->dev, "Expected %x:%lx, got %x:%x\n",
|
||||
|
@ -1060,14 +1070,6 @@ static int alc5623_i2c_probe(struct i2c_client *client,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id alc5623_i2c_table[] = {
|
||||
{"alc5621", 0x21},
|
||||
{"alc5622", 0x22},
|
||||
{"alc5623", 0x23},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, alc5623_i2c_table);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id alc5623_of_match[] = {
|
||||
{ .compatible = "realtek,alc5623", },
|
||||
|
@ -1082,7 +1084,7 @@ static struct i2c_driver alc5623_i2c_driver = {
|
|||
.name = "alc562x-codec",
|
||||
.of_match_table = of_match_ptr(alc5623_of_match),
|
||||
},
|
||||
.probe = alc5623_i2c_probe,
|
||||
.probe_new = alc5623_i2c_probe,
|
||||
.id_table = alc5623_i2c_table,
|
||||
};
|
||||
|
||||
|
|
|
@ -1092,18 +1092,24 @@ static const struct regmap_config alc5632_regmap = {
|
|||
.cache_type = REGCACHE_RBTREE,
|
||||
};
|
||||
|
||||
static const struct i2c_device_id alc5632_i2c_table[] = {
|
||||
{"alc5632", 0x5c},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
|
||||
|
||||
/*
|
||||
* alc5632 2 wire address is determined by A1 pin
|
||||
* state during powerup.
|
||||
* low = 0x1a
|
||||
* high = 0x1b
|
||||
*/
|
||||
static int alc5632_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int alc5632_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct alc5632_priv *alc5632;
|
||||
int ret, ret1, ret2;
|
||||
unsigned int vid1, vid2;
|
||||
const struct i2c_device_id *id;
|
||||
|
||||
alc5632 = devm_kzalloc(&client->dev,
|
||||
sizeof(struct alc5632_priv), GFP_KERNEL);
|
||||
|
@ -1129,6 +1135,8 @@ static int alc5632_i2c_probe(struct i2c_client *client,
|
|||
|
||||
vid2 >>= 8;
|
||||
|
||||
id = i2c_match_id(alc5632_i2c_table, client);
|
||||
|
||||
if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) {
|
||||
dev_err(&client->dev,
|
||||
"Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2);
|
||||
|
@ -1161,12 +1169,6 @@ static int alc5632_i2c_probe(struct i2c_client *client,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static const struct i2c_device_id alc5632_i2c_table[] = {
|
||||
{"alc5632", 0x5c},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id alc5632_of_match[] = {
|
||||
{ .compatible = "realtek,alc5632", },
|
||||
|
@ -1181,7 +1183,7 @@ static struct i2c_driver alc5632_i2c_driver = {
|
|||
.name = "alc5632",
|
||||
.of_match_table = of_match_ptr(alc5632_of_match),
|
||||
},
|
||||
.probe = alc5632_i2c_probe,
|
||||
.probe_new = alc5632_i2c_probe,
|
||||
.id_table = alc5632_i2c_table,
|
||||
};
|
||||
|
||||
|
|
|
@ -232,11 +232,11 @@ static int i2s_rx_hw_params(struct snd_pcm_substream *substream,
|
|||
if (params_rate(params) != 48000)
|
||||
return -EINVAL;
|
||||
|
||||
switch (params_format(params)) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
switch (params_width(params)) {
|
||||
case 16:
|
||||
depth = EC_CODEC_I2S_RX_SAMPLE_DEPTH_16;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case 24:
|
||||
depth = EC_CODEC_I2S_RX_SAMPLE_DEPTH_24;
|
||||
break;
|
||||
default:
|
||||
|
@ -387,6 +387,7 @@ static const struct snd_soc_component_driver i2s_rx_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(i2s_rx_dapm_widgets),
|
||||
.dapm_routes = i2s_rx_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(i2s_rx_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static void *wov_map_shm(struct cros_ec_codec_priv *priv,
|
||||
|
|
|
@ -346,8 +346,7 @@ static int cs35l32_handle_of_data(struct i2c_client *i2c_client,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l32_i2c_probe(struct i2c_client *i2c_client)
|
||||
{
|
||||
struct cs35l32_private *cs35l32;
|
||||
struct cs35l32_platform_data *pdata =
|
||||
|
@ -576,7 +575,7 @@ static struct i2c_driver cs35l32_i2c_driver = {
|
|||
.of_match_table = cs35l32_of_match,
|
||||
},
|
||||
.id_table = cs35l32_id,
|
||||
.probe = cs35l32_i2c_probe,
|
||||
.probe_new = cs35l32_i2c_probe,
|
||||
.remove = cs35l32_i2c_remove,
|
||||
};
|
||||
|
||||
|
|
|
@ -1116,8 +1116,7 @@ static int cs35l33_of_get_pdata(struct device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cs35l33_i2c_probe(struct i2c_client *i2c_client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l33_i2c_probe(struct i2c_client *i2c_client)
|
||||
{
|
||||
struct cs35l33_private *cs35l33;
|
||||
struct cs35l33_pdata *pdata = dev_get_platdata(&i2c_client->dev);
|
||||
|
@ -1286,7 +1285,7 @@ static struct i2c_driver cs35l33_i2c_driver = {
|
|||
|
||||
},
|
||||
.id_table = cs35l33_id,
|
||||
.probe = cs35l33_i2c_probe,
|
||||
.probe_new = cs35l33_i2c_probe,
|
||||
.remove = cs35l33_i2c_remove,
|
||||
|
||||
};
|
||||
|
|
|
@ -994,8 +994,7 @@ static const char * const cs35l34_core_supplies[] = {
|
|||
"VP",
|
||||
};
|
||||
|
||||
static int cs35l34_i2c_probe(struct i2c_client *i2c_client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l34_i2c_probe(struct i2c_client *i2c_client)
|
||||
{
|
||||
struct cs35l34_private *cs35l34;
|
||||
struct cs35l34_platform_data *pdata =
|
||||
|
@ -1217,7 +1216,7 @@ static struct i2c_driver cs35l34_i2c_driver = {
|
|||
|
||||
},
|
||||
.id_table = cs35l34_id,
|
||||
.probe = cs35l34_i2c_probe,
|
||||
.probe_new = cs35l34_i2c_probe,
|
||||
.remove = cs35l34_i2c_remove,
|
||||
|
||||
};
|
||||
|
|
|
@ -1466,8 +1466,7 @@ static const struct reg_sequence cs35l35_errata_patch[] = {
|
|||
{ 0x7F, 0x00 },
|
||||
};
|
||||
|
||||
static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l35_i2c_probe(struct i2c_client *i2c_client)
|
||||
{
|
||||
struct cs35l35_private *cs35l35;
|
||||
struct device *dev = &i2c_client->dev;
|
||||
|
@ -1658,7 +1657,7 @@ static struct i2c_driver cs35l35_i2c_driver = {
|
|||
.of_match_table = cs35l35_of_match,
|
||||
},
|
||||
.id_table = cs35l35_id,
|
||||
.probe = cs35l35_i2c_probe,
|
||||
.probe_new = cs35l35_i2c_probe,
|
||||
.remove = cs35l35_i2c_remove,
|
||||
};
|
||||
|
||||
|
|
|
@ -1700,8 +1700,7 @@ static const struct reg_sequence cs35l36_revb0_errata_patch[] = {
|
|||
{ CS35L36_TESTKEY_CTRL, CS35L36_TEST_LOCK2 },
|
||||
};
|
||||
|
||||
static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l36_i2c_probe(struct i2c_client *i2c_client)
|
||||
{
|
||||
struct cs35l36_private *cs35l36;
|
||||
struct device *dev = &i2c_client->dev;
|
||||
|
@ -1804,7 +1803,7 @@ static int cs35l36_i2c_probe(struct i2c_client *i2c_client,
|
|||
if (ret < 0) {
|
||||
dev_err(&i2c_client->dev, "Failed to read otp_id Register %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((l37_id_reg & CS35L36_OTP_REV_MASK) == CS35L36_OTP_REV_L37)
|
||||
|
@ -1947,7 +1946,7 @@ static struct i2c_driver cs35l36_i2c_driver = {
|
|||
.of_match_table = cs35l36_of_match,
|
||||
},
|
||||
.id_table = cs35l36_id,
|
||||
.probe = cs35l36_i2c_probe,
|
||||
.probe_new = cs35l36_i2c_probe,
|
||||
.remove = cs35l36_i2c_remove,
|
||||
};
|
||||
module_i2c_driver(cs35l36_i2c_driver);
|
||||
|
|
|
@ -29,8 +29,7 @@ static const struct i2c_device_id cs35l41_id_i2c[] = {
|
|||
|
||||
MODULE_DEVICE_TABLE(i2c, cs35l41_id_i2c);
|
||||
|
||||
static int cs35l41_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int cs35l41_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct cs35l41_private *cs35l41;
|
||||
struct device *dev = &client->dev;
|
||||
|
@ -91,7 +90,7 @@ static struct i2c_driver cs35l41_i2c_driver = {
|
|||
.acpi_match_table = ACPI_PTR(cs35l41_acpi_match),
|
||||
},
|
||||
.id_table = cs35l41_id_i2c,
|
||||
.probe = cs35l41_i2c_probe,
|
||||
.probe_new = cs35l41_i2c_probe,
|
||||
.remove = cs35l41_i2c_remove,
|
||||
};
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue