Skip to content

Commit

Permalink
Merge tag 'asoc-fix-v5.7-rc2' of https://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.7

Quite a lot of fixes here, a lot of driver specific ones but the biggest
one is the revert of changes to the startup and shutdown sequence for
DAIs that went in during the merge window - they broke some older x86
platforms and attempts to fix them didn't succeed so it's safer to just
roll them back and try to make sure those platforms are handled properly
in any future attempt.

The rockchip S/PDIF DT stuff was IIRC for validation issues.
  • Loading branch information
Takashi Iwai committed Apr 21, 2020
2 parents cf9fb7b + 1e060a4 commit e7b6b3e
Show file tree
Hide file tree
Showing 32 changed files with 509 additions and 263 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/sound/rockchip-i2s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ properties:
- const: tx
- const: rx

power-domains:
maxItems: 1

rockchip,capture-channels:
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32
Expand Down
45 changes: 0 additions & 45 deletions Documentation/devicetree/bindings/sound/rockchip-spdif.txt

This file was deleted.

101 changes: 101 additions & 0 deletions Documentation/devicetree/bindings/sound/rockchip-spdif.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/rockchip-spdif.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Rockchip SPDIF transceiver

description:
The S/PDIF audio block is a stereo transceiver that allows the
processor to receive and transmit digital audio via a coaxial or
fibre cable.

maintainers:
- Heiko Stuebner <heiko@sntech.de>

properties:
compatible:
oneOf:
- const: rockchip,rk3066-spdif
- const: rockchip,rk3228-spdif
- const: rockchip,rk3328-spdif
- const: rockchip,rk3366-spdif
- const: rockchip,rk3368-spdif
- const: rockchip,rk3399-spdif
- items:
- enum:
- rockchip,rk3188-spdif
- rockchip,rk3288-spdif
- const: rockchip,rk3066-spdif

reg:
maxItems: 1

interrupts:
maxItems: 1

clocks:
items:
- description: clock for SPDIF bus
- description: clock for SPDIF controller

clock-names:
items:
- const: mclk
- const: hclk

dmas:
maxItems: 1

dma-names:
const: tx

power-domains:
maxItems: 1

rockchip,grf:
$ref: /schemas/types.yaml#/definitions/phandle
description:
The phandle of the syscon node for the GRF register.
Required property on RK3288.

"#sound-dai-cells":
const: 0

required:
- compatible
- reg
- interrupts
- clocks
- clock-names
- dmas
- dma-names
- "#sound-dai-cells"

if:
properties:
compatible:
contains:
const: rockchip,rk3288-spdif

then:
required:
- rockchip,grf

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/rk3188-cru.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
spdif: spdif@1011e000 {
compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
reg = <0x1011e000 0x2000>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF>;
clock-names = "mclk", "hclk";
dmas = <&dmac1_s 8>;
dma-names = "tx";
#sound-dai-cells = <0>;
};
1 change: 0 additions & 1 deletion include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ struct snd_soc_dai {

/* bit field */
unsigned int probed:1;
unsigned int started[SNDRV_PCM_STREAM_LAST + 1];
};

static inline struct snd_soc_pcm_stream *
Expand Down
3 changes: 3 additions & 0 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ struct snd_soc_dai_link {
const struct snd_soc_pcm_stream *params;
unsigned int num_params;

struct snd_soc_dapm_widget *playback_widget;
struct snd_soc_dapm_widget *capture_widget;

unsigned int dai_fmt; /* format to set on init */

enum snd_soc_dpcm_trigger trigger[2]; /* trigger type for DPCM */
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/amd/acp3x-rt5682-max9836.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
}

snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(pco_jack.jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);

ret = snd_soc_component_set_jack(component, &pco_jack, NULL);
if (ret) {
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1525,6 +1525,7 @@ config SND_SOC_WM8804_SPI

config SND_SOC_WM8900
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8903
tristate "Wolfson Microelectronics WM8903 CODEC"
Expand Down Expand Up @@ -1576,6 +1577,7 @@ config SND_SOC_WM8985

config SND_SOC_WM8988
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8990
tristate
Expand All @@ -1594,6 +1596,7 @@ config SND_SOC_WM8994

config SND_SOC_WM8995
tristate
depends on SND_SOC_I2C_AND_SPI

config SND_SOC_WM8996
tristate
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ static struct hdac_hdmi_pcm *
hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi,
struct hdac_hdmi_cvt *cvt)
{
struct hdac_hdmi_pcm *pcm = NULL;
struct hdac_hdmi_pcm *pcm;

list_for_each_entry(pcm, &hdmi->pcm_list, head) {
if (pcm->cvt == cvt)
break;
return pcm;
}

return pcm;
return NULL;
}

static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm,
Expand Down
4 changes: 0 additions & 4 deletions sound/soc/codecs/madera.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,6 @@ const struct soc_enum madera_isrc_fsh[] = {
MADERA_ISRC4_FSH_SHIFT, 0xf,
MADERA_RATE_ENUM_SIZE,
madera_rate_text, madera_rate_val),

};
EXPORT_SYMBOL_GPL(madera_isrc_fsh);

Expand All @@ -1924,7 +1923,6 @@ const struct soc_enum madera_isrc_fsl[] = {
MADERA_ISRC4_FSL_SHIFT, 0xf,
MADERA_RATE_ENUM_SIZE,
madera_rate_text, madera_rate_val),

};
EXPORT_SYMBOL_GPL(madera_isrc_fsl);

Expand All @@ -1938,7 +1936,6 @@ const struct soc_enum madera_asrc1_rate[] = {
MADERA_ASYNC_RATE_ENUM_SIZE,
madera_rate_text + MADERA_SYNC_RATE_ENUM_SIZE,
madera_rate_val + MADERA_SYNC_RATE_ENUM_SIZE),

};
EXPORT_SYMBOL_GPL(madera_asrc1_rate);

Expand All @@ -1964,7 +1961,6 @@ const struct soc_enum madera_asrc2_rate[] = {
MADERA_ASYNC_RATE_ENUM_SIZE,
madera_rate_text + MADERA_SYNC_RATE_ENUM_SIZE,
madera_rate_val + MADERA_SYNC_RATE_ENUM_SIZE),

};
EXPORT_SYMBOL_GPL(madera_asrc2_rate);

Expand Down
34 changes: 34 additions & 0 deletions sound/soc/codecs/sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,40 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,
dev_err(&client->dev,
"Error %d initializing CHIP_CLK_CTRL\n", ret);

/* Mute everything to avoid pop from the following power-up */
ret = regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_CTRL,
SGTL5000_CHIP_ANA_CTRL_DEFAULT);
if (ret) {
dev_err(&client->dev,
"Error %d muting outputs via CHIP_ANA_CTRL\n", ret);
goto disable_clk;
}

/*
* If VAG is powered-on (e.g. from previous boot), it would be disabled
* by the write to ANA_POWER in later steps of the probe code. This
* may create a loud pop even with all outputs muted. The proper way
* to circumvent this is disabling the bit first and waiting the proper
* cool-down time.
*/
ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, &value);
if (ret) {
dev_err(&client->dev, "Failed to read ANA_POWER: %d\n", ret);
goto disable_clk;
}
if (value & SGTL5000_VAG_POWERUP) {
ret = regmap_update_bits(sgtl5000->regmap,
SGTL5000_CHIP_ANA_POWER,
SGTL5000_VAG_POWERUP,
0);
if (ret) {
dev_err(&client->dev, "Error %d disabling VAG\n", ret);
goto disable_clk;
}

msleep(SGTL5000_VAG_POWERDOWN_DELAY);
}

/* Follow section 2.2.1.1 of AN3663 */
ana_pwr = SGTL5000_ANA_POWER_DEFAULT;
if (sgtl5000->num_supplies <= VDDD) {
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/sgtl5000.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
/*
* SGTL5000_CHIP_ANA_CTRL
*/
#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133
#define SGTL5000_LINE_OUT_MUTE 0x0100
#define SGTL5000_HP_SEL_MASK 0x0040
#define SGTL5000_HP_SEL_SHIFT 6
Expand Down
20 changes: 15 additions & 5 deletions sound/soc/codecs/tas571x.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,8 +820,10 @@ static int tas571x_i2c_probe(struct i2c_client *client,

priv->regmap = devm_regmap_init(dev, NULL, client,
priv->chip->regmap_config);
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
if (IS_ERR(priv->regmap)) {
ret = PTR_ERR(priv->regmap);
goto disable_regs;
}

priv->pdn_gpio = devm_gpiod_get_optional(dev, "pdn", GPIOD_OUT_LOW);
if (IS_ERR(priv->pdn_gpio)) {
Expand All @@ -845,7 +847,7 @@ static int tas571x_i2c_probe(struct i2c_client *client,

ret = regmap_write(priv->regmap, TAS571X_OSC_TRIM_REG, 0);
if (ret)
return ret;
goto disable_regs;

usleep_range(50000, 60000);

Expand All @@ -861,12 +863,20 @@ static int tas571x_i2c_probe(struct i2c_client *client,
*/
ret = regmap_update_bits(priv->regmap, TAS571X_MVOL_REG, 1, 0);
if (ret)
return ret;
goto disable_regs;
}

return devm_snd_soc_register_component(&client->dev,
ret = devm_snd_soc_register_component(&client->dev,
&priv->component_driver,
&tas571x_dai, 1);
if (ret)
goto disable_regs;

return ret;

disable_regs:
regulator_bulk_disable(priv->chip->num_supply_names, priv->supplies);
return ret;
}

static int tas571x_i2c_remove(struct i2c_client *client)
Expand Down
3 changes: 1 addition & 2 deletions sound/soc/codecs/wm8960.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,

wm8960->is_stream_in_use[tx] = true;

if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_ON &&
!wm8960->is_stream_in_use[!tx])
if (!wm8960->is_stream_in_use[!tx])
return wm8960_configure_clocking(component);

return 0;
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/wsa881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,27 +394,31 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = {
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
.read_only_wordlength = true,
}, {
/* COMP */
.num = 2,
.type = SDW_DPN_SIMPLE,
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
.read_only_wordlength = true,
}, {
/* BOOST */
.num = 3,
.type = SDW_DPN_SIMPLE,
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
.read_only_wordlength = true,
}, {
/* VISENSE */
.num = 4,
.type = SDW_DPN_SIMPLE,
.min_ch = 1,
.max_ch = 1,
.simple_ch_prep_sm = true,
.read_only_wordlength = true,
}
};

Expand Down
Loading

0 comments on commit e7b6b3e

Please sign in to comment.