Commit fffe9b89 authored by Mark Brown's avatar Mark Brown

Merge tag 'asoc-v4.5' into asoc-next

ASoC: Updates for v4.5

This is quite a busy release on the driver front with a lot of new
drivers being added but comparatively quiet on the core side with only
one big change going in and that a fairly straightforward refactoring.

 - Conversion of the array of DAI links to a list by Mengdong Lin,
   supporting dynamically adding and removing DAI links.
 - Some more fixes for the topology code, though it is still not final
   and ready for enabling in production.  We really need to get to the
   point where that can be done.
 - A pile of changes for Intel SkyLake drivers which hopefully deliver
   some useful initial functionality for systems with this chipset,
   though there is more work still to come.
 - New drivers for a number of Imagination Technologies IPs.
 - Lots of new features and cleanups for the Renesas drivers.
 - ANC support for WM5110.
 - New driver for Atmel class D speaker drivers.
 - New drivers for Cirrus CS47L24 and WM1831.
 - New driver for Dialog DA7128.
 - New drivers for Realtek RT5659 and RT56156.
 - New driver for Rockchip RK3036.
 - New driver for TI PC3168A

# gpg: Signature made Wed 23 Dec 2015 00:42:40 GMT using RSA key ID 5D5487D0
# gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>"
# gpg:                 aka "Mark Brown <broonie@debian.org>"
# gpg:                 aka "Mark Brown <broonie@kernel.org>"
# gpg:                 aka "Mark Brown <broonie@tardis.ed.ac.uk>"
# gpg:                 aka "Mark Brown <broonie@linaro.org>"
# gpg:                 aka "Mark Brown <Mark.Brown@linaro.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 3F25 68AA C269 98F9 E813  A1C5 C3F4 36CA 30F5 D8EB
#      Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2  9FEA 24D6 8B72 5D54 87D0
parents 7b2f32cc 822ad70a
...@@ -7,6 +7,16 @@ Required properties: ...@@ -7,6 +7,16 @@ Required properties:
- compatible : "asahi-kasei,ak4613" - compatible : "asahi-kasei,ak4613"
- reg : The chip select number on the I2C bus - reg : The chip select number on the I2C bus
Optional properties:
- asahi-kasei,in1-single-end : Boolean. Indicate input / output pins are single-ended.
- asahi-kasei,in2-single-end rather than differential.
- asahi-kasei,out1-single-end
- asahi-kasei,out2-single-end
- asahi-kasei,out3-single-end
- asahi-kasei,out4-single-end
- asahi-kasei,out5-single-end
- asahi-kasei,out6-single-end
Example: Example:
&i2c { &i2c {
......
...@@ -16,6 +16,10 @@ Required properties: ...@@ -16,6 +16,10 @@ Required properties:
Required elements: "pclk", "gclk" and "aclk". Required elements: "pclk", "gclk" and "aclk".
- clocks - clocks
Please refer to clock-bindings.txt. Please refer to clock-bindings.txt.
- assigned-clocks
Should be <&classd_gclk>.
- assigned-clock-parents
Should be <&audio_pll_pmc>.
Optional properties: Optional properties:
- pinctrl-names, pinctrl-0 - pinctrl-names, pinctrl-0
...@@ -43,6 +47,8 @@ classd: classd@fc048000 { ...@@ -43,6 +47,8 @@ classd: classd@fc048000 {
dma-names = "tx"; dma-names = "tx";
clocks = <&classd_clk>, <&classd_gclk>, <&audio_pll_pmc>; clocks = <&classd_clk>, <&classd_gclk>, <&audio_pll_pmc>;
clock-names = "pclk", "gclk", "aclk"; clock-names = "pclk", "gclk", "aclk";
assigned-clocks = <&classd_gclk>;
assigned-clock-parents = <&audio_pll_pmc>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_classd_default>; pinctrl-0 = <&pinctrl_classd_default>;
......
* Atmel PDMIC driver under ALSA SoC architecture
Required properties:
- compatible
Should be "atmel,sama5d2-pdmic".
- reg
Should contain PDMIC registers location and length.
- interrupts
Should contain the IRQ line for the PDMIC.
- dmas
One DMA specifiers as described in atmel-dma.txt and dma.txt files.
- dma-names
Must be "rx".
- clock-names
Required elements:
- "pclk" peripheral clock
- "gclk" generated clock
- clocks
Must contain an entry for each required entry in clock-names.
Please refer to clock-bindings.txt.
- atmel,mic-min-freq
The minimal frequency that the micphone supports.
- atmel,mic-max-freq
The maximal frequency that the micphone supports.
Optional properties:
- pinctrl-names, pinctrl-0
Please refer to pinctrl-bindings.txt.
- atmel,model
The user-visible name of this sound card.
The default value is "PDMIC".
- atmel,mic-offset
The offset that should be added.
The range is from -32768 to 32767.
The default value is 0.
Example:
pdmic@f8018000 {
compatible = "atmel,sama5d2-pdmic";
reg = <0xf8018000 0x124>;
interrupts = <48 IRQ_TYPE_LEVEL_HIGH 7>;
dmas = <&dma0
(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
| AT91_XDMAC_DT_PERID(50))>;
dma-names = "rx";
clocks = <&pdmic_clk>, <&pdmic_gclk>;
clock-names = "pclk", "gclk";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pdmic_default>;
atmel,model = "PDMIC @ sama5d2_xplained";
atmel,mic-min-freq = <1000000>;
atmel,mic-max-freq = <3246000>;
atmel,mic-offset = <0x0>;
};
Dialog Semiconductor DA7218 Audio Codec bindings
DA7218 is an audio codec with HP detect feature.
======
Required properties:
- compatible : Should be "dlg,da7217" or "dlg,da7218"
- reg: Specifies the I2C slave address
- VDD-supply: VDD power supply for the device
- VDDMIC-supply: VDDMIC power supply for the device
- VDDIO-supply: VDDIO power supply for the device
(See Documentation/devicetree/bindings/regulator/regulator.txt for further
information relating to regulators)
Optional properties:
- interrupt-parent: Specifies the phandle of the interrupt controller to which
the IRQs from DA7218 are delivered to.
- interrupts: IRQ line info for DA7218 chip.
(See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt for
further information relating to interrupt properties)
- interrupt-names : Name associated with interrupt line. Should be "wakeup" if
interrupt is to be used to wake system, otherwise "irq" should be used.
- wakeup-source: Flag to indicate this device can wake system (suspend/resume).
- clocks : phandle and clock specifier for codec MCLK.
- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
- dlg,micbias1-lvl-millivolt : Voltage (mV) for Mic Bias 1
[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
- dlg,micbias2-lvl-millivolt : Voltage (mV) for Mic Bias 2
[<1200>, <1600>, <1800>, <2000>, <2200>, <2400>, <2600>, <2800>, <3000>]
- dlg,mic1-amp-in-sel : Mic1 input source type
["diff", "se_p", "se_n"]
- dlg,mic2-amp-in-sel : Mic2 input source type
["diff", "se_p", "se_n"]
- dlg,dmic1-data-sel : DMIC1 channel select based on clock edge.
["lrise_rfall", "lfall_rrise"]
- dlg,dmic1-samplephase : When to sample audio from DMIC1.
["on_clkedge", "between_clkedge"]
- dlg,dmic1-clkrate-hz : DMic1 clock frequency (Hz).
[<1500000>, <3000000>]
- dlg,dmic2-data-sel : DMic2 channel select based on clock edge.
["lrise_rfall", "lfall_rrise"]
- dlg,dmic2-samplephase : When to sample audio from DMic2.
["on_clkedge", "between_clkedge"]
- dlg,dmic2-clkrate-hz : DMic2 clock frequency (Hz).
[<1500000>, <3000000>]
- dlg,hp-diff-single-supply : Boolean flag, use single supply for HP
(DA7217 only)
======
Optional Child node - 'da7218_hpldet' (DA7218 only):
Optional properties:
- dlg,jack-rate-us : Time between jack detect measurements (us)
[<5>, <10>, <20>, <40>, <80>, <160>, <320>, <640>]
- dlg,jack-debounce : Number of debounce measurements taken for jack detect
[<0>, <2>, <3>, <4>]
- dlg,jack-threshold-pct : Threshold level for jack detection (% of VDD)
[<84>, <88>, <92>, <96>]
- dlg,comp-inv : Boolean flag, invert comparator output
- dlg,hyst : Boolean flag, enable hysteresis
- dlg,discharge : Boolean flag, auto discharge of Mic Bias on jack removal
======
Example:
codec: da7218@1a {
compatible = "dlg,da7218";
reg = <0x1a>;
interrupt-parent = <&gpio6>;
interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
wakeup-source;
VDD-supply = <&reg_audio>;
VDDMIC-supply = <&reg_audio>;
VDDIO-supply = <&reg_audio>;
clocks = <&clks 201>;
clock-names = "mclk";
dlg,micbias1-lvl-millivolt = <2600>;
dlg,micbias2-lvl-millivolt = <2600>;
dlg,mic1-amp-in-sel = "diff";
dlg,mic2-amp-in-sel = "diff";
dlg,dmic1-data-sel = "lrise_rfall";
dlg,dmic1-samplephase = "on_clkedge";
dlg,dmic1-clkrate-hz = <3000000>;
dlg,dmic2-data-sel = "lrise_rfall";
dlg,dmic2-samplephase = "on_clkedge";
dlg,dmic2-clkrate-hz = <3000000>;
da7218_hpldet {
dlg,jack-rate-us = <40>;
dlg,jack-debounce = <2>;
dlg,jack-threshold-pct = <84>;
dlg,hyst;
};
};
...@@ -28,13 +28,15 @@ Optional properties: ...@@ -28,13 +28,15 @@ Optional properties:
- clocks : phandle and clock specifier for codec MCLK. - clocks : phandle and clock specifier for codec MCLK.
- clock-names : Clock name string for 'clocks' attribute, should be "mclk". - clock-names : Clock name string for 'clocks' attribute, should be "mclk".
- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
[<1050>, <1100>, <1200>, <1400>]
- dlg,micbias-lvl : Voltage (mV) for Mic Bias - dlg,micbias-lvl : Voltage (mV) for Mic Bias
[<1800>, <2000>, <2200>, <2400>, <2600>] [<1600>, <1800>, <2000>, <2200>, <2400>, <2600>]
- dlg,mic-amp-in-sel : Mic input source type - dlg,mic-amp-in-sel : Mic input source type
["diff", "se_p", "se_n"] ["diff", "se_p", "se_n"]
Deprecated properties:
- dlg,ldo-lvl : Required internal LDO voltage (mV) level for digital engine
(LDO unavailable in production HW so property no longer required).
====== ======
Child node - 'da7219_aad': Child node - 'da7219_aad':
......
...@@ -25,6 +25,11 @@ Required properties: ...@@ -25,6 +25,11 @@ Required properties:
"mem" Peripheral access clock to access registers. "mem" Peripheral access clock to access registers.
"ipg" Peripheral clock to driver module. "ipg" Peripheral clock to driver module.
"asrck_<0-f>" Clock sources for input and output clock. "asrck_<0-f>" Clock sources for input and output clock.
"spba" The spba clock is required when ASRC is placed as a
bus slave of the Shared Peripheral Bus and when two
or more bus masters (CPU, DMA or DSP) try to access
it. This property is optional depending on the SoC
design.
- big-endian : If this property is absent, the little endian mode - big-endian : If this property is absent, the little endian mode
will be in use as default. Otherwise, the big endian will be in use as default. Otherwise, the big endian
......
...@@ -27,6 +27,11 @@ Required properties: ...@@ -27,6 +27,11 @@ Required properties:
derive HCK, SCK and FS. derive HCK, SCK and FS.
"fsys" The system clock derived from ahb clock used to "fsys" The system clock derived from ahb clock used to
derive HCK, SCK and FS. derive HCK, SCK and FS.
"spba" The spba clock is required when ESAI is placed as a
bus slave of the Shared Peripheral Bus and when two
or more bus masters (CPU, DMA or DSP) try to access
it. This property is optional depending on the SoC
design.
- fsl,fifo-depth : The number of elements in the transmit and receive - fsl,fifo-depth : The number of elements in the transmit and receive
FIFOs. This number is the maximum allowed value for FIFOs. This number is the maximum allowed value for
......
...@@ -27,6 +27,11 @@ Required properties: ...@@ -27,6 +27,11 @@ Required properties:
Transceiver Clock Diagram" of SoC reference manual. Transceiver Clock Diagram" of SoC reference manual.
It can also be referred to TxClk_Source bit of It can also be referred to TxClk_Source bit of
register SPDIF_STC. register SPDIF_STC.
"spba" The spba clock is required when SPDIF is placed as a
bus slave of the Shared Peripheral Bus and when two
or more bus masters (CPU, DMA or DSP) try to access
it. This property is optional depending on the SoC
design.
- big-endian : If this property is absent, the native endian mode - big-endian : If this property is absent, the native endian mode
will be in use as default, or the big endian mode will be in use as default, or the big endian mode
......
Imagination Technologies I2S Input Controller
Required Properties:
- compatible : Compatible list, must contain "img,i2s-in"
- #sound-dai-cells : Must be equal to 0
- reg : Offset and length of the register set for the device
- clocks : Contains an entry for each entry in clock-names
- clock-names : Must include the following entry:
"sys" The system clock
- dmas: Contains an entry for each entry in dma-names.
- dma-names: Must include the following entry:
"rx" Single DMA channel used by all active I2S channels
- img,i2s-channels : Number of I2S channels instantiated in the I2S in block
Optional Properties:
- interrupts : Contains the I2S in interrupts. Depending on
the configuration, there may be no interrupts, one interrupt,
or an interrupt per I2S channel. For the case where there is
one interrupt per channel, the interrupts should be listed
in ascending channel order
- resets: Contains a phandle to the I2S in reset signal
- reset-names: Contains the reset signal name "rst"
Example:
i2s_in: i2s-in@18100800 {
compatible = "img,i2s-in";
reg = <0x18100800 0x200>;
interrupts = <GIC_SHARED 7 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&mdc 30 0xffffffff 0>;
dma-names = "rx";
clocks = <&cr_periph SYS_CLK_I2S_IN>;
clock-names = "sys";
img,i2s-channels = <6>;
#sound-dai-cells = <0>;
};
Imagination Technologies I2S Output Controller
Required Properties:
- compatible : Compatible list, must contain "img,i2s-out"
- #sound-dai-cells : Must be equal to 0
- reg : Offset and length of the register set for the device
- clocks : Contains an entry for each entry in clock-names
- clock-names : Must include the following entries:
"sys" The system clock
"ref" The reference clock
- dmas: Contains an entry for each entry in dma-names.
- dma-names: Must include the following entry:
"tx" Single DMA channel used by all active I2S channels
- img,i2s-channels : Number of I2S channels instantiated in the I2S out block
- resets: Contains a phandle to the I2S out reset signal
- reset-names: Contains the reset signal name "rst"
Optional Properties:
- interrupts : Contains the I2S out interrupts. Depending on
the configuration, there may be no interrupts, one interrupt,
or an interrupt per I2S channel. For the case where there is
one interrupt per channel, the interrupts should be listed
in ascending channel order
Example:
i2s_out: i2s-out@18100A00 {
compatible = "img,i2s-out";
reg = <0x18100A00 0x200>;
interrupts = <GIC_SHARED 13 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&mdc 23 0xffffffff 0>;
dma-names = "tx";
clocks = <&cr_periph SYS_CLK_I2S_OUT>,
<&clk_core CLK_I2S>;
clock-names = "sys", "ref";
img,i2s-channels = <6>;
resets = <&pistachio_reset PISTACHIO_RESET_I2S_OUT>;
reset-names = "rst";
#sound-dai-cells = <0>;
};
Imagination Technologies Parallel Output Controller
Required Properties:
- compatible : Compatible list, must contain "img,parallel-out".
- #sound-dai-cells : Must be equal to 0
- reg : Offset and length of the register set for the device.
- dmas: Contains an entry for each entry in dma-names.
- dma-names: Must include the following entry:
"tx"
- clocks : Contains an entry for each entry in clock-names.
- clock-names : Includes the following entries:
"sys" The system clock
"ref" The reference clock
- resets: Contains a phandle to the parallel out reset signal
- reset-names: Contains the reset signal name "rst"
Optional Properties:
- interrupts : Contains the parallel out interrupt, if present
Example:
parallel_out: parallel-out@18100C00 {
compatible = "img,parallel-out";
reg = <0x18100C00 0x100>;
interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&mdc 16 0xffffffff 0>;
dma-names = "tx";
clocks = <&cr_periph SYS_CLK_PAUD_OUT>,
<&clk_core CLK_AUDIO_DAC>;
clock-names = "sys", "ref";
resets = <&pistachio_reset PISTACHIO_RESET_PRL_OUT>;
reset-names = "rst";
#sound-dai-cells = <0>;
};
Pistachio internal DAC DT bindings
Required properties:
- compatible: "img,pistachio-internal-dac"
- img,cr-top : Must contain a phandle to the top level control syscon
node which contains the internal dac control registers
- VDD-supply : Digital power supply regulator (+1.8V or +3.3V)
Examples:
internal_dac: internal-dac {
compatible = "img,pistachio-internal-dac";
img,cr-top = <&cr_top>;
VDD-supply = <&supply3v3>;
};
Imagination Technologies SPDIF Input Controller
Required Properties:
- compatible : Compatible list, must contain "img,spdif-in"
- #sound-dai-cells : Must be equal to 0
- reg : Offset and length of the register set for the device
- dmas: Contains an entry for each entry in dma-names.
- dma-names: Must include the following entry:
"rx"
- clocks : Contains an entry for each entry in clock-names
- clock-names : Includes the following entries:
"sys" The system clock
Optional Properties:
- resets: Should contain a phandle to the spdif in reset signal, if any
- reset-names: Should contain the reset signal name "rst", if a
reset phandle is given
- interrupts : Contains the spdif in interrupt, if present
Example:
spdif_in: spdif-in@18100E00 {
compatible = "img,spdif-in";
reg = <0x18100E00 0x100>;
interrupts = <GIC_SHARED 20 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&mdc 15 0xffffffff 0>;
dma-names = "rx";
clocks = <&cr_periph SYS_CLK_SPDIF_IN>;
clock-names = "sys";
#sound-dai-cells = <0>;
};
Imagination Technologies SPDIF Output Controller
Required Properties:
- compatible : Compatible list, must contain "img,spdif-out"
- #sound-dai-cells : Must be equal to 0
- reg : Offset and length of the register set for the device
- dmas: Contains an entry for each entry in dma-names.
- dma-names: Must include the following entry:
"tx"
- clocks : Contains an entry for each entry in clock-names.
- clock-names : Includes the following entries:
"sys" The system clock
"ref" The reference clock
- resets: Contains a phandle to the spdif out reset signal
- reset-names: Contains the reset signal name "rst"
Optional Properties:
- interrupts : Contains the parallel out interrupt, if present
Example:
spdif_out: spdif-out@18100D00 {
compatible = "img,spdif-out";
reg = <0x18100D00 0x100>;
interrupts = <GIC_SHARED 21 IRQ_TYPE_LEVEL_HIGH>;
dmas = <&mdc 14 0xffffffff 0>;
dma-names = "tx";
clocks = <&cr_periph SYS_CLK_SPDIF_OUT>,
<&clk_core CLK_SPDIF>;
clock-names = "sys", "ref";
resets = <&pistachio_reset PISTACHIO_RESET_SPDIF_OUT>;
reset-names = "rst";
#sound-dai-cells = <0>;
};
Inno audio codec for RK3036
Inno audio codec is integrated inside RK3036 SoC.
Required properties:
- compatible : Should be "rockchip,rk3036-codec".
- reg : The registers of codec.
- clock-names : Should be "acodec_pclk".
- clocks : The clock of codec.
- rockchip,grf : The phandle of grf device node.
Example:
acodec: acodec-ana@20030000 {
compatible = "rk3036-codec";
reg = <0x20030000 0x4000>;
rockchip,grf = <&grf>;
clock-names = "acodec_pclk";
clocks = <&cru ACLK_VCODEC>;
};
...@@ -7,8 +7,11 @@ Required properties: ...@@ -7,8 +7,11 @@ Required properties:
"renesas,rcar_sound-gen3" if generation3 "renesas,rcar_sound-gen3" if generation3
Examples with soctypes are: Examples with soctypes are:
- "renesas,rcar_sound-r8a7778" (R-Car M1A) - "renesas,rcar_sound-r8a7778" (R-Car M1A)
- "renesas,rcar_sound-r8a7779" (R-Car H1)
- "renesas,rcar_sound-r8a7790" (R-Car H2) - "renesas,rcar_sound-r8a7790" (R-Car H2)
- "renesas,rcar_sound-r8a7791" (R-Car M2-W) - "renesas,rcar_sound-r8a7791" (R-Car M2-W)
- "renesas,rcar_sound-r8a7793" (R-Car M2-N)
- "renesas,rcar_sound-r8a7794" (R-Car E2)
- "renesas,rcar_sound-r8a7795" (R-Car H3) - "renesas,rcar_sound-r8a7795" (R-Car H3)
- reg : Should contain the register physical address. - reg : Should contain the register physical address.
required register is required register is
...@@ -34,6 +37,8 @@ Required properties: ...@@ -34,6 +37,8 @@ Required properties:
see below for detail. see below for detail.
- #sound-dai-cells : it must be 0 if your system is using single DAI - #sound-dai-cells : it must be 0 if your system is using single DAI
it must be 1 if your system is using multi DAI it must be 1 if your system is using multi DAI
Optional properties:
- #clock-cells : it must be 0 if your system has audio_clkout - #clock-cells : it must be 0 if your system has audio_clkout
it must be 1 if your system has audio_clkout0/1/2/3 it must be 1 if your system has audio_clkout0/1/2/3
- clock-frequency : for all audio_clkout0/1/2/3 - clock-frequency : for all audio_clkout0/1/2/3
...@@ -244,3 +249,80 @@ rcar_sound: sound@ec500000 { ...@@ -244,3 +249,80 @@ rcar_sound: sound@ec500000 {
}; };
}; };
}; };
Example: simple sound card
rsnd_ak4643: sound {
compatible = "simple-audio-card";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&ak4643>;
clocks = <&audio_clock>;
};
};
&rcar_sound {
pinctrl-0 = <&sound_pins &sound_clk_pins>;
pinctrl-names = "default";
/* Single DAI */
#sound-dai-cells = <0>;
status = "okay";
rcar_sound,dai {
dai0 {
playback = <&ssi0 &src2 &dvc0>;
capture = <&ssi1 &src3 &dvc1>;
};
};
};
&ssi1 {
shared-pin;
};
Example: simple sound card for TDM
rsnd_tdm: sound {
compatible = "simple-audio-card";
simple-audio-card,format = "left_j";
simple-audio-card,bitclock-master = <&sndcodec>;
simple-audio-card,frame-master = <&sndcodec>;
sndcpu: simple-audio-card,cpu {
sound-dai = <&rcar_sound>;
dai-tdm-slot-num = <6>;
};
sndcodec: simple-audio-card,codec {
sound-dai = <&xxx>;
};
};
Example: simple sound card for Multi channel
&rcar_sound {
pinctrl-0 = <&sound_pins &sound_clk_pins>;
pinctrl-names = "default";
/* Single DAI */
#sound-dai-cells = <0>;
status = "okay";
rcar_sound,dai {
dai0 {
playback = <&ssi0 &ssi1 &ssi2 &src0 &dvc0>;
};
};
};
...@@ -4,8 +4,8 @@ Renesas Sampling Rate Convert Sound Card specifies audio DAI connections of SoC ...@@ -4,8 +4,8 @@ Renesas Sampling Rate Convert Sound Card specifies audio DAI connections of SoC
Required properties: Required properties:
- compatible : "renesas,rsrc-card,<board>" - compatible : "renesas,rsrc-card{,<board>}"
Examples with soctypes are: Examples with boards are:
- "renesas,rsrc-card" - "renesas,rsrc-card"
- "renesas,rsrc-card,lager" - "renesas,rsrc-card,lager"
- "renesas,rsrc-card,koelsch" - "renesas,rsrc-card,koelsch"
......
...@@ -19,6 +19,7 @@ Required properties: ...@@ -19,6 +19,7 @@ Required properties:
- clock-names: should contain followings: - clock-names: should contain followings:
- "i2s_hclk": clock for I2S BUS - "i2s_hclk": clock for I2S BUS
- "i2s_clk" : clock for I2S controller - "i2s_clk" : clock for I2S controller
- rockchip,playback-channels: max playback channels, if not set, 8 channels default.
- rockchip,capture-channels: max capture channels, if not set, 2 channels default. - rockchip,capture-channels: max capture channels, if not set, 2 channels default.
Example for rk3288 I2S controller: Example for rk3288 I2S controller:
...@@ -31,5 +32,6 @@ i2s@ff890000 { ...@@ -31,5 +32,6 @@ i2s@ff890000 {
dma-names = "tx", "rx"; dma-names = "tx", "rx";
clock-names = "i2s_hclk", "i2s_clk"; clock-names = "i2s_hclk", "i2s_clk";
clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>; clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
rockchip,playback-channels = <8>;
rockchip,capture-channels = <2>; rockchip,capture-channels = <2>;
}; };
RT5616 audio CODEC
This device supports I2C only.
Required properties:
- compatible : "realtek,rt5616".
- reg : The I2C address of the device.
Pins on the device (for linking into audio routes) for RT5616:
* IN1P
* IN2P
* IN2N
* LOUTL
* LOUTR
* HPOL
* HPOR
Example:
codec: rt5616@1b {
compatible = "realtek,rt5616";
reg = <0x1b>;
};
RT5659/RT5658 audio CODEC
This device supports I2C only.
Required properties:
- compatible : One of "realtek,rt5659" or "realtek,rt5658".
- reg : The I2C address of the device.
- interrupts : The CODEC's interrupt output.
Optional properties:
- realtek,in1-differential
- realtek,in3-differential
- realtek,in4-differential
Boolean. Indicate MIC1/3/4 input are differential, rather than single-ended.
- realtek,dmic1-data-pin
0: dmic1 is not used
1: using IN2N pin as dmic1 data pin
2: using GPIO5 pin as dmic1 data pin
3: using GPIO9 pin as dmic1 data pin
4: using GPIO11 pin as dmic1 data pin
- realtek,dmic2-data-pin
0: dmic2 is not used
1: using IN2P pin as dmic2 data pin
2: using GPIO6 pin as dmic2 data pin
3: using GPIO10 pin as dmic2 data pin
4: using GPIO12 pin as dmic2 data pin
- realtek,jd-src
0: No JD is used
1: using JD3 as JD source
- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.
- realtek,reset-gpios : The GPIO that controls the CODEC's RESET pin.
Pins on the device (for linking into audio routes) for RT5659/RT5658:
* DMIC L1
* DMIC R1
* DMIC L2
* DMIC R2
* IN1P
* IN1N
* IN2P
* IN2N
* IN3P
* IN3N
* IN4P
* IN4N
* HPOL
* HPOR
* SPOL
* SPOR
* LOUTL
* LOUTR
* MONOOUT
* PDML
* PDMR
* SPDIF
Example:
rt5659 {
compatible = "realtek,rt5659";
reg = <0x1b>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>;
realtek,ldo1-en-gpios =
<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
};
...@@ -18,7 +18,7 @@ Required properties: ...@@ -18,7 +18,7 @@ Required properties:
Optional properties: Optional properties:
- realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin. - realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin.
- realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin. - realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin. Active low.
- realtek,in1-differential - realtek,in1-differential
- realtek,in2-differential - realtek,in2-differential
......
...@@ -14,6 +14,9 @@ Required properties: ...@@ -14,6 +14,9 @@ Required properties:
- "apb": the parent APB clock for this controller - "apb": the parent APB clock for this controller
- "codec": the parent module clock - "codec": the parent module clock
Optional properties:
- allwinner,pa-gpios: gpio to enable external amplifier
Example: Example:
codec: codec@01c22c00 { codec: codec@01c22c00 {
#sound-dai-cells = <0>; #sound-dai-cells = <0>;
......
Texas Instruments pcm3168a DT bindings
This driver supports both SPI and I2C bus access for this codec
Required properties:
- compatible: "ti,pcm3168a"
- clocks : Contains an entry for each entry in clock-names
- clock-names : Includes the following entries:
"scki" The system clock
- VDD1-supply : Digital power supply regulator 1 (+3.3V)
- VDD2-supply : Digital power supply regulator 2 (+3.3V)
- VCCAD1-supply : ADC power supply regulator 1 (+5V)
- VCCAD2-supply : ADC power supply regulator 2 (+5V)
- VCCDA1-supply : DAC power supply regulator 1 (+5V)
- VCCDA2-supply : DAC power supply regulator 2 (+5V)
For required properties on SPI/I2C, consult SPI/I2C device tree documentation
Examples:
i2c0: i2c0@0 {
...
pcm3168a: audio-codec@44 {
compatible = "ti,pcm3168a";
reg = <0x44>;
clocks = <&clk_core CLK_AUDIO>;
clock-names = "scki";
VDD1-supply = <&supply3v3>;
VDD2-supply = <&supply3v3>;
VCCAD1-supply = <&supply5v0>;
VCCAD2-supply = <&supply5v0>;
VCCDA1-supply = <&supply5v0>;
VCCDA2-supply = <&supply5v0>;
pinctrl-names = "default";
pinctrl-0 = <&dac_clk_pin>;
};
};
WM8974 audio CODEC
This device supports both I2C and SPI (configured with pin strapping
on the board).
Required properties:
- compatible: "wlf,wm8974"
- reg: the I2C address or SPI chip select number of the device
Examples:
codec: wm8974@1a {
compatible = "wlf,wm8974";
reg = <0x1a>;
};
The Imagination Technologies SPDIF Input controller contains the following
controls:
name='IEC958 Capture Mask',index=0
This control returns a mask that shows which of the IEC958 status bits
can be read using the 'IEC958 Capture Default' control.
name='IEC958 Capture Default',index=0
This control returns the status bits contained within the SPDIF stream that
is being received. The 'IEC958 Capture Mask' shows which bits can be read
from this control.
name='SPDIF In Multi Frequency Acquire',index=0
name='SPDIF In Multi Frequency Acquire',index=1
name='SPDIF In Multi Frequency Acquire',index=2
name='SPDIF In Multi Frequency Acquire',index=3
This control is used to attempt acquisition of up to four different sample
rates. The active rate can be obtained by reading the 'SPDIF In Lock Frequency'
control.
When the value of this control is set to {0,0,0,0}, the rate given to hw_params
will determine the single rate the block will capture. Else, the rate given to
hw_params will be ignored, and the block will attempt capture for each of the
four sample rates set here.
If less than four rates are required, the same rate can be specified more than
once
name='SPDIF In Lock Frequency',index=0
This control returns the active capture rate, or 0 if a lock has not been
acquired
name='SPDIF In Lock TRK',index=0
This control is used to modify the locking/jitter rejection characteristics
of the block. Larger values increase the locking range, but reduce jitter
rejection.
name='SPDIF In Lock Acquire Threshold',index=0
This control is used to change the threshold at which a lock is acquired.
name='SPDIF In Lock Release Threshold',index=0
This control is used to change the threshold at which a lock is released.
...@@ -54,12 +54,13 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev) ...@@ -54,12 +54,13 @@ static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
static struct resource s3c64xx_iis0_resource[] = { static struct resource s3c64xx_iis0_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IIS0, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS0, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_I2S0_OUT),
[2] = DEFINE_RES_DMA(DMACH_I2S0_IN),
}; };
static struct s3c_audio_pdata i2sv3_pdata = { static struct s3c_audio_pdata i2s0_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio, .cfg_gpio = s3c64xx_i2s_cfg_gpio,
.dma_filter = pl08x_filter_id,
.dma_playback = DMACH_I2S0_OUT,
.dma_capture = DMACH_I2S0_IN,
}; };
struct platform_device s3c64xx_device_iis0 = { struct platform_device s3c64xx_device_iis0 = {
...@@ -68,15 +69,20 @@ struct platform_device s3c64xx_device_iis0 = { ...@@ -68,15 +69,20 @@ struct platform_device s3c64xx_device_iis0 = {
.num_resources = ARRAY_SIZE(s3c64xx_iis0_resource), .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
.resource = s3c64xx_iis0_resource, .resource = s3c64xx_iis0_resource,
.dev = { .dev = {
.platform_data = &i2sv3_pdata, .platform_data = &i2s0_pdata,
}, },
}; };
EXPORT_SYMBOL(s3c64xx_device_iis0); EXPORT_SYMBOL(s3c64xx_device_iis0);
static struct resource s3c64xx_iis1_resource[] = { static struct resource s3c64xx_iis1_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IIS1, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_IIS1, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_I2S1_OUT), };
[2] = DEFINE_RES_DMA(DMACH_I2S1_IN),
static struct s3c_audio_pdata i2s1_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio,
.dma_filter = pl08x_filter_id,
.dma_playback = DMACH_I2S1_OUT,
.dma_capture = DMACH_I2S1_IN,
}; };
struct platform_device s3c64xx_device_iis1 = { struct platform_device s3c64xx_device_iis1 = {
...@@ -85,19 +91,20 @@ struct platform_device s3c64xx_device_iis1 = { ...@@ -85,19 +91,20 @@ struct platform_device s3c64xx_device_iis1 = {
.num_resources = ARRAY_SIZE(s3c64xx_iis1_resource), .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
.resource = s3c64xx_iis1_resource, .resource = s3c64xx_iis1_resource,
.dev = { .dev = {
.platform_data = &i2sv3_pdata, .platform_data = &i2s1_pdata,
}, },
}; };
EXPORT_SYMBOL(s3c64xx_device_iis1); EXPORT_SYMBOL(s3c64xx_device_iis1);
static struct resource s3c64xx_iisv4_resource[] = { static struct resource s3c64xx_iisv4_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_IISV4, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_IISV4, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_TX),
[2] = DEFINE_RES_DMA(DMACH_HSI_I2SV40_RX),
}; };
static struct s3c_audio_pdata i2sv4_pdata = { static struct s3c_audio_pdata i2sv4_pdata = {
.cfg_gpio = s3c64xx_i2s_cfg_gpio, .cfg_gpio = s3c64xx_i2s_cfg_gpio,
.dma_filter = pl08x_filter_id,
.dma_playback = DMACH_HSI_I2SV40_TX,
.dma_capture = DMACH_HSI_I2SV40_RX,
.type = { .type = {
.i2s = { .i2s = {
.quirks = QUIRK_PRI_6CHAN, .quirks = QUIRK_PRI_6CHAN,
...@@ -142,12 +149,13 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev) ...@@ -142,12 +149,13 @@ static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
static struct resource s3c64xx_pcm0_resource[] = { static struct resource s3c64xx_pcm0_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_PCM0, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_PCM0, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_PCM0_TX),
[2] = DEFINE_RES_DMA(DMACH_PCM0_RX),
}; };
static struct s3c_audio_pdata s3c_pcm0_pdata = { static struct s3c_audio_pdata s3c_pcm0_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio, .cfg_gpio = s3c64xx_pcm_cfg_gpio,
.dma_filter = pl08x_filter_id,
.dma_capture = DMACH_PCM0_RX,
.dma_playback = DMACH_PCM0_TX,
}; };
struct platform_device s3c64xx_device_pcm0 = { struct platform_device s3c64xx_device_pcm0 = {
...@@ -163,12 +171,13 @@ EXPORT_SYMBOL(s3c64xx_device_pcm0); ...@@ -163,12 +171,13 @@ EXPORT_SYMBOL(s3c64xx_device_pcm0);
static struct resource s3c64xx_pcm1_resource[] = { static struct resource s3c64xx_pcm1_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_PCM1, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_PCM1, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_PCM1_TX),
[2] = DEFINE_RES_DMA(DMACH_PCM1_RX),
}; };
static struct s3c_audio_pdata s3c_pcm1_pdata = { static struct s3c_audio_pdata s3c_pcm1_pdata = {
.cfg_gpio = s3c64xx_pcm_cfg_gpio, .cfg_gpio = s3c64xx_pcm_cfg_gpio,
.dma_filter = pl08x_filter_id,
.dma_playback = DMACH_PCM1_TX,
.dma_capture = DMACH_PCM1_RX,
}; };
struct platform_device s3c64xx_device_pcm1 = { struct platform_device s3c64xx_device_pcm1 = {
...@@ -196,13 +205,15 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev) ...@@ -196,13 +205,15 @@ static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev)
static struct resource s3c64xx_ac97_resource[] = { static struct resource s3c64xx_ac97_resource[] = {
[0] = DEFINE_RES_MEM(S3C64XX_PA_AC97, SZ_256), [0] = DEFINE_RES_MEM(S3C64XX_PA_AC97, SZ_256),
[1] = DEFINE_RES_DMA(DMACH_AC97_PCMOUT), [1] = DEFINE_RES_IRQ(IRQ_AC97),
[2] = DEFINE_RES_DMA(DMACH_AC97_PCMIN),
[3] = DEFINE_RES_DMA(DMACH_AC97_MICIN),
[4] = DEFINE_RES_IRQ(IRQ_AC97),
}; };
static struct s3c_audio_pdata s3c_ac97_pdata; static struct s3c_audio_pdata s3c_ac97_pdata = {
.dma_playback = DMACH_AC97_PCMOUT,
.dma_filter = pl08x_filter_id,
.dma_capture = DMACH_AC97_PCMIN,
.dma_capture_mic = DMACH_AC97_MICIN,
};
static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32); static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
......
...@@ -14,38 +14,38 @@ ...@@ -14,38 +14,38 @@
#define S3C64XX_DMA_CHAN(name) ((unsigned long)(name)) #define S3C64XX_DMA_CHAN(name) ((unsigned long)(name))
/* DMA0/SDMA0 */ /* DMA0/SDMA0 */
#define DMACH_UART0 S3C64XX_DMA_CHAN("uart0_tx") #define DMACH_UART0 "uart0_tx"
#define DMACH_UART0_SRC2 S3C64XX_DMA_CHAN("uart0_rx") #define DMACH_UART0_SRC2 "uart0_rx"
#define DMACH_UART1 S3C64XX_DMA_CHAN("uart1_tx") #define DMACH_UART1 "uart1_tx"
#define DMACH_UART1_SRC2 S3C64XX_DMA_CHAN("uart1_rx") #define DMACH_UART1_SRC2 "uart1_rx"
#define DMACH_UART2 S3C64XX_DMA_CHAN("uart2_tx") #define DMACH_UART2 "uart2_tx"
#define DMACH_UART2_SRC2 S3C64XX_DMA_CHAN("uart2_rx") #define DMACH_UART2_SRC2 "uart2_rx"
#define DMACH_UART3 S3C64XX_DMA_CHAN("uart3_tx") #define DMACH_UART3 "uart3_tx"
#define DMACH_UART3_SRC2 S3C64XX_DMA_CHAN("uart3_rx") #define DMACH_UART3_SRC2 "uart3_rx"
#define DMACH_PCM0_TX S3C64XX_DMA_CHAN("pcm0_tx") #define DMACH_PCM0_TX "pcm0_tx"
#define DMACH_PCM0_RX S3C64XX_DMA_CHAN("pcm0_rx") #define DMACH_PCM0_RX "pcm0_rx"
#define DMACH_I2S0_OUT S3C64XX_DMA_CHAN("i2s0_tx") #define DMACH_I2S0_OUT "i2s0_tx"
#define DMACH_I2S0_IN S3C64XX_DMA_CHAN("i2s0_rx") #define DMACH_I2S0_IN "i2s0_rx"
#define DMACH_SPI0_TX S3C64XX_DMA_CHAN("spi0_tx") #define DMACH_SPI0_TX S3C64XX_DMA_CHAN("spi0_tx")
#define DMACH_SPI0_RX S3C64XX_DMA_CHAN("spi0_rx") #define DMACH_SPI0_RX S3C64XX_DMA_CHAN("spi0_rx")
#define DMACH_HSI_I2SV40_TX S3C64XX_DMA_CHAN("i2s2_tx") #define DMACH_HSI_I2SV40_TX "i2s2_tx"
#define DMACH_HSI_I2SV40_RX S3C64XX_DMA_CHAN("i2s2_rx") #define DMACH_HSI_I2SV40_RX "i2s2_rx"
/* DMA1/SDMA1 */ /* DMA1/SDMA1 */
#define DMACH_PCM1_TX S3C64XX_DMA_CHAN("pcm1_tx") #define DMACH_PCM1_TX "pcm1_tx"
#define DMACH_PCM1_RX S3C64XX_DMA_CHAN("pcm1_rx") #define DMACH_PCM1_RX "pcm1_rx"
#define DMACH_I2S1_OUT S3C64XX_DMA_CHAN("i2s1_tx") #define DMACH_I2S1_OUT "i2s1_tx"
#define DMACH_I2S1_IN S3C64XX_DMA_CHAN("i2s1_rx") #define DMACH_I2S1_IN "i2s1_rx"
#define DMACH_SPI1_TX S3C64XX_DMA_CHAN("spi1_tx") #define DMACH_SPI1_TX S3C64XX_DMA_CHAN("spi1_tx")
#define DMACH_SPI1_RX S3C64XX_DMA_CHAN("spi1_rx") #define DMACH_SPI1_RX S3C64XX_DMA_CHAN("spi1_rx")
#define DMACH_AC97_PCMOUT S3C64XX_DMA_CHAN("ac97_out") #define DMACH_AC97_PCMOUT "ac97_out"
#define DMACH_AC97_PCMIN S3C64XX_DMA_CHAN("ac97_in") #define DMACH_AC97_PCMIN "ac97_in"
#define DMACH_AC97_MICIN S3C64XX_DMA_CHAN("ac97_mic") #define DMACH_AC97_MICIN "ac97_mic"
#define DMACH_PWM S3C64XX_DMA_CHAN("pwm") #define DMACH_PWM "pwm"
#define DMACH_IRDA S3C64XX_DMA_CHAN("irda") #define DMACH_IRDA "irda"
#define DMACH_EXTERNAL S3C64XX_DMA_CHAN("external") #define DMACH_EXTERNAL "external"
#define DMACH_SECURITY_RX S3C64XX_DMA_CHAN("sec_rx") #define DMACH_SECURITY_RX "sec_rx"
#define DMACH_SECURITY_TX S3C64XX_DMA_CHAN("sec_tx") #define DMACH_SECURITY_TX "sec_tx"
enum dma_ch { enum dma_ch {
DMACH_MAX = 32 DMACH_MAX = 32
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
#include <linux/platform_data/usb-ohci-s3c2410.h> #include <linux/platform_data/usb-ohci-s3c2410.h>
#include <plat/usb-phy.h> #include <plat/usb-phy.h>
#include <plat/regs-spi.h> #include <plat/regs-spi.h>
#include <linux/platform_data/asoc-s3c.h>
#include <linux/platform_data/spi-s3c64xx.h> #include <linux/platform_data/spi-s3c64xx.h>
static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
...@@ -74,9 +75,15 @@ static u64 samsung_device_dma_mask = DMA_BIT_MASK(32); ...@@ -74,9 +75,15 @@ static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
static struct resource s3c_ac97_resource[] = { static struct resource s3c_ac97_resource[] = {
[0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97), [0] = DEFINE_RES_MEM(S3C2440_PA_AC97, S3C2440_SZ_AC97),
[1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97), [1] = DEFINE_RES_IRQ(IRQ_S3C244X_AC97),
[2] = DEFINE_RES_DMA_NAMED(DMACH_PCM_OUT, "PCM out"), };
[3] = DEFINE_RES_DMA_NAMED(DMACH_PCM_IN, "PCM in"),
[4] = DEFINE_RES_DMA_NAMED(DMACH_MIC_IN, "Mic in"), static struct s3c_audio_pdata s3c_ac97_pdata = {
#ifdef CONFIG_S3C24XX_DMAC
.dma_filter = s3c24xx_dma_filter,
#endif
.dma_playback = (void *)DMACH_PCM_OUT,
.dma_capture = (void *)DMACH_PCM_IN,
.dma_capture_mic = (void *)DMACH_MIC_IN,
}; };
struct platform_device s3c_device_ac97 = { struct platform_device s3c_device_ac97 = {
...@@ -87,6 +94,7 @@ struct platform_device s3c_device_ac97 = { ...@@ -87,6 +94,7 @@ struct platform_device s3c_device_ac97 = {
.dev = { .dev = {
.dma_mask = &samsung_device_dma_mask, .dma_mask = &samsung_device_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32), .coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &s3c_ac97_pdata,
} }
}; };
#endif /* CONFIG_CPU_S3C2440 */ #endif /* CONFIG_CPU_S3C2440 */
...@@ -566,6 +574,14 @@ static struct resource s3c_iis_resource[] = { ...@@ -566,6 +574,14 @@ static struct resource s3c_iis_resource[] = {
[0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS), [0] = DEFINE_RES_MEM(S3C24XX_PA_IIS, S3C24XX_SZ_IIS),
}; };
static struct s3c_audio_pdata s3c_iis_platdata = {
#ifdef CONFIG_S3C24XX_DMAC
.dma_filter = s3c24xx_dma_filter,
#endif
.dma_playback = (void *)DMACH_I2S_OUT,
.dma_capture = (void *)DMACH_I2S_IN,
};
struct platform_device s3c_device_iis = { struct platform_device s3c_device_iis = {
.name = "s3c24xx-iis", .name = "s3c24xx-iis",
.id = -1, .id = -1,
...@@ -574,6 +590,7 @@ struct platform_device s3c_device_iis = { ...@@ -574,6 +590,7 @@ struct platform_device s3c_device_iis = {
.dev = { .dev = {
.dma_mask = &samsung_device_dma_mask, .dma_mask = &samsung_device_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32), .coherent_dma_mask = DMA_BIT_MASK(32),
.platform_data = &s3c_iis_platdata,
} }
}; };
#endif /* CONFIG_PLAT_S3C24XX */ #endif /* CONFIG_PLAT_S3C24XX */
......
...@@ -432,7 +432,7 @@ config STE_DMA40 ...@@ -432,7 +432,7 @@ config STE_DMA40
Support for ST-Ericsson DMA40 controller Support for ST-Ericsson DMA40 controller
config S3C24XX_DMAC config S3C24XX_DMAC
tristate "Samsung S3C24XX DMA support" bool "Samsung S3C24XX DMA support"
depends on ARCH_S3C24XX depends on ARCH_S3C24XX
select DMA_ENGINE select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS select DMA_VIRTUAL_CHANNELS
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
*/ */
#define S3C64XX_AC97_GPD 0 #define S3C64XX_AC97_GPD 0
#define S3C64XX_AC97_GPE 1 #define S3C64XX_AC97_GPE 1
#include <linux/dmaengine.h>
extern void s3c64xx_ac97_setup_gpio(int); extern void s3c64xx_ac97_setup_gpio(int);
struct samsung_i2s { struct samsung_i2s {
...@@ -39,6 +42,11 @@ struct samsung_i2s { ...@@ -39,6 +42,11 @@ struct samsung_i2s {
*/ */
struct s3c_audio_pdata { struct s3c_audio_pdata {
int (*cfg_gpio)(struct platform_device *); int (*cfg_gpio)(struct platform_device *);
dma_filter_fn dma_filter;
void *dma_playback;
void *dma_capture;
void *dma_play_sec;
void *dma_capture_mic;
union { union {
struct samsung_i2s i2s; struct samsung_i2s i2s;
} type; } type;
......
...@@ -417,11 +417,13 @@ ...@@ -417,11 +417,13 @@
#define AC97_RATES_MIC_ADC 4 #define AC97_RATES_MIC_ADC 4
#define AC97_RATES_SPDIF 5 #define AC97_RATES_SPDIF 5
#define AC97_NUM_GPIOS 16
/* /*
* *
*/ */
struct snd_ac97; struct snd_ac97;
struct snd_ac97_gpio_priv;
struct snd_pcm_chmap; struct snd_pcm_chmap;
struct snd_ac97_build_ops { struct snd_ac97_build_ops {
...@@ -529,6 +531,7 @@ struct snd_ac97 { ...@@ -529,6 +531,7 @@ struct snd_ac97 {
struct delayed_work power_work; struct delayed_work power_work;
#endif #endif
struct device dev; struct device dev;
struct snd_ac97_gpio_priv *gpio_priv;
struct snd_pcm_chmap *chmaps[2]; /* channel-maps (optional) */ struct snd_pcm_chmap *chmaps[2]; /* channel-maps (optional) */
}; };
......
/*
* da7218.h - DA7218 ASoC Codec Driver Platform Data
*
* Copyright (c) 2015 Dialog Semiconductor
*
* Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifndef _DA7218_PDATA_H
#define _DA7218_PDATA_H
/* Mic Bias */
enum da7218_micbias_voltage {
DA7218_MICBIAS_1_2V = -1,
DA7218_MICBIAS_1_6V,
DA7218_MICBIAS_1_8V,
DA7218_MICBIAS_2_0V,
DA7218_MICBIAS_2_2V,
DA7218_MICBIAS_2_4V,
DA7218_MICBIAS_2_6V,
DA7218_MICBIAS_2_8V,
DA7218_MICBIAS_3_0V,
};
enum da7218_mic_amp_in_sel {
DA7218_MIC_AMP_IN_SEL_DIFF = 0,
DA7218_MIC_AMP_IN_SEL_SE_P,
DA7218_MIC_AMP_IN_SEL_SE_N,
};
/* DMIC */
enum da7218_dmic_data_sel {
DA7218_DMIC_DATA_LRISE_RFALL = 0,
DA7218_DMIC_DATA_LFALL_RRISE,
};
enum da7218_dmic_samplephase {
DA7218_DMIC_SAMPLE_ON_CLKEDGE = 0,
DA7218_DMIC_SAMPLE_BETWEEN_CLKEDGE,
};
enum da7218_dmic_clk_rate {
DA7218_DMIC_CLK_3_0MHZ = 0,
DA7218_DMIC_CLK_1_5MHZ,
};
/* Headphone Detect */
enum da7218_hpldet_jack_rate {
DA7218_HPLDET_JACK_RATE_5US = 0,
DA7218_HPLDET_JACK_RATE_10US,
DA7218_HPLDET_JACK_RATE_20US,
DA7218_HPLDET_JACK_RATE_40US,
DA7218_HPLDET_JACK_RATE_80US,
DA7218_HPLDET_JACK_RATE_160US,
DA7218_HPLDET_JACK_RATE_320US,
DA7218_HPLDET_JACK_RATE_640US,
};
enum da7218_hpldet_jack_debounce {
DA7218_HPLDET_JACK_DEBOUNCE_OFF = 0,
DA7218_HPLDET_JACK_DEBOUNCE_2,
DA7218_HPLDET_JACK_DEBOUNCE_3,
DA7218_HPLDET_JACK_DEBOUNCE_4,
};
enum da7218_hpldet_jack_thr {
DA7218_HPLDET_JACK_THR_84PCT = 0,
DA7218_HPLDET_JACK_THR_88PCT,
DA7218_HPLDET_JACK_THR_92PCT,
DA7218_HPLDET_JACK_THR_96PCT,
};
struct da7218_hpldet_pdata {
enum da7218_hpldet_jack_rate jack_rate;
enum da7218_hpldet_jack_debounce jack_debounce;
enum da7218_hpldet_jack_thr jack_thr;
bool comp_inv;
bool hyst;
bool discharge;
};
struct da7218_pdata {
/* Mic */
enum da7218_micbias_voltage micbias1_lvl;
enum da7218_micbias_voltage micbias2_lvl;
enum da7218_mic_amp_in_sel mic1_amp_in_sel;
enum da7218_mic_amp_in_sel mic2_amp_in_sel;
/* DMIC */
enum da7218_dmic_data_sel dmic1_data_sel;
enum da7218_dmic_data_sel dmic2_data_sel;
enum da7218_dmic_samplephase dmic1_samplephase;
enum da7218_dmic_samplephase dmic2_samplephase;
enum da7218_dmic_clk_rate dmic1_clk_rate;
enum da7218_dmic_clk_rate dmic2_clk_rate;
/* HP Diff Supply - DA7217 only */
bool hp_diff_single_supply;
/* HP Detect - DA7218 only */
struct da7218_hpldet_pdata *hpldet_pdata;
};
#endif /* _DA7218_PDATA_H */
...@@ -14,17 +14,10 @@ ...@@ -14,17 +14,10 @@
#ifndef __DA7219_PDATA_H #ifndef __DA7219_PDATA_H
#define __DA7219_PDATA_H #define __DA7219_PDATA_H
/* LDO */
enum da7219_ldo_lvl_sel {
DA7219_LDO_LVL_SEL_1_05V = 0,
DA7219_LDO_LVL_SEL_1_10V,
DA7219_LDO_LVL_SEL_1_20V,
DA7219_LDO_LVL_SEL_1_40V,
};
/* Mic Bias */ /* Mic Bias */
enum da7219_micbias_voltage { enum da7219_micbias_voltage {
DA7219_MICBIAS_1_8V = 1, DA7219_MICBIAS_1_6V = 0,
DA7219_MICBIAS_1_8V,
DA7219_MICBIAS_2_0V, DA7219_MICBIAS_2_0V,
DA7219_MICBIAS_2_2V, DA7219_MICBIAS_2_2V,
DA7219_MICBIAS_2_4V, DA7219_MICBIAS_2_4V,
...@@ -41,9 +34,6 @@ enum da7219_mic_amp_in_sel { ...@@ -41,9 +34,6 @@ enum da7219_mic_amp_in_sel {
struct da7219_aad_pdata; struct da7219_aad_pdata;
struct da7219_pdata { struct da7219_pdata {
/* Internal LDO */
enum da7219_ldo_lvl_sel ldo_lvl_sel;
/* Mic */ /* Mic */
enum da7219_micbias_voltage micbias_lvl; enum da7219_micbias_voltage micbias_lvl;
enum da7219_mic_amp_in_sel mic_amp_in_sel; enum da7219_mic_amp_in_sel mic_amp_in_sel;
......
...@@ -45,6 +45,11 @@ struct i2s_platform_data { ...@@ -45,6 +45,11 @@ struct i2s_platform_data {
u32 snd_fmts; u32 snd_fmts;
u32 snd_rates; u32 snd_rates;
#define DW_I2S_QUIRK_COMP_REG_OFFSET (1 << 0)
unsigned int quirks;
unsigned int i2s_reg_comp1;
unsigned int i2s_reg_comp2;
void *play_dma_data; void *play_dma_data;
void *capture_dma_data; void *capture_dma_data;
bool (*filter)(struct dma_chan *chan, void *slave); bool (*filter)(struct dma_chan *chan, void *slave);
......
/*
* linux/sound/rt5659.h -- Platform data for RT5659
*
* Copyright 2013 Realtek Microelectronics
*
* 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 __LINUX_SND_RT5659_H
#define __LINUX_SND_RT5659_H
enum rt5659_dmic1_data_pin {
RT5659_DMIC1_NULL,
RT5659_DMIC1_DATA_IN2N,
RT5659_DMIC1_DATA_GPIO5,
RT5659_DMIC1_DATA_GPIO9,
RT5659_DMIC1_DATA_GPIO11,
};
enum rt5659_dmic2_data_pin {
RT5659_DMIC2_NULL,
RT5659_DMIC2_DATA_IN2P,
RT5659_DMIC2_DATA_GPIO6,
RT5659_DMIC2_DATA_GPIO10,
RT5659_DMIC2_DATA_GPIO12,
};
enum rt5659_jd_src {
RT5659_JD_NULL,
RT5659_JD3,
};
struct rt5659_platform_data {
bool in1_diff;
bool in3_diff;
bool in4_diff;
int ldo1_en; /* GPIO for LDO1_EN */
int reset; /* GPIO for RESET */
enum rt5659_dmic1_data_pin dmic1_data_pin;
enum rt5659_dmic2_data_pin dmic2_data_pin;
enum rt5659_jd_src jd_src;
};
#endif
...@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops { ...@@ -92,8 +92,10 @@ struct snd_soc_tplg_kcontrol_ops {
/* Bytes ext operations, for TLV byte controls */ /* Bytes ext operations, for TLV byte controls */
struct snd_soc_tplg_bytes_ext_ops { struct snd_soc_tplg_bytes_ext_ops {
u32 id; u32 id;
int (*get)(unsigned int __user *bytes, unsigned int size); int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
int (*put)(const unsigned int __user *bytes, unsigned int size); unsigned int size);
int (*put)(struct snd_kcontrol *kcontrol,
const unsigned int __user *bytes, unsigned int size);
}; };
/* /*
......
...@@ -110,6 +110,14 @@ ...@@ -110,6 +110,14 @@
.put = snd_soc_put_volsw, \ .put = snd_soc_put_volsw, \
.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
max, invert, 0) } max, invert, 0) }
#define SOC_DOUBLE_STS(xname, reg, shift_left, shift_right, max, invert) \
{ \
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
.access = SNDRV_CTL_ELEM_ACCESS_READ | \
SNDRV_CTL_ELEM_ACCESS_VOLATILE, \
.private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
max, invert, 0) }
#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
.info = snd_soc_info_volsw, \ .info = snd_soc_info_volsw, \
...@@ -293,6 +301,9 @@ ...@@ -293,6 +301,9 @@
{.base = xbase, .num_regs = xregs, \ {.base = xbase, .num_regs = xregs, \
.mask = xmask }) } .mask = xmask }) }
/*
* SND_SOC_BYTES_EXT is deprecated, please USE SND_SOC_BYTES_TLV instead
*/
#define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \ #define SND_SOC_BYTES_EXT(xname, xcount, xhandler_get, xhandler_put) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
.info = snd_soc_bytes_info_ext, \ .info = snd_soc_bytes_info_ext, \
...@@ -1037,6 +1048,9 @@ struct snd_soc_dai_link { ...@@ -1037,6 +1048,9 @@ struct snd_soc_dai_link {
/* pmdown_time is ignored at stop */ /* pmdown_time is ignored at stop */
unsigned int ignore_pmdown_time:1; unsigned int ignore_pmdown_time:1;
struct list_head list; /* DAI link list of the soc card */
struct snd_soc_dobj dobj; /* For topology */
}; };
struct snd_soc_codec_conf { struct snd_soc_codec_conf {
...@@ -1101,11 +1115,19 @@ struct snd_soc_card { ...@@ -1101,11 +1115,19 @@ struct snd_soc_card {
struct snd_soc_dapm_context *dapm, struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level); enum snd_soc_bias_level level);
int (*add_dai_link)(struct snd_soc_card *,
struct snd_soc_dai_link *link);
void (*remove_dai_link)(struct snd_soc_card *,
struct snd_soc_dai_link *link);
long pmdown_time; long pmdown_time;
/* CPU <--> Codec DAI links */ /* CPU <--> Codec DAI links */
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link; /* predefined links only */
int num_links; int num_links; /* predefined links only */
struct list_head dai_link_list; /* all links */
int num_dai_links;
struct list_head rtd_list; struct list_head rtd_list;
int num_rtd; int num_rtd;
...@@ -1228,8 +1250,10 @@ struct soc_bytes_ext { ...@@ -1228,8 +1250,10 @@ struct soc_bytes_ext {
struct snd_soc_dobj dobj; struct snd_soc_dobj dobj;
/* used for TLV byte control */ /* used for TLV byte control */
int (*get)(unsigned int __user *bytes, unsigned int size); int (*get)(struct snd_kcontrol *kcontrol, unsigned int __user *bytes,
int (*put)(const unsigned int __user *bytes, unsigned int size); unsigned int size);
int (*put)(struct snd_kcontrol *kcontrol, const unsigned int __user *bytes,
unsigned int size);
}; };
/* multi register control */ /* multi register control */
...@@ -1647,6 +1671,11 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev, ...@@ -1647,6 +1671,11 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev,
struct device_node *of_node, struct device_node *of_node,
struct snd_soc_dai_link *dai_link); struct snd_soc_dai_link *dai_link);
int snd_soc_add_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link);
void snd_soc_remove_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *dai_link);
#include <sound/soc-dai.h> #include <sound/soc-dai.h>
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
...@@ -243,7 +243,7 @@ struct snd_soc_tplg_manifest { ...@@ -243,7 +243,7 @@ struct snd_soc_tplg_manifest {
__le32 control_elems; /* number of control elements */ __le32 control_elems; /* number of control elements */
__le32 widget_elems; /* number of widget elements */ __le32 widget_elems; /* number of widget elements */
__le32 graph_elems; /* number of graph elements */ __le32 graph_elems; /* number of graph elements */
__le32 dai_elems; /* number of DAI elements */ __le32 pcm_elems; /* number of PCM elements */
__le32 dai_link_elems; /* number of DAI link elements */ __le32 dai_link_elems; /* number of DAI link elements */
struct snd_soc_tplg_private priv; struct snd_soc_tplg_private priv;
} __attribute__((packed)); } __attribute__((packed));
......
...@@ -73,7 +73,8 @@ ...@@ -73,7 +73,8 @@
#define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B) #define SND_AUDIOCODEC_IEC61937 ((__u32) 0x0000000B)
#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C) #define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D) #define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_G729 #define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_BESPOKE
/* /*
* Profile and modes are listed with bit masks. This allows for a * Profile and modes are listed with bit masks. This allows for a
...@@ -312,7 +313,7 @@ struct snd_enc_flac { ...@@ -312,7 +313,7 @@ struct snd_enc_flac {
struct snd_enc_generic { struct snd_enc_generic {
__u32 bw; /* encoder bandwidth */ __u32 bw; /* encoder bandwidth */
__s32 reserved[15]; __s32 reserved[15]; /* Can be used for SND_AUDIOCODEC_BESPOKE */
} __attribute__((packed, aligned(4))); } __attribute__((packed, aligned(4)));
union snd_codec_options { union snd_codec_options {
......
...@@ -50,6 +50,7 @@ source "sound/soc/jz4740/Kconfig" ...@@ -50,6 +50,7 @@ source "sound/soc/jz4740/Kconfig"
source "sound/soc/nuc900/Kconfig" source "sound/soc/nuc900/Kconfig"
source "sound/soc/omap/Kconfig" source "sound/soc/omap/Kconfig"
source "sound/soc/kirkwood/Kconfig" source "sound/soc/kirkwood/Kconfig"
source "sound/soc/img/Kconfig"
source "sound/soc/intel/Kconfig" source "sound/soc/intel/Kconfig"
source "sound/soc/mediatek/Kconfig" source "sound/soc/mediatek/Kconfig"
source "sound/soc/mxs/Kconfig" source "sound/soc/mxs/Kconfig"
......
...@@ -27,6 +27,7 @@ obj-$(CONFIG_SND_SOC) += davinci/ ...@@ -27,6 +27,7 @@ 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) += jz4740/ obj-$(CONFIG_SND_SOC) += jz4740/
obj-$(CONFIG_SND_SOC) += img/
obj-$(CONFIG_SND_SOC) += intel/ obj-$(CONFIG_SND_SOC) += intel/
obj-$(CONFIG_SND_SOC) += mediatek/ obj-$(CONFIG_SND_SOC) += mediatek/
obj-$(CONFIG_SND_SOC) += mxs/ obj-$(CONFIG_SND_SOC) += mxs/
......
...@@ -68,4 +68,13 @@ config SND_ATMEL_SOC_CLASSD ...@@ -68,4 +68,13 @@ config SND_ATMEL_SOC_CLASSD
help help
Say Y if you want to add support for Atmel ASoC driver for boards using Say Y if you want to add support for Atmel ASoC driver for boards using
CLASSD. CLASSD.
config SND_ATMEL_SOC_PDMIC
tristate "Atmel ASoC driver for boards using PDMIC"
depends on OF && (ARCH_AT91 || COMPILE_TEST)
select SND_SOC_GENERIC_DMAENGINE_PCM
select REGMAP_MMIO
help
Say Y if you want to add support for Atmel ASoC driver for boards using
PDMIC.
endif endif
...@@ -12,8 +12,10 @@ snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o ...@@ -12,8 +12,10 @@ snd-soc-sam9g20-wm8731-objs := sam9g20_wm8731.o
snd-atmel-soc-wm8904-objs := atmel_wm8904.o snd-atmel-soc-wm8904-objs := atmel_wm8904.o
snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o snd-soc-sam9x5-wm8731-objs := sam9x5_wm8731.o
snd-atmel-soc-classd-objs := atmel-classd.o snd-atmel-soc-classd-objs := atmel-classd.o
snd-atmel-soc-pdmic-objs := atmel-pdmic.o
obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o obj-$(CONFIG_SND_AT91_SOC_SAM9G20_WM8731) += snd-soc-sam9g20-wm8731.o
obj-$(CONFIG_SND_ATMEL_SOC_WM8904) += snd-atmel-soc-wm8904.o obj-$(CONFIG_SND_ATMEL_SOC_WM8904) += snd-atmel-soc-wm8904.o
obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o obj-$(CONFIG_SND_AT91_SOC_SAM9X5_WM8731) += snd-soc-sam9x5-wm8731.o
obj-$(CONFIG_SND_ATMEL_SOC_CLASSD) += snd-atmel-soc-classd.o obj-$(CONFIG_SND_ATMEL_SOC_CLASSD) += snd-atmel-soc-classd.o
obj-$(CONFIG_SND_ATMEL_SOC_PDMIC) += snd-atmel-soc-pdmic.o
...@@ -106,7 +106,7 @@ static const struct snd_pcm_hardware atmel_classd_hw = { ...@@ -106,7 +106,7 @@ static const struct snd_pcm_hardware atmel_classd_hw = {
.rates = ATMEL_CLASSD_RATES, .rates = ATMEL_CLASSD_RATES,
.rate_min = 8000, .rate_min = 8000,
.rate_max = 96000, .rate_max = 96000,
.channels_min = 2, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.buffer_bytes_max = 64 * 1024, .buffer_bytes_max = 64 * 1024,
.period_bytes_min = 256, .period_bytes_min = 256,
...@@ -145,7 +145,7 @@ static const struct snd_soc_dai_ops atmel_classd_cpu_dai_ops = { ...@@ -145,7 +145,7 @@ static const struct snd_soc_dai_ops atmel_classd_cpu_dai_ops = {
static struct snd_soc_dai_driver atmel_classd_cpu_dai = { static struct snd_soc_dai_driver atmel_classd_cpu_dai = {
.playback = { .playback = {
.channels_min = 2, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = ATMEL_CLASSD_RATES, .rates = ATMEL_CLASSD_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE,}, .formats = SNDRV_PCM_FMTBIT_S16_LE,},
...@@ -171,9 +171,13 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream, ...@@ -171,9 +171,13 @@ atmel_classd_platform_configure_dma(struct snd_pcm_substream *substream,
return -EINVAL; return -EINVAL;
} }
if (params_channels(params) == 1)
slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
else
slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
slave_config->direction = DMA_MEM_TO_DEV; slave_config->direction = DMA_MEM_TO_DEV;
slave_config->dst_addr = dd->phy_base + CLASSD_THR; slave_config->dst_addr = dd->phy_base + CLASSD_THR;
slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
slave_config->dst_maxburst = 1; slave_config->dst_maxburst = 1;
slave_config->src_maxburst = 1; slave_config->src_maxburst = 1;
slave_config->device_fc = false; slave_config->device_fc = false;
...@@ -486,7 +490,7 @@ static struct snd_soc_dai_driver atmel_classd_codec_dai = { ...@@ -486,7 +490,7 @@ static struct snd_soc_dai_driver atmel_classd_codec_dai = {
.name = ATMEL_CLASSD_CODEC_DAI_NAME, .name = ATMEL_CLASSD_CODEC_DAI_NAME,
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "Playback",
.channels_min = 2, .channels_min = 1,
.channels_max = 2, .channels_max = 2,
.rates = ATMEL_CLASSD_RATES, .rates = ATMEL_CLASSD_RATES,
.formats = SNDRV_PCM_FMTBIT_S16_LE, .formats = SNDRV_PCM_FMTBIT_S16_LE,
...@@ -636,8 +640,10 @@ static int atmel_classd_probe(struct platform_device *pdev) ...@@ -636,8 +640,10 @@ static int atmel_classd_probe(struct platform_device *pdev)
/* register sound card */ /* register sound card */
card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
if (!card) if (!card) {
return -ENOMEM; ret = -ENOMEM;
goto unregister_codec;
}
snd_soc_card_set_drvdata(card, dd); snd_soc_card_set_drvdata(card, dd);
platform_set_drvdata(pdev, card); platform_set_drvdata(pdev, card);
...@@ -645,16 +651,20 @@ static int atmel_classd_probe(struct platform_device *pdev) ...@@ -645,16 +651,20 @@ static int atmel_classd_probe(struct platform_device *pdev)
ret = atmel_classd_asoc_card_init(dev, card); ret = atmel_classd_asoc_card_init(dev, card);
if (ret) { if (ret) {
dev_err(dev, "failed to init sound card\n"); dev_err(dev, "failed to init sound card\n");
return ret; goto unregister_codec;
} }
ret = devm_snd_soc_register_card(dev, card); ret = devm_snd_soc_register_card(dev, card);
if (ret) { if (ret) {
dev_err(dev, "failed to register sound card: %d\n", ret); dev_err(dev, "failed to register sound card: %d\n", ret);
return ret; goto unregister_codec;
} }
return 0; return 0;
unregister_codec:
snd_soc_unregister_codec(dev);
return ret;
} }
static int atmel_classd_remove(struct platform_device *pdev) static int atmel_classd_remove(struct platform_device *pdev)
......
This diff is collapsed.
#ifndef __ATMEL_PDMIC_H_
#define __ATMEL_PDMIC_H_
#include <linux/bitops.h>
#define PDMIC_CR 0x00000000
#define PDMIC_CR_SWRST 0x1
#define PDMIC_CR_SWRST_MASK BIT(0)
#define PDMIC_CR_SWRST_SHIFT (0)
#define PDMIC_CR_ENPDM_DIS 0x0
#define PDMIC_CR_ENPDM_EN 0x1
#define PDMIC_CR_ENPDM_MASK BIT(4)
#define PDMIC_CR_ENPDM_SHIFT (4)
#define PDMIC_MR 0x00000004
#define PDMIC_MR_CLKS_PCK 0x0
#define PDMIC_MR_CLKS_GCK 0x1
#define PDMIC_MR_CLKS_MASK BIT(4)
#define PDMIC_MR_CLKS_SHIFT (4)
#define PDMIC_MR_PRESCAL_MASK GENMASK(14, 8)
#define PDMIC_MR_PRESCAL_SHIFT (8)
#define PDMIC_CDR 0x00000014
#define PDMIC_IER 0x00000018
#define PDMIC_IER_OVRE BIT(25)
#define PDMIC_IDR 0x0000001c
#define PDMIC_IDR_OVRE BIT(25)
#define PDMIC_IMR 0x00000020
#define PDMIC_ISR 0x00000024
#define PDMIC_ISR_OVRE BIT(25)
#define PDMIC_DSPR0 0x00000058
#define PDMIC_DSPR0_HPFBYP_DIS 0x1
#define PDMIC_DSPR0_HPFBYP_EN 0x0
#define PDMIC_DSPR0_HPFBYP_MASK BIT(1)
#define PDMIC_DSPR0_HPFBYP_SHIFT (1)
#define PDMIC_DSPR0_SINBYP_DIS 0x1
#define PDMIC_DSPR0_SINBYP_EN 0x0
#define PDMIC_DSPR0_SINBYP_MASK BIT(2)
#define PDMIC_DSPR0_SINBYP_SHIFT (2)
#define PDMIC_DSPR0_SIZE_16_BITS 0x0
#define PDMIC_DSPR0_SIZE_32_BITS 0x1
#define PDMIC_DSPR0_SIZE_MASK BIT(3)
#define PDMIC_DSPR0_SIZE_SHIFT (3)
#define PDMIC_DSPR0_OSR_128 0x0
#define PDMIC_DSPR0_OSR_64 0x1
#define PDMIC_DSPR0_OSR_MASK GENMASK(6, 4)
#define PDMIC_DSPR0_OSR_SHIFT (4)
#define PDMIC_DSPR0_SCALE_MASK GENMASK(11, 8)
#define PDMIC_DSPR0_SCALE_SHIFT (8)
#define PDMIC_DSPR0_SHIFT_MASK GENMASK(15, 12)
#define PDMIC_DSPR0_SHIFT_SHIFT (12)
#define PDMIC_DSPR1 0x0000005c
#define PDMIC_DSPR1_DGAIN_MASK GENMASK(14, 0)
#define PDMIC_DSPR1_DGAIN_SHIFT (0)
#define PDMIC_DSPR1_OFFSET_MASK GENMASK(31, 16)
#define PDMIC_DSPR1_OFFSET_SHIFT (16)
#define PDMIC_WPMR 0x000000e4
#define PDMIC_WPSR 0x000000e8
#endif
...@@ -183,6 +183,7 @@ static struct platform_driver atmel_asoc_wm8904_driver = { ...@@ -183,6 +183,7 @@ static struct platform_driver atmel_asoc_wm8904_driver = {
.driver = { .driver = {
.name = "atmel-wm8904-audio", .name = "atmel-wm8904-audio",
.of_match_table = of_match_ptr(atmel_asoc_wm8904_dt_ids), .of_match_table = of_match_ptr(atmel_asoc_wm8904_dt_ids),
.pm = &snd_soc_pm_ops,
}, },
.probe = atmel_asoc_wm8904_probe, .probe = atmel_asoc_wm8904_probe,
.remove = atmel_asoc_wm8904_remove, .remove = atmel_asoc_wm8904_remove,
......
...@@ -55,9 +55,11 @@ config SND_SOC_ALL_CODECS ...@@ -55,9 +55,11 @@ config SND_SOC_ALL_CODECS
select SND_SOC_CS4271_SPI if SPI_MASTER select SND_SOC_CS4271_SPI if SPI_MASTER
select SND_SOC_CS42XX8_I2C if I2C select SND_SOC_CS42XX8_I2C if I2C
select SND_SOC_CS4349 if I2C select SND_SOC_CS4349 if I2C
select SND_SOC_CS47L24 if MFD_CS47L24
select SND_SOC_CX20442 if TTY select SND_SOC_CX20442 if TTY
select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
select SND_SOC_DA7213 if I2C select SND_SOC_DA7213 if I2C
select SND_SOC_DA7218 if I2C
select SND_SOC_DA7219 if I2C select SND_SOC_DA7219 if I2C
select SND_SOC_DA732X if I2C select SND_SOC_DA732X if I2C
select SND_SOC_DA9055 if I2C select SND_SOC_DA9055 if I2C
...@@ -68,6 +70,7 @@ config SND_SOC_ALL_CODECS ...@@ -68,6 +70,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_GTM601 select SND_SOC_GTM601
select SND_SOC_HDAC_HDMI select SND_SOC_HDAC_HDMI
select SND_SOC_ICS43432 select SND_SOC_ICS43432
select SND_SOC_INNO_RK3036
select SND_SOC_ISABELLE if I2C select SND_SOC_ISABELLE if I2C
select SND_SOC_JZ4740_CODEC select SND_SOC_JZ4740_CODEC
select SND_SOC_LM4857 if I2C select SND_SOC_LM4857 if I2C
...@@ -86,14 +89,18 @@ config SND_SOC_ALL_CODECS ...@@ -86,14 +89,18 @@ config SND_SOC_ALL_CODECS
select SND_SOC_PCM1681 if I2C select SND_SOC_PCM1681 if I2C
select SND_SOC_PCM1792A if SPI_MASTER select SND_SOC_PCM1792A if SPI_MASTER
select SND_SOC_PCM3008 select SND_SOC_PCM3008
select SND_SOC_PCM3168A_I2C if I2C
select SND_SOC_PCM3168A_SPI if SPI_MASTER
select SND_SOC_PCM512x_I2C if I2C select SND_SOC_PCM512x_I2C if I2C
select SND_SOC_PCM512x_SPI if SPI_MASTER select SND_SOC_PCM512x_SPI if SPI_MASTER
select SND_SOC_RT286 if I2C select SND_SOC_RT286 if I2C
select SND_SOC_RT298 if I2C select SND_SOC_RT298 if I2C
select SND_SOC_RT5616 if I2C
select SND_SOC_RT5631 if I2C select SND_SOC_RT5631 if I2C
select SND_SOC_RT5640 if I2C select SND_SOC_RT5640 if I2C
select SND_SOC_RT5645 if I2C select SND_SOC_RT5645 if I2C
select SND_SOC_RT5651 if I2C select SND_SOC_RT5651 if I2C
select SND_SOC_RT5659 if I2C
select SND_SOC_RT5670 if I2C select SND_SOC_RT5670 if I2C
select SND_SOC_RT5677 if I2C && SPI_MASTER select SND_SOC_RT5677 if I2C && SPI_MASTER
select SND_SOC_SGTL5000 if I2C select SND_SOC_SGTL5000 if I2C
...@@ -196,10 +203,12 @@ config SND_SOC_88PM860X ...@@ -196,10 +203,12 @@ config SND_SOC_88PM860X
config SND_SOC_ARIZONA config SND_SOC_ARIZONA
tristate tristate
default y if SND_SOC_CS47L24=y
default y if SND_SOC_WM5102=y default y if SND_SOC_WM5102=y
default y if SND_SOC_WM5110=y default y if SND_SOC_WM5110=y
default y if SND_SOC_WM8997=y default y if SND_SOC_WM8997=y
default y if SND_SOC_WM8998=y default y if SND_SOC_WM8998=y
default m if SND_SOC_CS47L24=m
default m if SND_SOC_WM5102=m default m if SND_SOC_WM5102=m
default m if SND_SOC_WM5110=m default m if SND_SOC_WM5110=m
default m if SND_SOC_WM8997=m default m if SND_SOC_WM8997=m
...@@ -212,9 +221,12 @@ config SND_SOC_WM_HUBS ...@@ -212,9 +221,12 @@ config SND_SOC_WM_HUBS
config SND_SOC_WM_ADSP config SND_SOC_WM_ADSP
tristate tristate
select SND_SOC_COMPRESS
default y if SND_SOC_CS47L24=y
default y if SND_SOC_WM5102=y default y if SND_SOC_WM5102=y
default y if SND_SOC_WM5110=y default y if SND_SOC_WM5110=y
default y if SND_SOC_WM2200=y default y if SND_SOC_WM2200=y
default m if SND_SOC_CS47L24=m
default m if SND_SOC_WM5102=m default m if SND_SOC_WM5102=m
default m if SND_SOC_WM5110=m default m if SND_SOC_WM5110=m
default m if SND_SOC_WM2200=m default m if SND_SOC_WM2200=m
...@@ -423,6 +435,9 @@ config SND_SOC_CS4349 ...@@ -423,6 +435,9 @@ config SND_SOC_CS4349
tristate "Cirrus Logic CS4349 CODEC" tristate "Cirrus Logic CS4349 CODEC"
depends on I2C depends on I2C
config SND_SOC_CS47L24
tristate
config SND_SOC_CX20442 config SND_SOC_CX20442
tristate tristate
depends on TTY depends on TTY
...@@ -440,6 +455,9 @@ config SND_SOC_DA7210 ...@@ -440,6 +455,9 @@ config SND_SOC_DA7210
config SND_SOC_DA7213 config SND_SOC_DA7213
tristate tristate
config SND_SOC_DA7218
tristate
config SND_SOC_DA7219 config SND_SOC_DA7219
tristate tristate
...@@ -477,6 +495,9 @@ config SND_SOC_HDAC_HDMI ...@@ -477,6 +495,9 @@ config SND_SOC_HDAC_HDMI
config SND_SOC_ICS43432 config SND_SOC_ICS43432
tristate tristate
config SND_SOC_INNO_RK3036
tristate "Inno codec driver for RK3036 SoC"
config SND_SOC_ISABELLE config SND_SOC_ISABELLE
tristate tristate
...@@ -512,6 +533,21 @@ config SND_SOC_PCM1792A ...@@ -512,6 +533,21 @@ config SND_SOC_PCM1792A
config SND_SOC_PCM3008 config SND_SOC_PCM3008
tristate tristate
config SND_SOC_PCM3168A
tristate
config SND_SOC_PCM3168A_I2C
tristate "Texas Instruments PCM3168A CODEC - I2C"
depends on I2C
select SND_SOC_PCM3168A
select REGMAP_I2C
config SND_SOC_PCM3168A_SPI
tristate "Texas Instruments PCM3168A CODEC - SPI"
depends on SPI_MASTER
select SND_SOC_PCM3168A
select REGMAP_SPI
config SND_SOC_PCM512x config SND_SOC_PCM512x
tristate tristate
...@@ -529,14 +565,18 @@ config SND_SOC_PCM512x_SPI ...@@ -529,14 +565,18 @@ config SND_SOC_PCM512x_SPI
config SND_SOC_RL6231 config SND_SOC_RL6231
tristate tristate
default y if SND_SOC_RT5616=y
default y if SND_SOC_RT5640=y default y if SND_SOC_RT5640=y
default y if SND_SOC_RT5645=y default y if SND_SOC_RT5645=y
default y if SND_SOC_RT5651=y default y if SND_SOC_RT5651=y
default y if SND_SOC_RT5659=y
default y if SND_SOC_RT5670=y default y if SND_SOC_RT5670=y
default y if SND_SOC_RT5677=y default y if SND_SOC_RT5677=y
default m if SND_SOC_RT5616=m
default m if SND_SOC_RT5640=m default m if SND_SOC_RT5640=m
default m if SND_SOC_RT5645=m default m if SND_SOC_RT5645=m
default m if SND_SOC_RT5651=m default m if SND_SOC_RT5651=m
default m if SND_SOC_RT5659=m
default m if SND_SOC_RT5670=m default m if SND_SOC_RT5670=m
default m if SND_SOC_RT5677=m default m if SND_SOC_RT5677=m
...@@ -555,6 +595,9 @@ config SND_SOC_RT298 ...@@ -555,6 +595,9 @@ config SND_SOC_RT298
tristate tristate
depends on I2C depends on I2C
config SND_SOC_RT5616
tristate
config SND_SOC_RT5631 config SND_SOC_RT5631
tristate "Realtek ALC5631/RT5631 CODEC" tristate "Realtek ALC5631/RT5631 CODEC"
depends on I2C depends on I2C
...@@ -568,6 +611,9 @@ config SND_SOC_RT5645 ...@@ -568,6 +611,9 @@ config SND_SOC_RT5645
config SND_SOC_RT5651 config SND_SOC_RT5651
tristate tristate
config SND_SOC_RT5659
tristate
config SND_SOC_RT5670 config SND_SOC_RT5670
tristate tristate
...@@ -844,7 +890,8 @@ config SND_SOC_WM8971 ...@@ -844,7 +890,8 @@ config SND_SOC_WM8971
tristate tristate
config SND_SOC_WM8974 config SND_SOC_WM8974
tristate tristate "Wolfson Microelectronics WM8974 codec"
depends on I2C
config SND_SOC_WM8978 config SND_SOC_WM8978
tristate "Wolfson Microelectronics WM8978 codec" tristate "Wolfson Microelectronics WM8978 codec"
...@@ -897,6 +944,7 @@ config SND_SOC_WM9712 ...@@ -897,6 +944,7 @@ config SND_SOC_WM9712
config SND_SOC_WM9713 config SND_SOC_WM9713
tristate tristate
select REGMAP_AC97
# Amp # Amp
config SND_SOC_LM4857 config SND_SOC_LM4857
......
...@@ -47,9 +47,11 @@ snd-soc-cs4271-spi-objs := cs4271-spi.o ...@@ -47,9 +47,11 @@ snd-soc-cs4271-spi-objs := cs4271-spi.o
snd-soc-cs42xx8-objs := cs42xx8.o snd-soc-cs42xx8-objs := cs42xx8.o
snd-soc-cs42xx8-i2c-objs := cs42xx8-i2c.o snd-soc-cs42xx8-i2c-objs := cs42xx8-i2c.o
snd-soc-cs4349-objs := cs4349.o snd-soc-cs4349-objs := cs4349.o
snd-soc-cs47l24-objs := cs47l24.o
snd-soc-cx20442-objs := cx20442.o snd-soc-cx20442-objs := cx20442.o
snd-soc-da7210-objs := da7210.o snd-soc-da7210-objs := da7210.o
snd-soc-da7213-objs := da7213.o snd-soc-da7213-objs := da7213.o
snd-soc-da7218-objs := da7218.o
snd-soc-da7219-objs := da7219.o da7219-aad.o snd-soc-da7219-objs := da7219.o da7219-aad.o
snd-soc-da732x-objs := da732x.o snd-soc-da732x-objs := da732x.o
snd-soc-da9055-objs := da9055.o snd-soc-da9055-objs := da9055.o
...@@ -61,6 +63,7 @@ snd-soc-es8328-spi-objs := es8328-spi.o ...@@ -61,6 +63,7 @@ snd-soc-es8328-spi-objs := es8328-spi.o
snd-soc-gtm601-objs := gtm601.o snd-soc-gtm601-objs := gtm601.o
snd-soc-hdac-hdmi-objs := hdac_hdmi.o snd-soc-hdac-hdmi-objs := hdac_hdmi.o
snd-soc-ics43432-objs := ics43432.o snd-soc-ics43432-objs := ics43432.o
snd-soc-inno-rk3036-objs := inno_rk3036.o
snd-soc-isabelle-objs := isabelle.o snd-soc-isabelle-objs := isabelle.o
snd-soc-jz4740-codec-objs := jz4740.o snd-soc-jz4740-codec-objs := jz4740.o
snd-soc-l3-objs := l3.o snd-soc-l3-objs := l3.o
...@@ -79,6 +82,9 @@ snd-soc-nau8825-objs := nau8825.o ...@@ -79,6 +82,9 @@ snd-soc-nau8825-objs := nau8825.o
snd-soc-pcm1681-objs := pcm1681.o snd-soc-pcm1681-objs := pcm1681.o
snd-soc-pcm1792a-codec-objs := pcm1792a.o snd-soc-pcm1792a-codec-objs := pcm1792a.o
snd-soc-pcm3008-objs := pcm3008.o snd-soc-pcm3008-objs := pcm3008.o
snd-soc-pcm3168a-objs := pcm3168a.o
snd-soc-pcm3168a-i2c-objs := pcm3168a-i2c.o
snd-soc-pcm3168a-spi-objs := pcm3168a-spi.o
snd-soc-pcm512x-objs := pcm512x.o snd-soc-pcm512x-objs := pcm512x.o
snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o
snd-soc-pcm512x-spi-objs := pcm512x-spi.o snd-soc-pcm512x-spi-objs := pcm512x-spi.o
...@@ -86,10 +92,12 @@ snd-soc-rl6231-objs := rl6231.o ...@@ -86,10 +92,12 @@ snd-soc-rl6231-objs := rl6231.o
snd-soc-rl6347a-objs := rl6347a.o snd-soc-rl6347a-objs := rl6347a.o
snd-soc-rt286-objs := rt286.o snd-soc-rt286-objs := rt286.o
snd-soc-rt298-objs := rt298.o snd-soc-rt298-objs := rt298.o
snd-soc-rt5616-objs := rt5616.o
snd-soc-rt5631-objs := rt5631.o snd-soc-rt5631-objs := rt5631.o
snd-soc-rt5640-objs := rt5640.o snd-soc-rt5640-objs := rt5640.o
snd-soc-rt5645-objs := rt5645.o snd-soc-rt5645-objs := rt5645.o
snd-soc-rt5651-objs := rt5651.o snd-soc-rt5651-objs := rt5651.o
snd-soc-rt5659-objs := rt5659.o
snd-soc-rt5670-objs := rt5670.o snd-soc-rt5670-objs := rt5670.o
snd-soc-rt5677-objs := rt5677.o snd-soc-rt5677-objs := rt5677.o
snd-soc-rt5677-spi-objs := rt5677-spi.o snd-soc-rt5677-spi-objs := rt5677-spi.o
...@@ -243,9 +251,11 @@ obj-$(CONFIG_SND_SOC_CS4271_SPI) += snd-soc-cs4271-spi.o ...@@ -243,9 +251,11 @@ obj-$(CONFIG_SND_SOC_CS4271_SPI) += snd-soc-cs4271-spi.o
obj-$(CONFIG_SND_SOC_CS42XX8) += snd-soc-cs42xx8.o obj-$(CONFIG_SND_SOC_CS42XX8) += snd-soc-cs42xx8.o
obj-$(CONFIG_SND_SOC_CS42XX8_I2C) += snd-soc-cs42xx8-i2c.o obj-$(CONFIG_SND_SOC_CS42XX8_I2C) += snd-soc-cs42xx8-i2c.o
obj-$(CONFIG_SND_SOC_CS4349) += snd-soc-cs4349.o obj-$(CONFIG_SND_SOC_CS4349) += snd-soc-cs4349.o
obj-$(CONFIG_SND_SOC_CS47L24) += snd-soc-cs47l24.o
obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o obj-$(CONFIG_SND_SOC_CX20442) += snd-soc-cx20442.o
obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o obj-$(CONFIG_SND_SOC_DA7210) += snd-soc-da7210.o
obj-$(CONFIG_SND_SOC_DA7213) += snd-soc-da7213.o obj-$(CONFIG_SND_SOC_DA7213) += snd-soc-da7213.o
obj-$(CONFIG_SND_SOC_DA7218) += snd-soc-da7218.o
obj-$(CONFIG_SND_SOC_DA7219) += snd-soc-da7219.o obj-$(CONFIG_SND_SOC_DA7219) += snd-soc-da7219.o
obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o obj-$(CONFIG_SND_SOC_DA732X) += snd-soc-da732x.o
obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o obj-$(CONFIG_SND_SOC_DA9055) += snd-soc-da9055.o
...@@ -257,6 +267,7 @@ obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o ...@@ -257,6 +267,7 @@ obj-$(CONFIG_SND_SOC_ES8328_SPI)+= snd-soc-es8328-spi.o
obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o obj-$(CONFIG_SND_SOC_GTM601) += snd-soc-gtm601.o
obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o obj-$(CONFIG_SND_SOC_HDAC_HDMI) += snd-soc-hdac-hdmi.o
obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o obj-$(CONFIG_SND_SOC_ICS43432) += snd-soc-ics43432.o
obj-$(CONFIG_SND_SOC_INNO_RK3036) += snd-soc-inno-rk3036.o
obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o obj-$(CONFIG_SND_SOC_ISABELLE) += snd-soc-isabelle.o
obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o obj-$(CONFIG_SND_SOC_JZ4740_CODEC) += snd-soc-jz4740-codec.o
obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o obj-$(CONFIG_SND_SOC_L3) += snd-soc-l3.o
...@@ -275,6 +286,9 @@ obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o ...@@ -275,6 +286,9 @@ obj-$(CONFIG_SND_SOC_NAU8825) += snd-soc-nau8825.o
obj-$(CONFIG_SND_SOC_PCM1681) += snd-soc-pcm1681.o obj-$(CONFIG_SND_SOC_PCM1681) += snd-soc-pcm1681.o
obj-$(CONFIG_SND_SOC_PCM1792A) += snd-soc-pcm1792a-codec.o obj-$(CONFIG_SND_SOC_PCM1792A) += snd-soc-pcm1792a-codec.o
obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o obj-$(CONFIG_SND_SOC_PCM3008) += snd-soc-pcm3008.o
obj-$(CONFIG_SND_SOC_PCM3168A) += snd-soc-pcm3168a.o
obj-$(CONFIG_SND_SOC_PCM3168A_I2C) += snd-soc-pcm3168a-i2c.o
obj-$(CONFIG_SND_SOC_PCM3168A_SPI) += snd-soc-pcm3168a-spi.o
obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o
obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o
obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o
...@@ -282,10 +296,12 @@ obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o ...@@ -282,10 +296,12 @@ obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o
obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o obj-$(CONFIG_SND_SOC_RL6347A) += snd-soc-rl6347a.o
obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o obj-$(CONFIG_SND_SOC_RT286) += snd-soc-rt286.o
obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o obj-$(CONFIG_SND_SOC_RT298) += snd-soc-rt298.o
obj-$(CONFIG_SND_SOC_RT5616) += snd-soc-rt5616.o
obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o obj-$(CONFIG_SND_SOC_RT5631) += snd-soc-rt5631.o
obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o obj-$(CONFIG_SND_SOC_RT5640) += snd-soc-rt5640.o
obj-$(CONFIG_SND_SOC_RT5645) += snd-soc-rt5645.o obj-$(CONFIG_SND_SOC_RT5645) += snd-soc-rt5645.o
obj-$(CONFIG_SND_SOC_RT5651) += snd-soc-rt5651.o obj-$(CONFIG_SND_SOC_RT5651) += snd-soc-rt5651.o
obj-$(CONFIG_SND_SOC_RT5659) += snd-soc-rt5659.o
obj-$(CONFIG_SND_SOC_RT5670) += snd-soc-rt5670.o obj-$(CONFIG_SND_SOC_RT5670) += snd-soc-rt5670.o
obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o obj-$(CONFIG_SND_SOC_RT5677) += snd-soc-rt5677.o
obj-$(CONFIG_SND_SOC_RT5677_SPI) += snd-soc-rt5677-spi.o obj-$(CONFIG_SND_SOC_RT5677_SPI) += snd-soc-rt5677-spi.o
......
...@@ -70,18 +70,11 @@ ...@@ -70,18 +70,11 @@
#define FMT_MASK (0xf8) #define FMT_MASK (0xf8)
/* CTRL2 */ /* CTRL2 */
#define DFS_MASK (3 << 2)
#define DFS_NORMAL_SPEED (0 << 2) #define DFS_NORMAL_SPEED (0 << 2)
#define DFS_DOUBLE_SPEED (1 << 2) #define DFS_DOUBLE_SPEED (1 << 2)
#define DFS_QUAD_SPEED (2 << 2) #define DFS_QUAD_SPEED (2 << 2)
struct ak4613_priv {
struct mutex lock;
unsigned int fmt;
u8 fmt_ctrl;
int cnt;
};
struct ak4613_formats { struct ak4613_formats {
unsigned int width; unsigned int width;
unsigned int fmt; unsigned int fmt;
...@@ -92,6 +85,16 @@ struct ak4613_interface { ...@@ -92,6 +85,16 @@ struct ak4613_interface {
struct ak4613_formats playback; struct ak4613_formats playback;
}; };
struct ak4613_priv {
struct mutex lock;
const struct ak4613_interface *iface;
unsigned int fmt;
u8 oc;
u8 ic;
int cnt;
};
/* /*
* Playback Volume * Playback Volume
* *
...@@ -126,7 +129,7 @@ static const struct reg_default ak4613_reg[] = { ...@@ -126,7 +129,7 @@ static const struct reg_default ak4613_reg[] = {
{ 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 }, { 0x14, 0x00 }, { 0x15, 0x00 }, { 0x16, 0x00 },
}; };
#define AUDIO_IFACE_IDX_TO_VAL(i) (i << 3) #define AUDIO_IFACE_TO_VAL(fmts) ((fmts - ak4613_iface) << 3)
#define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt } #define AUDIO_IFACE(b, fmt) { b, SND_SOC_DAIFMT_##fmt }
static const struct ak4613_interface ak4613_iface[] = { static const struct ak4613_interface ak4613_iface[] = {
/* capture */ /* playback */ /* capture */ /* playback */
...@@ -240,7 +243,7 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream, ...@@ -240,7 +243,7 @@ static void ak4613_dai_shutdown(struct snd_pcm_substream *substream,
priv->cnt = 0; priv->cnt = 0;
} }
if (!priv->cnt) if (!priv->cnt)
priv->fmt_ctrl = NO_FMT; priv->iface = NULL;
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
} }
...@@ -265,13 +268,35 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -265,13 +268,35 @@ static int ak4613_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return 0; 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 (fmt == SND_SOC_DAIFMT_RIGHT_J) {
if (fmts->width != width)
return false;
} else {
if (fmts->width < width)
return false;
}
return true;
}
static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct snd_soc_codec *codec = dai->codec; struct snd_soc_codec *codec = dai->codec;
struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec); struct ak4613_priv *priv = snd_soc_codec_get_drvdata(codec);
const struct ak4613_formats *fmts; const struct ak4613_interface *iface;
struct device *dev = codec->dev; struct device *dev = codec->dev;
unsigned int width = params_width(params); unsigned int width = params_width(params);
unsigned int fmt = priv->fmt; unsigned int fmt = priv->fmt;
...@@ -305,33 +330,27 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -305,33 +330,27 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
* It doesn't support TDM at this point * It doesn't support TDM at this point
*/ */
fmt_ctrl = NO_FMT; fmt_ctrl = NO_FMT;
for (i = 0; i < ARRAY_SIZE(ak4613_iface); i++) { ret = -EINVAL;
fmts = (is_play) ? &ak4613_iface[i].playback : iface = NULL;
&ak4613_iface[i].capture;
if (fmts->fmt != fmt)
continue;
if (fmt == SND_SOC_DAIFMT_RIGHT_J) { mutex_lock(&priv->lock);
if (fmts->width != width) if (priv->iface) {
continue; if (ak4613_dai_fmt_matching(priv->iface, is_play, fmt, width))
} else { iface = priv->iface;
if (fmts->width < width) } else {
for (i = ARRAY_SIZE(ak4613_iface); i >= 0; i--) {
if (!ak4613_dai_fmt_matching(ak4613_iface + i,
is_play,
fmt, width))
continue; continue;
iface = ak4613_iface + i;
break;
} }
fmt_ctrl = AUDIO_IFACE_IDX_TO_VAL(i);
break;
} }
ret = -EINVAL; if ((priv->iface == NULL) ||
if (fmt_ctrl == NO_FMT) (priv->iface == iface)) {
goto hw_params_end; priv->iface = iface;
mutex_lock(&priv->lock);
if ((priv->fmt_ctrl == NO_FMT) ||
(priv->fmt_ctrl == fmt_ctrl)) {
priv->fmt_ctrl = fmt_ctrl;
priv->cnt++; priv->cnt++;
ret = 0; ret = 0;
} }
...@@ -340,8 +359,13 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, ...@@ -340,8 +359,13 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream,
if (ret < 0) if (ret < 0)
goto hw_params_end; goto hw_params_end;
fmt_ctrl = AUDIO_IFACE_TO_VAL(iface);
snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl); snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl);
snd_soc_write(codec, CTRL2, ctrl2); snd_soc_update_bits(codec, CTRL2, DFS_MASK, ctrl2);
snd_soc_write(codec, ICTRL, priv->ic);
snd_soc_write(codec, OCTRL, priv->oc);
hw_params_end: hw_params_end:
if (ret < 0) if (ret < 0)
...@@ -431,6 +455,28 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { ...@@ -431,6 +455,28 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4613 = {
.num_dapm_routes = ARRAY_SIZE(ak4613_intercon), .num_dapm_routes = ARRAY_SIZE(ak4613_intercon),
}; };
static void ak4613_parse_of(struct ak4613_priv *priv,
struct device *dev)
{
struct device_node *np = dev->of_node;
char prop[32];
int i;
/* Input 1 - 2 */
for (i = 0; i < 2; i++) {
snprintf(prop, sizeof(prop), "asahi-kasei,in%d-single-end", i + 1);
if (!of_get_property(np, prop, NULL))
priv->ic |= 1 << i;
}
/* Output 1 - 6 */
for (i = 0; i < 6; i++) {
snprintf(prop, sizeof(prop), "asahi-kasei,out%d-single-end", i + 1);
if (!of_get_property(np, prop, NULL))
priv->oc |= 1 << i;
}
}
static int ak4613_i2c_probe(struct i2c_client *i2c, static int ak4613_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
...@@ -458,7 +504,9 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, ...@@ -458,7 +504,9 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
priv->fmt_ctrl = NO_FMT; ak4613_parse_of(priv, dev);
priv->iface = NULL;
priv->cnt = 0; priv->cnt = 0;
mutex_init(&priv->lock); mutex_init(&priv->lock);
......
...@@ -310,7 +310,7 @@ int arizona_init_gpio(struct snd_soc_codec *codec) ...@@ -310,7 +310,7 @@ int arizona_init_gpio(struct snd_soc_codec *codec)
} }
EXPORT_SYMBOL_GPL(arizona_init_gpio); EXPORT_SYMBOL_GPL(arizona_init_gpio);
const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
"None", "None",
"Tone Generator 1", "Tone Generator 1",
"Tone Generator 2", "Tone Generator 2",
...@@ -418,7 +418,7 @@ const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = { ...@@ -418,7 +418,7 @@ const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
}; };
EXPORT_SYMBOL_GPL(arizona_mixer_texts); EXPORT_SYMBOL_GPL(arizona_mixer_texts);
int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS] = { unsigned int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS] = {
0x00, /* None */ 0x00, /* None */
0x04, /* Tone */ 0x04, /* Tone */
0x05, 0x05,
...@@ -555,12 +555,12 @@ const char *arizona_sample_rate_val_to_name(unsigned int rate_val) ...@@ -555,12 +555,12 @@ const char *arizona_sample_rate_val_to_name(unsigned int rate_val)
} }
EXPORT_SYMBOL_GPL(arizona_sample_rate_val_to_name); EXPORT_SYMBOL_GPL(arizona_sample_rate_val_to_name);
const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = { const char * const arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = {
"SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate", "SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate",
}; };
EXPORT_SYMBOL_GPL(arizona_rate_text); EXPORT_SYMBOL_GPL(arizona_rate_text);
const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE] = { const unsigned int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE] = {
0, 1, 2, 8, 0, 1, 2, 8,
}; };
EXPORT_SYMBOL_GPL(arizona_rate_val); EXPORT_SYMBOL_GPL(arizona_rate_val);
...@@ -702,6 +702,100 @@ const struct soc_enum arizona_in_dmic_osr[] = { ...@@ -702,6 +702,100 @@ const struct soc_enum arizona_in_dmic_osr[] = {
}; };
EXPORT_SYMBOL_GPL(arizona_in_dmic_osr); EXPORT_SYMBOL_GPL(arizona_in_dmic_osr);
static const char * const arizona_anc_input_src_text[] = {
"None", "IN1", "IN2", "IN3", "IN4",
};
static const char * const arizona_anc_channel_src_text[] = {
"None", "Left", "Right", "Combine",
};
const struct soc_enum arizona_anc_input_src[] = {
SOC_ENUM_SINGLE(ARIZONA_ANC_SRC,
ARIZONA_IN_RXANCL_SEL_SHIFT,
ARRAY_SIZE(arizona_anc_input_src_text),
arizona_anc_input_src_text),
SOC_ENUM_SINGLE(ARIZONA_FCL_ADC_REFORMATTER_CONTROL,
ARIZONA_FCL_MIC_MODE_SEL,
ARRAY_SIZE(arizona_anc_channel_src_text),
arizona_anc_channel_src_text),
SOC_ENUM_SINGLE(ARIZONA_ANC_SRC,
ARIZONA_IN_RXANCR_SEL_SHIFT,
ARRAY_SIZE(arizona_anc_input_src_text),
arizona_anc_input_src_text),
SOC_ENUM_SINGLE(ARIZONA_FCR_ADC_REFORMATTER_CONTROL,
ARIZONA_FCR_MIC_MODE_SEL,
ARRAY_SIZE(arizona_anc_channel_src_text),
arizona_anc_channel_src_text),
};
EXPORT_SYMBOL_GPL(arizona_anc_input_src);
static const char * const arizona_anc_ng_texts[] = {
"None",
"Internal",
"External",
};
SOC_ENUM_SINGLE_DECL(arizona_anc_ng_enum, SND_SOC_NOPM, 0,
arizona_anc_ng_texts);
EXPORT_SYMBOL_GPL(arizona_anc_ng_enum);
static const char * const arizona_output_anc_src_text[] = {
"None", "RXANCL", "RXANCR",
};
const struct soc_enum arizona_output_anc_src[] = {
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_1L,
ARIZONA_OUT1L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_1R,
ARIZONA_OUT1R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_2L,
ARIZONA_OUT2L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_2R,
ARIZONA_OUT2R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_3L,
ARIZONA_OUT3L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_DAC_VOLUME_LIMIT_3R,
ARIZONA_OUT3R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_4L,
ARIZONA_OUT4L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_4R,
ARIZONA_OUT4R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_5L,
ARIZONA_OUT5L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_5R,
ARIZONA_OUT5R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_6L,
ARIZONA_OUT6L_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
SOC_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_6R,
ARIZONA_OUT6R_ANC_SRC_SHIFT,
ARRAY_SIZE(arizona_output_anc_src_text),
arizona_output_anc_src_text),
};
EXPORT_SYMBOL_GPL(arizona_output_anc_src);
static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena) static void arizona_in_set_vu(struct snd_soc_codec *codec, int ena)
{ {
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
...@@ -1023,6 +1117,31 @@ void arizona_init_dvfs(struct arizona_priv *priv) ...@@ -1023,6 +1117,31 @@ void arizona_init_dvfs(struct arizona_priv *priv)
} }
EXPORT_SYMBOL_GPL(arizona_init_dvfs); EXPORT_SYMBOL_GPL(arizona_init_dvfs);
int arizona_anc_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event)
{
struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
unsigned int mask = 0x3 << w->shift;
unsigned int val;
switch (event) {
case SND_SOC_DAPM_POST_PMU:
val = 1 << w->shift;
break;
case SND_SOC_DAPM_PRE_PMD:
val = 1 << (w->shift + 1);
break;
default:
return 0;
}
snd_soc_update_bits(codec, ARIZONA_CLOCK_CONTROL, mask, val);
return 0;
}
EXPORT_SYMBOL_GPL(arizona_anc_ev);
static unsigned int arizona_opclk_ref_48k_rates[] = { static unsigned int arizona_opclk_ref_48k_rates[] = {
6144000, 6144000,
12288000, 12288000,
...@@ -1095,7 +1214,7 @@ int arizona_set_sysclk(struct snd_soc_codec *codec, int clk_id, ...@@ -1095,7 +1214,7 @@ int arizona_set_sysclk(struct snd_soc_codec *codec, int clk_id,
unsigned int reg; unsigned int reg;
unsigned int mask = ARIZONA_SYSCLK_FREQ_MASK | ARIZONA_SYSCLK_SRC_MASK; unsigned int mask = ARIZONA_SYSCLK_FREQ_MASK | ARIZONA_SYSCLK_SRC_MASK;
unsigned int val = source << ARIZONA_SYSCLK_SRC_SHIFT; unsigned int val = source << ARIZONA_SYSCLK_SRC_SHIFT;
unsigned int *clk; int *clk;
switch (clk_id) { switch (clk_id) {
case ARIZONA_CLK_SYSCLK: case ARIZONA_CLK_SYSCLK:
...@@ -1901,18 +2020,18 @@ static int arizona_calc_fratio(struct arizona_fll *fll, ...@@ -1901,18 +2020,18 @@ static int arizona_calc_fratio(struct arizona_fll *fll,
} }
switch (fll->arizona->type) { switch (fll->arizona->type) {
case WM5102:
case WM8997:
return init_ratio;
case WM5110: case WM5110:
case WM8280: case WM8280:
if (fll->arizona->rev < 3 || sync) if (fll->arizona->rev < 3 || sync)
return init_ratio; return init_ratio;
break; break;
case WM8998: default:
case WM1814:
if (sync) if (sync)
return init_ratio; return init_ratio;
break; break;
default:
return init_ratio;
} }
cfg->fratio = init_ratio - 1; cfg->fratio = init_ratio - 1;
...@@ -2093,9 +2212,9 @@ static int arizona_enable_fll(struct arizona_fll *fll) ...@@ -2093,9 +2212,9 @@ static int arizona_enable_fll(struct arizona_fll *fll)
/* Facilitate smooth refclk across the transition */ /* Facilitate smooth refclk across the transition */
regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9, regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
ARIZONA_FLL1_GAIN_MASK, 0); ARIZONA_FLL1_GAIN_MASK, 0);
regmap_update_bits_async(fll->arizona->regmap, fll->base + 1, regmap_update_bits(fll->arizona->regmap, fll->base + 1,
ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN, ARIZONA_FLL1_FREERUN);
ARIZONA_FLL1_FREERUN); udelay(32);
} }
/* /*
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#define ARIZONA_CLK_98MHZ 5 #define ARIZONA_CLK_98MHZ 5
#define ARIZONA_CLK_147MHZ 6 #define ARIZONA_CLK_147MHZ 6
#define ARIZONA_MAX_DAI 6 #define ARIZONA_MAX_DAI 8
#define ARIZONA_MAX_ADSP 4 #define ARIZONA_MAX_ADSP 4
#define ARIZONA_DVFS_SR1_RQ 0x001 #define ARIZONA_DVFS_SR1_RQ 0x001
...@@ -96,8 +96,8 @@ struct arizona_priv { ...@@ -96,8 +96,8 @@ struct arizona_priv {
#define ARIZONA_NUM_MIXER_INPUTS 104 #define ARIZONA_NUM_MIXER_INPUTS 104
extern const unsigned int arizona_mixer_tlv[]; extern const unsigned int arizona_mixer_tlv[];
extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS]; extern const char * const arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS];
extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS]; extern unsigned int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
#define ARIZONA_GAINMUX_CONTROLS(name, base) \ #define ARIZONA_GAINMUX_CONTROLS(name, base) \
SOC_SINGLE_RANGE_TLV(name " Input Volume", base + 1, \ SOC_SINGLE_RANGE_TLV(name " Input Volume", base + 1, \
...@@ -216,8 +216,8 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS]; ...@@ -216,8 +216,8 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
#define ARIZONA_RATE_ENUM_SIZE 4 #define ARIZONA_RATE_ENUM_SIZE 4
#define ARIZONA_SAMPLE_RATE_ENUM_SIZE 14 #define ARIZONA_SAMPLE_RATE_ENUM_SIZE 14
extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE]; extern const char * const arizona_rate_text[ARIZONA_RATE_ENUM_SIZE];
extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE]; extern const unsigned int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE];
extern const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE]; extern const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE];
extern const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE]; extern const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE];
...@@ -242,6 +242,10 @@ extern const struct soc_enum arizona_in_dmic_osr[]; ...@@ -242,6 +242,10 @@ extern const struct soc_enum arizona_in_dmic_osr[];
extern const struct snd_kcontrol_new arizona_adsp2_rate_controls[]; extern const struct snd_kcontrol_new arizona_adsp2_rate_controls[];
extern const struct soc_enum arizona_anc_input_src[];
extern const struct soc_enum arizona_anc_ng_enum;
extern const struct soc_enum arizona_output_anc_src[];
extern int arizona_in_ev(struct snd_soc_dapm_widget *w, extern int arizona_in_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, struct snd_kcontrol *kcontrol,
int event); int event);
...@@ -251,6 +255,9 @@ extern int arizona_out_ev(struct snd_soc_dapm_widget *w, ...@@ -251,6 +255,9 @@ extern int arizona_out_ev(struct snd_soc_dapm_widget *w,
extern int arizona_hp_ev(struct snd_soc_dapm_widget *w, extern int arizona_hp_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, struct snd_kcontrol *kcontrol,
int event); int event);
extern int arizona_anc_ev(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol,
int event);
extern int arizona_eq_coeff_put(struct snd_kcontrol *kcontrol, extern int arizona_eq_coeff_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol); struct snd_ctl_elem_value *ucontrol);
......
This diff is collapsed.
/*
* cs47l24.h -- ALSA SoC Audio driver for Cirrus Logic CS47L24
*
* Copyright 2015 Cirrus Logic Inc.
*
* Author: Richard Fitzgerald <rf@opensource.wolfsonmicro.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 _CS47L24_H
#define _CS47L24_H
#include "arizona.h"
#define CS47L24_FLL1 1
#define CS47L24_FLL2 2
#define CS47L24_FLL1_REFCLK 3
#define CS47L24_FLL2_REFCLK 4
#endif
This diff is collapsed.
This diff is collapsed.
...@@ -968,10 +968,11 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = { ...@@ -968,10 +968,11 @@ static const struct snd_soc_dapm_route da7219_audio_map[] = {
{"Mixin PGA", NULL, "Mic PGA"}, {"Mixin PGA", NULL, "Mic PGA"},
{"ADC", NULL, "Mixin PGA"}, {"ADC", NULL, "Mixin PGA"},
{"Sidetone Filter", NULL, "ADC"},
{"Mixer In", NULL, "Mixer In Supply"}, {"Mixer In", NULL, "Mixer In Supply"},
{"Mixer In", "Mic Switch", "ADC"}, {"Mixer In", "Mic Switch", "ADC"},
{"Sidetone Filter", NULL, "Mixer In"},
{"Tone Generator", NULL, "TONE"}, {"Tone Generator", NULL, "TONE"},
DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"), DA7219_OUT_DAI_MUX_ROUTES("Out DAIL Mux"),
...@@ -1073,11 +1074,8 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, ...@@ -1073,11 +1074,8 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
u32 freq_ref; u32 freq_ref;
u64 frac_div; u64 frac_div;
/* Verify 32KHz, 2MHz - 54MHz MCLK provided, and set input divider */ /* Verify 2MHz - 54MHz MCLK provided, and set input divider */
if (da7219->mclk_rate == 32768) { if (da7219->mclk_rate < 2000000) {
indiv_bits = DA7219_PLL_INDIV_2_5_MHZ;
indiv = DA7219_PLL_INDIV_2_5_MHZ_VAL;
} else if (da7219->mclk_rate < 2000000) {
dev_err(codec->dev, "PLL input clock %d below valid range\n", dev_err(codec->dev, "PLL input clock %d below valid range\n",
da7219->mclk_rate); da7219->mclk_rate);
return -EINVAL; return -EINVAL;
...@@ -1118,9 +1116,6 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, ...@@ -1118,9 +1116,6 @@ static int da7219_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
case DA7219_SYSCLK_PLL_SRM: case DA7219_SYSCLK_PLL_SRM:
pll_ctrl |= DA7219_PLL_MODE_SRM; pll_ctrl |= DA7219_PLL_MODE_SRM;
break; break;
case DA7219_SYSCLK_PLL_32KHZ:
pll_ctrl |= DA7219_PLL_MODE_32KHZ;
break;
default: default:
dev_err(codec->dev, "Invalid PLL config\n"); dev_err(codec->dev, "Invalid PLL config\n");
return -EINVAL; return -EINVAL;
...@@ -1306,7 +1301,7 @@ static int da7219_hw_params(struct snd_pcm_substream *substream, ...@@ -1306,7 +1301,7 @@ static int da7219_hw_params(struct snd_pcm_substream *substream,
} }
channels = params_channels(params); channels = params_channels(params);
if ((channels < 1) | (channels > DA7219_DAI_CH_NUM_MAX)) { if ((channels < 1) || (channels > DA7219_DAI_CH_NUM_MAX)) {
dev_err(codec->dev, dev_err(codec->dev,
"Invalid number of channels, only 1 to %d supported\n", "Invalid number of channels, only 1 to %d supported\n",
DA7219_DAI_CH_NUM_MAX); DA7219_DAI_CH_NUM_MAX);
...@@ -1405,28 +1400,12 @@ static const struct of_device_id da7219_of_match[] = { ...@@ -1405,28 +1400,12 @@ static const struct of_device_id da7219_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, da7219_of_match); MODULE_DEVICE_TABLE(of, da7219_of_match);
static enum da7219_ldo_lvl_sel da7219_of_ldo_lvl(struct snd_soc_codec *codec,
u32 val)
{
switch (val) {
case 1050:
return DA7219_LDO_LVL_SEL_1_05V;
case 1100:
return DA7219_LDO_LVL_SEL_1_10V;
case 1200:
return DA7219_LDO_LVL_SEL_1_20V;
case 1400:
return DA7219_LDO_LVL_SEL_1_40V;
default:
dev_warn(codec->dev, "Invalid LDO level");
return DA7219_LDO_LVL_SEL_1_05V;
}
}
static enum da7219_micbias_voltage static enum da7219_micbias_voltage
da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val) da7219_of_micbias_lvl(struct snd_soc_codec *codec, u32 val)
{ {
switch (val) { switch (val) {
case 1600:
return DA7219_MICBIAS_1_6V;
case 1800: case 1800:
return DA7219_MICBIAS_1_8V; return DA7219_MICBIAS_1_8V;
case 2000: case 2000:
...@@ -1469,9 +1448,6 @@ static struct da7219_pdata *da7219_of_to_pdata(struct snd_soc_codec *codec) ...@@ -1469,9 +1448,6 @@ static struct da7219_pdata *da7219_of_to_pdata(struct snd_soc_codec *codec)
if (!pdata) if (!pdata)
return NULL; return NULL;
if (of_property_read_u32(np, "dlg,ldo-lvl", &of_val32) >= 0)
pdata->ldo_lvl_sel = da7219_of_ldo_lvl(codec, of_val32);
if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0) if (of_property_read_u32(np, "dlg,micbias-lvl", &of_val32) >= 0)
pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32); pdata->micbias_lvl = da7219_of_micbias_lvl(codec, of_val32);
else else
...@@ -1516,24 +1492,13 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec, ...@@ -1516,24 +1492,13 @@ static int da7219_set_bias_level(struct snd_soc_codec *codec,
snd_soc_update_bits(codec, DA7219_REFERENCES, snd_soc_update_bits(codec, DA7219_REFERENCES,
DA7219_BIAS_EN_MASK, DA7219_BIAS_EN_MASK,
DA7219_BIAS_EN_MASK); DA7219_BIAS_EN_MASK);
/* Enable Internal Digital LDO */
snd_soc_update_bits(codec, DA7219_LDO_CTRL,
DA7219_LDO_EN_MASK,
DA7219_LDO_EN_MASK);
} }
break; break;
case SND_SOC_BIAS_OFF: case SND_SOC_BIAS_OFF:
/* Only disable if jack detection not active */ /* Only disable master bias if jack detection not active */
if (!da7219->aad->jack) { if (!da7219->aad->jack)
/* Bypass Internal Digital LDO */
snd_soc_update_bits(codec, DA7219_LDO_CTRL,
DA7219_LDO_EN_MASK, 0);
/* Master bias */
snd_soc_update_bits(codec, DA7219_REFERENCES, snd_soc_update_bits(codec, DA7219_REFERENCES,
DA7219_BIAS_EN_MASK, 0); DA7219_BIAS_EN_MASK, 0);
}
/* MCLK */ /* MCLK */
if (da7219->mclk) if (da7219->mclk)
...@@ -1600,21 +1565,9 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec) ...@@ -1600,21 +1565,9 @@ static void da7219_handle_pdata(struct snd_soc_codec *codec)
if (pdata) { if (pdata) {
u8 micbias_lvl = 0; u8 micbias_lvl = 0;
/* Internal LDO */
switch (pdata->ldo_lvl_sel) {
case DA7219_LDO_LVL_SEL_1_05V:
case DA7219_LDO_LVL_SEL_1_10V:
case DA7219_LDO_LVL_SEL_1_20V:
case DA7219_LDO_LVL_SEL_1_40V:
snd_soc_update_bits(codec, DA7219_LDO_CTRL,
DA7219_LDO_LEVEL_SELECT_MASK,
(pdata->ldo_lvl_sel <<
DA7219_LDO_LEVEL_SELECT_SHIFT));
break;
}
/* Mic Bias voltages */ /* Mic Bias voltages */
switch (pdata->micbias_lvl) { switch (pdata->micbias_lvl) {
case DA7219_MICBIAS_1_6V:
case DA7219_MICBIAS_1_8V: case DA7219_MICBIAS_1_8V:
case DA7219_MICBIAS_2_0V: case DA7219_MICBIAS_2_0V:
case DA7219_MICBIAS_2_2V: case DA7219_MICBIAS_2_2V:
...@@ -1662,10 +1615,12 @@ static int da7219_probe(struct snd_soc_codec *codec) ...@@ -1662,10 +1615,12 @@ static int da7219_probe(struct snd_soc_codec *codec)
/* Check if MCLK provided */ /* Check if MCLK provided */
da7219->mclk = devm_clk_get(codec->dev, "mclk"); da7219->mclk = devm_clk_get(codec->dev, "mclk");
if (IS_ERR(da7219->mclk)) { if (IS_ERR(da7219->mclk)) {
if (PTR_ERR(da7219->mclk) != -ENOENT) if (PTR_ERR(da7219->mclk) != -ENOENT) {
return PTR_ERR(da7219->mclk); ret = PTR_ERR(da7219->mclk);
else goto err_disable_reg;
} else {
da7219->mclk = NULL; da7219->mclk = NULL;
}
} }
/* Default PC counter to free-running */ /* Default PC counter to free-running */
...@@ -1693,7 +1648,16 @@ static int da7219_probe(struct snd_soc_codec *codec) ...@@ -1693,7 +1648,16 @@ static int da7219_probe(struct snd_soc_codec *codec)
snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK); snd_soc_write(codec, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
/* Initialise AAD block */ /* Initialise AAD block */
return da7219_aad_init(codec); ret = da7219_aad_init(codec);
if (ret)
goto err_disable_reg;
return 0;
err_disable_reg:
regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
return ret;
} }
static int da7219_remove(struct snd_soc_codec *codec) static int da7219_remove(struct snd_soc_codec *codec)
...@@ -1776,7 +1740,7 @@ static struct reg_default da7219_reg_defaults[] = { ...@@ -1776,7 +1740,7 @@ static struct reg_default da7219_reg_defaults[] = {
{ DA7219_DIG_ROUTING_DAC, 0x32 }, { DA7219_DIG_ROUTING_DAC, 0x32 },
{ DA7219_DAI_OFFSET_LOWER, 0x00 }, { DA7219_DAI_OFFSET_LOWER, 0x00 },
{ DA7219_DAI_OFFSET_UPPER, 0x00 }, { DA7219_DAI_OFFSET_UPPER, 0x00 },
{ DA7219_REFERENCES, 0x00 }, { DA7219_REFERENCES, 0x08 },
{ DA7219_MIXIN_L_SELECT, 0x00 }, { DA7219_MIXIN_L_SELECT, 0x00 },
{ DA7219_MIXIN_L_GAIN, 0x03 }, { DA7219_MIXIN_L_GAIN, 0x03 },
{ DA7219_ADC_L_GAIN, 0x6F }, { DA7219_ADC_L_GAIN, 0x6F },
...@@ -1811,7 +1775,6 @@ static struct reg_default da7219_reg_defaults[] = { ...@@ -1811,7 +1775,6 @@ static struct reg_default da7219_reg_defaults[] = {
{ DA7219_CHIP_ID1, 0x23 }, { DA7219_CHIP_ID1, 0x23 },
{ DA7219_CHIP_ID2, 0x93 }, { DA7219_CHIP_ID2, 0x93 },
{ DA7219_CHIP_REVISION, 0x00 }, { DA7219_CHIP_REVISION, 0x00 },
{ DA7219_LDO_CTRL, 0x00 },
{ DA7219_IO_CTRL, 0x00 }, { DA7219_IO_CTRL, 0x00 },
{ DA7219_GAIN_RAMP_CTRL, 0x00 }, { DA7219_GAIN_RAMP_CTRL, 0x00 },
{ DA7219_PC_COUNT, 0x02 }, { DA7219_PC_COUNT, 0x02 },
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#define DA7219_CHIP_ID1 0x81 #define DA7219_CHIP_ID1 0x81
#define DA7219_CHIP_ID2 0x82 #define DA7219_CHIP_ID2 0x82
#define DA7219_CHIP_REVISION 0x83 #define DA7219_CHIP_REVISION 0x83
#define DA7219_LDO_CTRL 0x90
#define DA7219_IO_CTRL 0x91 #define DA7219_IO_CTRL 0x91
#define DA7219_GAIN_RAMP_CTRL 0x92 #define DA7219_GAIN_RAMP_CTRL 0x92
#define DA7219_PC_COUNT 0x94 #define DA7219_PC_COUNT 0x94
...@@ -207,7 +206,6 @@ ...@@ -207,7 +206,6 @@
#define DA7219_PLL_MODE_BYPASS (0x0 << 6) #define DA7219_PLL_MODE_BYPASS (0x0 << 6)
#define DA7219_PLL_MODE_NORMAL (0x1 << 6) #define DA7219_PLL_MODE_NORMAL (0x1 << 6)
#define DA7219_PLL_MODE_SRM (0x2 << 6) #define DA7219_PLL_MODE_SRM (0x2 << 6)
#define DA7219_PLL_MODE_32KHZ (0x3 << 6)
/* DA7219_PLL_FRAC_TOP = 0x22 */ /* DA7219_PLL_FRAC_TOP = 0x22 */
#define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT 0 #define DA7219_PLL_FBDIV_FRAC_TOP_SHIFT 0
...@@ -569,12 +567,6 @@ ...@@ -569,12 +567,6 @@
#define DA7219_CHIP_MAJOR_SHIFT 4 #define DA7219_CHIP_MAJOR_SHIFT 4
#define DA7219_CHIP_MAJOR_MASK (0xF << 4) #define DA7219_CHIP_MAJOR_MASK (0xF << 4)
/* DA7219_LDO_CTRL = 0x90 */
#define DA7219_LDO_LEVEL_SELECT_SHIFT 4
#define DA7219_LDO_LEVEL_SELECT_MASK (0x3 << 4)
#define DA7219_LDO_EN_SHIFT 7
#define DA7219_LDO_EN_MASK (0x1 << 7)
/* DA7219_IO_CTRL = 0x91 */ /* DA7219_IO_CTRL = 0x91 */
#define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0 #define DA7219_IO_VOLTAGE_LEVEL_SHIFT 0
#define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0) #define DA7219_IO_VOLTAGE_LEVEL_MASK (0x1 << 0)
...@@ -787,7 +779,6 @@ enum da7219_sys_clk { ...@@ -787,7 +779,6 @@ enum da7219_sys_clk {
DA7219_SYSCLK_MCLK = 0, DA7219_SYSCLK_MCLK = 0,
DA7219_SYSCLK_PLL, DA7219_SYSCLK_PLL,
DA7219_SYSCLK_PLL_SRM, DA7219_SYSCLK_PLL_SRM,
DA7219_SYSCLK_PLL_32KHZ
}; };
/* Regulators */ /* Regulators */
......
This diff is collapsed.
This diff is collapsed.
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* max98357a.c -- MAX98357A ALSA SoC Codec driver * max98357a.c -- MAX98357A ALSA SoC Codec driver
*/ */
#include <linux/acpi.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -123,10 +124,19 @@ static const struct of_device_id max98357a_device_id[] = { ...@@ -123,10 +124,19 @@ static const struct of_device_id max98357a_device_id[] = {
MODULE_DEVICE_TABLE(of, max98357a_device_id); MODULE_DEVICE_TABLE(of, max98357a_device_id);
#endif #endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id max98357a_acpi_match[] = {
{ "MX98357A", 0 },
{},
};
MODULE_DEVICE_TABLE(acpi, max98357a_acpi_match);
#endif
static struct platform_driver max98357a_platform_driver = { static struct platform_driver max98357a_platform_driver = {
.driver = { .driver = {
.name = "max98357a", .name = "max98357a",
.of_match_table = of_match_ptr(max98357a_device_id), .of_match_table = of_match_ptr(max98357a_device_id),
.acpi_match_table = ACPI_PTR(max98357a_acpi_match),
}, },
.probe = max98357a_platform_probe, .probe = max98357a_platform_probe,
.remove = max98357a_platform_remove, .remove = max98357a_platform_remove,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1114,6 +1114,12 @@ static const struct dmi_system_id force_combo_jack_table[] = { ...@@ -1114,6 +1114,12 @@ static const struct dmi_system_id force_combo_jack_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "Wilson Beach SDS") DMI_MATCH(DMI_BOARD_NAME, "Wilson Beach SDS")
} }
}, },
{
.ident = "Intel Skylake RVP",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "Skylake Client platform")
}
},
{ } { }
}; };
......
...@@ -854,8 +854,6 @@ static int rt298_set_dai_sysclk(struct snd_soc_dai *dai, ...@@ -854,8 +854,6 @@ static int rt298_set_dai_sysclk(struct snd_soc_dai *dai,
} else { } else {
snd_soc_update_bits(codec, snd_soc_update_bits(codec,
RT298_I2S_CTRL2, 0x0100, 0x0100); RT298_I2S_CTRL2, 0x0100, 0x0100);
snd_soc_update_bits(codec,
RT298_PLL_CTRL, 0x4, 0x4);
snd_soc_update_bits(codec, snd_soc_update_bits(codec,
RT298_PLL_CTRL1, 0x20, 0x0); RT298_PLL_CTRL1, 0x20, 0x0);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -309,7 +309,7 @@ static const struct snd_pcm_hw_constraint_list ssm2518_constraints_12288000 = { ...@@ -309,7 +309,7 @@ static const struct snd_pcm_hw_constraint_list ssm2518_constraints_12288000 = {
.count = ARRAY_SIZE(ssm2518_rates_12288000), .count = ARRAY_SIZE(ssm2518_rates_12288000),
}; };
static unsigned int ssm2518_lookup_mcs(struct ssm2518 *ssm2518, static int ssm2518_lookup_mcs(struct ssm2518 *ssm2518,
unsigned int rate) unsigned int rate)
{ {
const unsigned int *sysclks = NULL; const unsigned int *sysclks = NULL;
......
This diff is collapsed.
...@@ -1804,7 +1804,7 @@ static int wm8903_gpio_get(struct gpio_chip *chip, unsigned offset) ...@@ -1804,7 +1804,7 @@ static int wm8903_gpio_get(struct gpio_chip *chip, unsigned offset)
regmap_read(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, &reg); regmap_read(wm8903->regmap, WM8903_GPIO_CONTROL_1 + offset, &reg);
return (reg & WM8903_GP1_LVL_MASK) >> WM8903_GP1_LVL_SHIFT; return !!((reg & WM8903_GP1_LVL_MASK) >> WM8903_GP1_LVL_SHIFT);
} }
static int wm8903_gpio_direction_out(struct gpio_chip *chip, static int wm8903_gpio_direction_out(struct gpio_chip *chip,
......
...@@ -312,7 +312,7 @@ static bool wm8904_readable_register(struct device *dev, unsigned int reg) ...@@ -312,7 +312,7 @@ static bool wm8904_readable_register(struct device *dev, unsigned int reg)
case WM8904_FLL_NCO_TEST_1: case WM8904_FLL_NCO_TEST_1:
return true; return true;
default: default:
return true; return false;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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