···1223122312241224/* mixer control */12251225struct soc_mixer_control {12261226- int min, max, platform_max;12261226+ /* Minimum and maximum specified as written to the hardware */12271227+ int min, max;12281228+ /* Limited maximum value specified as presented through the control */12291229+ int platform_max;12271230 int reg, rreg;12281231 unsigned int shift, rshift;12291232 u32 num_channels;
···104104 case 0x6100067:105105 case 0x6100070 ... 0x610007c:106106 case 0x6100080:107107+ case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,108108+ CH_01) ...109109+ SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_FU15, RT722_SDCA_CTL_FU_CH_GAIN,110110+ CH_04):107111 case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,108112 CH_01):109113 case SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT722_SDCA_ENT_USER_FU1E, RT722_SDCA_CTL_FU_VOLUME,
+11-2
sound/soc/codecs/wm0010.c
···920920 if (ret) {921921 dev_err(wm0010->dev, "Failed to set IRQ %d as wake source: %d\n",922922 irq, ret);923923- return ret;923923+ goto free_irq;924924 }925925926926 if (spi->max_speed_hz)···932932 &soc_component_dev_wm0010, wm0010_dai,933933 ARRAY_SIZE(wm0010_dai));934934 if (ret < 0)935935- return ret;935935+ goto disable_irq_wake;936936937937 return 0;938938+939939+disable_irq_wake:940940+ irq_set_irq_wake(wm0010->irq, 0);941941+942942+free_irq:943943+ if (wm0010->irq)944944+ free_irq(wm0010->irq, wm0010);945945+946946+ return ret;938947}939948940949static void wm0010_spi_remove(struct spi_device *spi)
+5-2
sound/soc/generic/simple-card-utils.c
···11031103 struct snd_soc_dai_link_component *dlc, int *is_single_link)11041104{11051105 struct device *dev = simple_priv_to_dev(priv);11061106+ struct device_node *node;11061107 struct of_phandle_args args = {};11071108 struct snd_soc_dai *dai;11081109 int ret;···11111110 if (!ep)11121111 return 0;1113111211141114- struct device_node *node __free(device_node) = of_graph_get_port_parent(ep);11131113+ node = of_graph_get_port_parent(ep);1115111411161115 /*11171116 * Try to find from DAI node···11541153 * if he unbinded CPU or Codec.11551154 */11561155 ret = snd_soc_get_dlc(&args, dlc);11571157- if (ret < 0)11561156+ if (ret < 0) {11571157+ of_node_put(node);11581158 goto end;11591159+ }1159116011601161parse_dai_end:11611162 if (is_single_link)
+7-8
sound/soc/soc-ops.c
···325325 if (ucontrol->value.integer.value[0] < 0)326326 return -EINVAL;327327 val = ucontrol->value.integer.value[0];328328- if (mc->platform_max && ((int)val + min) > mc->platform_max)328328+ if (mc->platform_max && val > mc->platform_max)329329 return -EINVAL;330330 if (val > max - min)331331 return -EINVAL;···338338 if (ucontrol->value.integer.value[1] < 0)339339 return -EINVAL;340340 val2 = ucontrol->value.integer.value[1];341341- if (mc->platform_max && ((int)val2 + min) > mc->platform_max)341341+ if (mc->platform_max && val2 > mc->platform_max)342342 return -EINVAL;343343 if (val2 > max - min)344344 return -EINVAL;···491491{492492 struct soc_mixer_control *mc =493493 (struct soc_mixer_control *)kcontrol->private_value;494494- int platform_max;495495- int min = mc->min;494494+ int max;496495497497- if (!mc->platform_max)498498- mc->platform_max = mc->max;499499- platform_max = mc->platform_max;496496+ max = mc->max - mc->min;497497+ if (mc->platform_max && mc->platform_max < max)498498+ max = mc->platform_max;500499501500 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;502501 uinfo->count = snd_soc_volsw_is_stereo(mc) ? 2 : 1;503502 uinfo->value.integer.min = 0;504504- uinfo->value.integer.max = platform_max - min;503503+ uinfo->value.integer.max = max;505504506505 return 0;507506}