Skip to content

Commit 992fd39

Browse files
committed
2 parents 18dd66e + 9508ef5 commit 992fd39

21 files changed

Lines changed: 122 additions & 57 deletions

‎include/sound/simple_card_utils.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
136136
struct link_info *li);
137137

138138
#ifdef DEBUG
139-
inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
140-
char *name,
141-
struct asoc_simple_dai *dai)
139+
static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
140+
char *name,
141+
struct asoc_simple_dai *dai)
142142
{
143143
struct device *dev = simple_priv_to_dev(priv);
144144

@@ -168,7 +168,7 @@ inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
168168
dev_dbg(dev, "%s clk %luHz\n", name, clk_get_rate(dai->clk));
169169
}
170170

171-
inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
171+
static inline void asoc_simple_debug_info(struct asoc_simple_priv *priv)
172172
{
173173
struct snd_soc_card *card = simple_priv_to_card(priv);
174174
struct device *dev = simple_priv_to_dev(priv);

‎sound/core/compress_offload.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int snd_compress_check_input(struct snd_compr_params *params)
528528
{
529529
/* first let's check the buffer parameter's */
530530
if (params->buffer.fragment_size == 0 ||
531-
params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
531+
params->buffer.fragments > U32_MAX / params->buffer.fragment_size ||
532532
params->buffer.fragments == 0)
533533
return -EINVAL;
534534

‎sound/soc/codecs/hdac_hda.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ static void hdac_hda_codec_remove(struct snd_soc_component *component)
500500
return;
501501
}
502502

503-
snd_hdac_ext_bus_link_put(hdev->bus, hlink);
504503
pm_runtime_disable(&hdev->dev);
504+
snd_hdac_ext_bus_link_put(hdev->bus, hlink);
505505
}
506506

507507
static const struct snd_soc_dapm_route hdac_hda_dapm_routes[] = {

‎sound/soc/codecs/hdmi-codec.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ struct hdmi_codec_priv {
274274
uint8_t eld[MAX_ELD_BYTES];
275275
struct snd_pcm_chmap *chmap_info;
276276
unsigned int chmap_idx;
277-
struct mutex lock;
277+
unsigned long busy;
278278
struct snd_soc_jack *jack;
279279
unsigned int jack_status;
280280
};
@@ -390,8 +390,8 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
390390
struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
391391
int ret = 0;
392392

393-
ret = mutex_trylock(&hcp->lock);
394-
if (!ret) {
393+
ret = test_and_set_bit(0, &hcp->busy);
394+
if (ret) {
395395
dev_err(dai->dev, "Only one simultaneous stream supported!\n");
396396
return -EINVAL;
397397
}
@@ -419,7 +419,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream,
419419

420420
err:
421421
/* Release the exclusive lock on error */
422-
mutex_unlock(&hcp->lock);
422+
clear_bit(0, &hcp->busy);
423423
return ret;
424424
}
425425

@@ -431,7 +431,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
431431
hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
432432
hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data);
433433

434-
mutex_unlock(&hcp->lock);
434+
clear_bit(0, &hcp->busy);
435435
}
436436

437437
static int hdmi_codec_hw_params(struct snd_pcm_substream *substream,
@@ -811,8 +811,6 @@ static int hdmi_codec_probe(struct platform_device *pdev)
811811
return -ENOMEM;
812812

813813
hcp->hcd = *hcd;
814-
mutex_init(&hcp->lock);
815-
816814
daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL);
817815
if (!daidrv)
818816
return -ENOMEM;

‎sound/soc/codecs/max98373.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,11 @@ static int max98373_i2c_probe(struct i2c_client *i2c,
960960

961961
/* Power on device */
962962
if (gpio_is_valid(max98373->reset_gpio)) {
963-
ret = gpio_request(max98373->reset_gpio, "MAX98373_RESET");
963+
ret = devm_gpio_request(&i2c->dev, max98373->reset_gpio,
964+
"MAX98373_RESET");
964965
if (ret) {
965966
dev_err(&i2c->dev, "%s: Failed to request gpio %d\n",
966967
__func__, max98373->reset_gpio);
967-
gpio_free(max98373->reset_gpio);
968968
return -EINVAL;
969969
}
970970
gpio_direction_output(max98373->reset_gpio, 0);

‎sound/soc/codecs/msm8916-wcd-analog.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ struct pm8916_wcd_analog_priv {
310310
};
311311

312312
static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" };
313-
static const char *const rdac2_mux_text[] = { "ZERO", "RX2", "RX1" };
313+
static const char *const rdac2_mux_text[] = { "RX1", "RX2" };
314314
static const char *const hph_text[] = { "ZERO", "Switch", };
315315

316316
static const struct soc_enum hph_enum = SOC_ENUM_SINGLE_VIRT(
@@ -326,7 +326,7 @@ static const struct soc_enum adc2_enum = SOC_ENUM_SINGLE_VIRT(
326326

327327
/* RDAC2 MUX */
328328
static const struct soc_enum rdac2_mux_enum = SOC_ENUM_SINGLE(
329-
CDC_D_CDC_CONN_HPHR_DAC_CTL, 0, 3, rdac2_mux_text);
329+
CDC_D_CDC_CONN_HPHR_DAC_CTL, 0, 2, rdac2_mux_text);
330330

331331
static const struct snd_kcontrol_new spkr_switch[] = {
332332
SOC_DAPM_SINGLE("Switch", CDC_A_SPKR_DAC_CTL, 7, 1, 0)

‎sound/soc/codecs/msm8916-wcd-digital.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ static const char *const rx_mix1_text[] = {
243243
"ZERO", "IIR1", "IIR2", "RX1", "RX2", "RX3"
244244
};
245245

246+
static const char * const rx_mix2_text[] = {
247+
"ZERO", "IIR1", "IIR2"
248+
};
249+
246250
static const char *const dec_mux_text[] = {
247251
"ZERO", "ADC1", "ADC2", "ADC3", "DMIC1", "DMIC2"
248252
};
@@ -270,6 +274,16 @@ static const struct soc_enum rx3_mix1_inp_enum[] = {
270274
SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX3_B2_CTL, 0, 6, rx_mix1_text),
271275
};
272276

277+
/* RX1 MIX2 */
278+
static const struct soc_enum rx_mix2_inp1_chain_enum =
279+
SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX1_B3_CTL,
280+
0, 3, rx_mix2_text);
281+
282+
/* RX2 MIX2 */
283+
static const struct soc_enum rx2_mix2_inp1_chain_enum =
284+
SOC_ENUM_SINGLE(LPASS_CDC_CONN_RX2_B3_CTL,
285+
0, 3, rx_mix2_text);
286+
273287
/* DEC */
274288
static const struct soc_enum dec1_mux_enum = SOC_ENUM_SINGLE(
275289
LPASS_CDC_CONN_TX_B1_CTL, 0, 6, dec_mux_text);
@@ -309,6 +323,10 @@ static const struct snd_kcontrol_new rx3_mix1_inp2_mux = SOC_DAPM_ENUM(
309323
"RX3 MIX1 INP2 Mux", rx3_mix1_inp_enum[1]);
310324
static const struct snd_kcontrol_new rx3_mix1_inp3_mux = SOC_DAPM_ENUM(
311325
"RX3 MIX1 INP3 Mux", rx3_mix1_inp_enum[2]);
326+
static const struct snd_kcontrol_new rx1_mix2_inp1_mux = SOC_DAPM_ENUM(
327+
"RX1 MIX2 INP1 Mux", rx_mix2_inp1_chain_enum);
328+
static const struct snd_kcontrol_new rx2_mix2_inp1_mux = SOC_DAPM_ENUM(
329+
"RX2 MIX2 INP1 Mux", rx2_mix2_inp1_chain_enum);
312330

313331
/* Digital Gain control -38.4 dB to +38.4 dB in 0.3 dB steps */
314332
static const DECLARE_TLV_DB_SCALE(digital_gain, -3840, 30, 0);
@@ -740,6 +758,10 @@ static const struct snd_soc_dapm_widget msm8916_wcd_digital_dapm_widgets[] = {
740758
&rx3_mix1_inp2_mux),
741759
SND_SOC_DAPM_MUX("RX3 MIX1 INP3", SND_SOC_NOPM, 0, 0,
742760
&rx3_mix1_inp3_mux),
761+
SND_SOC_DAPM_MUX("RX1 MIX2 INP1", SND_SOC_NOPM, 0, 0,
762+
&rx1_mix2_inp1_mux),
763+
SND_SOC_DAPM_MUX("RX2 MIX2 INP1", SND_SOC_NOPM, 0, 0,
764+
&rx2_mix2_inp1_mux),
743765

744766
SND_SOC_DAPM_MUX("CIC1 MUX", SND_SOC_NOPM, 0, 0, &cic1_mux),
745767
SND_SOC_DAPM_MUX("CIC2 MUX", SND_SOC_NOPM, 0, 0, &cic2_mux),

‎sound/soc/codecs/wm_adsp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,8 +1259,7 @@ static unsigned int wmfw_convert_flags(unsigned int in, unsigned int len)
12591259
}
12601260

12611261
if (in) {
1262-
if (in & WMFW_CTL_FLAG_READABLE)
1263-
out |= rd;
1262+
out |= rd;
12641263
if (in & WMFW_CTL_FLAG_WRITEABLE)
12651264
out |= wr;
12661265
if (in & WMFW_CTL_FLAG_VOLATILE)

‎sound/soc/intel/boards/sof_rt5682.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,15 @@ static int sof_audio_probe(struct platform_device *pdev)
612612
/* need to get main clock from pmc */
613613
if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
614614
ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
615+
if (IS_ERR(ctx->mclk)) {
616+
ret = PTR_ERR(ctx->mclk);
617+
618+
dev_err(&pdev->dev,
619+
"Failed to get MCLK from pmc_plt_clk_3: %d\n",
620+
ret);
621+
return ret;
622+
}
623+
615624
ret = clk_prepare_enable(ctx->mclk);
616625
if (ret < 0) {
617626
dev_err(&pdev->dev,

‎sound/soc/kirkwood/kirkwood-i2s.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,6 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
555555
return PTR_ERR(priv->clk);
556556
}
557557

558-
err = clk_prepare_enable(priv->clk);
559-
if (err < 0)
560-
return err;
561-
562558
priv->extclk = devm_clk_get(&pdev->dev, "extclk");
563559
if (IS_ERR(priv->extclk)) {
564560
if (PTR_ERR(priv->extclk) == -EPROBE_DEFER)
@@ -574,6 +570,10 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
574570
}
575571
}
576572

573+
err = clk_prepare_enable(priv->clk);
574+
if (err < 0)
575+
return err;
576+
577577
/* Some sensible defaults - this reflects the powerup values */
578578
priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24;
579579
priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24;
@@ -587,7 +587,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
587587
priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128;
588588
}
589589

590-
err = devm_snd_soc_register_component(&pdev->dev, &kirkwood_soc_component,
590+
err = snd_soc_register_component(&pdev->dev, &kirkwood_soc_component,
591591
soc_dai, 2);
592592
if (err) {
593593
dev_err(&pdev->dev, "snd_soc_register_component failed\n");
@@ -610,6 +610,7 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
610610
{
611611
struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev);
612612

613+
snd_soc_unregister_component(&pdev->dev);
613614
if (!IS_ERR(priv->extclk))
614615
clk_disable_unprepare(priv->extclk);
615616
clk_disable_unprepare(priv->clk);

0 commit comments

Comments
 (0)