Commit a7a850db authored by Mark Brown's avatar Mark Brown

Merge branch 'asoc-4.21' into asoc-next

parents c5fd9e77 0f4967bc
...@@ -12,8 +12,8 @@ Required properties: ...@@ -12,8 +12,8 @@ Required properties:
Optional properties: Optional properties:
- reset-gpio : a GPIO spec for the reset pin. If specified, it will be - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
deasserted before communication to the device starts. deasserted before communication to the device starts.
Example: Example:
......
AK4118 S/PDIF transceiver
This device supports I2C mode.
Required properties:
- compatible : "asahi-kasei,ak4118"
- reg : The I2C address of the device for I2C
- reset-gpios: A GPIO specifier for the reset pin
- irq-gpios: A GPIO specifier for the IRQ pin
Example:
&i2c {
ak4118: ak4118@13 {
#sound-dai-cells = <0>;
compatible = "asahi-kasei,ak4118";
reg = <0x13>;
reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>
irq-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
};
* Amlogic Audio SPDIF Input
Required properties:
- compatible: 'amlogic,axg-spdifin'
- interrupts: interrupt specifier for the spdif input.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
* "pclk" : peripheral clock.
* "refclk" : spdif input reference clock
- #sound-dai-cells: must be 0.
Example on the A113 SoC:
spdifin: audio-controller@400 {
compatible = "amlogic,axg-spdifin";
reg = <0x0 0x400 0x0 0x30>;
#sound-dai-cells = <0>;
interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
clock-names = "pclk", "refclk";
};
...@@ -32,7 +32,9 @@ Required properties: ...@@ -32,7 +32,9 @@ Required properties:
Optional properties: Optional properties:
- pa-gpios: GPIO used to control external amplifier. - pa-gpios: GPIO used to control external amplifier.
-----------------------
Example: Single DAI case Example: Single DAI case
-----------------------
sound_card { sound_card {
compatible = "audio-graph-card"; compatible = "audio-graph-card";
...@@ -61,7 +63,9 @@ Example: Single DAI case ...@@ -61,7 +63,9 @@ Example: Single DAI case
}; };
}; };
-----------------------
Example: Multi DAI case Example: Multi DAI case
-----------------------
sound-card { sound-card {
compatible = "audio-graph-card"; compatible = "audio-graph-card";
...@@ -130,3 +134,204 @@ Example: Multi DAI case ...@@ -130,3 +134,204 @@ Example: Multi DAI case
}; };
}; };
-----------------------
Example: Sampling Rate Conversion
-----------------------
sound_card {
compatible = "audio-graph-card";
label = "sound-card";
prefix = "codec";
routing = "codec Playback", "DAI0 Playback",
"DAI0 Capture", "codec Capture";
convert-rate = <48000>;
dais = <&cpu_port>;
};
audio-codec {
...
port {
codec_endpoint: endpoint {
remote-endpoint = <&cpu_endpoint>;
};
};
};
dai-controller {
...
cpu_port: port {
cpu_endpoint: endpoint {
remote-endpoint = <&codec_endpoint>;
dai-format = "left_j";
...
};
};
};
-----------------------
Example: 2 CPU 1 Codec (Mixing)
-----------------------
sound_card {
compatible = "audio-graph-card";
label = "sound-card";
routing = "codec Playback", "DAI0 Playback",
"codec Playback", "DAI1 Playback",
"DAI0 Capture", "codec Capture";
dais = <&cpu_port>;
};
audio-codec {
...
audio-graph-card,prefix = "codec";
audio-graph-card,convert-rate = <48000>;
port {
reg = <0>;
codec_endpoint0: endpoint@0 {
remote-endpoint = <&cpu_endpoint0>;
};
codec_endpoint1: endpoint@1 {
remote-endpoint = <&cpu_endpoint1>;
};
};
};
dai-controller {
...
cpu_port: port {
cpu_endpoint0: endpoint@0 {
remote-endpoint = <&codec_endpoint0>;
dai-format = "left_j";
...
};
cpu_endpoint1: endpoint@1 {
remote-endpoint = <&codec_endpoint1>;
dai-format = "left_j";
...
};
};
};
-----------------------
Example: Multi DAI with DPCM
-----------------------
CPU0 ------ ak4613
CPU1 ------ HDMI
CPU2 ------ PCM3168A-p /* DPCM 1ch/2ch */
CPU3 --/ /* DPCM 3ch/4ch */
CPU4 --/ /* DPCM 5ch/6ch */
CPU5 --/ /* DPCM 7ch/8ch */
CPU6 ------ PCM3168A-c
sound_card: sound {
compatible = "audio-graph-card";
label = "sound-card";
routing = "pcm3168a Playback", "DAI2 Playback",
"pcm3168a Playback", "DAI3 Playback",
"pcm3168a Playback", "DAI4 Playback",
"pcm3168a Playback", "DAI5 Playback";
dais = <&snd_port0 /* ak4613 */
&snd_port1 /* HDMI0 */
&snd_port2 /* pcm3168a playback */
&snd_port3 /* pcm3168a capture */
>;
};
ak4613: codec@10 {
...
port {
ak4613_endpoint: endpoint {
remote-endpoint = <&rsnd_endpoint0>;
};
};
};
pcm3168a: audio-codec@44 {
...
audio-graph-card,prefix = "pcm3168a";
audio-graph-card,convert-channels = <8>; /* TDM Split */
ports {
port@0 {
reg = <0>;
pcm3168a_endpoint_p1: endpoint@1 {
remote-endpoint = <&rsnd_endpoint2>;
...
};
pcm3168a_endpoint_p2: endpoint@2 {
remote-endpoint = <&rsnd_endpoint3>;
...
};
pcm3168a_endpoint_p3: endpoint@3 {
remote-endpoint = <&rsnd_endpoint4>;
...
};
pcm3168a_endpoint_p4: endpoint@4 {
remote-endpoint = <&rsnd_endpoint5>;
...
};
};
port@1 {
reg = <1>;
pcm3168a_endpoint_c: endpoint {
remote-endpoint = <&rsnd_endpoint6>;
...
};
};
};
};
&sound {
ports {
snd_port0: port@0 {
rsnd_endpoint0: endpoint {
remote-endpoint = <&ak4613_endpoint>;
...
};
};
snd_port1: port@1 {
rsnd_endpoint1: endpoint {
remote-endpoint = <&dw_hdmi0_snd_in>;
...
};
};
snd_port2: port@2 {
#address-cells = <1>;
#size-cells = <0>;
rsnd_endpoint2: endpoint@2 {
remote-endpoint = <&pcm3168a_endpoint_p1>;
...
};
rsnd_endpoint3: endpoint@3 {
remote-endpoint = <&pcm3168a_endpoint_p2>;
...
};
rsnd_endpoint4: endpoint@4 {
remote-endpoint = <&pcm3168a_endpoint_p3>;
...
};
rsnd_endpoint5: endpoint@5 {
remote-endpoint = <&pcm3168a_endpoint_p4>;
...
};
};
snd_port3: port@6 {
rsnd_endpoint6: endpoint {
remote-endpoint = <&pcm3168a_endpoint_c>;
...
};
};
};
};
...@@ -77,11 +77,9 @@ Example 2. 2 CPU 1 Codec (Mixing) ...@@ -77,11 +77,9 @@ Example 2. 2 CPU 1 Codec (Mixing)
compatible = "audio-graph-scu-card"; compatible = "audio-graph-scu-card";
label = "sound-card"; label = "sound-card";
prefix = "codec";
routing = "codec Playback", "DAI0 Playback", routing = "codec Playback", "DAI0 Playback",
"codec Playback", "DAI1 Playback", "codec Playback", "DAI1 Playback",
"DAI0 Capture", "codec Capture"; "DAI0 Capture", "codec Capture";
convert-rate = <48000>;
dais = <&cpu_port0 dais = <&cpu_port0
&cpu_port1>; &cpu_port1>;
...@@ -90,6 +88,8 @@ Example 2. 2 CPU 1 Codec (Mixing) ...@@ -90,6 +88,8 @@ Example 2. 2 CPU 1 Codec (Mixing)
audio-codec { audio-codec {
... ...
audio-graph-card,prefix = "codec";
audio-graph-card,convert-rate = <48000>;
port { port {
codec_endpoint0: endpoint { codec_endpoint0: endpoint {
remote-endpoint = <&cpu_endpoint0>; remote-endpoint = <&cpu_endpoint0>;
......
...@@ -10,8 +10,8 @@ Required properties: ...@@ -10,8 +10,8 @@ Required properties:
Optional properties: Optional properties:
- reset-gpio : a GPIO spec for the reset pin. If specified, it will be - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
deasserted before communication to the codec starts. deasserted before communication to the codec starts.
Example: Example:
......
...@@ -30,6 +30,11 @@ Optional properties: ...@@ -30,6 +30,11 @@ Optional properties:
- ti,hwmods : Must be "mcasp<n>", n is controller instance starting 0 - ti,hwmods : Must be "mcasp<n>", n is controller instance starting 0
- tx-num-evt : FIFO levels. - tx-num-evt : FIFO levels.
- rx-num-evt : FIFO levels. - rx-num-evt : FIFO levels.
- dismod : Specify the drive on TX pin during inactive slots
0 : 3-state
2 : logic low
3 : logic high
Defaults to 'logic low' when the property is not present
- sram-size-playback : size of sram to be allocated during playback - sram-size-playback : size of sram to be allocated during playback
- sram-size-capture : size of sram to be allocated during capture - sram-size-capture : size of sram to be allocated during capture
- interrupts : Interrupt numbers for McASP - interrupts : Interrupt numbers for McASP
......
...@@ -9,6 +9,7 @@ Optional properties: ...@@ -9,6 +9,7 @@ Optional properties:
- dmicen-gpios: GPIO specifier for dmic to control start and stop - dmicen-gpios: GPIO specifier for dmic to control start and stop
- num-channels: Number of microphones on this DAI - num-channels: Number of microphones on this DAI
- wakeup-delay-ms: Delay (in ms) after enabling the DMIC - wakeup-delay-ms: Delay (in ms) after enabling the DMIC
- modeswitch-delay-ms: Delay (in ms) to complete DMIC mode switch
Example node: Example node:
...@@ -17,4 +18,5 @@ Example node: ...@@ -17,4 +18,5 @@ Example node:
dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>; dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>;
num-channels = <1>; num-channels = <1>;
wakeup-delay-ms <50>; wakeup-delay-ms <50>;
modeswitch-delay-ms <35>;
}; };
...@@ -35,13 +35,13 @@ Required properties: ...@@ -35,13 +35,13 @@ Required properties:
- fsl,sai-synchronous-rx: This is a boolean property. If present, indicating - fsl,sai-synchronous-rx: This is a boolean property. If present, indicating
that SAI will work in the synchronous mode (sync Tx that SAI will work in the synchronous mode (sync Tx
with Rx) which means both the transimitter and the with Rx) which means both the transmitter and the
receiver will send and receive data by following receiver will send and receive data by following
receiver's bit clocks and frame sync clocks. receiver's bit clocks and frame sync clocks.
- fsl,sai-asynchronous: This is a boolean property. If present, indicating - fsl,sai-asynchronous: This is a boolean property. If present, indicating
that SAI will work in the asynchronous mode, which that SAI will work in the asynchronous mode, which
means both transimitter and receiver will send and means both transmitter and receiver will send and
receive data by following their own bit clocks and receive data by following their own bit clocks and
frame sync clocks separately. frame sync clocks separately.
...@@ -58,8 +58,8 @@ Optional properties (for mx6ul): ...@@ -58,8 +58,8 @@ Optional properties (for mx6ul):
Note: Note:
- If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the - If both fsl,sai-asynchronous and fsl,sai-synchronous-rx are absent, the
default synchronous mode (sync Rx with Tx) will be used, which means both default synchronous mode (sync Rx with Tx) will be used, which means both
transimitter and receiver will send and receive data by following clocks transmitter and receiver will send and receive data by following clocks
of transimitter. of transmitter.
- fsl,sai-asynchronous and fsl,sai-synchronous-rx are exclusive. - fsl,sai-asynchronous and fsl,sai-synchronous-rx are exclusive.
Example: Example:
......
...@@ -7,6 +7,8 @@ Required properties: ...@@ -7,6 +7,8 @@ Required properties:
<L3 interconnect address, size>; <L3 interconnect address, size>;
- interrupts: Interrupt number for McPDM - interrupts: Interrupt number for McPDM
- ti,hwmods: Name of the hwmod associated to the McPDM - ti,hwmods: Name of the hwmod associated to the McPDM
- clocks: phandle for the pdmclk provider, likely <&twl6040>
- clock-names: Must be "pdmclk"
Example: Example:
...@@ -18,3 +20,11 @@ mcpdm: mcpdm@40132000 { ...@@ -18,3 +20,11 @@ mcpdm: mcpdm@40132000 {
interrupt-parent = <&gic>; interrupt-parent = <&gic>;
ti,hwmods = "mcpdm"; ti,hwmods = "mcpdm";
}; };
In board DTS file the pdmclk needs to be added:
&mcpdm {
clocks = <&twl6040>;
clock-names = "pdmclk";
status = "okay";
};
...@@ -9,9 +9,15 @@ Required properties: ...@@ -9,9 +9,15 @@ Required properties:
- reg : the I2C address of the device for I2C, the chip select - reg : the I2C address of the device for I2C, the chip select
number for SPI. number for SPI.
Optional properties:
- ti,out-single-ended: "true" if output is single-ended;
"false" or not specified if output is differential.
Examples: Examples:
pcm3060: pcm3060@46 { pcm3060: pcm3060@46 {
compatible = "ti,pcm3060"; compatible = "ti,pcm3060";
reg = <0x46>; reg = <0x46>;
ti,out-single-ended = "true";
}; };
...@@ -27,6 +27,28 @@ used by the apr service device. ...@@ -27,6 +27,28 @@ used by the apr service device.
Value type: <u32> Value type: <u32>
Definition: Must be 1 Definition: Must be 1
== ASM DAI is subnode of "dais" and represent a dai, it includes board specific
configuration of each dai. Must contain the following properties.
- reg
Usage: required
Value type: <u32>
Definition: Must be dai id
- direction:
Usage: Required for Compress offload dais
Value type: <u32>
Definition: Specifies the direction of the dai stream
0 for both tx and rx
1 for only tx (Capture/Encode)
2 for only rx (Playback/Decode)
- is-compress-dai:
Usage: Required for Compress offload dais
Value type: <boolean>
Definition: present for Compress offload dais
= EXAMPLE = EXAMPLE
q6asm@7 { q6asm@7 {
...@@ -35,5 +57,10 @@ q6asm@7 { ...@@ -35,5 +57,10 @@ q6asm@7 {
q6asmdai: dais { q6asmdai: dais {
compatible = "qcom,q6asm-dais"; compatible = "qcom,q6asm-dais";
#sound-dai-cells = <1>; #sound-dai-cells = <1>;
mm@0 {
reg = <0>;
direction = <2>;
is-compress-dai;
};
}; };
}; };
...@@ -35,14 +35,14 @@ Pins on the device (for linking into audio routes): ...@@ -35,14 +35,14 @@ Pins on the device (for linking into audio routes):
Example: Example:
alc5631: alc5631@1a { alc5631: audio-codec@1a {
compatible = "realtek,alc5631"; compatible = "realtek,alc5631";
reg = <0x1a>; reg = <0x1a>;
}; };
or or
rt5631: rt5631@1a { rt5631: audio-codec@1a {
compatible = "realtek,rt5631"; compatible = "realtek,rt5631";
reg = <0x1a>; reg = <0x1a>;
}; };
...@@ -10,6 +10,10 @@ Required properties: ...@@ -10,6 +10,10 @@ Required properties:
- interrupts : The CODEC's interrupt output. - interrupts : The CODEC's interrupt output.
- avdd-supply: Power supply for AVDD, providing 1.8V.
- cpvdd-supply: Power supply for CPVDD, providing 3.5V.
Optional properties: Optional properties:
- "realtek,dc_offset_l_manual" - "realtek,dc_offset_l_manual"
...@@ -51,4 +55,6 @@ rt5663: codec@12 { ...@@ -51,4 +55,6 @@ rt5663: codec@12 {
compatible = "realtek,rt5663"; compatible = "realtek,rt5663";
reg = <0x12>; reg = <0x12>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>; interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
avdd-supply = <&pp1800_a_alc5662>;
cpvdd-supply = <&pp3500_a_alc5662>;
}; };
...@@ -4,9 +4,14 @@ Required properties: ...@@ -4,9 +4,14 @@ Required properties:
- compatible : "dioo,dio2125" or "simple-audio-amplifier" - compatible : "dioo,dio2125" or "simple-audio-amplifier"
- enable-gpios : the gpio connected to the enable pin of the simple amplifier - enable-gpios : the gpio connected to the enable pin of the simple amplifier
Optional properties:
- VCC-supply : power supply for the device, as covered
in Documentation/devicetree/bindings/regulator/regulator.txt
Example: Example:
amp: analog-amplifier { amp: analog-amplifier {
compatible = "simple-audio-amplifier"; compatible = "simple-audio-amplifier";
VCC-supply = <&regulator>;
enable-gpios = <&gpio GPIOH_3 0>; enable-gpios = <&gpio GPIOH_3 0>;
}; };
...@@ -95,7 +95,9 @@ Optional CPU/CODEC subnodes properties: ...@@ -95,7 +95,9 @@ Optional CPU/CODEC subnodes properties:
initialization. It is useful for some aCPUs with initialization. It is useful for some aCPUs with
fixed clocks. fixed clocks.
-------------------------------------------
Example 1 - single DAI link: Example 1 - single DAI link:
-------------------------------------------
sound { sound {
compatible = "simple-audio-card"; compatible = "simple-audio-card";
...@@ -138,7 +140,9 @@ sh_fsi2: sh_fsi2@ec230000 { ...@@ -138,7 +140,9 @@ sh_fsi2: sh_fsi2@ec230000 {
interrupts = <0 146 0x4>; interrupts = <0 146 0x4>;
}; };
-------------------------------------------
Example 2 - many DAI links: Example 2 - many DAI links:
-------------------------------------------
sound { sound {
compatible = "simple-audio-card"; compatible = "simple-audio-card";
...@@ -176,8 +180,10 @@ sound { ...@@ -176,8 +180,10 @@ sound {
}; };
}; };
-------------------------------------------
Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec Example 3 - route audio from IMX6 SSI2 through TLV320DAC3100 codec
through TPA6130A2 amplifier to headphones: through TPA6130A2 amplifier to headphones:
-------------------------------------------
&i2c0 { &i2c0 {
codec: tlv320dac3100@18 { codec: tlv320dac3100@18 {
...@@ -210,3 +216,134 @@ sound { ...@@ -210,3 +216,134 @@ sound {
clocks = ... clocks = ...
}; };
}; };
-------------------------------------------
Example 4. Sampling Rate Conversion
-------------------------------------------
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "rsnd-ak4643";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
simple-audio-card,convert-rate = <48000>;
simple-audio-card,prefix = "ak4642";
simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
"DAI0 Capture", "ak4642 Capture";
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&ak4643>;
system-clock-frequency = <11289600>;
};
};
-------------------------------------------
Example 5. 2 CPU 1 Codec (Mixing)
-------------------------------------------
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "rsnd-ak4643";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&dpcmcpu>;
simple-audio-card,frame-master = <&dpcmcpu>;
simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
"ak4642 Playback", "DAI1 Playback";
dpcmcpu: cpu@0 {
sound-dai = <&rcar_sound 0>;
};
cpu@1 {
sound-dai = <&rcar_sound 1>;
};
codec {
prefix = "ak4642";
sound-dai = <&ak4643>;
clocks = <&audio_clock>;
};
};
-------------------------------------------
Example 6 - many DAI links with DPCM:
-------------------------------------------
CPU0 ------ ak4613
CPU1 ------ PCM3168A-p /* DPCM 1ch/2ch */
CPU2 --/ /* DPCM 3ch/4ch */
CPU3 --/ /* DPCM 5ch/6ch */
CPU4 --/ /* DPCM 7ch/8ch */
CPU5 ------ PCM3168A-c
sound {
compatible = "simple-audio-card";
simple-audio-card,routing =
"pcm3168a Playback", "DAI1 Playback",
"pcm3168a Playback", "DAI2 Playback",
"pcm3168a Playback", "DAI3 Playback",
"pcm3168a Playback", "DAI4 Playback";
simple-audio-card,dai-link@0 {
format = "left_j";
bitclock-master = <&sndcpu0>;
frame-master = <&sndcpu0>;
sndcpu0: cpu {
sound-dai = <&rcar_sound 0>;
};
codec {
sound-dai = <&ak4613>;
};
};
simple-audio-card,dai-link@1 {
format = "i2s";
bitclock-master = <&sndcpu1>;
frame-master = <&sndcpu1>;
convert-channels = <8>; /* TDM Split */
sndcpu1: cpu@0 {
sound-dai = <&rcar_sound 1>;
};
cpu@1 {
sound-dai = <&rcar_sound 2>;
};
cpu@2 {
sound-dai = <&rcar_sound 3>;
};
cpu@3 {
sound-dai = <&rcar_sound 4>;
};
codec {
mclk-fs = <512>;
prefix = "pcm3168a";
dai-tdm-slot-num = <8>;
sound-dai = <&pcm3168a 0>;
};
};
simple-audio-card,dai-link@2 {
format = "i2s";
bitclock-master = <&sndcpu2>;
frame-master = <&sndcpu2>;
sndcpu2: cpu {
sound-dai = <&rcar_sound 5>;
};
codec {
mclk-fs = <512>;
prefix = "pcm3168a";
sound-dai = <&pcm3168a 1>;
};
};
};
...@@ -75,7 +75,6 @@ sound { ...@@ -75,7 +75,6 @@ sound {
simple-audio-card,bitclock-master = <&dpcmcpu>; simple-audio-card,bitclock-master = <&dpcmcpu>;
simple-audio-card,frame-master = <&dpcmcpu>; simple-audio-card,frame-master = <&dpcmcpu>;
simple-audio-card,prefix = "ak4642";
simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback", simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
"ak4642 Playback", "DAI1 Playback"; "ak4642 Playback", "DAI1 Playback";
...@@ -88,6 +87,7 @@ sound { ...@@ -88,6 +87,7 @@ sound {
}; };
codec { codec {
prefix = "ak4642";
sound-dai = <&ak4643>; sound-dai = <&ak4643>;
clocks = <&audio_clock>; clocks = <&audio_clock>;
}; };
......
...@@ -4,9 +4,11 @@ Required properties: ...@@ -4,9 +4,11 @@ Required properties:
- compatible: must be one of the following compatibles: - compatible: must be one of the following compatibles:
- "allwinner,sun50i-a64-codec-analog" - "allwinner,sun50i-a64-codec-analog"
- reg: must contain the registers location and length - reg: must contain the registers location and length
- cpvdd-supply: Regulator supply for the headphone amplifier
Example: Example:
codec_analog: codec-analog@1f015c0 { codec_analog: codec-analog@1f015c0 {
compatible = "allwinner,sun50i-a64-codec-analog"; compatible = "allwinner,sun50i-a64-codec-analog";
reg = <0x01f015c0 0x4>; reg = <0x01f015c0 0x4>;
cpvdd-supply = <&reg_eldo1>;
}; };
Device-Tree bindings for Xilinx I2S PL block
The IP supports I2S based playback/capture audio
Required property:
- compatible: "xlnx,i2s-transmitter-1.0" for playback and
"xlnx,i2s-receiver-1.0" for capture
Required property common to both I2S playback and capture:
- reg: Base address and size of the IP core instance.
- xlnx,dwidth: sample data width. Can be any of 16, 24.
- xlnx,num-channels: Number of I2S streams. Can be any of 1, 2, 3, 4.
supported channels = 2 * xlnx,num-channels
Example:
i2s_receiver@a0080000 {
compatible = "xlnx,i2s-receiver-1.0";
reg = <0x0 0xa0080000 0x0 0x10000>;
xlnx,dwidth = <0x18>;
xlnx,num-channels = <1>;
};
i2s_transmitter@a0090000 {
compatible = "xlnx,i2s-transmitter-1.0";
reg = <0x0 0xa0090000 0x0 0x10000>;
xlnx,dwidth = <0x18>;
xlnx,num-channels = <1>;
};
...@@ -1310,6 +1310,13 @@ F: drivers/pinctrl/meson/ ...@@ -1310,6 +1310,13 @@ F: drivers/pinctrl/meson/
F: drivers/mmc/host/meson* F: drivers/mmc/host/meson*
N: meson N: meson
ARM/Amlogic Meson SoC Sound Drivers
M: Jerome Brunet <jbrunet@baylibre.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained
F: sound/soc/meson/
F: Documentation/devicetree/bindings/sound/amlogic*
ARM/Annapurna Labs ALPINE ARCHITECTURE ARM/Annapurna Labs ALPINE ARCHITECTURE
M: Tsahee Zidenberg <tsahee@annapurnalabs.com> M: Tsahee Zidenberg <tsahee@annapurnalabs.com>
M: Antoine Tenart <antoine.tenart@bootlin.com> M: Antoine Tenart <antoine.tenart@bootlin.com>
...@@ -10795,7 +10802,10 @@ M: Jarkko Nikula <jarkko.nikula@bitmer.com> ...@@ -10795,7 +10802,10 @@ M: Jarkko Nikula <jarkko.nikula@bitmer.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
L: linux-omap@vger.kernel.org L: linux-omap@vger.kernel.org
S: Maintained S: Maintained
F: sound/soc/omap/ F: sound/soc/ti/omap*
F: sound/soc/ti/rx51.c
F: sound/soc/ti/n810.c
F: sound/soc/ti/sdma-pcm.*
OMAP CLOCK FRAMEWORK SUPPORT OMAP CLOCK FRAMEWORK SUPPORT
M: Paul Walmsley <paul@pwsan.com> M: Paul Walmsley <paul@pwsan.com>
...@@ -14839,6 +14849,12 @@ F: Documentation/devicetree/bindings/clock/ti,sci-clk.txt ...@@ -14839,6 +14849,12 @@ F: Documentation/devicetree/bindings/clock/ti,sci-clk.txt
F: drivers/clk/keystone/sci-clk.c F: drivers/clk/keystone/sci-clk.c
F: drivers/reset/reset-ti-sci.c F: drivers/reset/reset-ti-sci.c
Texas Instruments ASoC drivers
M: Peter Ujfalusi <peter.ujfalusi@ti.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Maintained
F: sound/soc/ti/
THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER THANKO'S RAREMONO AM/FM/SW RADIO RECEIVER USB DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl> M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
......
...@@ -167,8 +167,9 @@ CONFIG_SOUND=m ...@@ -167,8 +167,9 @@ CONFIG_SOUND=m
CONFIG_SND=m CONFIG_SND=m
CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_AUDIO=m
CONFIG_SND_SOC=m CONFIG_SND_SOC=m
CONFIG_SND_EDMA_SOC=m CONFIG_SND_SOC_TLV320AIC3X=m
CONFIG_SND_DA850_SOC_EVM=m CONFIG_SND_SOC_DAVINCI_MCASP=m
CONFIG_SND_SOC_DAVINCI_EVM=m
CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_SIMPLE_CARD=m
CONFIG_HID=m CONFIG_HID=m
CONFIG_HID_A4TECH=m CONFIG_HID_A4TECH=m
......
...@@ -175,8 +175,6 @@ CONFIG_SND_PCM_OSS=y ...@@ -175,8 +175,6 @@ CONFIG_SND_PCM_OSS=y
# CONFIG_SND_VERBOSE_PROCFS is not set # CONFIG_SND_VERBOSE_PROCFS is not set
CONFIG_SND_DUMMY=y CONFIG_SND_DUMMY=y
CONFIG_SND_USB_AUDIO=y CONFIG_SND_USB_AUDIO=y
CONFIG_SND_SOC=y
CONFIG_SND_OMAP_SOC=y
# CONFIG_USB_HID is not set # CONFIG_USB_HID is not set
CONFIG_USB=y CONFIG_USB=y
CONFIG_USB_PHY=y CONFIG_USB_PHY=y
......
...@@ -381,13 +381,13 @@ CONFIG_SND_VERBOSE_PRINTK=y ...@@ -381,13 +381,13 @@ CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y CONFIG_SND_DEBUG=y
CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_AUDIO=m
CONFIG_SND_SOC=m CONFIG_SND_SOC=m
CONFIG_SND_EDMA_SOC=m CONFIG_SND_SOC_TLV320AIC3X=m
CONFIG_SND_AM33XX_SOC_EVM=m CONFIG_SND_SOC_DAVINCI_MCASP=m
CONFIG_SND_OMAP_SOC=m CONFIG_SND_SOC_NOKIA_RX51=m
CONFIG_SND_OMAP_SOC_HDMI_AUDIO=m CONFIG_SND_SOC_OMAP_HDMI=m
CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m CONFIG_SND_SOC_OMAP_ABE_TWL6040=m
CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m CONFIG_SND_SOC_OMAP3_PANDORA=m
CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m CONFIG_SND_SOC_OMAP3_TWL4030=m
CONFIG_SND_SOC_CPCAP=m CONFIG_SND_SOC_CPCAP=m
CONFIG_SND_SIMPLE_CARD=m CONFIG_SND_SIMPLE_CARD=m
CONFIG_SND_AUDIO_GRAPH_CARD=m CONFIG_SND_AUDIO_GRAPH_CARD=m
......
...@@ -794,9 +794,9 @@ static __init void dm365_evm_init(void) ...@@ -794,9 +794,9 @@ static __init void dm365_evm_init(void)
/* maybe setup mmc1/etc ... _after_ mmc0 */ /* maybe setup mmc1/etc ... _after_ mmc0 */
evm_init_cpld(); evm_init_cpld();
#ifdef CONFIG_SND_DM365_AIC3X_CODEC #ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC
dm365_init_asp(); dm365_init_asp();
#elif defined(CONFIG_SND_DM365_VOICE_CODEC) #elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC)
dm365_init_vc(); dm365_init_vc();
#endif #endif
dm365_init_rtc(); dm365_init_rtc();
......
...@@ -8,7 +8,7 @@ obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ ...@@ -8,7 +8,7 @@ obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \
serial.o devices.o dma.o fb.o serial.o devices.o dma.o fb.o
obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o
ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) ifneq ($(CONFIG_SND_SOC_OMAP_MCBSP),)
obj-y += mcbsp.o obj-y += mcbsp.o
endif endif
......
...@@ -24,7 +24,7 @@ obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common) ...@@ -24,7 +24,7 @@ obj-$(CONFIG_SOC_OMAP5) += $(hwmod-common) $(secure-common)
obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common) obj-$(CONFIG_SOC_AM43XX) += $(hwmod-common) $(secure-common)
obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common) obj-$(CONFIG_SOC_DRA7XX) += $(hwmod-common) $(secure-common)
ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),) ifneq ($(CONFIG_SND_SOC_OMAP_MCBSP),)
obj-y += mcbsp.o obj-y += mcbsp.o
endif endif
......
...@@ -524,7 +524,7 @@ void omap_auxdata_legacy_init(struct device *dev) ...@@ -524,7 +524,7 @@ void omap_auxdata_legacy_init(struct device *dev)
dev->platform_data = &twl_gpio_auxdata; dev->platform_data = &twl_gpio_auxdata;
} }
#if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP) #if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
static struct omap_mcbsp_platform_data mcbsp_pdata; static struct omap_mcbsp_platform_data mcbsp_pdata;
static void __init omap3_mcbsp_init(void) static void __init omap3_mcbsp_init(void)
{ {
...@@ -572,7 +572,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { ...@@ -572,7 +572,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {
OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
&am35xx_emac_pdata), &am35xx_emac_pdata),
/* McBSP modules with sidetone core */ /* McBSP modules with sidetone core */
#if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP) #if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata), OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata),
OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49024000, "49024000.mcbsp", &mcbsp_pdata), OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49024000, "49024000.mcbsp", &mcbsp_pdata),
#endif #endif
......
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
#define QUINARY_TDM_TX_6 101 #define QUINARY_TDM_TX_6 101
#define QUINARY_TDM_RX_7 102 #define QUINARY_TDM_RX_7 102
#define QUINARY_TDM_TX_7 103 #define QUINARY_TDM_TX_7 103
#define DISPLAY_PORT_RX 104
#endif /* __DT_BINDINGS_Q6_AFE_H__ */ #endif /* __DT_BINDINGS_Q6_AFE_H__ */
...@@ -79,6 +79,7 @@ struct davinci_mcasp_pdata { ...@@ -79,6 +79,7 @@ struct davinci_mcasp_pdata {
/* McASP specific fields */ /* McASP specific fields */
int tdm_slots; int tdm_slots;
u8 op_mode; u8 op_mode;
u8 dismod;
u8 num_serializer; u8 num_serializer;
u8 *serial_dir; u8 *serial_dir;
u8 version; u8 version;
......
...@@ -23,6 +23,7 @@ struct snd_compr_ops; ...@@ -23,6 +23,7 @@ struct snd_compr_ops;
* struct snd_compr_runtime: runtime stream description * struct snd_compr_runtime: runtime stream description
* @state: stream state * @state: stream state
* @ops: pointer to DSP callbacks * @ops: pointer to DSP callbacks
* @dma_buffer_p: runtime dma buffer pointer
* @buffer: pointer to kernel buffer, valid only when not in mmap mode or * @buffer: pointer to kernel buffer, valid only when not in mmap mode or
* DSP doesn't implement copy * DSP doesn't implement copy
* @buffer_size: size of the above buffer * @buffer_size: size of the above buffer
...@@ -37,6 +38,7 @@ struct snd_compr_ops; ...@@ -37,6 +38,7 @@ struct snd_compr_ops;
struct snd_compr_runtime { struct snd_compr_runtime {
snd_pcm_state_t state; snd_pcm_state_t state;
struct snd_compr_ops *ops; struct snd_compr_ops *ops;
struct snd_dma_buffer *dma_buffer_p;
void *buffer; void *buffer;
u64 buffer_size; u64 buffer_size;
u32 fragment_size; u32 fragment_size;
...@@ -175,6 +177,23 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream) ...@@ -175,6 +177,23 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
wake_up(&stream->runtime->sleep); wake_up(&stream->runtime->sleep);
} }
/**
* snd_compr_set_runtime_buffer - Set the Compress runtime buffer
* @substream: compress substream to set
* @bufp: the buffer information, NULL to clear
*
* Copy the buffer information to runtime buffer when @bufp is non-NULL.
* Otherwise it clears the current buffer information.
*/
static inline void snd_compr_set_runtime_buffer(
struct snd_compr_stream *substream,
struct snd_dma_buffer *bufp)
{
struct snd_compr_runtime *runtime = substream->runtime;
runtime->dma_buffer_p = bufp;
}
int snd_compr_stop_error(struct snd_compr_stream *stream, int snd_compr_stop_error(struct snd_compr_stream *stream,
snd_pcm_state_t state); snd_pcm_state_t state);
......
...@@ -116,12 +116,12 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card); ...@@ -116,12 +116,12 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card);
void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data, void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
struct snd_pcm_hw_params *params); struct snd_pcm_hw_params *params);
void asoc_simple_card_parse_convert(struct device *dev, char *prefix, void asoc_simple_card_parse_convert(struct device *dev,
struct device_node *np, char *prefix,
struct asoc_simple_card_data *data); struct asoc_simple_card_data *data);
int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
char *prefix, char *prefix);
int optional);
int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card, int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
char *prefix); char *prefix);
......
...@@ -24,6 +24,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[]; ...@@ -24,6 +24,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[]; extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[];
/* /*
* generic table used for HDA codec-based platforms, possibly with * generic table used for HDA codec-based platforms, possibly with
......
...@@ -37,6 +37,20 @@ snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN], ...@@ -37,6 +37,20 @@ snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
struct snd_soc_acpi_mach * struct snd_soc_acpi_mach *
snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines); snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines);
/**
* snd_soc_acpi_mach_params: interface for machine driver configuration
*
* @acpi_ipc_irq_index: used for BYT-CR detection
* @platform: string used for HDaudio codec support
* @codec_mask: used for HDAudio support
*/
struct snd_soc_acpi_mach_params {
u32 acpi_ipc_irq_index;
const char *platform;
u32 codec_mask;
u32 dmic_num;
};
/** /**
* snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
* related to the hardware, except for the firmware and topology file names. * related to the hardware, except for the firmware and topology file names.
...@@ -68,6 +82,7 @@ struct snd_soc_acpi_mach { ...@@ -68,6 +82,7 @@ struct snd_soc_acpi_mach {
struct snd_soc_acpi_mach * (*machine_quirk)(void *arg); struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);
const void *quirk_data; const void *quirk_data;
void *pdata; void *pdata;
struct snd_soc_acpi_mach_params mach_params;
const char *sof_fw_filename; const char *sof_fw_filename;
const char *sof_tplg_filename; const char *sof_tplg_filename;
const char *asoc_plat_name; const char *asoc_plat_name;
......
...@@ -553,12 +553,12 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, ...@@ -553,12 +553,12 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
} }
#endif #endif
#ifdef CONFIG_SND_SOC_AC97_BUS
struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component); struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component);
struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component, struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
unsigned int id, unsigned int id_mask); unsigned int id, unsigned int id_mask);
void snd_soc_free_ac97_component(struct snd_ac97 *ac97); void snd_soc_free_ac97_component(struct snd_ac97 *ac97);
#ifdef CONFIG_SND_SOC_AC97_BUS
int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
struct platform_device *pdev); struct platform_device *pdev);
...@@ -1477,10 +1477,20 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, ...@@ -1477,10 +1477,20 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np,
unsigned int *rx_mask, unsigned int *rx_mask,
unsigned int *slots, unsigned int *slots,
unsigned int *slot_width); unsigned int *slot_width);
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, void snd_soc_of_parse_node_prefix(struct device_node *np,
struct snd_soc_codec_conf *codec_conf, struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node, struct device_node *of_node,
const char *propname); const char *propname);
static inline
void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card,
struct snd_soc_codec_conf *codec_conf,
struct device_node *of_node,
const char *propname)
{
snd_soc_of_parse_node_prefix(card->dev->of_node,
codec_conf, of_node, propname);
}
int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
const char *propname); const char *propname);
unsigned int snd_soc_of_parse_daifmt(struct device_node *np, unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
......
...@@ -171,7 +171,8 @@ static int snd_compr_free(struct inode *inode, struct file *f) ...@@ -171,7 +171,8 @@ static int snd_compr_free(struct inode *inode, struct file *f)
} }
data->stream.ops->free(&data->stream); data->stream.ops->free(&data->stream);
kfree(data->stream.runtime->buffer); if (!data->stream.runtime->dma_buffer_p)
kfree(data->stream.runtime->buffer);
kfree(data->stream.runtime); kfree(data->stream.runtime);
kfree(data); kfree(data);
return 0; return 0;
...@@ -505,7 +506,7 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, ...@@ -505,7 +506,7 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
struct snd_compr_params *params) struct snd_compr_params *params)
{ {
unsigned int buffer_size; unsigned int buffer_size;
void *buffer; void *buffer = NULL;
buffer_size = params->buffer.fragment_size * params->buffer.fragments; buffer_size = params->buffer.fragment_size * params->buffer.fragments;
if (stream->ops->copy) { if (stream->ops->copy) {
...@@ -514,7 +515,18 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream, ...@@ -514,7 +515,18 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
* the data from core * the data from core
*/ */
} else { } else {
buffer = kmalloc(buffer_size, GFP_KERNEL); if (stream->runtime->dma_buffer_p) {
if (buffer_size > stream->runtime->dma_buffer_p->bytes)
dev_err(&stream->device->dev,
"Not enough DMA buffer");
else
buffer = stream->runtime->dma_buffer_p->area;
} else {
buffer = kmalloc(buffer_size, GFP_KERNEL);
}
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -46,13 +46,11 @@ source "sound/soc/atmel/Kconfig" ...@@ -46,13 +46,11 @@ source "sound/soc/atmel/Kconfig"
source "sound/soc/au1x/Kconfig" source "sound/soc/au1x/Kconfig"
source "sound/soc/bcm/Kconfig" source "sound/soc/bcm/Kconfig"
source "sound/soc/cirrus/Kconfig" source "sound/soc/cirrus/Kconfig"
source "sound/soc/davinci/Kconfig"
source "sound/soc/dwc/Kconfig" source "sound/soc/dwc/Kconfig"
source "sound/soc/fsl/Kconfig" source "sound/soc/fsl/Kconfig"
source "sound/soc/hisilicon/Kconfig" source "sound/soc/hisilicon/Kconfig"
source "sound/soc/jz4740/Kconfig" source "sound/soc/jz4740/Kconfig"
source "sound/soc/nuc900/Kconfig" source "sound/soc/nuc900/Kconfig"
source "sound/soc/omap/Kconfig"
source "sound/soc/kirkwood/Kconfig" source "sound/soc/kirkwood/Kconfig"
source "sound/soc/img/Kconfig" source "sound/soc/img/Kconfig"
source "sound/soc/intel/Kconfig" source "sound/soc/intel/Kconfig"
...@@ -70,9 +68,11 @@ source "sound/soc/sti/Kconfig" ...@@ -70,9 +68,11 @@ source "sound/soc/sti/Kconfig"
source "sound/soc/stm/Kconfig" source "sound/soc/stm/Kconfig"
source "sound/soc/sunxi/Kconfig" source "sound/soc/sunxi/Kconfig"
source "sound/soc/tegra/Kconfig" source "sound/soc/tegra/Kconfig"
source "sound/soc/ti/Kconfig"
source "sound/soc/txx9/Kconfig" source "sound/soc/txx9/Kconfig"
source "sound/soc/uniphier/Kconfig" source "sound/soc/uniphier/Kconfig"
source "sound/soc/ux500/Kconfig" source "sound/soc/ux500/Kconfig"
source "sound/soc/xilinx/Kconfig"
source "sound/soc/xtensa/Kconfig" source "sound/soc/xtensa/Kconfig"
source "sound/soc/zte/Kconfig" source "sound/soc/zte/Kconfig"
......
...@@ -30,7 +30,6 @@ obj-$(CONFIG_SND_SOC) += atmel/ ...@@ -30,7 +30,6 @@ obj-$(CONFIG_SND_SOC) += atmel/
obj-$(CONFIG_SND_SOC) += au1x/ obj-$(CONFIG_SND_SOC) += au1x/
obj-$(CONFIG_SND_SOC) += bcm/ obj-$(CONFIG_SND_SOC) += bcm/
obj-$(CONFIG_SND_SOC) += cirrus/ obj-$(CONFIG_SND_SOC) += cirrus/
obj-$(CONFIG_SND_SOC) += davinci/
obj-$(CONFIG_SND_SOC) += dwc/ obj-$(CONFIG_SND_SOC) += dwc/
obj-$(CONFIG_SND_SOC) += fsl/ obj-$(CONFIG_SND_SOC) += fsl/
obj-$(CONFIG_SND_SOC) += hisilicon/ obj-$(CONFIG_SND_SOC) += hisilicon/
...@@ -41,7 +40,6 @@ obj-$(CONFIG_SND_SOC) += mediatek/ ...@@ -41,7 +40,6 @@ obj-$(CONFIG_SND_SOC) += mediatek/
obj-$(CONFIG_SND_SOC) += meson/ obj-$(CONFIG_SND_SOC) += meson/
obj-$(CONFIG_SND_SOC) += mxs/ obj-$(CONFIG_SND_SOC) += mxs/
obj-$(CONFIG_SND_SOC) += nuc900/ obj-$(CONFIG_SND_SOC) += nuc900/
obj-$(CONFIG_SND_SOC) += omap/
obj-$(CONFIG_SND_SOC) += kirkwood/ obj-$(CONFIG_SND_SOC) += kirkwood/
obj-$(CONFIG_SND_SOC) += pxa/ obj-$(CONFIG_SND_SOC) += pxa/
obj-$(CONFIG_SND_SOC) += qcom/ obj-$(CONFIG_SND_SOC) += qcom/
...@@ -54,8 +52,10 @@ obj-$(CONFIG_SND_SOC) += sti/ ...@@ -54,8 +52,10 @@ obj-$(CONFIG_SND_SOC) += sti/
obj-$(CONFIG_SND_SOC) += stm/ obj-$(CONFIG_SND_SOC) += stm/
obj-$(CONFIG_SND_SOC) += sunxi/ obj-$(CONFIG_SND_SOC) += sunxi/
obj-$(CONFIG_SND_SOC) += tegra/ obj-$(CONFIG_SND_SOC) += tegra/
obj-$(CONFIG_SND_SOC) += ti/
obj-$(CONFIG_SND_SOC) += txx9/ obj-$(CONFIG_SND_SOC) += txx9/
obj-$(CONFIG_SND_SOC) += uniphier/ obj-$(CONFIG_SND_SOC) += uniphier/
obj-$(CONFIG_SND_SOC) += ux500/ obj-$(CONFIG_SND_SOC) += ux500/
obj-$(CONFIG_SND_SOC) += xilinx/
obj-$(CONFIG_SND_SOC) += xtensa/ obj-$(CONFIG_SND_SOC) += xtensa/
obj-$(CONFIG_SND_SOC) += zte/ obj-$(CONFIG_SND_SOC) += zte/
...@@ -19,3 +19,9 @@ config SND_SOC_AMD_CZ_RT5645_MACH ...@@ -19,3 +19,9 @@ config SND_SOC_AMD_CZ_RT5645_MACH
depends on SND_SOC_AMD_ACP && I2C depends on SND_SOC_AMD_ACP && I2C
help help
This option enables machine driver for rt5645. This option enables machine driver for rt5645.
config SND_SOC_AMD_ACP3x
tristate "AMD Audio Coprocessor-v3.x support"
depends on X86 && PCI
help
This option enables ACP v3.x I2S support on AMD platform
...@@ -5,3 +5,4 @@ snd-soc-acp-rt5645-mach-objs := acp-rt5645.o ...@@ -5,3 +5,4 @@ snd-soc-acp-rt5645-mach-objs := acp-rt5645.o
obj-$(CONFIG_SND_SOC_AMD_ACP) += acp_audio_dma.o obj-$(CONFIG_SND_SOC_AMD_ACP) += acp_audio_dma.o
obj-$(CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH) += snd-soc-acp-da7219mx98357-mach.o obj-$(CONFIG_SND_SOC_AMD_CZ_DA7219MX98357_MACH) += snd-soc-acp-da7219mx98357-mach.o
obj-$(CONFIG_SND_SOC_AMD_CZ_RT5645_MACH) += snd-soc-acp-rt5645-mach.o obj-$(CONFIG_SND_SOC_AMD_CZ_RT5645_MACH) += snd-soc-acp-rt5645-mach.o
obj-$(CONFIG_SND_SOC_AMD_ACP3x) += raven/
...@@ -403,7 +403,7 @@ static struct regulator_config acp_da7219_cfg = { ...@@ -403,7 +403,7 @@ static struct regulator_config acp_da7219_cfg = {
static struct regulator_ops acp_da7219_ops = { static struct regulator_ops acp_da7219_ops = {
}; };
static struct regulator_desc acp_da7219_desc = { static const struct regulator_desc acp_da7219_desc = {
.name = "reg-fixed-1.8V", .name = "reg-fixed-1.8V",
.type = REGULATOR_VOLTAGE, .type = REGULATOR_VOLTAGE,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -303,11 +303,10 @@ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, u32 size, ...@@ -303,11 +303,10 @@ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, u32 size,
} }
/* Create page table entries in ACP SRAM for the allocated memory */ /* Create page table entries in ACP SRAM for the allocated memory */
static void acp_pte_config(void __iomem *acp_mmio, struct page *pg, static void acp_pte_config(void __iomem *acp_mmio, dma_addr_t addr,
u16 num_of_pages, u32 pte_offset) u16 num_of_pages, u32 pte_offset)
{ {
u16 page_idx; u16 page_idx;
u64 addr;
u32 low; u32 low;
u32 high; u32 high;
u32 offset; u32 offset;
...@@ -317,7 +316,6 @@ static void acp_pte_config(void __iomem *acp_mmio, struct page *pg, ...@@ -317,7 +316,6 @@ static void acp_pte_config(void __iomem *acp_mmio, struct page *pg,
/* Load the low address of page int ACP SRAM through SRBM */ /* Load the low address of page int ACP SRAM through SRBM */
acp_reg_write((offset + (page_idx * 8)), acp_reg_write((offset + (page_idx * 8)),
acp_mmio, mmACP_SRBM_Targ_Idx_Addr); acp_mmio, mmACP_SRBM_Targ_Idx_Addr);
addr = page_to_phys(pg);
low = lower_32_bits(addr); low = lower_32_bits(addr);
high = upper_32_bits(addr); high = upper_32_bits(addr);
...@@ -333,7 +331,7 @@ static void acp_pte_config(void __iomem *acp_mmio, struct page *pg, ...@@ -333,7 +331,7 @@ static void acp_pte_config(void __iomem *acp_mmio, struct page *pg,
acp_reg_write(high, acp_mmio, mmACP_SRBM_Targ_Idx_Data); acp_reg_write(high, acp_mmio, mmACP_SRBM_Targ_Idx_Data);
/* Move to next physically contiguos page */ /* Move to next physically contiguos page */
pg++; addr += PAGE_SIZE;
} }
} }
...@@ -343,7 +341,7 @@ static void config_acp_dma(void __iomem *acp_mmio, ...@@ -343,7 +341,7 @@ static void config_acp_dma(void __iomem *acp_mmio,
{ {
u16 ch_acp_sysmem, ch_acp_i2s; u16 ch_acp_sysmem, ch_acp_i2s;
acp_pte_config(acp_mmio, rtd->pg, rtd->num_of_pages, acp_pte_config(acp_mmio, rtd->dma_addr, rtd->num_of_pages,
rtd->pte_offset); rtd->pte_offset);
if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) {
...@@ -850,7 +848,6 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, ...@@ -850,7 +848,6 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream,
int status; int status;
uint64_t size; uint64_t size;
u32 val = 0; u32 val = 0;
struct page *pg;
struct snd_pcm_runtime *runtime; struct snd_pcm_runtime *runtime;
struct audio_substream_data *rtd; struct audio_substream_data *rtd;
struct snd_soc_pcm_runtime *prtd = substream->private_data; struct snd_soc_pcm_runtime *prtd = substream->private_data;
...@@ -986,16 +983,14 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream, ...@@ -986,16 +983,14 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream,
return status; return status;
memset(substream->runtime->dma_area, 0, params_buffer_bytes(params)); memset(substream->runtime->dma_area, 0, params_buffer_bytes(params));
pg = virt_to_page(substream->dma_buffer.area);
if (pg) { if (substream->dma_buffer.area) {
acp_set_sram_bank_state(rtd->acp_mmio, 0, true); acp_set_sram_bank_state(rtd->acp_mmio, 0, true);
/* Save for runtime private data */ /* Save for runtime private data */
rtd->pg = pg; rtd->dma_addr = substream->dma_buffer.addr;
rtd->order = get_order(size); rtd->order = get_order(size);
/* Fill the page table entries in ACP SRAM */ /* Fill the page table entries in ACP SRAM */
rtd->pg = pg;
rtd->size = size; rtd->size = size;
rtd->num_of_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; rtd->num_of_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
rtd->direction = substream->stream; rtd->direction = substream->stream;
...@@ -1151,18 +1146,21 @@ static int acp_dma_new(struct snd_soc_pcm_runtime *rtd) ...@@ -1151,18 +1146,21 @@ static int acp_dma_new(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd,
DRV_NAME); DRV_NAME);
struct audio_drv_data *adata = dev_get_drvdata(component->dev); struct audio_drv_data *adata = dev_get_drvdata(component->dev);
struct device *parent = component->dev->parent;
switch (adata->asic_type) { switch (adata->asic_type) {
case CHIP_STONEY: case CHIP_STONEY:
ret = snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, ret = snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
SNDRV_DMA_TYPE_DEV, SNDRV_DMA_TYPE_DEV,
NULL, ST_MIN_BUFFER, parent,
ST_MIN_BUFFER,
ST_MAX_BUFFER); ST_MAX_BUFFER);
break; break;
default: default:
ret = snd_pcm_lib_preallocate_pages_for_all(rtd->pcm, ret = snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
SNDRV_DMA_TYPE_DEV, SNDRV_DMA_TYPE_DEV,
NULL, MIN_BUFFER, parent,
MIN_BUFFER,
MAX_BUFFER); MAX_BUFFER);
break; break;
} }
......
...@@ -123,7 +123,7 @@ enum acp_dma_priority_level { ...@@ -123,7 +123,7 @@ enum acp_dma_priority_level {
}; };
struct audio_substream_data { struct audio_substream_data {
struct page *pg; dma_addr_t dma_addr;
unsigned int order; unsigned int order;
u16 num_of_pages; u16 num_of_pages;
u16 i2s_instance; u16 i2s_instance;
......
# SPDX-License-Identifier: GPL-2.0+
# Raven Ridge platform Support
snd-pci-acp3x-objs := pci-acp3x.o
snd-acp3x-pcm-dma-objs := acp3x-pcm-dma.o
obj-$(CONFIG_SND_SOC_AMD_ACP3x) += snd-pci-acp3x.o
obj-$(CONFIG_SND_SOC_AMD_ACP3x) += snd-acp3x-pcm-dma.o
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* AMD ALSA SoC PCM Driver
*
* Copyright 2016 Advanced Micro Devices, Inc.
*/
#include "chip_offset_byte.h"
#define ACP3x_PHY_BASE_ADDRESS 0x1240000
#define ACP3x_I2S_MODE 0
#define ACP3x_REG_START 0x1240000
#define ACP3x_REG_END 0x1250200
#define I2S_MODE 0x04
#define BT_TX_THRESHOLD 26
#define BT_RX_THRESHOLD 25
#define ACP3x_POWER_ON 0x00
#define ACP3x_POWER_ON_IN_PROGRESS 0x01
#define ACP3x_POWER_OFF 0x02
#define ACP3x_POWER_OFF_IN_PROGRESS 0x03
#define ACP3x_SOFT_RESET__SoftResetAudDone_MASK 0x00010001
#define ACP_SRAM_PTE_OFFSET 0x02050000
#define PAGE_SIZE_4K_ENABLE 0x2
#define MEM_WINDOW_START 0x4000000
#define PLAYBACK_FIFO_ADDR_OFFSET 0x400
#define CAPTURE_FIFO_ADDR_OFFSET 0x500
#define PLAYBACK_MIN_NUM_PERIODS 2
#define PLAYBACK_MAX_NUM_PERIODS 8
#define PLAYBACK_MAX_PERIOD_SIZE 16384
#define PLAYBACK_MIN_PERIOD_SIZE 4096
#define CAPTURE_MIN_NUM_PERIODS 2
#define CAPTURE_MAX_NUM_PERIODS 8
#define CAPTURE_MAX_PERIOD_SIZE 16384
#define CAPTURE_MIN_PERIOD_SIZE 4096
#define MAX_BUFFER (PLAYBACK_MAX_PERIOD_SIZE * PLAYBACK_MAX_NUM_PERIODS)
#define MIN_BUFFER MAX_BUFFER
#define FIFO_SIZE 0x100
#define DMA_SIZE 0x40
#define FRM_LEN 0x100
#define SLOT_WIDTH_8 0x08
#define SLOT_WIDTH_16 0x10
#define SLOT_WIDTH_24 0x18
#define SLOT_WIDTH_32 0x20
static inline u32 rv_readl(void __iomem *base_addr)
{
return readl(base_addr - ACP3x_PHY_BASE_ADDRESS);
}
static inline void rv_writel(u32 val, void __iomem *base_addr)
{
writel(val, base_addr - ACP3x_PHY_BASE_ADDRESS);
}
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0+
//
// AMD ACP PCI Driver
//
//Copyright 2016 Advanced Micro Devices, Inc.
#include <linux/pci.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include "acp3x.h"
struct acp3x_dev_data {
void __iomem *acp3x_base;
bool acp3x_audio_mode;
struct resource *res;
struct platform_device *pdev;
};
static int snd_acp3x_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{
int ret;
u32 addr, val;
struct acp3x_dev_data *adata;
struct platform_device_info pdevinfo;
unsigned int irqflags;
if (pci_enable_device(pci)) {
dev_err(&pci->dev, "pci_enable_device failed\n");
return -ENODEV;
}
ret = pci_request_regions(pci, "AMD ACP3x audio");
if (ret < 0) {
dev_err(&pci->dev, "pci_request_regions failed\n");
goto disable_pci;
}
adata = devm_kzalloc(&pci->dev, sizeof(struct acp3x_dev_data),
GFP_KERNEL);
if (!adata) {
ret = -ENOMEM;
goto release_regions;
}
/* check for msi interrupt support */
ret = pci_enable_msi(pci);
if (ret)
/* msi is not enabled */
irqflags = IRQF_SHARED;
else
/* msi is enabled */
irqflags = 0;
addr = pci_resource_start(pci, 0);
adata->acp3x_base = ioremap(addr, pci_resource_len(pci, 0));
if (!adata->acp3x_base) {
ret = -ENOMEM;
goto release_regions;
}
pci_set_master(pci);
pci_set_drvdata(pci, adata);
val = rv_readl(adata->acp3x_base + mmACP_I2S_PIN_CONFIG);
switch (val) {
case I2S_MODE:
adata->res = devm_kzalloc(&pci->dev,
sizeof(struct resource) * 2,
GFP_KERNEL);
if (!adata->res) {
ret = -ENOMEM;
goto unmap_mmio;
}
adata->res[0].name = "acp3x_i2s_iomem";
adata->res[0].flags = IORESOURCE_MEM;
adata->res[0].start = addr;
adata->res[0].end = addr + (ACP3x_REG_END - ACP3x_REG_START);
adata->res[1].name = "acp3x_i2s_irq";
adata->res[1].flags = IORESOURCE_IRQ;
adata->res[1].start = pci->irq;
adata->res[1].end = pci->irq;
adata->acp3x_audio_mode = ACP3x_I2S_MODE;
memset(&pdevinfo, 0, sizeof(pdevinfo));
pdevinfo.name = "acp3x_rv_i2s";
pdevinfo.id = 0;
pdevinfo.parent = &pci->dev;
pdevinfo.num_res = 2;
pdevinfo.res = adata->res;
pdevinfo.data = &irqflags;
pdevinfo.size_data = sizeof(irqflags);
adata->pdev = platform_device_register_full(&pdevinfo);
if (IS_ERR(adata->pdev)) {
dev_err(&pci->dev, "cannot register %s device\n",
pdevinfo.name);
ret = PTR_ERR(adata->pdev);
goto unmap_mmio;
}
break;
default:
dev_err(&pci->dev, "Invalid ACP audio mode : %d\n", val);
ret = -ENODEV;
goto unmap_mmio;
}
return 0;
unmap_mmio:
pci_disable_msi(pci);
iounmap(adata->acp3x_base);
release_regions:
pci_release_regions(pci);
disable_pci:
pci_disable_device(pci);
return ret;
}
static void snd_acp3x_remove(struct pci_dev *pci)
{
struct acp3x_dev_data *adata = pci_get_drvdata(pci);
platform_device_unregister(adata->pdev);
iounmap(adata->acp3x_base);
pci_disable_msi(pci);
pci_release_regions(pci);
pci_disable_device(pci);
}
static const struct pci_device_id snd_acp3x_ids[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x15e2),
.class = PCI_CLASS_MULTIMEDIA_OTHER << 8,
.class_mask = 0xffffff },
{ 0, },
};
MODULE_DEVICE_TABLE(pci, snd_acp3x_ids);
static struct pci_driver acp3x_driver = {
.name = KBUILD_MODNAME,
.id_table = snd_acp3x_ids,
.probe = snd_acp3x_probe,
.remove = snd_acp3x_remove,
};
module_pci_driver(acp3x_driver);
MODULE_AUTHOR("Maruthi.Bayyavarapu@amd.com");
MODULE_DESCRIPTION("AMD ACP3x PCI driver");
MODULE_LICENSE("GPL v2");
...@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS ...@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_ADAU7002 select SND_SOC_ADAU7002
select SND_SOC_ADS117X select SND_SOC_ADS117X
select SND_SOC_AK4104 if SPI_MASTER select SND_SOC_AK4104 if SPI_MASTER
select SND_SOC_AK4118 if I2C
select SND_SOC_AK4458 if I2C select SND_SOC_AK4458 if I2C
select SND_SOC_AK4535 if I2C select SND_SOC_AK4535 if I2C
select SND_SOC_AK4554 select SND_SOC_AK4554
...@@ -392,6 +393,11 @@ config SND_SOC_AK4104 ...@@ -392,6 +393,11 @@ config SND_SOC_AK4104
tristate "AKM AK4104 CODEC" tristate "AKM AK4104 CODEC"
depends on SPI_MASTER depends on SPI_MASTER
config SND_SOC_AK4118
tristate "AKM AK4118 CODEC"
depends on I2C
select REGMAP_I2C
config SND_SOC_AK4458 config SND_SOC_AK4458
tristate "AKM AK4458 CODEC" tristate "AKM AK4458 CODEC"
depends on I2C depends on I2C
......
...@@ -27,6 +27,7 @@ snd-soc-adav801-objs := adav801.o ...@@ -27,6 +27,7 @@ snd-soc-adav801-objs := adav801.o
snd-soc-adav803-objs := adav803.o snd-soc-adav803-objs := adav803.o
snd-soc-ads117x-objs := ads117x.o snd-soc-ads117x-objs := ads117x.o
snd-soc-ak4104-objs := ak4104.o snd-soc-ak4104-objs := ak4104.o
snd-soc-ak4118-objs := ak4118.o
snd-soc-ak4458-objs := ak4458.o snd-soc-ak4458-objs := ak4458.o
snd-soc-ak4535-objs := ak4535.o snd-soc-ak4535-objs := ak4535.o
snd-soc-ak4554-objs := ak4554.o snd-soc-ak4554-objs := ak4554.o
...@@ -290,6 +291,7 @@ obj-$(CONFIG_SND_SOC_ADAV801) += snd-soc-adav801.o ...@@ -290,6 +291,7 @@ obj-$(CONFIG_SND_SOC_ADAV801) += snd-soc-adav801.o
obj-$(CONFIG_SND_SOC_ADAV803) += snd-soc-adav803.o obj-$(CONFIG_SND_SOC_ADAV803) += snd-soc-adav803.o
obj-$(CONFIG_SND_SOC_ADS117X) += snd-soc-ads117x.o obj-$(CONFIG_SND_SOC_ADS117X) += snd-soc-ads117x.o
obj-$(CONFIG_SND_SOC_AK4104) += snd-soc-ak4104.o obj-$(CONFIG_SND_SOC_AK4104) += snd-soc-ak4104.o
obj-$(CONFIG_SND_SOC_AK4118) += snd-soc-ak4118.o
obj-$(CONFIG_SND_SOC_AK4458) += snd-soc-ak4458.o obj-$(CONFIG_SND_SOC_AK4458) += snd-soc-ak4458.o
obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o
obj-$(CONFIG_SND_SOC_AK4554) += snd-soc-ak4554.o obj-$(CONFIG_SND_SOC_AK4554) += snd-soc-ak4554.o
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h> #include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <sound/asoundef.h> #include <sound/asoundef.h>
#include <sound/core.h> #include <sound/core.h>
...@@ -268,8 +268,8 @@ static const struct regmap_config ak4104_regmap = { ...@@ -268,8 +268,8 @@ static const struct regmap_config ak4104_regmap = {
static int ak4104_spi_probe(struct spi_device *spi) static int ak4104_spi_probe(struct spi_device *spi)
{ {
struct device_node *np = spi->dev.of_node;
struct ak4104_private *ak4104; struct ak4104_private *ak4104;
struct gpio_desc *reset_gpiod;
unsigned int val; unsigned int val;
int ret; int ret;
...@@ -297,19 +297,11 @@ static int ak4104_spi_probe(struct spi_device *spi) ...@@ -297,19 +297,11 @@ static int ak4104_spi_probe(struct spi_device *spi)
return ret; return ret;
} }
if (np) { reset_gpiod = devm_gpiod_get_optional(&spi->dev, "reset",
enum of_gpio_flags flags; GPIOD_OUT_HIGH);
int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags); if (IS_ERR(reset_gpiod) &&
PTR_ERR(reset_gpiod) == -EPROBE_DEFER)
if (gpio_is_valid(gpio)) { return -EPROBE_DEFER;
ret = devm_gpio_request_one(&spi->dev, gpio,
flags & OF_GPIO_ACTIVE_LOW ?
GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
"ak4104 reset");
if (ret < 0)
return ret;
}
}
/* read the 'reserved' register - according to the datasheet, it /* read the 'reserved' register - according to the datasheet, it
* should contain 0x5b. Not a good way to verify the presence of * should contain 0x5b. Not a good way to verify the presence of
......
This diff is collapsed.
...@@ -456,7 +456,7 @@ static int ak4458_startup(struct snd_pcm_substream *substream, ...@@ -456,7 +456,7 @@ static int ak4458_startup(struct snd_pcm_substream *substream,
return ret; return ret;
} }
static struct snd_soc_dai_ops ak4458_dai_ops = { static const struct snd_soc_dai_ops ak4458_dai_ops = {
.startup = ak4458_startup, .startup = ak4458_startup,
.hw_params = ak4458_hw_params, .hw_params = ak4458_hw_params,
.set_fmt = ak4458_set_dai_fmt, .set_fmt = ak4458_set_dai_fmt,
......
...@@ -130,16 +130,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream, ...@@ -130,16 +130,12 @@ static int ak5558_hw_params(struct snd_pcm_substream *substream,
u8 bits; u8 bits;
int pcm_width = max(params_physical_width(params), ak5558->slot_width); int pcm_width = max(params_physical_width(params), ak5558->slot_width);
/* set master/slave audio interface */
bits = snd_soc_component_read32(component, AK5558_02_CONTROL1);
bits &= ~AK5558_BITS;
switch (pcm_width) { switch (pcm_width) {
case 16: case 16:
bits |= AK5558_DIF_24BIT_MODE; bits = AK5558_DIF_24BIT_MODE;
break; break;
case 32: case 32:
bits |= AK5558_DIF_32BIT_MODE; bits = AK5558_DIF_32BIT_MODE;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -168,18 +164,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -168,18 +164,15 @@ static int ak5558_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
} }
/* set master/slave audio interface */ /* set master/slave audio interface */
format = snd_soc_component_read32(component, AK5558_02_CONTROL1);
format &= ~AK5558_DIF;
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S: case SND_SOC_DAIFMT_I2S:
format |= AK5558_DIF_I2S_MODE; format = AK5558_DIF_I2S_MODE;
break; break;
case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_LEFT_J:
format |= AK5558_DIF_MSB_MODE; format = AK5558_DIF_MSB_MODE;
break; break;
case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_B:
format |= AK5558_DIF_MSB_MODE; format = AK5558_DIF_MSB_MODE;
break; break;
default: default:
return -EINVAL; return -EINVAL;
...@@ -246,7 +239,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream, ...@@ -246,7 +239,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream,
&ak5558_rate_constraints); &ak5558_rate_constraints);
} }
static struct snd_soc_dai_ops ak5558_dai_ops = { static const struct snd_soc_dai_ops ak5558_dai_ops = {
.startup = ak5558_startup, .startup = ak5558_startup,
.hw_params = ak5558_hw_params, .hw_params = ak5558_hw_params,
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h>
/* /*
* The codec isn't really big-endian or little-endian, since the I2S * The codec isn't really big-endian or little-endian, since the I2S
...@@ -658,8 +658,8 @@ static const struct regmap_config cs4270_regmap = { ...@@ -658,8 +658,8 @@ static const struct regmap_config cs4270_regmap = {
static int cs4270_i2c_probe(struct i2c_client *i2c_client, static int cs4270_i2c_probe(struct i2c_client *i2c_client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct device_node *np = i2c_client->dev.of_node;
struct cs4270_private *cs4270; struct cs4270_private *cs4270;
struct gpio_desc *reset_gpiod;
unsigned int val; unsigned int val;
int ret, i; int ret, i;
...@@ -678,20 +678,11 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, ...@@ -678,20 +678,11 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client,
if (ret < 0) if (ret < 0)
return ret; return ret;
/* See if we have a way to bring the codec out of reset */ reset_gpiod = devm_gpiod_get_optional(&i2c_client->dev, "reset",
if (np) { GPIOD_OUT_HIGH);
enum of_gpio_flags flags; if (IS_ERR(reset_gpiod) &&
int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags); PTR_ERR(reset_gpiod) == -EPROBE_DEFER)
return -EPROBE_DEFER;
if (gpio_is_valid(gpio)) {
ret = devm_gpio_request_one(&i2c_client->dev, gpio,
flags & OF_GPIO_ACTIVE_LOW ?
GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
"cs4270 reset");
if (ret < 0)
return ret;
}
}
cs4270->regmap = devm_regmap_init_i2c(i2c_client, &cs4270_regmap); cs4270->regmap = devm_regmap_init_i2c(i2c_client, &cs4270_regmap);
if (IS_ERR(cs4270->regmap)) if (IS_ERR(cs4270->regmap))
......
...@@ -30,9 +30,39 @@ ...@@ -30,9 +30,39 @@
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/soc-dapm.h> #include <sound/soc-dapm.h>
#define MAX_MODESWITCH_DELAY 70
static int modeswitch_delay;
module_param(modeswitch_delay, uint, 0644);
static int wakeup_delay;
module_param(wakeup_delay, uint, 0644);
struct dmic { struct dmic {
struct gpio_desc *gpio_en; struct gpio_desc *gpio_en;
int wakeup_delay; int wakeup_delay;
/* Delay after DMIC mode switch */
int modeswitch_delay;
};
int dmic_daiops_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct snd_soc_component *component = dai->component;
struct dmic *dmic = snd_soc_component_get_drvdata(component);
switch (cmd) {
case SNDRV_PCM_TRIGGER_STOP:
if (dmic->modeswitch_delay)
mdelay(dmic->modeswitch_delay);
break;
}
return 0;
}
static const struct snd_soc_dai_ops dmic_dai_ops = {
.trigger = dmic_daiops_trigger,
}; };
static int dmic_aif_event(struct snd_soc_dapm_widget *w, static int dmic_aif_event(struct snd_soc_dapm_widget *w,
...@@ -68,6 +98,7 @@ static struct snd_soc_dai_driver dmic_dai = { ...@@ -68,6 +98,7 @@ static struct snd_soc_dai_driver dmic_dai = {
| SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_LE
| SNDRV_PCM_FMTBIT_S16_LE, | SNDRV_PCM_FMTBIT_S16_LE,
}, },
.ops = &dmic_dai_ops,
}; };
static int dmic_component_probe(struct snd_soc_component *component) static int dmic_component_probe(struct snd_soc_component *component)
...@@ -85,6 +116,15 @@ static int dmic_component_probe(struct snd_soc_component *component) ...@@ -85,6 +116,15 @@ static int dmic_component_probe(struct snd_soc_component *component)
device_property_read_u32(component->dev, "wakeup-delay-ms", device_property_read_u32(component->dev, "wakeup-delay-ms",
&dmic->wakeup_delay); &dmic->wakeup_delay);
device_property_read_u32(component->dev, "modeswitch-delay-ms",
&dmic->modeswitch_delay);
if (wakeup_delay)
dmic->wakeup_delay = wakeup_delay;
if (modeswitch_delay)
dmic->modeswitch_delay = modeswitch_delay;
if (dmic->modeswitch_delay > MAX_MODESWITCH_DELAY)
dmic->modeswitch_delay = MAX_MODESWITCH_DELAY;
snd_soc_component_set_drvdata(component, dmic); snd_soc_component_set_drvdata(component, dmic);
......
...@@ -46,7 +46,7 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai, ...@@ -46,7 +46,7 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt, static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt,
struct snd_soc_dai *dai); struct snd_soc_dai *dai);
static struct snd_soc_dai_ops hdac_hda_dai_ops = { static const struct snd_soc_dai_ops hdac_hda_dai_ops = {
.startup = hdac_hda_dai_open, .startup = hdac_hda_dai_open,
.shutdown = hdac_hda_dai_close, .shutdown = hdac_hda_dai_close,
.prepare = hdac_hda_dai_prepare, .prepare = hdac_hda_dai_prepare,
......
...@@ -121,8 +121,16 @@ struct hdac_hdmi_dai_port_map { ...@@ -121,8 +121,16 @@ struct hdac_hdmi_dai_port_map {
struct hdac_hdmi_cvt *cvt; struct hdac_hdmi_cvt *cvt;
}; };
/*
* pin to port mapping table where the value indicate the pin number and
* the index indicate the port number with 1 base.
*/
static const int icl_pin2port_map[] = {0x4, 0x6, 0x8, 0xa, 0xb};
struct hdac_hdmi_drv_data { struct hdac_hdmi_drv_data {
unsigned int vendor_nid; unsigned int vendor_nid;
const int *port_map; /* pin to port mapping table */
int port_num;
}; };
struct hdac_hdmi_priv { struct hdac_hdmi_priv {
...@@ -1329,11 +1337,12 @@ static int hdac_hdmi_add_pin(struct hdac_device *hdev, hda_nid_t nid) ...@@ -1329,11 +1337,12 @@ static int hdac_hdmi_add_pin(struct hdac_device *hdev, hda_nid_t nid)
return 0; return 0;
} }
#define INTEL_VENDOR_NID 0x08 #define INTEL_VENDOR_NID_0x2 0x02
#define INTEL_GLK_VENDOR_NID 0x0b #define INTEL_VENDOR_NID_0x8 0x08
#define INTEL_VENDOR_NID_0xb 0x0b
#define INTEL_GET_VENDOR_VERB 0xf81 #define INTEL_GET_VENDOR_VERB 0xf81
#define INTEL_SET_VENDOR_VERB 0x781 #define INTEL_SET_VENDOR_VERB 0x781
#define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */
#define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */
static void hdac_hdmi_skl_enable_all_pins(struct hdac_device *hdev) static void hdac_hdmi_skl_enable_all_pins(struct hdac_device *hdev)
...@@ -1538,7 +1547,26 @@ static int hdac_hdmi_parse_and_map_nid(struct hdac_device *hdev, ...@@ -1538,7 +1547,26 @@ static int hdac_hdmi_parse_and_map_nid(struct hdac_device *hdev,
static int hdac_hdmi_pin2port(void *aptr, int pin) static int hdac_hdmi_pin2port(void *aptr, int pin)
{ {
return pin - 4; /* map NID 0x05 -> port #1 */ struct hdac_device *hdev = aptr;
struct hdac_hdmi_priv *hdmi = hdev_to_hdmi_priv(hdev);
const int *map = hdmi->drv_data->port_map;
int i;
if (!hdmi->drv_data->port_num)
return pin - 4; /* map NID 0x05 -> port #1 */
/*
* looking for the pin number in the mapping table and return
* the index which indicate the port number
*/
for (i = 0; i < hdmi->drv_data->port_num; i++) {
if (pin == map[i])
return i + 1;
}
/* return -1 if pin number exceeds our expectation */
dev_err(&hdev->dev, "Can't find the port for pin %d\n", pin);
return -1;
} }
static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe) static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
...@@ -1549,9 +1577,18 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe) ...@@ -1549,9 +1577,18 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
struct hdac_hdmi_port *hport = NULL; struct hdac_hdmi_port *hport = NULL;
struct snd_soc_component *component = hdmi->component; struct snd_soc_component *component = hdmi->component;
int i; int i;
hda_nid_t pin_nid;
/* Don't know how this mapping is derived */
hda_nid_t pin_nid = port + 0x04; if (!hdmi->drv_data->port_num) {
/* for legacy platforms */
pin_nid = port + 0x04;
} else if (port < hdmi->drv_data->port_num) {
/* get pin number from the pin2port mapping table */
pin_nid = hdmi->drv_data->port_map[port - 1];
} else {
dev_err(&hdev->dev, "Can't find the pin for port %d\n", port);
return;
}
dev_dbg(&hdev->dev, "%s: for pin:%d port=%d\n", __func__, dev_dbg(&hdev->dev, "%s: for pin:%d port=%d\n", __func__,
pin_nid, pipe); pin_nid, pipe);
...@@ -1973,12 +2010,18 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdev, int pcm_idx) ...@@ -1973,12 +2010,18 @@ static int hdac_hdmi_get_spk_alloc(struct hdac_device *hdev, int pcm_idx)
return port->eld.info.spk_alloc; return port->eld.info.spk_alloc;
} }
static struct hdac_hdmi_drv_data intel_icl_drv_data = {
.vendor_nid = INTEL_VENDOR_NID_0x2,
.port_map = icl_pin2port_map,
.port_num = ARRAY_SIZE(icl_pin2port_map),
};
static struct hdac_hdmi_drv_data intel_glk_drv_data = { static struct hdac_hdmi_drv_data intel_glk_drv_data = {
.vendor_nid = INTEL_GLK_VENDOR_NID, .vendor_nid = INTEL_VENDOR_NID_0xb,
}; };
static struct hdac_hdmi_drv_data intel_drv_data = { static struct hdac_hdmi_drv_data intel_drv_data = {
.vendor_nid = INTEL_VENDOR_NID, .vendor_nid = INTEL_VENDOR_NID_0x8,
}; };
static int hdac_hdmi_dev_probe(struct hdac_device *hdev) static int hdac_hdmi_dev_probe(struct hdac_device *hdev)
...@@ -2258,6 +2301,8 @@ static const struct hda_device_id hdmi_list[] = { ...@@ -2258,6 +2301,8 @@ static const struct hda_device_id hdmi_list[] = {
&intel_glk_drv_data), &intel_glk_drv_data),
HDA_CODEC_EXT_ENTRY(0x8086280d, 0x100000, "Geminilake HDMI", HDA_CODEC_EXT_ENTRY(0x8086280d, 0x100000, "Geminilake HDMI",
&intel_glk_drv_data), &intel_glk_drv_data),
HDA_CODEC_EXT_ENTRY(0x8086280f, 0x100000, "Icelake HDMI",
&intel_icl_drv_data),
{} {}
}; };
......
...@@ -724,14 +724,39 @@ static struct snd_soc_dai_driver max98373_dai[] = { ...@@ -724,14 +724,39 @@ static struct snd_soc_dai_driver max98373_dai[] = {
} }
}; };
static void max98373_reset(struct max98373_priv *max98373, struct device *dev)
{
int ret, reg, count;
/* Software Reset */
ret = regmap_update_bits(max98373->regmap,
MAX98373_R2000_SW_RESET,
MAX98373_SOFT_RESET,
MAX98373_SOFT_RESET);
if (ret)
dev_err(dev, "Reset command failed. (ret:%d)\n", ret);
count = 0;
while (count < 3) {
usleep_range(10000, 11000);
/* Software Reset Verification */
ret = regmap_read(max98373->regmap,
MAX98373_R21FF_REV_ID, &reg);
if (!ret) {
dev_info(dev, "Reset completed (retry:%d)\n", count);
return;
}
count++;
}
dev_err(dev, "Reset failed. (ret:%d)\n", ret);
}
static int max98373_probe(struct snd_soc_component *component) static int max98373_probe(struct snd_soc_component *component)
{ {
struct max98373_priv *max98373 = snd_soc_component_get_drvdata(component); struct max98373_priv *max98373 = snd_soc_component_get_drvdata(component);
/* Software Reset */ /* Software Reset */
regmap_write(max98373->regmap, max98373_reset(max98373, component->dev);
MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
usleep_range(10000, 11000);
/* IV default slot configuration */ /* IV default slot configuration */
regmap_write(max98373->regmap, regmap_write(max98373->regmap,
...@@ -818,9 +843,7 @@ static int max98373_resume(struct device *dev) ...@@ -818,9 +843,7 @@ static int max98373_resume(struct device *dev)
{ {
struct max98373_priv *max98373 = dev_get_drvdata(dev); struct max98373_priv *max98373 = dev_get_drvdata(dev);
regmap_write(max98373->regmap, max98373_reset(max98373, dev);
MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
usleep_range(10000, 11000);
regcache_cache_only(max98373->regmap, false); regcache_cache_only(max98373->regmap, false);
regcache_sync(max98373->regmap); regcache_sync(max98373->regmap);
return 0; return 0;
......
This diff is collapsed.
...@@ -26,13 +26,11 @@ ...@@ -26,13 +26,11 @@
#define MAX9867_PSCLK_10_20 0x1 #define MAX9867_PSCLK_10_20 0x1
#define MAX9867_PSCLK_20_40 0x2 #define MAX9867_PSCLK_20_40 0x2
#define MAX9867_PSCLK_40_60 0x3 #define MAX9867_PSCLK_40_60 0x3
#define MAX9867_AUDIOCLKHIGH 0x06 #define MAX9867_AUDIOCLKHIGH 0x06
#define MAX9867_NI_HIGH_WIDTH 0x7 #define MAX9867_NI_HIGH_MASK 0x7F
#define MAX9867_NI_HIGH_MASK 0x7F #define MAX9867_NI_LOW_MASK 0xFE
#define MAX9867_NI_LOW_MASK 0x7F #define MAX9867_PLL (1<<7)
#define MAX9867_NI_LOW_SHIFT 0x1 #define MAX9867_AUDIOCLKLOW 0x07
#define MAX9867_PLL (1<<7)
#define MAX9867_AUDIOCLKLOW 0x07
#define MAX9867_RAPID_LOCK 0x01 #define MAX9867_RAPID_LOCK 0x01
#define MAX9867_IFC1A 0x08 #define MAX9867_IFC1A 0x08
#define MAX9867_MASTER (1<<7) #define MAX9867_MASTER (1<<7)
...@@ -43,40 +41,29 @@ ...@@ -43,40 +41,29 @@
#define MAX9867_BCI_MODE (1<<5) #define MAX9867_BCI_MODE (1<<5)
#define MAX9867_IFC1B 0x09 #define MAX9867_IFC1B 0x09
#define MAX9867_IFC1B_BCLK_MASK 7 #define MAX9867_IFC1B_BCLK_MASK 7
#define MAX9867_IFC1B_32BIT 0x01 #define MAX9867_IFC1B_64X 0x01
#define MAX9867_IFC1B_24BIT 0x02 #define MAX9867_IFC1B_48X 0x02
#define MAX9867_IFC1B_PCLK_2 4 #define MAX9867_IFC1B_PCLK_2 0x04
#define MAX9867_IFC1B_PCLK_4 5 #define MAX9867_IFC1B_PCLK_4 0x05
#define MAX9867_IFC1B_PCLK_8 6 #define MAX9867_IFC1B_PCLK_8 0x06
#define MAX9867_IFC1B_PCLK_16 7 #define MAX9867_IFC1B_PCLK_16 0x07
#define MAX9867_CODECFLTR 0x0a #define MAX9867_CODECFLTR 0x0a
#define MAX9867_DACGAIN 0x0b #define MAX9867_SIDETONE 0x0b
#define MAX9867_DACLEVEL 0x0c #define MAX9867_DACLEVEL 0x0c
#define MAX9867_DAC_MUTE_SHIFT 0x6
#define MAX9867_DAC_MUTE_WIDTH 0x1
#define MAX9867_DAC_MUTE_MASK (0x1<<MAX9867_DAC_MUTE_SHIFT)
#define MAX9867_ADCLEVEL 0x0d #define MAX9867_ADCLEVEL 0x0d
#define MAX9867_LEFTLINELVL 0x0e #define MAX9867_LEFTLINELVL 0x0e
#define MAX9867_RIGTHLINELVL 0x0f #define MAX9867_RIGHTLINELVL 0x0f
#define MAX9867_LEFTVOL 0x10 #define MAX9867_LEFTVOL 0x10
#define MAX9867_RIGHTVOL 0x11 #define MAX9867_RIGHTVOL 0x11
#define MAX9867_LEFTMICGAIN 0x12 #define MAX9867_LEFTMICGAIN 0x12
#define MAX9867_RIGHTMICGAIN 0x13 #define MAX9867_RIGHTMICGAIN 0x13
#define MAX9867_INPUTCONFIG 0x14 #define MAX9867_INPUTCONFIG 0x14
#define MAX9867_INPUT_SHIFT 0x6
#define MAX9867_MICCONFIG 0x15 #define MAX9867_MICCONFIG 0x15
#define MAX9867_MODECONFIG 0x16 #define MAX9867_MODECONFIG 0x16
#define MAX9867_PWRMAN 0x17 #define MAX9867_PWRMAN 0x17
#define MAX9867_SHTDOWN_MASK (1<<7) #define MAX9867_SHTDOWN 0x80
#define MAX9867_REVISION 0xff #define MAX9867_REVISION 0xff
#define MAX9867_CACHEREGNUM 10 #define MAX9867_CACHEREGNUM 10
/* codec private data */
struct max9867_priv {
struct regmap *regmap;
unsigned int sysclk;
unsigned int pclk;
unsigned int master;
};
#endif #endif
...@@ -585,7 +585,7 @@ static int nau8540_calc_fll_param(unsigned int fll_in, ...@@ -585,7 +585,7 @@ static int nau8540_calc_fll_param(unsigned int fll_in,
fvco_max = 0; fvco_max = 0;
fvco_sel = ARRAY_SIZE(mclk_src_scaling); fvco_sel = ARRAY_SIZE(mclk_src_scaling);
for (i = 0; i < ARRAY_SIZE(mclk_src_scaling); i++) { for (i = 0; i < ARRAY_SIZE(mclk_src_scaling); i++) {
fvco = 256 * fs * 2 * mclk_src_scaling[i].param; fvco = 256ULL * fs * 2 * mclk_src_scaling[i].param;
if (fvco > NAU_FVCO_MIN && fvco < NAU_FVCO_MAX && if (fvco > NAU_FVCO_MIN && fvco < NAU_FVCO_MAX &&
fvco_max < fvco) { fvco_max < fvco) {
fvco_max = fvco; fvco_max = fvco;
......
/* // SPDX-License-Identifier: GPL-2.0
* nau8822.c -- NAU8822 ALSA Soc Audio Codec driver //
* // nau8822.c -- NAU8822 ALSA Soc Audio driver
* Copyright 2017 Nuvoton Technology Corp. //
* // Copyright 2017 Nuvoton Technology Crop.
* Author: David Lin <ctlin0@nuvoton.com> //
* Co-author: John Hsu <kchsu0@nuvoton.com> // Author: David Lin <ctlin0@nuvoton.com>
* Co-author: Seven Li <wtli@nuvoton.com> // Co-author: John Hsu <kchsu0@nuvoton.com>
* // Co-author: Seven Li <wtli@nuvoton.com>
* Based on WM8974.c //
* // Based on WM8974.c
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* nau8822.h -- NAU8822 Soc Audio Codec driver * nau8822.h -- NAU8822 ALSA SoC Audio driver
*
* Copyright 2017 Nuvoton Technology Crop.
* *
* Author: David Lin <ctlin0@nuvoton.com> * Author: David Lin <ctlin0@nuvoton.com>
* Co-author: John Hsu <kchsu0@nuvoton.com> * Co-author: John Hsu <kchsu0@nuvoton.com>
* Co-author: Seven Li <wtli@nuvoton.com> * Co-author: Seven Li <wtli@nuvoton.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/ */
#ifndef __NAU8822_H__ #ifndef __NAU8822_H__
......
...@@ -424,10 +424,8 @@ static u32 nau8825_xtalk_sidetone(u32 sig_org, u32 sig_cros) ...@@ -424,10 +424,8 @@ static u32 nau8825_xtalk_sidetone(u32 sig_org, u32 sig_cros)
{ {
u32 gain, sidetone; u32 gain, sidetone;
if (unlikely(sig_org == 0) || unlikely(sig_cros == 0)) { if (WARN_ON(sig_org == 0 || sig_cros == 0))
WARN_ON(1);
return 0; return 0;
}
sig_org = nau8825_intlog10_dec3(sig_org); sig_org = nau8825_intlog10_dec3(sig_org);
sig_cros = nau8825_intlog10_dec3(sig_cros); sig_cros = nau8825_intlog10_dec3(sig_cros);
......
...@@ -198,19 +198,25 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = { ...@@ -198,19 +198,25 @@ static const struct snd_kcontrol_new pcm3060_dapm_controls[] = {
}; };
static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = { static const struct snd_soc_dapm_widget pcm3060_dapm_widgets[] = {
SND_SOC_DAPM_DAC("DAC", "Playback", PCM3060_REG64,
PCM3060_REG_SHIFT_DAPSV, 1),
SND_SOC_DAPM_OUTPUT("OUTL"), SND_SOC_DAPM_OUTPUT("OUTL"),
SND_SOC_DAPM_OUTPUT("OUTR"), SND_SOC_DAPM_OUTPUT("OUTR"),
SND_SOC_DAPM_INPUT("INL"), SND_SOC_DAPM_INPUT("INL"),
SND_SOC_DAPM_INPUT("INR"), SND_SOC_DAPM_INPUT("INR"),
SND_SOC_DAPM_ADC("ADC", "Capture", PCM3060_REG64,
PCM3060_REG_SHIFT_ADPSV, 1),
}; };
static const struct snd_soc_dapm_route pcm3060_dapm_map[] = { static const struct snd_soc_dapm_route pcm3060_dapm_map[] = {
{ "OUTL", NULL, "Playback" }, { "OUTL", NULL, "DAC" },
{ "OUTR", NULL, "Playback" }, { "OUTR", NULL, "DAC" },
{ "Capture", NULL, "INL" }, { "ADC", NULL, "INL" },
{ "Capture", NULL, "INR" }, { "ADC", NULL, "INR" },
}; };
/* soc component */ /* soc component */
...@@ -270,9 +276,23 @@ EXPORT_SYMBOL(pcm3060_regmap); ...@@ -270,9 +276,23 @@ EXPORT_SYMBOL(pcm3060_regmap);
/* device */ /* device */
static void pcm3060_parse_dt(const struct device_node *np,
struct pcm3060_priv *priv)
{
priv->out_se = of_property_read_bool(np, "ti,out-single-ended");
}
int pcm3060_probe(struct device *dev) int pcm3060_probe(struct device *dev)
{ {
int rc; int rc;
struct pcm3060_priv *priv = dev_get_drvdata(dev);
if (dev->of_node)
pcm3060_parse_dt(dev->of_node, priv);
if (priv->out_se)
regmap_update_bits(priv->regmap, PCM3060_REG64,
PCM3060_REG_SE, PCM3060_REG_SE);
rc = devm_snd_soc_register_component(dev, &pcm3060_soc_comp_driver, rc = devm_snd_soc_register_component(dev, &pcm3060_soc_comp_driver,
pcm3060_dai, pcm3060_dai,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment