Skip to content

Commit

Permalink
ASoC: Merge up fixes
Browse files Browse the repository at this point in the history
Merge the for-6.14 to resolve conflicts with simple-card-utils.c due to
parallel delveopment.
  • Loading branch information
Mark Brown committed Mar 14, 2025
2 parents f0066c8 + de74ec7 commit e0afd7d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 14 deletions.
5 changes: 4 additions & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,10 @@ void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);

/* mixer control */
struct soc_mixer_control {
int min, max, platform_max;
/* Minimum and maximum specified as written to the hardware */
int min, max;
/* Limited maximum value specified as presented through the control */
int platform_max;
int reg, rreg;
unsigned int shift, rshift;
u32 num_channels;
Expand Down
7 changes: 7 additions & 0 deletions sound/soc/amd/yc/acp6x-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21M5"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "21M6"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/cs42l43.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ static const struct snd_kcontrol_new cs42l43_controls[] = {

SOC_DOUBLE_R_SX_TLV("ADC Volume", CS42L43_ADC_B_CTRL1, CS42L43_ADC_B_CTRL2,
CS42L43_ADC_PGA_GAIN_SHIFT,
0xF, 5, cs42l43_adc_tlv),
0xF, 4, cs42l43_adc_tlv),

SOC_DOUBLE("PDM1 Invert Switch", CS42L43_DMIC_PDM_CTRL,
CS42L43_PDM1L_INV_SHIFT, CS42L43_PDM1R_INV_SHIFT, 1, 0),
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/codecs/rt722-sdca-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ static int rt722_sdca_mbq_size(struct device *dev, unsigned int reg)
case 0x6100067:
case 0x6100070 ... 0x610007c:
case 0x6100080:
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,
CH_01) ...
SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,
CH_04):
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,
CH_01):
case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,
Expand Down
13 changes: 11 additions & 2 deletions sound/soc/codecs/wm0010.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ static int wm0010_spi_probe(struct spi_device *spi)
if (ret) {
dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",
irq, ret);
return ret;
goto free_irq;
}

if (spi->max_speed_hz)
Expand All @@ -932,9 +932,18 @@ static int wm0010_spi_probe(struct spi_device *spi)
&soc_component_dev_wm0010, wm0010_dai,
ARRAY_SIZE(wm0010_dai));
if (ret < 0)
return ret;
goto disable_irq_wake;

return 0;

disable_irq_wake:
irq_set_irq_wake(wm0010->irq, 0);

free_irq:
if (wm0010->irq)
free_irq(wm0010->irq, wm0010);

return ret;
}

static void wm0010_spi_remove(struct spi_device *spi)
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/generic/simple-card-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,14 +1103,15 @@ int graph_util_parse_dai(struct simple_util_priv *priv, struct device_node *ep,
struct snd_soc_dai_link_component *dlc, int *is_single_link)
{
struct device *dev = simple_priv_to_dev(priv);
struct device_node *node;
struct of_phandle_args args = {};
struct snd_soc_dai *dai;
int ret;

if (!ep)
return 0;

struct device_node *node __free(device_node) = of_graph_get_port_parent(ep);
node = of_graph_get_port_parent(ep);

/*
* Try to find from DAI node
Expand Down Expand Up @@ -1153,8 +1154,10 @@ int graph_util_parse_dai(struct simple_util_priv *priv, struct device_node *ep,
* if he unbinded CPU or Codec.
*/
ret = snd_soc_get_dlc(&args, dlc);
if (ret < 0)
if (ret < 0) {
of_node_put(node);
goto end;
}

parse_dai_end:
if (is_single_link)
Expand Down
15 changes: 7 additions & 8 deletions sound/soc/soc-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[0] < 0)
return -EINVAL;
val = ucontrol->value.integer.value[0];
if (mc->platform_max && ((int)val + min) > mc->platform_max)
if (mc->platform_max && val > mc->platform_max)
return -EINVAL;
if (val > max - min)
return -EINVAL;
Expand All @@ -338,7 +338,7 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[1] < 0)
return -EINVAL;
val2 = ucontrol->value.integer.value[1];
if (mc->platform_max && ((int)val2 + min) > mc->platform_max)
if (mc->platform_max && val2 > mc->platform_max)
return -EINVAL;
if (val2 > max - min)
return -EINVAL;
Expand Down Expand Up @@ -491,17 +491,16 @@ int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol,
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
int platform_max;
int min = mc->min;
int max;

if (!mc->platform_max)
mc->platform_max = mc->max;
platform_max = mc->platform_max;
max = mc->max - mc->min;
if (mc->platform_max && mc->platform_max < max)
max = mc->platform_max;

uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = platform_max - min;
uinfo->value.integer.max = max;

return 0;
}
Expand Down

0 comments on commit e0afd7d

Please sign in to comment.