Skip to content

Commit a1e9185

Browse files
committed
Merge tag 'sound-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Likely the last piece for 6.1; the only significant fixes are ASoC core ops fixes, while others are device-specific (rather minor) fixes in ASoC and FireWire drivers. All appear safe enough to take as a late stage material" * tag 'sound-6.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: dice: fix regression for Lexicon I-ONIX FW810S ASoC: cs42l51: Correct PGA Volume minimum value ASoC: ops: Correct bounds check for second channel on SX controls ASoC: tlv320adc3xxx: Fix build error for implicit function declaration ASoC: ops: Check bounds for second channel in snd_soc_put_volsw_sx() ASoC: ops: Fix bounds check for _sx controls ASoC: fsl_micfil: explicitly clear CHnF flags ASoC: fsl_micfil: explicitly clear software reset bit
2 parents c290db0 + b47068b commit a1e9185

File tree

5 files changed

+38
-9
lines changed

5 files changed

+38
-9
lines changed

sound/firewire/dice/dice-stream.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int snd_dice_stream_get_rate_mode(struct snd_dice *dice, unsigned int rate,
5959

6060
static int select_clock(struct snd_dice *dice, unsigned int rate)
6161
{
62-
__be32 reg;
62+
__be32 reg, new;
6363
u32 data;
6464
int i;
6565
int err;
@@ -83,15 +83,17 @@ static int select_clock(struct snd_dice *dice, unsigned int rate)
8383
if (completion_done(&dice->clock_accepted))
8484
reinit_completion(&dice->clock_accepted);
8585

86-
reg = cpu_to_be32(data);
86+
new = cpu_to_be32(data);
8787
err = snd_dice_transaction_write_global(dice, GLOBAL_CLOCK_SELECT,
88-
&reg, sizeof(reg));
88+
&new, sizeof(new));
8989
if (err < 0)
9090
return err;
9191

9292
if (wait_for_completion_timeout(&dice->clock_accepted,
93-
msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0)
94-
return -ETIMEDOUT;
93+
msecs_to_jiffies(NOTIFICATION_TIMEOUT_MS)) == 0) {
94+
if (reg != new)
95+
return -ETIMEDOUT;
96+
}
9597

9698
return 0;
9799
}

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)