Skip to content

Commit c8f7dbd

Browse files
committed
Merge remote-tracking branch 'asoc/for-5.8' into asoc-linus
2 parents 92ed301 + 5aef1ff commit c8f7dbd

20 files changed

+186
-98
lines changed

drivers/spi/spi-lantiq-ssc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ static int lantiq_ssc_probe(struct platform_device *pdev)
899899
master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 8) |
900900
SPI_BPW_MASK(16) | SPI_BPW_MASK(32);
901901

902-
spi->wq = alloc_ordered_workqueue(dev_name(dev), 0);
902+
spi->wq = alloc_ordered_workqueue(dev_name(dev), WQ_MEM_RECLAIM);
903903
if (!spi->wq) {
904904
err = -ENOMEM;
905905
goto err_clk_put;

sound/soc/codecs/max98357a.c

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,61 @@
2323
struct max98357a_priv {
2424
struct gpio_desc *sdmode;
2525
unsigned int sdmode_delay;
26+
int sdmode_switch;
2627
};
2728

28-
static int max98357a_sdmode_event(struct snd_soc_dapm_widget *w,
29-
struct snd_kcontrol *kcontrol, int event)
29+
static int max98357a_daiops_trigger(struct snd_pcm_substream *substream,
30+
int cmd, struct snd_soc_dai *dai)
3031
{
31-
struct snd_soc_component *component =
32-
snd_soc_dapm_to_component(w->dapm);
32+
struct snd_soc_component *component = dai->component;
3333
struct max98357a_priv *max98357a =
3434
snd_soc_component_get_drvdata(component);
3535

3636
if (!max98357a->sdmode)
3737
return 0;
3838

39-
if (event & SND_SOC_DAPM_POST_PMU) {
40-
msleep(max98357a->sdmode_delay);
41-
gpiod_set_value(max98357a->sdmode, 1);
42-
dev_dbg(component->dev, "set sdmode to 1");
43-
} else if (event & SND_SOC_DAPM_PRE_PMD) {
39+
switch (cmd) {
40+
case SNDRV_PCM_TRIGGER_START:
41+
case SNDRV_PCM_TRIGGER_RESUME:
42+
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
43+
mdelay(max98357a->sdmode_delay);
44+
if (max98357a->sdmode_switch) {
45+
gpiod_set_value(max98357a->sdmode, 1);
46+
dev_dbg(component->dev, "set sdmode to 1");
47+
}
48+
break;
49+
case SNDRV_PCM_TRIGGER_STOP:
50+
case SNDRV_PCM_TRIGGER_SUSPEND:
51+
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
4452
gpiod_set_value(max98357a->sdmode, 0);
4553
dev_dbg(component->dev, "set sdmode to 0");
54+
break;
4655
}
4756

4857
return 0;
4958
}
5059

60+
static int max98357a_sdmode_event(struct snd_soc_dapm_widget *w,
61+
struct snd_kcontrol *kcontrol, int event)
62+
{
63+
struct snd_soc_component *component =
64+
snd_soc_dapm_to_component(w->dapm);
65+
struct max98357a_priv *max98357a =
66+
snd_soc_component_get_drvdata(component);
67+
68+
if (event & SND_SOC_DAPM_POST_PMU)
69+
max98357a->sdmode_switch = 1;
70+
else if (event & SND_SOC_DAPM_POST_PMD)
71+
max98357a->sdmode_switch = 0;
72+
73+
return 0;
74+
}
75+
5176
static const struct snd_soc_dapm_widget max98357a_dapm_widgets[] = {
5277
SND_SOC_DAPM_OUTPUT("Speaker"),
5378
SND_SOC_DAPM_OUT_DRV_E("SD_MODE", SND_SOC_NOPM, 0, 0, NULL, 0,
5479
max98357a_sdmode_event,
55-
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
80+
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
5681
};
5782

5883
static const struct snd_soc_dapm_route max98357a_dapm_routes[] = {
@@ -71,6 +96,10 @@ static const struct snd_soc_component_driver max98357a_component_driver = {
7196
.non_legacy_dai_naming = 1,
7297
};
7398

99+
static const struct snd_soc_dai_ops max98357a_dai_ops = {
100+
.trigger = max98357a_daiops_trigger,
101+
};
102+
74103
static struct snd_soc_dai_driver max98357a_dai_driver = {
75104
.name = "HiFi",
76105
.playback = {
@@ -90,6 +119,7 @@ static struct snd_soc_dai_driver max98357a_dai_driver = {
90119
.channels_min = 1,
91120
.channels_max = 2,
92121
},
122+
.ops = &max98357a_dai_ops,
93123
};
94124

95125
static int max98357a_platform_probe(struct platform_device *pdev)

sound/soc/codecs/max98390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ static const struct snd_kcontrol_new max98390_dai_controls =
678678

679679
static const struct snd_soc_dapm_widget max98390_dapm_widgets[] = {
680680
SND_SOC_DAPM_DAC_E("Amp Enable", "HiFi Playback",
681-
MAX98390_R203A_AMP_EN, 0, 0, max98390_dac_event,
681+
SND_SOC_NOPM, 0, 0, max98390_dac_event,
682682
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
683683
SND_SOC_DAPM_MUX("DAI Sel Mux", SND_SOC_NOPM, 0, 0,
684684
&max98390_dai_controls),

sound/soc/fsl/fsl_sai.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,11 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
680680
regmap_write(sai->regmap, FSL_SAI_RCSR(ofs), 0);
681681

682682
regmap_update_bits(sai->regmap, FSL_SAI_TCR1(ofs),
683-
FSL_SAI_CR1_RFW_MASK,
683+
FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
684684
sai->soc_data->fifo_depth - FSL_SAI_MAXBURST_TX);
685685
regmap_update_bits(sai->regmap, FSL_SAI_RCR1(ofs),
686-
FSL_SAI_CR1_RFW_MASK, FSL_SAI_MAXBURST_RX - 1);
686+
FSL_SAI_CR1_RFW_MASK(sai->soc_data->fifo_depth),
687+
FSL_SAI_MAXBURST_RX - 1);
687688

688689
snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx,
689690
&sai->dma_params_rx);

sound/soc/fsl/fsl_sai.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
#define FSL_SAI_CSR_FRDE BIT(0)
9595

9696
/* SAI Transmit and Receive Configuration 1 Register */
97-
#define FSL_SAI_CR1_RFW_MASK 0x1f
97+
#define FSL_SAI_CR1_RFW_MASK(x) ((x) - 1)
9898

9999
/* SAI Transmit and Receive Configuration 2 Register */
100100
#define FSL_SAI_CR2_SYNC BIT(30)

sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -336,22 +336,45 @@ static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
336336
struct snd_interval *chan = hw_param_interval(params,
337337
SNDRV_PCM_HW_PARAM_CHANNELS);
338338
struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
339-
struct snd_soc_dpcm *dpcm = container_of(
340-
params, struct snd_soc_dpcm, hw_params);
341-
struct snd_soc_dai_link *fe_dai_link = dpcm->fe->dai_link;
342-
struct snd_soc_dai_link *be_dai_link = dpcm->be->dai_link;
339+
struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
340+
341+
/*
342+
* The following loop will be called only for playback stream
343+
* In this platform, there is only one playback device on every SSP
344+
*/
345+
for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
346+
rtd_dpcm = dpcm;
347+
break;
348+
}
349+
350+
/*
351+
* This following loop will be called only for capture stream
352+
* In this platform, there is only one capture device on every SSP
353+
*/
354+
for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
355+
rtd_dpcm = dpcm;
356+
break;
357+
}
358+
359+
if (!rtd_dpcm)
360+
return -EINVAL;
361+
362+
/*
363+
* The above 2 loops are mutually exclusive based on the stream direction,
364+
* thus rtd_dpcm variable will never be overwritten
365+
*/
343366

344367
/*
345368
* The ADSP will convert the FE rate to 48k, stereo, 24 bit
346369
*/
347-
if (!strcmp(fe_dai_link->name, "Kbl Audio Port") ||
348-
!strcmp(fe_dai_link->name, "Kbl Audio Headset Playback") ||
349-
!strcmp(fe_dai_link->name, "Kbl Audio Capture Port")) {
370+
if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
371+
!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
372+
!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
350373
rate->min = rate->max = 48000;
351374
chan->min = chan->max = 2;
352375
snd_mask_none(fmt);
353376
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
354-
} else if (!strcmp(fe_dai_link->name, "Kbl Audio DMIC cap")) {
377+
} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
355378
if (params_channels(params) == 2 ||
356379
DMIC_CH(dmic_constraints) == 2)
357380
chan->min = chan->max = 2;
@@ -362,7 +385,7 @@ static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
362385
* The speaker on the SSP0 supports S16_LE and not S24_LE.
363386
* thus changing the mask here
364387
*/
365-
if (!strcmp(be_dai_link->name, "SSP0-Codec"))
388+
if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
366389
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
367390

368391
return 0;

sound/soc/intel/boards/skl_hda_dsp_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct skl_hda_private {
3333
int dai_index;
3434
const char *platform_name;
3535
bool common_hdmi_codec_drv;
36+
bool idisp_codec;
3637
};
3738

3839
extern struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS];

sound/soc/intel/boards/skl_hda_dsp_generic.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ skl_hda_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *link)
7979
link->platforms->name = ctx->platform_name;
8080
link->nonatomic = 1;
8181

82+
if (!ctx->idisp_codec)
83+
return 0;
84+
8285
if (strstr(link->name, "HDMI")) {
8386
ret = skl_hda_hdmi_add_pcm(card, ctx->pcm_count);
8487

@@ -118,19 +121,20 @@ static char hda_soc_components[30];
118121
static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
119122
{
120123
struct snd_soc_card *card = &hda_soc_card;
124+
struct skl_hda_private *ctx = snd_soc_card_get_drvdata(card);
121125
struct snd_soc_dai_link *dai_link;
122-
u32 codec_count, codec_mask, idisp_mask;
126+
u32 codec_count, codec_mask;
123127
int i, num_links, num_route;
124128

125129
codec_mask = mach_params->codec_mask;
126130
codec_count = hweight_long(codec_mask);
127-
idisp_mask = codec_mask & IDISP_CODEC_MASK;
131+
ctx->idisp_codec = !!(codec_mask & IDISP_CODEC_MASK);
128132

129133
if (!codec_count || codec_count > 2 ||
130-
(codec_count == 2 && !idisp_mask))
134+
(codec_count == 2 && !ctx->idisp_codec))
131135
return -EINVAL;
132136

133-
if (codec_mask == idisp_mask) {
137+
if (codec_mask == IDISP_CODEC_MASK) {
134138
/* topology with iDisp as the only HDA codec */
135139
num_links = IDISP_DAI_COUNT + DMIC_DAI_COUNT;
136140
num_route = IDISP_ROUTE_COUNT;
@@ -152,7 +156,7 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
152156
num_route = ARRAY_SIZE(skl_hda_map);
153157
card->dapm_widgets = skl_hda_widgets;
154158
card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets);
155-
if (!idisp_mask) {
159+
if (!ctx->idisp_codec) {
156160
for (i = 0; i < IDISP_DAI_COUNT; i++) {
157161
skl_hda_be_dai_links[i].codecs = dummy_codec;
158162
skl_hda_be_dai_links[i].num_codecs =
@@ -211,6 +215,8 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
211215
if (!mach)
212216
return -EINVAL;
213217

218+
snd_soc_card_set_drvdata(&hda_soc_card, ctx);
219+
214220
ret = skl_hda_fill_card_info(&mach->mach_params);
215221
if (ret < 0) {
216222
dev_err(&pdev->dev, "Unsupported HDAudio/iDisp configuration found\n");
@@ -223,7 +229,6 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
223229
ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv;
224230

225231
hda_soc_card.dev = &pdev->dev;
226-
snd_soc_card_set_drvdata(&hda_soc_card, ctx);
227232

228233
if (mach->mach_params.dmic_num > 0) {
229234
snprintf(hda_soc_components, sizeof(hda_soc_components),

sound/soc/intel/common/soc-acpi-intel-ehl-match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = {
1414
{
15-
.id = "INTC1027",
15+
.id = "10EC5660",
1616
.drv_name = "ehl_rt5660",
1717
.sof_fw_filename = "sof-ehl.ri",
1818
.sof_tplg_filename = "sof-ehl-rt5660.tplg",

sound/soc/meson/axg-card.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int axg_card_add_tdm_loopback(struct snd_soc_card *card,
116116

117117
lb = &card->dai_link[*index + 1];
118118

119-
lb->name = kasprintf(GFP_KERNEL, "%s-lb", pad->name);
119+
lb->name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-lb", pad->name);
120120
if (!lb->name)
121121
return -ENOMEM;
122122

@@ -327,20 +327,22 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
327327
return ret;
328328

329329
if (axg_card_cpu_is_playback_fe(dai_link->cpus->of_node))
330-
ret = meson_card_set_fe_link(card, dai_link, np, true);
330+
return meson_card_set_fe_link(card, dai_link, np, true);
331331
else if (axg_card_cpu_is_capture_fe(dai_link->cpus->of_node))
332-
ret = meson_card_set_fe_link(card, dai_link, np, false);
333-
else
334-
ret = meson_card_set_be_link(card, dai_link, np);
332+
return meson_card_set_fe_link(card, dai_link, np, false);
335333

334+
335+
ret = meson_card_set_be_link(card, dai_link, np);
336336
if (ret)
337337
return ret;
338338

339-
if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node))
340-
ret = axg_card_parse_tdm(card, np, index);
341-
else if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) {
339+
if (axg_card_cpu_is_codec(dai_link->cpus->of_node)) {
342340
dai_link->params = &codec_params;
343-
dai_link->no_pcm = 0; /* link is not a DPCM BE */
341+
} else {
342+
dai_link->no_pcm = 1;
343+
snd_soc_dai_link_set_capabilities(dai_link);
344+
if (axg_card_cpu_is_tdm_iface(dai_link->cpus->of_node))
345+
ret = axg_card_parse_tdm(card, np, index);
344346
}
345347

346348
return ret;

0 commit comments

Comments
 (0)