Skip to content

Commit 9dfcce4

Browse files
committed
Merge tag 'asoc-fix-v4.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v4.11 A relatively large pile of fixes for mainline, the first since the merge window. The biggest block of changes here by volume is the sun8i-codec set, the driver was newly added in the merge window but it was realized that renaming some of the user visible controls was required so these are being pushed for v4.11 to avoid the original code appearing in a release. Otherwise it's all fairly standard bugfix stuff.
2 parents 2d7d540 + 2ddaa67 commit 9dfcce4

File tree

15 files changed

+109
-77
lines changed

15 files changed

+109
-77
lines changed

arch/arm/boot/dts/sun8i-a33.dtsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
simple-audio-card,mclk-fs = <512>;
114114
simple-audio-card,aux-devs = <&codec_analog>;
115115
simple-audio-card,routing =
116-
"Left DAC", "Digital Left DAC",
117-
"Right DAC", "Digital Right DAC";
116+
"Left DAC", "AIF1 Slot 0 Left",
117+
"Right DAC", "AIF1 Slot 0 Right";
118118
status = "disabled";
119119

120120
simple-audio-card,cpu {

sound/soc/atmel/atmel-classd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int atmel_classd_codec_dai_digital_mute(struct snd_soc_dai *codec_dai,
349349
}
350350

351351
#define CLASSD_ACLK_RATE_11M2896_MPY_8 (112896 * 100 * 8)
352-
#define CLASSD_ACLK_RATE_12M288_MPY_8 (12228 * 1000 * 8)
352+
#define CLASSD_ACLK_RATE_12M288_MPY_8 (12288 * 1000 * 8)
353353

354354
static struct {
355355
int rate;

sound/soc/codecs/hdac_hdmi.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,21 +1534,20 @@ static void hdac_hdmi_eld_notify_cb(void *aptr, int port, int pipe)
15341534
pin->mst_capable = false;
15351535
/* if not MST, default is port[0] */
15361536
hport = &pin->ports[0];
1537-
goto out;
15381537
} else {
15391538
for (i = 0; i < pin->num_ports; i++) {
15401539
pin->mst_capable = true;
15411540
if (pin->ports[i].id == pipe) {
15421541
hport = &pin->ports[i];
1543-
goto out;
1542+
break;
15441543
}
15451544
}
15461545
}
1546+
1547+
if (hport)
1548+
hdac_hdmi_present_sense(pin, hport);
15471549
}
15481550

1549-
out:
1550-
if (pin && hport)
1551-
hdac_hdmi_present_sense(pin, hport);
15521551
}
15531552

15541553
static struct i915_audio_component_audio_ops aops = {
@@ -1998,7 +1997,7 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
19981997
struct hdac_hdmi_pin *pin, *pin_next;
19991998
struct hdac_hdmi_cvt *cvt, *cvt_next;
20001999
struct hdac_hdmi_pcm *pcm, *pcm_next;
2001-
struct hdac_hdmi_port *port;
2000+
struct hdac_hdmi_port *port, *port_next;
20022001
int i;
20032002

20042003
snd_soc_unregister_codec(&edev->hdac.dev);
@@ -2008,8 +2007,9 @@ static int hdac_hdmi_dev_remove(struct hdac_ext_device *edev)
20082007
if (list_empty(&pcm->port_list))
20092008
continue;
20102009

2011-
list_for_each_entry(port, &pcm->port_list, head)
2012-
port = NULL;
2010+
list_for_each_entry_safe(port, port_next,
2011+
&pcm->port_list, head)
2012+
list_del(&port->head);
20132013

20142014
list_del(&pcm->head);
20152015
kfree(pcm);

sound/soc/codecs/rt5665.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ static irqreturn_t rt5665_irq(int irq, void *data)
12411241
static void rt5665_jd_check_handler(struct work_struct *work)
12421242
{
12431243
struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv,
1244-
calibrate_work.work);
1244+
jd_check_work.work);
12451245

12461246
if (snd_soc_read(rt5665->codec, RT5665_AJD1_CTRL) & 0x0010) {
12471247
/* jack out */
@@ -2252,7 +2252,7 @@ static const char * const rt5665_if2_1_adc_in_src[] = {
22522252

22532253
static const SOC_ENUM_SINGLE_DECL(
22542254
rt5665_if2_1_adc_in_enum, RT5665_DIG_INF2_DATA,
2255-
RT5665_IF3_ADC_IN_SFT, rt5665_if2_1_adc_in_src);
2255+
RT5665_IF2_1_ADC_IN_SFT, rt5665_if2_1_adc_in_src);
22562256

22572257
static const struct snd_kcontrol_new rt5665_if2_1_adc_in_mux =
22582258
SOC_DAPM_ENUM("IF2_1 ADC IN Source", rt5665_if2_1_adc_in_enum);
@@ -3178,6 +3178,9 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
31783178
{"DAC Mono Right Filter", NULL, "DAC Mono R ASRC", is_using_asrc},
31793179
{"DAC Stereo1 Filter", NULL, "DAC STO1 ASRC", is_using_asrc},
31803180
{"DAC Stereo2 Filter", NULL, "DAC STO2 ASRC", is_using_asrc},
3181+
{"I2S1 ASRC", NULL, "CLKDET"},
3182+
{"I2S2 ASRC", NULL, "CLKDET"},
3183+
{"I2S3 ASRC", NULL, "CLKDET"},
31813184

31823185
/*Vref*/
31833186
{"Mic Det Power", NULL, "Vref2"},
@@ -3912,6 +3915,7 @@ static const struct snd_soc_dapm_route rt5665_dapm_routes[] = {
39123915
{"Mono MIX", "MONOVOL Switch", "MONOVOL"},
39133916
{"Mono Amp", NULL, "Mono MIX"},
39143917
{"Mono Amp", NULL, "Vref2"},
3918+
{"Mono Amp", NULL, "Vref3"},
39153919
{"Mono Amp", NULL, "CLKDET SYS"},
39163920
{"Mono Amp", NULL, "CLKDET MONO"},
39173921
{"Mono Playback", "Switch", "Mono Amp"},
@@ -4798,7 +4802,7 @@ static int rt5665_i2c_probe(struct i2c_client *i2c,
47984802
/* Enhance performance*/
47994803
regmap_update_bits(rt5665->regmap, RT5665_PWR_ANLG_1,
48004804
RT5665_HP_DRIVER_MASK | RT5665_LDO1_DVO_MASK,
4801-
RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_09);
4805+
RT5665_HP_DRIVER_5X | RT5665_LDO1_DVO_12);
48024806

48034807
INIT_DELAYED_WORK(&rt5665->jack_detect_work,
48044808
rt5665_jack_detect_handler);

sound/soc/codecs/rt5665.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@
11061106
#define RT5665_HP_DRIVER_MASK (0x3 << 2)
11071107
#define RT5665_HP_DRIVER_1X (0x0 << 2)
11081108
#define RT5665_HP_DRIVER_3X (0x1 << 2)
1109-
#define RT5665_HP_DRIVER_5X (0x2 << 2)
1109+
#define RT5665_HP_DRIVER_5X (0x3 << 2)
11101110
#define RT5665_LDO1_DVO_MASK (0x3)
11111111
#define RT5665_LDO1_DVO_09 (0x0)
11121112
#define RT5665_LDO1_DVO_10 (0x1)

sound/soc/codecs/wm_adsp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,10 @@ static int wm_coeff_put(struct snd_kcontrol *kctl,
899899

900900
mutex_lock(&ctl->dsp->pwr_lock);
901901

902-
memcpy(ctl->cache, p, ctl->len);
902+
if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
903+
ret = -EPERM;
904+
else
905+
memcpy(ctl->cache, p, ctl->len);
903906

904907
ctl->set = 1;
905908
if (ctl->enabled && ctl->dsp->running)
@@ -926,6 +929,8 @@ static int wm_coeff_tlv_put(struct snd_kcontrol *kctl,
926929
ctl->set = 1;
927930
if (ctl->enabled && ctl->dsp->running)
928931
ret = wm_coeff_write_control(ctl, ctl->cache, size);
932+
else if (ctl->flags & WMFW_CTL_FLAG_VOLATILE)
933+
ret = -EPERM;
929934
}
930935

931936
mutex_unlock(&ctl->dsp->pwr_lock);
@@ -947,7 +952,7 @@ static int wm_coeff_put_acked(struct snd_kcontrol *kctl,
947952

948953
mutex_lock(&ctl->dsp->pwr_lock);
949954

950-
if (ctl->enabled)
955+
if (ctl->enabled && ctl->dsp->running)
951956
ret = wm_coeff_write_acked_control(ctl, val);
952957
else
953958
ret = -EPERM;

sound/soc/generic/simple-card-utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ int asoc_simple_card_parse_clk(struct device *dev,
115115
clk = devm_get_clk_from_child(dev, node, NULL);
116116
if (!IS_ERR(clk)) {
117117
simple_dai->sysclk = clk_get_rate(clk);
118+
simple_dai->clk = clk;
118119
} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
119120
simple_dai->sysclk = val;
120121
} else {

sound/soc/intel/skylake/skl-topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
512512
if (bc->set_params != SKL_PARAM_INIT)
513513
continue;
514514

515-
mconfig->formats_config.caps = (u32 *)&bc->params;
515+
mconfig->formats_config.caps = (u32 *)bc->params;
516516
mconfig->formats_config.caps_size = bc->size;
517517

518518
break;

sound/soc/mediatek/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ config SND_SOC_MT2701
1313

1414
config SND_SOC_MT2701_CS42448
1515
tristate "ASoc Audio driver for MT2701 with CS42448 codec"
16-
depends on SND_SOC_MT2701
16+
depends on SND_SOC_MT2701 && I2C
1717
select SND_SOC_CS42XX8_I2C
1818
select SND_SOC_BT_SCO
1919
help

sound/soc/sh/rcar/cmd.c

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,24 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
3131
struct rsnd_mod *mix = rsnd_io_to_mod_mix(io);
3232
struct device *dev = rsnd_priv_to_dev(priv);
3333
u32 data;
34+
u32 path[] = {
35+
[1] = 1 << 0,
36+
[5] = 1 << 8,
37+
[6] = 1 << 12,
38+
[9] = 1 << 15,
39+
};
3440

3541
if (!mix && !dvc)
3642
return 0;
3743

44+
if (ARRAY_SIZE(path) < rsnd_mod_id(mod) + 1)
45+
return -ENXIO;
46+
3847
if (mix) {
3948
struct rsnd_dai *rdai;
4049
struct rsnd_mod *src;
4150
struct rsnd_dai_stream *tio;
4251
int i;
43-
u32 path[] = {
44-
[0] = 0,
45-
[1] = 1 << 0,
46-
[2] = 0,
47-
[3] = 0,
48-
[4] = 0,
49-
[5] = 1 << 8
50-
};
5152

5253
/*
5354
* it is assuming that integrater is well understanding about
@@ -70,16 +71,19 @@ static int rsnd_cmd_init(struct rsnd_mod *mod,
7071
} else {
7172
struct rsnd_mod *src = rsnd_io_to_mod_src(io);
7273

73-
u32 path[] = {
74-
[0] = 0x30000,
75-
[1] = 0x30001,
76-
[2] = 0x40000,
77-
[3] = 0x10000,
78-
[4] = 0x20000,
79-
[5] = 0x40100
74+
u8 cmd_case[] = {
75+
[0] = 0x3,
76+
[1] = 0x3,
77+
[2] = 0x4,
78+
[3] = 0x1,
79+
[4] = 0x2,
80+
[5] = 0x4,
81+
[6] = 0x1,
82+
[9] = 0x2,
8083
};
8184

82-
data = path[rsnd_mod_id(src)];
85+
data = path[rsnd_mod_id(src)] |
86+
cmd_case[rsnd_mod_id(src)] << 16;
8387
}
8488

8589
dev_dbg(dev, "ctu/mix path = 0x%08x", data);

sound/soc/sh/rcar/dma.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,17 +454,31 @@ static u32 rsnd_dmapp_read(struct rsnd_dma *dma, u32 reg)
454454
return ioread32(rsnd_dmapp_addr(dmac, dma, reg));
455455
}
456456

457+
static void rsnd_dmapp_bset(struct rsnd_dma *dma, u32 data, u32 mask, u32 reg)
458+
{
459+
struct rsnd_mod *mod = rsnd_mod_get(dma);
460+
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
461+
struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
462+
void __iomem *addr = rsnd_dmapp_addr(dmac, dma, reg);
463+
u32 val = ioread32(addr);
464+
465+
val &= ~mask;
466+
val |= (data & mask);
467+
468+
iowrite32(val, addr);
469+
}
470+
457471
static int rsnd_dmapp_stop(struct rsnd_mod *mod,
458472
struct rsnd_dai_stream *io,
459473
struct rsnd_priv *priv)
460474
{
461475
struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
462476
int i;
463477

464-
rsnd_dmapp_write(dma, 0, PDMACHCR);
478+
rsnd_dmapp_bset(dma, 0, PDMACHCR_DE, PDMACHCR);
465479

466480
for (i = 0; i < 1024; i++) {
467-
if (0 == rsnd_dmapp_read(dma, PDMACHCR))
481+
if (0 == (rsnd_dmapp_read(dma, PDMACHCR) & PDMACHCR_DE))
468482
return 0;
469483
udelay(1);
470484
}

sound/soc/sh/rcar/ssiu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ static int rsnd_ssiu_init(struct rsnd_mod *mod,
6464
mask1 = (1 << 4) | (1 << 20); /* mask sync bit */
6565
mask2 = (1 << 4); /* mask sync bit */
6666
val1 = val2 = 0;
67-
if (rsnd_ssi_is_pin_sharing(io)) {
67+
if (id == 8) {
68+
/*
69+
* SSI8 pin is sharing with SSI7, nothing to do.
70+
*/
71+
} else if (rsnd_ssi_is_pin_sharing(io)) {
6872
int shift = -1;
6973

7074
switch (id) {

sound/soc/soc-core.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,15 +3326,19 @@ static int snd_soc_platform_drv_pcm_new(struct snd_soc_pcm_runtime *rtd)
33263326
{
33273327
struct snd_soc_platform *platform = rtd->platform;
33283328

3329-
return platform->driver->pcm_new(rtd);
3329+
if (platform->driver->pcm_new)
3330+
return platform->driver->pcm_new(rtd);
3331+
else
3332+
return 0;
33303333
}
33313334

33323335
static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm)
33333336
{
33343337
struct snd_soc_pcm_runtime *rtd = pcm->private_data;
33353338
struct snd_soc_platform *platform = rtd->platform;
33363339

3337-
platform->driver->pcm_free(pcm);
3340+
if (platform->driver->pcm_free)
3341+
platform->driver->pcm_free(pcm);
33383342
}
33393343

33403344
/**

sound/soc/sti/uniperif_reader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ static int uni_reader_startup(struct snd_pcm_substream *substream,
349349
struct uniperif *reader = priv->dai_data.uni;
350350
int ret;
351351

352+
reader->substream = substream;
353+
352354
if (!UNIPERIF_TYPE_IS_TDM(reader))
353355
return 0;
354356

@@ -378,6 +380,7 @@ static void uni_reader_shutdown(struct snd_pcm_substream *substream,
378380
/* Stop the reader */
379381
uni_reader_stop(reader);
380382
}
383+
reader->substream = NULL;
381384
}
382385

383386
static const struct snd_soc_dai_ops uni_reader_dai_ops = {

0 commit comments

Comments
 (0)