mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'sound-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
"As the diffstat shows we've had again a lot of works done for this
cycle: the majority of changes are the continued componentization and
code refactoring in ASoC, the tree-wide PCM API updates and cleanups
and SOF updates while a few ASoC driver updates are seen, too.
Here we go, some highlights:
Core:
- Finally y2038 support landed to ALSA ABI; some ioctls have been
extended and lots of tricks were applied
- Applying the new managed PCM buffer API to all drivers; the API
itself was already merged in 5.5
- The already deprecated dimension support in ALSA control API is
dropped completely now
- Verification of ALSA control elements to catch API misuses
ASoC:
- Further code refactorings and moving things to the component level
- Lots of updates and improvements on SOF / Intel drivers; now
including common HDMI driver and SoundWire support
- New driver support for Ingenic JZ4770, Mediatek MT6660, Qualcomm
WCD934x and WSA881x, and Realtek RT700, RT711, RT715, RT1011,
RT1015 and RT1308
HD-audio:
- Improved ring-buffer communications using waitqueue
- Drop the superfluous buffer preallocation on x86
Others:
- Many code cleanups, mostly constifications over the whole tree
- USB-audio: quirks for MOTU, Corsair Virtuoso, Line6 Helix
- FireWire: code refactoring for oxfw and dice drivers"
* tag 'sound-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (638 commits)
ALSA: usb-audio: add quirks for Line6 Helix devices fw>=2.82
ALSA: hda: Add Clevo W65_67SB the power_save blacklist
ASoC: soc-core: remove null_snd_soc_ops
ASoC: soc-pcm: add soc_rtd_trigger()
ASoC: soc-pcm: add soc_rtd_hw_free()
ASoC: soc-pcm: add soc_rtd_hw_params()
ASoC: soc-pcm: add soc_rtd_prepare()
ASoC: soc-pcm: add soc_rtd_shutdown()
ASoC: soc-pcm: add soc_rtd_startup()
ASoC: rt1015: add rt1015 amplifier driver
ASoC: madera: Correct some kernel doc
ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
ASoC: Intel: skl_hda_dsp_common: Fix global-out-of-bounds bug
ASoC: madera: Correct DMIC only input hook ups
ALSA: cs46xx: fix spelling mistake "to" -> "too"
ALSA: hda - Add docking station support for Lenovo Thinkpad T420s
ASoC: Add MediaTek MT6660 Speaker Amp Driver
ASoC: dt-bindings: rt5645: add suppliers
ASoC: max98090: fix deadlock in max98090_dapm_put_enum_double()
ASoC: dapm: add snd_soc_dapm_put_enum_double_locked
...
This commit is contained in:
@@ -17,6 +17,9 @@ Required properties:
|
||||
* "arb" : memory ARB line (required)
|
||||
* "rst" : dedicated device reset line (optional)
|
||||
- #sound-dai-cells: must be 0.
|
||||
- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
|
||||
is useful for determining certain configuration such
|
||||
as the flush threshold of the fifo
|
||||
|
||||
Example of FRDDR A on the A113 SoC:
|
||||
|
||||
@@ -27,4 +30,5 @@ frddr_a: audio-controller@1c0 {
|
||||
interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
|
||||
clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
|
||||
resets = <&arb AXG_ARB_FRDDR_A>;
|
||||
fifo-depth = <512>;
|
||||
};
|
||||
|
||||
@@ -8,7 +8,12 @@ three substreams within totally 10 channels.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : Contains "fsl,imx35-asrc" or "fsl,imx53-asrc".
|
||||
- compatible : Compatible list, should contain one of the following
|
||||
compatibles:
|
||||
"fsl,imx35-asrc",
|
||||
"fsl,imx53-asrc",
|
||||
"fsl,imx8qm-asrc",
|
||||
"fsl,imx8qxp-asrc",
|
||||
|
||||
- reg : Offset and length of the register set for the device.
|
||||
|
||||
@@ -35,6 +40,11 @@ Required properties:
|
||||
|
||||
- fsl,asrc-width : Defines a mutual sample width used by DPCM Back Ends.
|
||||
|
||||
- fsl,asrc-clk-map : Defines clock map used in driver. which is required
|
||||
by imx8qm/imx8qxp platform
|
||||
<0> - select the map for asrc0 in imx8qm/imx8qxp
|
||||
<1> - select the map for asrc1 in imx8qm/imx8qxp
|
||||
|
||||
Optional properties:
|
||||
|
||||
- big-endian : If this property is absent, the little endian mode
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
GTM601 UMTS modem audio interface CODEC
|
||||
|
||||
This device has no configuration interface. Sample rate is fixed - 8kHz.
|
||||
This device has no configuration interface. The sample rate and channels are
|
||||
based on the compatible string
|
||||
"option,gtm601" = 8kHz mono
|
||||
"broadmobi,bm818" = 48KHz stereo
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "option,gtm601"
|
||||
- compatible : one of
|
||||
"option,gtm601"
|
||||
"broadmobi,bm818"
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/ingenic,codec.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Ingenic JZ47xx internal codec DT bindings
|
||||
|
||||
maintainers:
|
||||
- Paul Cercueil <paul@crapouillou.net>
|
||||
|
||||
properties:
|
||||
$nodename:
|
||||
pattern: '^audio-codec@.*'
|
||||
|
||||
compatible:
|
||||
oneOf:
|
||||
- const: ingenic,jz4770-codec
|
||||
- const: ingenic,jz4725b-codec
|
||||
- const: ingenic,jz4740-codec
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: aic
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 0
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
- clock-names
|
||||
- '#sound-dai-cells'
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/jz4740-cgu.h>
|
||||
codec: audio-codec@10020080 {
|
||||
compatible = "ingenic,jz4740-codec";
|
||||
reg = <0x10020080 0x8>;
|
||||
#sound-dai-cells = <0>;
|
||||
clocks = <&cgu JZ4740_CLK_AIC>;
|
||||
clock-names = "aic";
|
||||
};
|
||||
|
||||
...
|
||||
@@ -1,20 +0,0 @@
|
||||
Ingenic JZ4725B codec controller
|
||||
|
||||
Required properties:
|
||||
- compatible : "ingenic,jz4725b-codec"
|
||||
- reg : codec registers location and length
|
||||
- clocks : phandle to the AIC clock.
|
||||
- clock-names: must be set to "aic".
|
||||
- #sound-dai-cells: Must be set to 0.
|
||||
|
||||
Example:
|
||||
|
||||
codec: audio-codec@100200a4 {
|
||||
compatible = "ingenic,jz4725b-codec";
|
||||
reg = <0x100200a4 0x8>;
|
||||
|
||||
#sound-dai-cells = <0>;
|
||||
|
||||
clocks = <&cgu JZ4725B_CLK_AIC>;
|
||||
clock-names = "aic";
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
Ingenic JZ4740 codec controller
|
||||
|
||||
Required properties:
|
||||
- compatible : "ingenic,jz4740-codec"
|
||||
- reg : codec registers location and length
|
||||
- clocks : phandle to the AIC clock.
|
||||
- clock-names: must be set to "aic".
|
||||
- #sound-dai-cells: Must be set to 0.
|
||||
|
||||
Example:
|
||||
|
||||
codec: audio-codec@10020080 {
|
||||
compatible = "ingenic,jz4740-codec";
|
||||
reg = <0x10020080 0x8>;
|
||||
|
||||
#sound-dai-cells = <0>;
|
||||
|
||||
clocks = <&cgu JZ4740_CLK_AIC>;
|
||||
clock-names = "aic";
|
||||
};
|
||||
@@ -5,7 +5,10 @@ This binding describes the SDM845 sound card, which uses qdsp for audio.
|
||||
- compatible:
|
||||
Usage: required
|
||||
Value type: <stringlist>
|
||||
Definition: must be "qcom,sdm845-sndcard"
|
||||
Definition: must be one of this
|
||||
"qcom,sdm845-sndcard"
|
||||
"qcom,db845c-sndcard"
|
||||
"lenovo,yoga-c630-sndcard"
|
||||
|
||||
- audio-routing:
|
||||
Usage: Optional
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/qcom,wcd934x.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Bindings for Qualcomm WCD9340/WCD9341 Audio Codec
|
||||
|
||||
maintainers:
|
||||
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
|
||||
description: |
|
||||
Qualcomm WCD9340/WCD9341 Codec is a standalone Hi-Fi audio codec IC.
|
||||
It has in-built Soundwire controller, pin controller, interrupt mux and
|
||||
supports both I2S/I2C and SLIMbus audio interfaces.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: slim217,250
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
reset-gpios:
|
||||
description: GPIO spec for reset line to use
|
||||
maxItems: 1
|
||||
|
||||
slim-ifc-dev: true
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
clock-names:
|
||||
const: extclk
|
||||
|
||||
vdd-buck-supply:
|
||||
description: A reference to the 1.8V buck supply
|
||||
|
||||
vdd-buck-sido-supply:
|
||||
description: A reference to the 1.8V SIDO buck supply
|
||||
|
||||
vdd-rx-supply:
|
||||
description: A reference to the 1.8V rx supply
|
||||
|
||||
vdd-tx-supply:
|
||||
description: A reference to the 1.8V tx supply
|
||||
|
||||
vdd-vbat-supply:
|
||||
description: A reference to the vbat supply
|
||||
|
||||
vdd-io-supply:
|
||||
description: A reference to the 1.8V I/O supply
|
||||
|
||||
vdd-micbias-supply:
|
||||
description: A reference to the micbias supply
|
||||
|
||||
qcom,micbias1-microvolt:
|
||||
description: micbias1 voltage
|
||||
minimum: 1800000
|
||||
maximum: 2850000
|
||||
|
||||
qcom,micbias2-microvolt:
|
||||
description: micbias2 voltage
|
||||
minimum: 1800000
|
||||
maximum: 2850000
|
||||
|
||||
qcom,micbias3-microvolt:
|
||||
description: micbias3 voltage
|
||||
minimum: 1800000
|
||||
maximum: 2850000
|
||||
|
||||
qcom,micbias4-microvolt:
|
||||
description: micbias4 voltage
|
||||
minimum: 1800000
|
||||
maximum: 2850000
|
||||
|
||||
clock-output-names:
|
||||
const: mclk
|
||||
|
||||
clock-frequency:
|
||||
description: Clock frequency of output clk in Hz
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 1
|
||||
|
||||
'#clock-cells':
|
||||
const: 0
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
|
||||
"#address-cells":
|
||||
const: 1
|
||||
|
||||
"#size-cells":
|
||||
const: 1
|
||||
|
||||
gpio@42:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: ../gpio/qcom,wcd934x-gpio.yaml#
|
||||
|
||||
patternProperties:
|
||||
"^.*@[0-9a-f]+$":
|
||||
type: object
|
||||
description: |
|
||||
WCD934x subnode for each slave devices. Bindings of each subnodes
|
||||
depends on the specific driver providing the functionality and
|
||||
documented in their respective bindings.
|
||||
|
||||
properties:
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- reg
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- reset-gpios
|
||||
- slim-ifc-dev
|
||||
- interrupts
|
||||
- interrupt-controller
|
||||
- clock-frequency
|
||||
- clock-output-names
|
||||
- qcom,micbias1-microvolt
|
||||
- qcom,micbias2-microvolt
|
||||
- qcom,micbias3-microvolt
|
||||
- qcom,micbias4-microvolt
|
||||
- "#interrupt-cells"
|
||||
- "#clock-cells"
|
||||
- "#sound-dai-cells"
|
||||
- "#address-cells"
|
||||
- "#size-cells"
|
||||
|
||||
examples:
|
||||
- |
|
||||
codec@1,0{
|
||||
compatible = "slim217,250";
|
||||
reg = <1 0>;
|
||||
reset-gpios = <&tlmm 64 0>;
|
||||
slim-ifc-dev = <&wcd9340_ifd>;
|
||||
#sound-dai-cells = <1>;
|
||||
interrupt-parent = <&tlmm>;
|
||||
interrupts = <54 4>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <9600000>;
|
||||
clock-output-names = "mclk";
|
||||
qcom,micbias1-microvolt = <1800000>;
|
||||
qcom,micbias2-microvolt = <1800000>;
|
||||
qcom,micbias3-microvolt = <1800000>;
|
||||
qcom,micbias4-microvolt = <1800000>;
|
||||
clock-names = "extclk";
|
||||
clocks = <&rpmhcc 2>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
gpio@42 {
|
||||
compatible = "qcom,wcd9340-gpio";
|
||||
reg = <0x42 0x2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
...
|
||||
@@ -0,0 +1,68 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/sound/qcom,wsa881x.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Bindings for Qualcomm WSA8810/WSA8815 Class-D Smart Speaker Amplifier
|
||||
|
||||
maintainers:
|
||||
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
||||
|
||||
description: |
|
||||
WSA8810 is a class-D smart speaker amplifier and WSA8815
|
||||
is a high-output power class-D smart speaker amplifier.
|
||||
Their primary operating mode uses a SoundWire digital audio
|
||||
interface. This binding is for SoundWire interface.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: sdw10217201000
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
powerdown-gpios:
|
||||
description: GPIO spec for Powerdown/Shutdown line to use
|
||||
maxItems: 1
|
||||
|
||||
'#thermal-sensor-cells':
|
||||
const: 0
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 0
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- powerdown-gpios
|
||||
- "#thermal-sensor-cells"
|
||||
- "#sound-dai-cells"
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
soundwire@c2d0000 {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x0c2d0000 0x2000>;
|
||||
|
||||
speaker@0,1 {
|
||||
compatible = "sdw10217201000";
|
||||
reg = <0 1>;
|
||||
powerdown-gpios = <&wcdpinctrl 2 0>;
|
||||
#thermal-sensor-cells = <0>;
|
||||
#sound-dai-cells = <0>;
|
||||
};
|
||||
|
||||
speaker@0,2 {
|
||||
compatible = "sdw10217201000";
|
||||
reg = <0 2>;
|
||||
powerdown-gpios = <&wcdpinctrl 2 0>;
|
||||
#thermal-sensor-cells = <0>;
|
||||
#sound-dai-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
...
|
||||
@@ -0,0 +1,17 @@
|
||||
RT1015 Mono Class D Audio Amplifier
|
||||
|
||||
This device supports I2C only.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : "realtek,rt1015".
|
||||
|
||||
- reg : The I2C address of the device.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
rt1015: codec@28 {
|
||||
compatible = "realtek,rt1015";
|
||||
reg = <0x28>;
|
||||
};
|
||||
@@ -10,6 +10,10 @@ Required properties:
|
||||
|
||||
- interrupts : The CODEC's interrupt output.
|
||||
|
||||
- avdd-supply: Power supply for AVDD, providing 1.8V.
|
||||
|
||||
- cpvdd-supply: Power supply for CPVDD, providing 3.5V.
|
||||
|
||||
Optional properties:
|
||||
|
||||
- hp-detect-gpios:
|
||||
|
||||
@@ -495,7 +495,8 @@ Module for C-Media CMI8338/8738/8768/8770 PCI sound cards.
|
||||
mpu_port
|
||||
port address of MIDI interface (8338 only):
|
||||
0x300,0x310,0x320,0x330 = legacy port,
|
||||
0 = disable (default)
|
||||
1 = integrated PCI port (default on 8738),
|
||||
0 = disable
|
||||
fm_port
|
||||
port address of OPL-3 FM synthesizer (8x38 only):
|
||||
0x388 = legacy port,
|
||||
|
||||
@@ -259,7 +259,7 @@ to details explained in the following section.
|
||||
{
|
||||
struct mychip *chip;
|
||||
int err;
|
||||
static struct snd_device_ops ops = {
|
||||
static const struct snd_device_ops ops = {
|
||||
.dev_free = snd_mychip_dev_free,
|
||||
};
|
||||
|
||||
@@ -675,7 +675,7 @@ low-level device with a specified ``ops``,
|
||||
|
||||
::
|
||||
|
||||
static struct snd_device_ops ops = {
|
||||
static const struct snd_device_ops ops = {
|
||||
.dev_free = snd_mychip_dev_free,
|
||||
};
|
||||
....
|
||||
@@ -761,7 +761,7 @@ destructor and PCI entries. Example code is shown first, below.
|
||||
{
|
||||
struct mychip *chip;
|
||||
int err;
|
||||
static struct snd_device_ops ops = {
|
||||
static const struct snd_device_ops ops = {
|
||||
.dev_free = snd_mychip_dev_free,
|
||||
};
|
||||
|
||||
@@ -3912,7 +3912,7 @@ For a raw-data proc-file, set the attributes as follows:
|
||||
|
||||
::
|
||||
|
||||
static struct snd_info_entry_ops my_file_io_ops = {
|
||||
static const struct snd_info_entry_ops my_file_io_ops = {
|
||||
.read = my_file_io_read,
|
||||
};
|
||||
|
||||
|
||||
@@ -529,17 +529,24 @@ intel_pdi_alh_configure(struct sdw_intel *sdw, struct sdw_cdns_pdi *pdi)
|
||||
intel_writel(alh, SDW_ALH_STRMZCFG(pdi->intel_alh_id), conf);
|
||||
}
|
||||
|
||||
static int intel_config_stream(struct sdw_intel *sdw,
|
||||
static int intel_params_stream(struct sdw_intel *sdw,
|
||||
struct snd_pcm_substream *substream,
|
||||
struct snd_soc_dai *dai,
|
||||
struct snd_pcm_hw_params *hw_params, int link_id)
|
||||
struct snd_pcm_hw_params *hw_params,
|
||||
int link_id, int alh_stream_id)
|
||||
{
|
||||
struct sdw_intel_link_res *res = sdw->res;
|
||||
struct sdw_intel_stream_params_data params_data;
|
||||
|
||||
if (res->ops && res->ops->config_stream && res->arg)
|
||||
return res->ops->config_stream(res->arg,
|
||||
substream, dai, hw_params, link_id);
|
||||
params_data.substream = substream;
|
||||
params_data.dai = dai;
|
||||
params_data.hw_params = hw_params;
|
||||
params_data.link_id = link_id;
|
||||
params_data.alh_stream_id = alh_stream_id;
|
||||
|
||||
if (res->ops && res->ops->params_stream && res->dev)
|
||||
return res->ops->params_stream(res->dev,
|
||||
¶ms_data);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -654,7 +661,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
|
||||
|
||||
|
||||
/* Inform DSP about PDI stream number */
|
||||
ret = intel_config_stream(sdw, substream, dai, params,
|
||||
ret = intel_params_stream(sdw, substream, dai, params,
|
||||
sdw->instance,
|
||||
pdi->intel_alh_id);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
@@ -5,23 +5,26 @@
|
||||
#define __SDW_INTEL_LOCAL_H
|
||||
|
||||
/**
|
||||
* struct sdw_intel_link_res - Soundwire link resources
|
||||
* struct sdw_intel_link_res - Soundwire Intel link resource structure,
|
||||
* typically populated by the controller driver.
|
||||
* @pdev: platform_device
|
||||
* @mmio_base: mmio base of SoundWire registers
|
||||
* @registers: Link IO registers base
|
||||
* @shim: Audio shim pointer
|
||||
* @alh: ALH (Audio Link Hub) pointer
|
||||
* @irq: Interrupt line
|
||||
* @ops: Shim callback ops
|
||||
* @arg: Shim callback ops argument
|
||||
*
|
||||
* This is set as pdata for each link instance.
|
||||
* @dev: device implementing hw_params and free callbacks
|
||||
*/
|
||||
struct sdw_intel_link_res {
|
||||
struct platform_device *pdev;
|
||||
void __iomem *mmio_base; /* not strictly needed, useful for debug */
|
||||
void __iomem *registers;
|
||||
void __iomem *shim;
|
||||
void __iomem *alh;
|
||||
int irq;
|
||||
const struct sdw_intel_ops *ops;
|
||||
void *arg;
|
||||
struct device *dev;
|
||||
};
|
||||
|
||||
#endif /* __SDW_INTEL_LOCAL_H */
|
||||
|
||||
@@ -27,19 +27,9 @@ static int link_mask;
|
||||
module_param_named(sdw_link_mask, link_mask, int, 0444);
|
||||
MODULE_PARM_DESC(sdw_link_mask, "Intel link mask (one bit per link)");
|
||||
|
||||
struct sdw_link_data {
|
||||
struct sdw_intel_link_res res;
|
||||
struct platform_device *pdev;
|
||||
};
|
||||
|
||||
struct sdw_intel_ctx {
|
||||
int count;
|
||||
struct sdw_link_data *links;
|
||||
};
|
||||
|
||||
static int sdw_intel_cleanup_pdev(struct sdw_intel_ctx *ctx)
|
||||
{
|
||||
struct sdw_link_data *link = ctx->links;
|
||||
struct sdw_intel_link_res *link = ctx->links;
|
||||
int i;
|
||||
|
||||
if (!link)
|
||||
@@ -62,7 +52,7 @@ static struct sdw_intel_ctx
|
||||
{
|
||||
struct platform_device_info pdevinfo;
|
||||
struct platform_device *pdev;
|
||||
struct sdw_link_data *link;
|
||||
struct sdw_intel_link_res *link;
|
||||
struct sdw_intel_ctx *ctx;
|
||||
struct acpi_device *adev;
|
||||
int ret, i;
|
||||
@@ -123,14 +113,13 @@ static struct sdw_intel_ctx
|
||||
continue;
|
||||
}
|
||||
|
||||
link->res.irq = res->irq;
|
||||
link->res.registers = res->mmio_base + SDW_LINK_BASE
|
||||
link->registers = res->mmio_base + SDW_LINK_BASE
|
||||
+ (SDW_LINK_SIZE * i);
|
||||
link->res.shim = res->mmio_base + SDW_SHIM_BASE;
|
||||
link->res.alh = res->mmio_base + SDW_ALH_BASE;
|
||||
link->shim = res->mmio_base + SDW_SHIM_BASE;
|
||||
link->alh = res->mmio_base + SDW_ALH_BASE;
|
||||
|
||||
link->res.ops = res->ops;
|
||||
link->res.arg = res->arg;
|
||||
link->ops = res->ops;
|
||||
link->dev = res->dev;
|
||||
|
||||
memset(&pdevinfo, 0, sizeof(pdevinfo));
|
||||
|
||||
@@ -138,8 +127,6 @@ static struct sdw_intel_ctx
|
||||
pdevinfo.name = "int-sdw";
|
||||
pdevinfo.id = i;
|
||||
pdevinfo.fwnode = acpi_fwnode_handle(adev);
|
||||
pdevinfo.data = &link->res;
|
||||
pdevinfo.size_data = sizeof(link->res);
|
||||
|
||||
pdev = platform_device_register_full(&pdevinfo);
|
||||
if (IS_ERR(pdev)) {
|
||||
@@ -216,7 +203,6 @@ void *sdw_intel_init(acpi_handle *parent_handle, struct sdw_intel_res *res)
|
||||
|
||||
return sdw_intel_add_controller(res);
|
||||
}
|
||||
EXPORT_SYMBOL(sdw_intel_init);
|
||||
|
||||
/**
|
||||
* sdw_intel_exit() - SoundWire Intel exit
|
||||
@@ -224,10 +210,8 @@ EXPORT_SYMBOL(sdw_intel_init);
|
||||
*
|
||||
* Delete the controller instances created and cleanup
|
||||
*/
|
||||
void sdw_intel_exit(void *arg)
|
||||
void sdw_intel_exit(struct sdw_intel_ctx *ctx)
|
||||
{
|
||||
struct sdw_intel_ctx *ctx = arg;
|
||||
|
||||
sdw_intel_cleanup_pdev(ctx);
|
||||
kfree(ctx);
|
||||
}
|
||||
|
||||
@@ -547,6 +547,20 @@ struct sdw_slave_ops {
|
||||
* @node: node for bus list
|
||||
* @port_ready: Port ready completion flag for each Slave port
|
||||
* @dev_num: Device Number assigned by Bus
|
||||
* @probed: boolean tracking driver state
|
||||
* @probe_complete: completion utility to control potential races
|
||||
* on startup between driver probe/initialization and SoundWire
|
||||
* Slave state changes/implementation-defined interrupts
|
||||
* @enumeration_complete: completion utility to control potential races
|
||||
* on startup between device enumeration and read/write access to the
|
||||
* Slave device
|
||||
* @initialization_complete: completion utility to control potential races
|
||||
* on startup between device enumeration and settings being restored
|
||||
* @unattach_request: mask field to keep track why the Slave re-attached and
|
||||
* was re-initialized. This is useful to deal with potential race conditions
|
||||
* between the Master suspending and the codec resuming, and make sure that
|
||||
* when the Master triggered a reset the Slave is properly enumerated and
|
||||
* initialized
|
||||
*/
|
||||
struct sdw_slave {
|
||||
struct sdw_slave_id id;
|
||||
@@ -561,6 +575,11 @@ struct sdw_slave {
|
||||
struct list_head node;
|
||||
struct completion *port_ready;
|
||||
u16 dev_num;
|
||||
bool probed;
|
||||
struct completion probe_complete;
|
||||
struct completion enumeration_complete;
|
||||
struct completion initialization_complete;
|
||||
u32 unattach_request;
|
||||
};
|
||||
|
||||
#define dev_to_sdw_dev(_dev) container_of(_dev, struct sdw_slave, dev)
|
||||
|
||||
@@ -4,36 +4,174 @@
|
||||
#ifndef __SDW_INTEL_H
|
||||
#define __SDW_INTEL_H
|
||||
|
||||
#include <linux/irqreturn.h>
|
||||
|
||||
/**
|
||||
* struct sdw_intel_ops: Intel audio driver callback ops
|
||||
*
|
||||
* @config_stream: configure the stream with the hw_params
|
||||
* the first argument containing the context is mandatory
|
||||
* struct sdw_intel_stream_params_data: configuration passed during
|
||||
* the @params_stream callback, e.g. for interaction with DSP
|
||||
* firmware.
|
||||
*/
|
||||
struct sdw_intel_ops {
|
||||
int (*config_stream)(void *arg, void *substream,
|
||||
void *dai, void *hw_params, int stream_num);
|
||||
struct sdw_intel_stream_params_data {
|
||||
struct snd_pcm_substream *substream;
|
||||
struct snd_soc_dai *dai;
|
||||
struct snd_pcm_hw_params *hw_params;
|
||||
int link_id;
|
||||
int alh_stream_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_intel_res - Soundwire Intel resource structure
|
||||
* struct sdw_intel_stream_free_data: configuration passed during
|
||||
* the @free_stream callback, e.g. for interaction with DSP
|
||||
* firmware.
|
||||
*/
|
||||
struct sdw_intel_stream_free_data {
|
||||
struct snd_pcm_substream *substream;
|
||||
struct snd_soc_dai *dai;
|
||||
int link_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_intel_ops: Intel audio driver callback ops
|
||||
*
|
||||
*/
|
||||
struct sdw_intel_ops {
|
||||
int (*params_stream)(struct device *dev,
|
||||
struct sdw_intel_stream_params_data *params_data);
|
||||
int (*free_stream)(struct device *dev,
|
||||
struct sdw_intel_stream_free_data *free_data);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_intel_acpi_info - Soundwire Intel information found in ACPI tables
|
||||
* @handle: ACPI controller handle
|
||||
* @count: link count found with "sdw-master-count" property
|
||||
* @link_mask: bit-wise mask listing links enabled by BIOS menu
|
||||
*
|
||||
* this structure could be expanded to e.g. provide all the _ADR
|
||||
* information in case the link_mask is not sufficient to identify
|
||||
* platform capabilities.
|
||||
*/
|
||||
struct sdw_intel_acpi_info {
|
||||
acpi_handle handle;
|
||||
int count;
|
||||
u32 link_mask;
|
||||
};
|
||||
|
||||
struct sdw_intel_link_res;
|
||||
|
||||
/* Intel clock-stop/pm_runtime quirk definitions */
|
||||
|
||||
/*
|
||||
* Force the clock to remain on during pm_runtime suspend. This might
|
||||
* be needed if Slave devices do not have an alternate clock source or
|
||||
* if the latency requirements are very strict.
|
||||
*/
|
||||
#define SDW_INTEL_CLK_STOP_NOT_ALLOWED BIT(0)
|
||||
|
||||
/*
|
||||
* Stop the bus during pm_runtime suspend. If set, a complete bus
|
||||
* reset and re-enumeration will be performed when the bus
|
||||
* restarts. This mode shall not be used if Slave devices can generate
|
||||
* in-band wakes.
|
||||
*/
|
||||
#define SDW_INTEL_CLK_STOP_TEARDOWN BIT(1)
|
||||
|
||||
/*
|
||||
* Stop the bus during pm_suspend if Slaves are not wake capable
|
||||
* (e.g. speaker amplifiers). The clock-stop mode is typically
|
||||
* slightly higher power than when the IP is completely powered-off.
|
||||
*/
|
||||
#define SDW_INTEL_CLK_STOP_WAKE_CAPABLE_ONLY BIT(2)
|
||||
|
||||
/*
|
||||
* Require a bus reset (and complete re-enumeration) when exiting
|
||||
* clock stop modes. This may be needed if the controller power was
|
||||
* turned off and all context lost. This quirk shall not be used if a
|
||||
* Slave device needs to remain enumerated and keep its context,
|
||||
* e.g. to provide the reasons for the wake, report acoustic events or
|
||||
* pass a history buffer.
|
||||
*/
|
||||
#define SDW_INTEL_CLK_STOP_BUS_RESET BIT(3)
|
||||
|
||||
/**
|
||||
* struct sdw_intel_ctx - context allocated by the controller
|
||||
* driver probe
|
||||
* @count: link count
|
||||
* @mmio_base: mmio base of SoundWire registers, only used to check
|
||||
* hardware capabilities after all power dependencies are settled.
|
||||
* @link_mask: bit-wise mask listing SoundWire links reported by the
|
||||
* Controller
|
||||
* @handle: ACPI parent handle
|
||||
* @links: information for each link (controller-specific and kept
|
||||
* opaque here)
|
||||
* @link_list: list to handle interrupts across all links
|
||||
* @shim_lock: mutex to handle concurrent rmw access to shared SHIM registers.
|
||||
*/
|
||||
struct sdw_intel_ctx {
|
||||
int count;
|
||||
void __iomem *mmio_base;
|
||||
u32 link_mask;
|
||||
acpi_handle handle;
|
||||
struct sdw_intel_link_res *links;
|
||||
struct list_head link_list;
|
||||
struct mutex shim_lock; /* lock for access to shared SHIM registers */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sdw_intel_res - Soundwire Intel global resource structure,
|
||||
* typically populated by the DSP driver
|
||||
*
|
||||
* @count: link count
|
||||
* @mmio_base: mmio base of SoundWire registers
|
||||
* @irq: interrupt number
|
||||
* @handle: ACPI parent handle
|
||||
* @parent: parent device
|
||||
* @ops: callback ops
|
||||
* @arg: callback arg
|
||||
* @dev: device implementing hwparams and free callbacks
|
||||
* @link_mask: bit-wise mask listing links selected by the DSP driver
|
||||
* This mask may be a subset of the one reported by the controller since
|
||||
* machine-specific quirks are handled in the DSP driver.
|
||||
* @clock_stop_quirks: mask array of possible behaviors requested by the
|
||||
* DSP driver. The quirks are common for all links for now.
|
||||
*/
|
||||
struct sdw_intel_res {
|
||||
int count;
|
||||
void __iomem *mmio_base;
|
||||
int irq;
|
||||
acpi_handle handle;
|
||||
struct device *parent;
|
||||
const struct sdw_intel_ops *ops;
|
||||
void *arg;
|
||||
struct device *dev;
|
||||
u32 link_mask;
|
||||
u32 clock_stop_quirks;
|
||||
};
|
||||
|
||||
void *sdw_intel_init(acpi_handle *parent_handle, struct sdw_intel_res *res);
|
||||
void sdw_intel_exit(void *arg);
|
||||
/*
|
||||
* On Intel platforms, the SoundWire IP has dependencies on power
|
||||
* rails shared with the DSP, and the initialization steps are split
|
||||
* in three. First an ACPI scan to check what the firmware describes
|
||||
* in DSDT tables, then an allocation step (with no hardware
|
||||
* configuration but with all the relevant devices created) and last
|
||||
* the actual hardware configuration. The final stage is a global
|
||||
* interrupt enable which is controlled by the DSP driver. Splitting
|
||||
* these phases helps simplify the boot flow and make early decisions
|
||||
* on e.g. which machine driver to select (I2S mode, HDaudio or
|
||||
* SoundWire).
|
||||
*/
|
||||
int sdw_intel_acpi_scan(acpi_handle *parent_handle,
|
||||
struct sdw_intel_acpi_info *info);
|
||||
|
||||
void sdw_intel_process_wakeen_event(struct sdw_intel_ctx *ctx);
|
||||
|
||||
struct sdw_intel_ctx *
|
||||
sdw_intel_probe(struct sdw_intel_res *res);
|
||||
|
||||
int sdw_intel_startup(struct sdw_intel_ctx *ctx);
|
||||
|
||||
void sdw_intel_exit(struct sdw_intel_ctx *ctx);
|
||||
|
||||
void sdw_intel_enable_irq(void __iomem *mmio_base, bool enable);
|
||||
|
||||
irqreturn_t sdw_intel_thread(int irq, void *dev_id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -197,7 +197,7 @@ struct snd_ac97_bus_ops {
|
||||
|
||||
struct snd_ac97_bus {
|
||||
/* -- lowlevel (hardware) driver specific -- */
|
||||
struct snd_ac97_bus_ops *ops;
|
||||
const struct snd_ac97_bus_ops *ops;
|
||||
void *private_data;
|
||||
void (*private_free) (struct snd_ac97_bus *bus);
|
||||
/* --- */
|
||||
@@ -310,7 +310,8 @@ static inline int ac97_can_spdif(struct snd_ac97 * ac97)
|
||||
|
||||
/* functions */
|
||||
/* create new AC97 bus */
|
||||
int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
|
||||
int snd_ac97_bus(struct snd_card *card, int num,
|
||||
const struct snd_ac97_bus_ops *ops,
|
||||
void *private_data, struct snd_ac97_bus **rbus);
|
||||
/* create mixer controls */
|
||||
int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
|
||||
|
||||
@@ -22,6 +22,16 @@ typedef int (snd_kcontrol_tlv_rw_t)(struct snd_kcontrol *kcontrol,
|
||||
unsigned int size,
|
||||
unsigned int __user *tlv);
|
||||
|
||||
/* internal flag for skipping validations */
|
||||
#ifdef CONFIG_SND_CTL_VALIDATION
|
||||
#define SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK (1 << 27)
|
||||
#define snd_ctl_skip_validation(info) \
|
||||
((info)->access & SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK)
|
||||
#else
|
||||
#define SNDRV_CTL_ELEM_ACCESS_SKIP_CHECK 0
|
||||
#define snd_ctl_skip_validation(info) true
|
||||
#endif
|
||||
|
||||
enum {
|
||||
SNDRV_CTL_TLV_OP_READ = 0,
|
||||
SNDRV_CTL_TLV_OP_WRITE = 1,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user