Skip to content

Commit b47068b

Browse files
committed
Merge tag 'asoc-fix-v6.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.1 Some more fixes for v6.1, some of these are very old and were originally intended to get sent for v5.18 but got lost in the shuffle when there was an issue with Linus not liking my branching strategy and I rebuilt bits of my workflow. The ops changes have been validated by people looking at real hardware and are how things getting dropped got noticed.
2 parents 9b84f0f + 3d1bb6c commit b47068b

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

sound/soc/codecs/cs42l51.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = {
143143
0, 0xA0, 96, adc_att_tlv),
144144
SOC_DOUBLE_R_SX_TLV("PGA Volume",
145145
CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
146-
0, 0x19, 30, pga_tlv),
146+
0, 0x1A, 30, pga_tlv),
147147
SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
148148
SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
149149
SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),

sound/soc/codecs/tlv320adc3xxx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <dt-bindings/sound/tlv320adc3xxx.h>
1616
#include <linux/clk.h>
17+
#include <linux/gpio/consumer.h>
1718
#include <linux/module.h>
1819
#include <linux/moduleparam.h>
1920
#include <linux/io.h>
@@ -1025,7 +1026,9 @@ static const struct gpio_chip adc3xxx_gpio_chip = {
10251026

10261027
static void adc3xxx_free_gpio(struct adc3xxx *adc3xxx)
10271028
{
1029+
#ifdef CONFIG_GPIOLIB
10281030
gpiochip_remove(&adc3xxx->gpio_chip);
1031+
#endif
10291032
}
10301033

10311034
static void adc3xxx_init_gpio(struct adc3xxx *adc3xxx)

sound/soc/fsl/fsl_micfil.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,25 @@ static int fsl_micfil_reset(struct device *dev)
194194
if (ret)
195195
return ret;
196196

197+
/*
198+
* SRES is self-cleared bit, but REG_MICFIL_CTRL1 is defined
199+
* as non-volatile register, so SRES still remain in regmap
200+
* cache after set, that every update of REG_MICFIL_CTRL1,
201+
* software reset happens. so clear it explicitly.
202+
*/
203+
ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1,
204+
MICFIL_CTRL1_SRES);
205+
if (ret)
206+
return ret;
207+
208+
/*
209+
* Set SRES should clear CHnF flags, But even add delay here
210+
* the CHnF may not be cleared sometimes, so clear CHnF explicitly.
211+
*/
212+
ret = regmap_write_bits(micfil->regmap, REG_MICFIL_STAT, 0xFF, 0xFF);
213+
if (ret)
214+
return ret;
215+
197216
return 0;
198217
}
199218

sound/soc/soc-ops.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
452452
val = ucontrol->value.integer.value[0];
453453
if (mc->platform_max && val > mc->platform_max)
454454
return -EINVAL;
455-
if (val > max - min)
455+
if (val > max)
456456
return -EINVAL;
457457
val_mask = mask << shift;
458458
val = (val + min) & mask;
@@ -464,10 +464,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
464464
ret = err;
465465

466466
if (snd_soc_volsw_is_stereo(mc)) {
467-
unsigned int val2;
467+
unsigned int val2 = ucontrol->value.integer.value[1];
468+
469+
if (mc->platform_max && val2 > mc->platform_max)
470+
return -EINVAL;
471+
if (val2 > max)
472+
return -EINVAL;
468473

469474
val_mask = mask << rshift;
470-
val2 = (ucontrol->value.integer.value[1] + min) & mask;
475+
val2 = (val2 + min) & mask;
471476
val2 = val2 << rshift;
472477

473478
err = snd_soc_component_update_bits(component, reg2, val_mask,

0 commit comments

Comments
 (0)