Skip to content

Commit b23229e

Browse files
committed
Merge remote-tracking branches 'asoc/fix/samsung', 'asoc/fix/tlv320dac33', 'asoc/fix/wl1273', 'asoc/fix/wm8753', 'asoc/fix/wm8904', 'asoc/fix/wm8958' and 'asoc/fix/wm8983' into asoc-linus
8 parents 3b22371 + 316fa9e + 8733f99 + 154a0fd + 0cad105 + c41a024 + d078482 + b5ab265 commit b23229e

File tree

7 files changed

+38
-37
lines changed

7 files changed

+38
-37
lines changed

sound/soc/codecs/tlv320dac33.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ static int dac33_get_fifo_mode(struct snd_kcontrol *kcontrol,
446446
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
447447
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
448448

449-
ucontrol->value.integer.value[0] = dac33->fifo_mode;
449+
ucontrol->value.enumerated.item[0] = dac33->fifo_mode;
450450

451451
return 0;
452452
}
@@ -458,17 +458,16 @@ static int dac33_set_fifo_mode(struct snd_kcontrol *kcontrol,
458458
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
459459
int ret = 0;
460460

461-
if (dac33->fifo_mode == ucontrol->value.integer.value[0])
461+
if (dac33->fifo_mode == ucontrol->value.enumerated.item[0])
462462
return 0;
463463
/* Do not allow changes while stream is running*/
464464
if (snd_soc_codec_is_active(codec))
465465
return -EPERM;
466466

467-
if (ucontrol->value.integer.value[0] < 0 ||
468-
ucontrol->value.integer.value[0] >= DAC33_FIFO_LAST_MODE)
467+
if (ucontrol->value.enumerated.item[0] >= DAC33_FIFO_LAST_MODE)
469468
ret = -EINVAL;
470469
else
471-
dac33->fifo_mode = ucontrol->value.integer.value[0];
470+
dac33->fifo_mode = ucontrol->value.enumerated.item[0];
472471

473472
return ret;
474473
}

sound/soc/codecs/wl1273.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int snd_wl1273_get_audio_route(struct snd_kcontrol *kcontrol,
175175
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
176176
struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
177177

178-
ucontrol->value.integer.value[0] = wl1273->mode;
178+
ucontrol->value.enumerated.item[0] = wl1273->mode;
179179

180180
return 0;
181181
}
@@ -193,18 +193,17 @@ static int snd_wl1273_set_audio_route(struct snd_kcontrol *kcontrol,
193193
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
194194
struct wl1273_priv *wl1273 = snd_soc_codec_get_drvdata(codec);
195195

196-
if (wl1273->mode == ucontrol->value.integer.value[0])
196+
if (wl1273->mode == ucontrol->value.enumerated.item[0])
197197
return 0;
198198

199199
/* Do not allow changes while stream is running */
200200
if (snd_soc_codec_is_active(codec))
201201
return -EPERM;
202202

203-
if (ucontrol->value.integer.value[0] < 0 ||
204-
ucontrol->value.integer.value[0] >= ARRAY_SIZE(wl1273_audio_route))
203+
if (ucontrol->value.enumerated.item[0] >= ARRAY_SIZE(wl1273_audio_route))
205204
return -EINVAL;
206205

207-
wl1273->mode = ucontrol->value.integer.value[0];
206+
wl1273->mode = ucontrol->value.enumerated.item[0];
208207

209208
return 1;
210209
}
@@ -219,7 +218,7 @@ static int snd_wl1273_fm_audio_get(struct snd_kcontrol *kcontrol,
219218

220219
dev_dbg(codec->dev, "%s: enter.\n", __func__);
221220

222-
ucontrol->value.integer.value[0] = wl1273->core->audio_mode;
221+
ucontrol->value.enumerated.item[0] = wl1273->core->audio_mode;
223222

224223
return 0;
225224
}
@@ -233,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
233232

234233
dev_dbg(codec->dev, "%s: enter.\n", __func__);
235234

236-
val = ucontrol->value.integer.value[0];
235+
val = ucontrol->value.enumerated.item[0];
237236
if (wl1273->core->audio_mode == val)
238237
return 0;
239238

sound/soc/codecs/wm8753.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ static int wm8753_get_dai(struct snd_kcontrol *kcontrol,
233233
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
234234
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
235235

236-
ucontrol->value.integer.value[0] = wm8753->dai_func;
236+
ucontrol->value.enumerated.item[0] = wm8753->dai_func;
237237
return 0;
238238
}
239239

@@ -244,15 +244,15 @@ static int wm8753_set_dai(struct snd_kcontrol *kcontrol,
244244
struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
245245
u16 ioctl;
246246

247-
if (wm8753->dai_func == ucontrol->value.integer.value[0])
247+
if (wm8753->dai_func == ucontrol->value.enumerated.item[0])
248248
return 0;
249249

250250
if (snd_soc_codec_is_active(codec))
251251
return -EBUSY;
252252

253253
ioctl = snd_soc_read(codec, WM8753_IOCTL);
254254

255-
wm8753->dai_func = ucontrol->value.integer.value[0];
255+
wm8753->dai_func = ucontrol->value.enumerated.item[0];
256256

257257
if (((ioctl >> 2) & 0x3) == wm8753->dai_func)
258258
return 1;

sound/soc/codecs/wm8904.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol,
396396
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
397397
struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
398398
struct wm8904_pdata *pdata = wm8904->pdata;
399-
int value = ucontrol->value.integer.value[0];
399+
int value = ucontrol->value.enumerated.item[0];
400400

401401
if (value >= pdata->num_drc_cfgs)
402402
return -EINVAL;
@@ -467,7 +467,7 @@ static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol,
467467
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
468468
struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
469469
struct wm8904_pdata *pdata = wm8904->pdata;
470-
int value = ucontrol->value.integer.value[0];
470+
int value = ucontrol->value.enumerated.item[0];
471471

472472
if (value >= pdata->num_retune_mobile_cfgs)
473473
return -EINVAL;

sound/soc/codecs/wm8958-dsp2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol,
459459
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
460460
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
461461
struct wm8994 *control = wm8994->wm8994;
462-
int value = ucontrol->value.integer.value[0];
462+
int value = ucontrol->value.enumerated.item[0];
463463
int reg;
464464

465465
/* Don't allow on the fly reconfiguration */
@@ -549,7 +549,7 @@ static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol,
549549
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
550550
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
551551
struct wm8994 *control = wm8994->wm8994;
552-
int value = ucontrol->value.integer.value[0];
552+
int value = ucontrol->value.enumerated.item[0];
553553
int reg;
554554

555555
/* Don't allow on the fly reconfiguration */
@@ -582,7 +582,7 @@ static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol,
582582
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
583583
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
584584
struct wm8994 *control = wm8994->wm8994;
585-
int value = ucontrol->value.integer.value[0];
585+
int value = ucontrol->value.enumerated.item[0];
586586
int reg;
587587

588588
/* Don't allow on the fly reconfiguration */
@@ -749,7 +749,7 @@ static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol,
749749
struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
750750
struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
751751
struct wm8994 *control = wm8994->wm8994;
752-
int value = ucontrol->value.integer.value[0];
752+
int value = ucontrol->value.enumerated.item[0];
753753
int reg;
754754

755755
/* Don't allow on the fly reconfiguration */

sound/soc/codecs/wm8983.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ static int eqmode_get(struct snd_kcontrol *kcontrol,
497497

498498
reg = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF);
499499
if (reg & WM8983_EQ3DMODE)
500-
ucontrol->value.integer.value[0] = 1;
500+
ucontrol->value.enumerated.item[0] = 1;
501501
else
502-
ucontrol->value.integer.value[0] = 0;
502+
ucontrol->value.enumerated.item[0] = 0;
503503

504504
return 0;
505505
}
@@ -511,18 +511,18 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,
511511
unsigned int regpwr2, regpwr3;
512512
unsigned int reg_eq;
513513

514-
if (ucontrol->value.integer.value[0] != 0
515-
&& ucontrol->value.integer.value[0] != 1)
514+
if (ucontrol->value.enumerated.item[0] != 0
515+
&& ucontrol->value.enumerated.item[0] != 1)
516516
return -EINVAL;
517517

518518
reg_eq = snd_soc_read(codec, WM8983_EQ1_LOW_SHELF);
519519
switch ((reg_eq & WM8983_EQ3DMODE) >> WM8983_EQ3DMODE_SHIFT) {
520520
case 0:
521-
if (!ucontrol->value.integer.value[0])
521+
if (!ucontrol->value.enumerated.item[0])
522522
return 0;
523523
break;
524524
case 1:
525-
if (ucontrol->value.integer.value[0])
525+
if (ucontrol->value.enumerated.item[0])
526526
return 0;
527527
break;
528528
}
@@ -537,7 +537,7 @@ static int eqmode_put(struct snd_kcontrol *kcontrol,
537537
/* set the desired eqmode */
538538
snd_soc_update_bits(codec, WM8983_EQ1_LOW_SHELF,
539539
WM8983_EQ3DMODE_MASK,
540-
ucontrol->value.integer.value[0]
540+
ucontrol->value.enumerated.item[0]
541541
<< WM8983_EQ3DMODE_SHIFT);
542542
/* restore DAC/ADC configuration */
543543
snd_soc_write(codec, WM8983_POWER_MANAGEMENT_2, regpwr2);

sound/soc/samsung/i2s.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
481481
unsigned int cdcon_mask = 1 << i2s_regs->cdclkcon_off;
482482
unsigned int rsrc_mask = 1 << i2s_regs->rclksrc_off;
483483
u32 mod, mask, val = 0;
484+
unsigned long flags;
484485

485-
spin_lock(i2s->lock);
486+
spin_lock_irqsave(i2s->lock, flags);
486487
mod = readl(i2s->addr + I2SMOD);
487-
spin_unlock(i2s->lock);
488+
spin_unlock_irqrestore(i2s->lock, flags);
488489

489490
switch (clk_id) {
490491
case SAMSUNG_I2S_OPCLK:
@@ -575,11 +576,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
575576
return -EINVAL;
576577
}
577578

578-
spin_lock(i2s->lock);
579+
spin_lock_irqsave(i2s->lock, flags);
579580
mod = readl(i2s->addr + I2SMOD);
580581
mod = (mod & ~mask) | val;
581582
writel(mod, i2s->addr + I2SMOD);
582-
spin_unlock(i2s->lock);
583+
spin_unlock_irqrestore(i2s->lock, flags);
583584

584585
return 0;
585586
}
@@ -590,6 +591,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
590591
struct i2s_dai *i2s = to_info(dai);
591592
int lrp_shift, sdf_shift, sdf_mask, lrp_rlow, mod_slave;
592593
u32 mod, tmp = 0;
594+
unsigned long flags;
593595

594596
lrp_shift = i2s->variant_regs->lrp_off;
595597
sdf_shift = i2s->variant_regs->sdf_off;
@@ -649,15 +651,15 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
649651
return -EINVAL;
650652
}
651653

652-
spin_lock(i2s->lock);
654+
spin_lock_irqsave(i2s->lock, flags);
653655
mod = readl(i2s->addr + I2SMOD);
654656
/*
655657
* Don't change the I2S mode if any controller is active on this
656658
* channel.
657659
*/
658660
if (any_active(i2s) &&
659661
((mod & (sdf_mask | lrp_rlow | mod_slave)) != tmp)) {
660-
spin_unlock(i2s->lock);
662+
spin_unlock_irqrestore(i2s->lock, flags);
661663
dev_err(&i2s->pdev->dev,
662664
"%s:%d Other DAI busy\n", __func__, __LINE__);
663665
return -EAGAIN;
@@ -666,7 +668,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
666668
mod &= ~(sdf_mask | lrp_rlow | mod_slave);
667669
mod |= tmp;
668670
writel(mod, i2s->addr + I2SMOD);
669-
spin_unlock(i2s->lock);
671+
spin_unlock_irqrestore(i2s->lock, flags);
670672

671673
return 0;
672674
}
@@ -676,6 +678,7 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
676678
{
677679
struct i2s_dai *i2s = to_info(dai);
678680
u32 mod, mask = 0, val = 0;
681+
unsigned long flags;
679682

680683
if (!is_secondary(i2s))
681684
mask |= (MOD_DC2_EN | MOD_DC1_EN);
@@ -744,11 +747,11 @@ static int i2s_hw_params(struct snd_pcm_substream *substream,
744747
return -EINVAL;
745748
}
746749

747-
spin_lock(i2s->lock);
750+
spin_lock_irqsave(i2s->lock, flags);
748751
mod = readl(i2s->addr + I2SMOD);
749752
mod = (mod & ~mask) | val;
750753
writel(mod, i2s->addr + I2SMOD);
751-
spin_unlock(i2s->lock);
754+
spin_unlock_irqrestore(i2s->lock, flags);
752755

753756
samsung_asoc_init_dma_data(dai, &i2s->dma_playback, &i2s->dma_capture);
754757

0 commit comments

Comments
 (0)