Skip to content

Commit

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

ASoC: Fixes for v5.15

A collection of fixes that came in during the merge window, nothing too
remarkable but a reasonably large number of fixes.
  • Loading branch information
tiwai committed Sep 8, 2021
2 parents c5433f0 + fcb958e commit 25fca8c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 39 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ properties:
- fsl,imx8mn-rpmsg-audio
- fsl,imx8mm-rpmsg-audio
- fsl,imx8mp-rpmsg-audio
- fsl,imx8ulp-rpmsg-audio

model:
$ref: /schemas/types.yaml#/definitions/string
Expand Down
40 changes: 19 additions & 21 deletions Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,36 +130,34 @@ additionalProperties: false

examples:
- |
#include <dt-bindings/clock/mt8195-clk.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/power/mt8195-power.h>
afe: mt8195-afe-pcm@10890000 {
compatible = "mediatek,mt8195-audio";
reg = <0x10890000 0x10000>;
interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
mediatek,topckgen = <&topckgen>;
power-domains = <&spm MT8195_POWER_DOMAIN_AUDIO>;
power-domains = <&spm 7>; //MT8195_POWER_DOMAIN_AUDIO
clocks = <&clk26m>,
<&topckgen CLK_TOP_APLL1>,
<&topckgen CLK_TOP_APLL2>,
<&topckgen CLK_TOP_APLL12_DIV0>,
<&topckgen CLK_TOP_APLL12_DIV1>,
<&topckgen CLK_TOP_APLL12_DIV2>,
<&topckgen CLK_TOP_APLL12_DIV3>,
<&topckgen CLK_TOP_APLL12_DIV9>,
<&topckgen CLK_TOP_A1SYS_HP_SEL>,
<&topckgen CLK_TOP_AUD_INTBUS_SEL>,
<&topckgen CLK_TOP_AUDIO_H_SEL>,
<&topckgen CLK_TOP_AUDIO_LOCAL_BUS_SEL>,
<&topckgen CLK_TOP_DPTX_M_SEL>,
<&topckgen CLK_TOP_I2SO1_M_SEL>,
<&topckgen CLK_TOP_I2SO2_M_SEL>,
<&topckgen CLK_TOP_I2SI1_M_SEL>,
<&topckgen CLK_TOP_I2SI2_M_SEL>,
<&infracfg_ao CLK_INFRA_AO_AUDIO_26M_B>,
<&scp_adsp CLK_SCP_ADSP_AUDIODSP>;
<&topckgen 163>, //CLK_TOP_APLL1
<&topckgen 166>, //CLK_TOP_APLL2
<&topckgen 233>, //CLK_TOP_APLL12_DIV0
<&topckgen 234>, //CLK_TOP_APLL12_DIV1
<&topckgen 235>, //CLK_TOP_APLL12_DIV2
<&topckgen 236>, //CLK_TOP_APLL12_DIV3
<&topckgen 238>, //CLK_TOP_APLL12_DIV9
<&topckgen 100>, //CLK_TOP_A1SYS_HP_SEL
<&topckgen 33>, //CLK_TOP_AUD_INTBUS_SEL
<&topckgen 34>, //CLK_TOP_AUDIO_H_SEL
<&topckgen 107>, //CLK_TOP_AUDIO_LOCAL_BUS_SEL
<&topckgen 98>, //CLK_TOP_DPTX_M_SEL
<&topckgen 94>, //CLK_TOP_I2SO1_M_SEL
<&topckgen 95>, //CLK_TOP_I2SO2_M_SEL
<&topckgen 96>, //CLK_TOP_I2SI1_M_SEL
<&topckgen 97>, //CLK_TOP_I2SI2_M_SEL
<&infracfg_ao 50>, //CLK_INFRA_AO_AUDIO_26M_B
<&scp_adsp 0>; //CLK_SCP_ADSP_AUDIODSP
clock-names = "clk26m",
"apll1_ck",
"apll2_ck",
Expand Down
3 changes: 0 additions & 3 deletions sound/soc/codecs/rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -2942,9 +2942,6 @@ static int rt5682_suspend(struct snd_soc_component *component)
break;
}

snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
RT5682_PWR_CBJ, 0);

/* enter SAR ADC power saving mode */
snd_soc_component_update_bits(component, RT5682_SAR_IL_CMD_1,
RT5682_SAR_BUTT_DET_MASK | RT5682_SAR_BUTDET_MODE_MASK |
Expand Down
6 changes: 6 additions & 0 deletions sound/soc/generic/audio-graph-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
if (li->cpu) {
struct snd_soc_card *card = simple_priv_to_card(priv);
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
int is_single_links = 0;

/* Codec is dummy */
Expand Down Expand Up @@ -313,6 +314,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai_link->no_pcm = 1;

asoc_simple_canonicalize_cpu(cpus, is_single_links);
asoc_simple_canonicalize_platform(platforms, cpus);
} else {
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
Expand Down Expand Up @@ -366,6 +368,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
char dai_name[64];
int ret, is_single_links = 0;

Expand All @@ -383,6 +386,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
"%s-%s", cpus->dai_name, codecs->dai_name);

asoc_simple_canonicalize_cpu(cpus, is_single_links);
asoc_simple_canonicalize_platform(platforms, cpus);

ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
if (ret < 0)
Expand Down Expand Up @@ -608,6 +612,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,

li->num[li->link].cpus = 1;
li->num[li->link].codecs = 1;
li->num[li->link].platforms = 1;

li->link += 1; /* 1xCPU-Codec */

Expand All @@ -630,6 +635,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,

if (li->cpu) {
li->num[li->link].cpus = 1;
li->num[li->link].platforms = 1;

li->link++; /* 1xCPU-dummy */
} else {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
select SND_SOC_DMIC
select SND_SOC_INTEL_HDA_DSP_COMMON
select SND_SOC_INTEL_SOF_MAXIM_COMMON
select SND_SOC_SDW_MOCKUP
imply SND_SOC_SDW_MOCKUP
help
Add support for Intel SoundWire-based platforms connected to
MAX98373, RT700, RT711, RT1308 and RT715
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/mediatek/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682

config SND_SOC_MT8195
tristate "ASoC support for Mediatek MT8195 chip"
depends on ARCH_MEDIATEK || COMPILE_TEST
select SND_SOC_MEDIATEK
help
This adds ASoC platform driver support for Mediatek MT8195 chip
Expand All @@ -197,7 +198,7 @@ config SND_SOC_MT8195
config SND_SOC_MT8195_MT6359_RT1019_RT5682
tristate "ASoC Audio driver for MT8195 with MT6359 RT1019 RT5682 codec"
depends on I2C
depends on SND_SOC_MT8195
depends on SND_SOC_MT8195 && MTK_PMIC_WRAP
select SND_SOC_MT6359
select SND_SOC_RT1015P
select SND_SOC_RT5682_I2C
Expand Down
22 changes: 10 additions & 12 deletions sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,27 +1018,25 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev)
of_parse_phandle(pdev->dev.of_node,
"mediatek,dptx-codec", 0);
if (!dai_link->codecs->of_node) {
dev_err(&pdev->dev, "Property 'dptx-codec' missing or invalid\n");
return -EINVAL;
dev_dbg(&pdev->dev, "No property 'dptx-codec'\n");
} else {
dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}

dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}

if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
dai_link->codecs->of_node =
of_parse_phandle(pdev->dev.of_node,
"mediatek,hdmi-codec", 0);
if (!dai_link->codecs->of_node) {
dev_err(&pdev->dev, "Property 'hdmi-codec' missing or invalid\n");
return -EINVAL;
dev_dbg(&pdev->dev, "No property 'hdmi-codec'\n");
} else {
dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}

dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}
}

Expand Down
7 changes: 7 additions & 0 deletions sound/soc/rockchip/rockchip_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/spinlock.h>
#include <sound/pcm_params.h>
#include <sound/dmaengine_pcm.h>

Expand Down Expand Up @@ -53,6 +54,7 @@ struct rk_i2s_dev {
bool is_master_mode;
const struct rk_i2s_pins *pins;
unsigned int bclk_ratio;
spinlock_t lock; /* tx/rx lock */
};

static int i2s_runtime_suspend(struct device *dev)
Expand Down Expand Up @@ -96,6 +98,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
unsigned int val = 0;
int retry = 10;

spin_lock(&i2s->lock);
if (on) {
regmap_update_bits(i2s->regmap, I2S_DMACR,
I2S_DMACR_TDE_ENABLE, I2S_DMACR_TDE_ENABLE);
Expand Down Expand Up @@ -136,13 +139,15 @@ static void rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
}
}
}
spin_unlock(&i2s->lock);
}

static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
{
unsigned int val = 0;
int retry = 10;

spin_lock(&i2s->lock);
if (on) {
regmap_update_bits(i2s->regmap, I2S_DMACR,
I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_ENABLE);
Expand Down Expand Up @@ -183,6 +188,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
}
}
}
spin_unlock(&i2s->lock);
}

static int rockchip_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
Expand Down Expand Up @@ -684,6 +690,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
if (!i2s)
return -ENOMEM;

spin_lock_init(&i2s->lock);
i2s->dev = &pdev->dev;

i2s->grf = syscon_regmap_lookup_by_phandle(node, "rockchip,grf");
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/samsung/s3c24xx_simtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ int simtec_audio_core_probe(struct platform_device *pdev,

snd_dev = platform_device_alloc("soc-audio", -1);
if (!snd_dev) {
dev_err(&pdev->dev, "failed to alloc soc-audio devicec\n");
dev_err(&pdev->dev, "failed to alloc soc-audio device\n");
ret = -ENOMEM;
goto err_gpio;
}
Expand Down

0 comments on commit 25fca8c

Please sign in to comment.