Skip to content

Commit c24ff3e

Browse files
committed
Merge tag 'asoc-fix-v6.3-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.3 More fixes that came in since -rc1, a lot from Intel - looks like they've been busy test. Everything is driver specific.
2 parents ff44788 + e041a2a commit c24ff3e

27 files changed

+228
-86
lines changed

sound/soc/codecs/da7219-aad.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,8 @@ int da7219_aad_init(struct snd_soc_component *component)
968968
INIT_WORK(&da7219_aad->hptest_work, da7219_aad_hptest_work);
969969
INIT_WORK(&da7219_aad->jack_det_work, da7219_aad_jack_det_work);
970970

971+
mutex_init(&da7219_aad->jack_det_mutex);
972+
971973
ret = request_threaded_irq(da7219_aad->irq, da7219_aad_pre_irq_thread,
972974
da7219_aad_irq_thread,
973975
IRQF_TRIGGER_LOW | IRQF_ONESHOT,

sound/soc/codecs/hdmi-codec.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,13 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
428428
{
429429
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
430430
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
431+
bool has_capture = !hcp->hcd.no_i2s_capture;
432+
bool has_playback = !hcp->hcd.no_i2s_playback;
431433
int ret = 0;
432434

435+
if (!((has_playback && tx) || (has_capture && !tx)))
436+
return 0;
437+
433438
mutex_lock(&hcp->lock);
434439
if (hcp->busy) {
435440
dev_err(dai->dev, "Only one simultaneous stream supported!\n");
@@ -468,6 +473,12 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
468473
struct snd_soc_dai *dai)
469474
{
470475
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
476+
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
477+
bool has_capture = !hcp->hcd.no_i2s_capture;
478+
bool has_playback = !hcp->hcd.no_i2s_playback;
479+
480+
if (!((has_playback && tx) || (has_capture && !tx)))
481+
return;
471482

472483
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
473484
hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);

sound/soc/codecs/lpass-tx-macro.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ enum {
242242

243243
struct tx_mute_work {
244244
struct tx_macro *tx;
245-
u32 decimator;
245+
u8 decimator;
246246
struct delayed_work dwork;
247247
};
248248

@@ -635,7 +635,7 @@ static int tx_macro_mclk_enable(struct tx_macro *tx,
635635
return 0;
636636
}
637637

638-
static bool is_amic_enabled(struct snd_soc_component *component, int decimator)
638+
static bool is_amic_enabled(struct snd_soc_component *component, u8 decimator)
639639
{
640640
u16 adc_mux_reg, adc_reg, adc_n;
641641

@@ -849,7 +849,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
849849
struct snd_kcontrol *kcontrol, int event)
850850
{
851851
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
852-
unsigned int decimator;
852+
u8 decimator;
853853
u16 tx_vol_ctl_reg, dec_cfg_reg, hpf_gate_reg, tx_gain_ctl_reg;
854854
u8 hpf_cut_off_freq;
855855
int hpf_delay = TX_MACRO_DMIC_HPF_DELAY_MS;
@@ -1064,7 +1064,8 @@ static int tx_macro_hw_params(struct snd_pcm_substream *substream,
10641064
struct snd_soc_dai *dai)
10651065
{
10661066
struct snd_soc_component *component = dai->component;
1067-
u32 decimator, sample_rate;
1067+
u32 sample_rate;
1068+
u8 decimator;
10681069
int tx_fs_rate;
10691070
struct tx_macro *tx = snd_soc_component_get_drvdata(component);
10701071

@@ -1128,7 +1129,7 @@ static int tx_macro_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
11281129
{
11291130
struct snd_soc_component *component = dai->component;
11301131
struct tx_macro *tx = snd_soc_component_get_drvdata(component);
1131-
u16 decimator;
1132+
u8 decimator;
11321133

11331134
/* active decimator not set yet */
11341135
if (tx->active_decimator[dai->id] == -1)

sound/soc/fsl/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ config SND_SOC_IMX_SGTL5000
294294
Say Y if you want to add support for SoC audio on an i.MX board with
295295
a sgtl5000 codec.
296296

297+
Note that this is an old driver. Consider enabling
298+
SND_SOC_FSL_ASOC_CARD and SND_SOC_SGTL5000 to use the newer
299+
driver.
300+
297301
config SND_SOC_IMX_SPDIF
298302
tristate "SoC Audio support for i.MX boards with S/PDIF"
299303
select SND_SOC_IMX_PCM_DMA

sound/soc/intel/avs/boards/da7219.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ static void avs_da7219_codec_exit(struct snd_soc_pcm_runtime *rtd)
117117
snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, NULL, NULL);
118118
}
119119

120+
static int
121+
avs_da7219_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params)
122+
{
123+
struct snd_interval *rate, *channels;
124+
struct snd_mask *fmt;
125+
126+
rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
127+
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
128+
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
129+
130+
/* The ADSP will convert the FE rate to 48k, stereo */
131+
rate->min = rate->max = 48000;
132+
channels->min = channels->max = 2;
133+
134+
/* set SSP0 to 24 bit */
135+
snd_mask_none(fmt);
136+
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
137+
return 0;
138+
}
139+
120140
static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
121141
struct snd_soc_dai_link **dai_link)
122142
{
@@ -148,6 +168,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
148168
dl->num_platforms = 1;
149169
dl->id = 0;
150170
dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS;
171+
dl->be_hw_params_fixup = avs_da7219_be_fixup;
151172
dl->init = avs_da7219_codec_init;
152173
dl->exit = avs_da7219_codec_exit;
153174
dl->nonatomic = 1;

sound/soc/intel/avs/boards/max98357a.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/module.h>
1010
#include <linux/platform_device.h>
11+
#include <sound/pcm_params.h>
1112
#include <sound/soc.h>
1213
#include <sound/soc-acpi.h>
1314
#include <sound/soc-dapm.h>
@@ -24,6 +25,26 @@ static const struct snd_soc_dapm_route card_base_routes[] = {
2425
{ "Spk", NULL, "Speaker" },
2526
};
2627

28+
static int
29+
avs_max98357a_be_fixup(struct snd_soc_pcm_runtime *runrime, struct snd_pcm_hw_params *params)
30+
{
31+
struct snd_interval *rate, *channels;
32+
struct snd_mask *fmt;
33+
34+
rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
35+
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
36+
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
37+
38+
/* The ADSP will convert the FE rate to 48k, stereo */
39+
rate->min = rate->max = 48000;
40+
channels->min = channels->max = 2;
41+
42+
/* set SSP0 to 16 bit */
43+
snd_mask_none(fmt);
44+
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
45+
return 0;
46+
}
47+
2748
static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
2849
struct snd_soc_dai_link **dai_link)
2950
{
@@ -55,6 +76,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
5576
dl->num_platforms = 1;
5677
dl->id = 0;
5778
dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS;
79+
dl->be_hw_params_fixup = avs_max98357a_be_fixup;
5880
dl->nonatomic = 1;
5981
dl->no_pcm = 1;
6082
dl->dpcm_playback = 1;

sound/soc/intel/avs/boards/nau8825.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ avs_nau8825_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *co
3333
return -EINVAL;
3434
}
3535

36-
if (!SND_SOC_DAPM_EVENT_ON(event)) {
36+
if (SND_SOC_DAPM_EVENT_ON(event))
37+
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000,
38+
SND_SOC_CLOCK_IN);
39+
else
3740
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
38-
if (ret < 0) {
39-
dev_err(card->dev, "set sysclk err = %d\n", ret);
40-
return ret;
41-
}
42-
}
41+
if (ret < 0)
42+
dev_err(card->dev, "Set sysclk failed: %d\n", ret);
4343

44-
return 0;
44+
return ret;
4545
}
4646

4747
static const struct snd_kcontrol_new card_controls[] = {

sound/soc/intel/avs/boards/rt5682.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,27 @@ static const struct snd_soc_ops avs_rt5682_ops = {
169169
.hw_params = avs_rt5682_hw_params,
170170
};
171171

172+
static int
173+
avs_rt5682_be_fixup(struct snd_soc_pcm_runtime *runtime, struct snd_pcm_hw_params *params)
174+
{
175+
struct snd_interval *rate, *channels;
176+
struct snd_mask *fmt;
177+
178+
rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
179+
channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
180+
fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
181+
182+
/* The ADSP will convert the FE rate to 48k, stereo */
183+
rate->min = rate->max = 48000;
184+
channels->min = channels->max = 2;
185+
186+
/* set SSPN to 24 bit */
187+
snd_mask_none(fmt);
188+
snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
189+
190+
return 0;
191+
}
192+
172193
static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
173194
struct snd_soc_dai_link **dai_link)
174195
{
@@ -201,6 +222,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
201222
dl->id = 0;
202223
dl->init = avs_rt5682_codec_init;
203224
dl->exit = avs_rt5682_codec_exit;
225+
dl->be_hw_params_fixup = avs_rt5682_be_fixup;
204226
dl->ops = &avs_rt5682_ops;
205227
dl->nonatomic = 1;
206228
dl->no_pcm = 1;

sound/soc/intel/avs/boards/ssm4567.c

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <sound/soc-acpi.h>
1616
#include "../../../codecs/nau8825.h"
1717

18-
#define SKL_NUVOTON_CODEC_DAI "nau8825-hifi"
1918
#define SKL_SSM_CODEC_DAI "ssm4567-hifi"
2019

2120
static struct snd_soc_codec_conf card_codec_conf[] = {
@@ -34,41 +33,11 @@ static const struct snd_kcontrol_new card_controls[] = {
3433
SOC_DAPM_PIN_SWITCH("Right Speaker"),
3534
};
3635

37-
static int
38-
platform_clock_control(struct snd_soc_dapm_widget *w, struct snd_kcontrol *control, int event)
39-
{
40-
struct snd_soc_dapm_context *dapm = w->dapm;
41-
struct snd_soc_card *card = dapm->card;
42-
struct snd_soc_dai *codec_dai;
43-
int ret;
44-
45-
codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI);
46-
if (!codec_dai) {
47-
dev_err(card->dev, "Codec dai not found\n");
48-
return -EINVAL;
49-
}
50-
51-
if (SND_SOC_DAPM_EVENT_ON(event)) {
52-
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_MCLK, 24000000,
53-
SND_SOC_CLOCK_IN);
54-
if (ret < 0)
55-
dev_err(card->dev, "set sysclk err = %d\n", ret);
56-
} else {
57-
ret = snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_INTERNAL, 0, SND_SOC_CLOCK_IN);
58-
if (ret < 0)
59-
dev_err(card->dev, "set sysclk err = %d\n", ret);
60-
}
61-
62-
return ret;
63-
}
64-
6536
static const struct snd_soc_dapm_widget card_widgets[] = {
6637
SND_SOC_DAPM_SPK("Left Speaker", NULL),
6738
SND_SOC_DAPM_SPK("Right Speaker", NULL),
6839
SND_SOC_DAPM_SPK("DP1", NULL),
6940
SND_SOC_DAPM_SPK("DP2", NULL),
70-
SND_SOC_DAPM_SUPPLY("Platform Clock", SND_SOC_NOPM, 0, 0, platform_clock_control,
71-
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
7241
};
7342

7443
static const struct snd_soc_dapm_route card_base_routes[] = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
559559
{
560560
.comp_ids = &essx_83x6,
561561
.drv_name = "sof-essx8336",
562-
.sof_tplg_filename = "sof-adl-es83x6", /* the tplg suffix is added at run time */
562+
.sof_tplg_filename = "sof-adl-es8336", /* the tplg suffix is added at run time */
563563
.tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
564564
SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
565565
SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,

0 commit comments

Comments
 (0)