Skip to content

Commit 3855360

Browse files
committed
Merge tag 'asoc-fix-v5.6-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.6 A few fixes sent in since the merge window, none of them with global impact but all important for the users they affect.
2 parents 44eeb08 + 96781fd commit 3855360

File tree

16 files changed

+219
-415
lines changed

16 files changed

+219
-415
lines changed

include/sound/soc-dapm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
392392
struct snd_ctl_elem_value *ucontrol);
393393
int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
394394
struct snd_ctl_elem_value *ucontrol);
395-
int snd_soc_dapm_put_enum_double_locked(struct snd_kcontrol *kcontrol,
396-
struct snd_ctl_elem_value *ucontrol);
397395
int snd_soc_dapm_info_pin_switch(struct snd_kcontrol *kcontrol,
398396
struct snd_ctl_elem_info *uinfo);
399397
int snd_soc_dapm_get_pin_switch(struct snd_kcontrol *kcontrol,

sound/hda/ext/hdac_ext_controller.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all);
254254
int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
255255
struct hdac_ext_link *link)
256256
{
257+
unsigned long codec_mask;
257258
int ret = 0;
258259

259260
mutex_lock(&bus->lock);
@@ -280,9 +281,11 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
280281
* HDA spec section 4.3 - Codec Discovery
281282
*/
282283
udelay(521);
283-
bus->codec_mask = snd_hdac_chip_readw(bus, STATESTS);
284-
dev_dbg(bus->dev, "codec_mask = 0x%lx\n", bus->codec_mask);
285-
snd_hdac_chip_writew(bus, STATESTS, bus->codec_mask);
284+
codec_mask = snd_hdac_chip_readw(bus, STATESTS);
285+
dev_dbg(bus->dev, "codec_mask = 0x%lx\n", codec_mask);
286+
snd_hdac_chip_writew(bus, STATESTS, codec_mask);
287+
if (!bus->codec_mask)
288+
bus->codec_mask = codec_mask;
286289
}
287290

288291
mutex_unlock(&bus->lock);

sound/soc/amd/raven/acp3x-i2s.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
170170
struct snd_soc_card *card;
171171
struct acp3x_platform_info *pinfo;
172172
u32 ret, val, period_bytes, reg_val, ier_val, water_val;
173+
u32 buf_size, buf_reg;
173174

174175
prtd = substream->private_data;
175176
rtd = substream->runtime->private_data;
@@ -183,6 +184,8 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
183184
}
184185
period_bytes = frames_to_bytes(substream->runtime,
185186
substream->runtime->period_size);
187+
buf_size = frames_to_bytes(substream->runtime,
188+
substream->runtime->buffer_size);
186189
switch (cmd) {
187190
case SNDRV_PCM_TRIGGER_START:
188191
case SNDRV_PCM_TRIGGER_RESUME:
@@ -196,13 +199,15 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
196199
mmACP_BT_TX_INTR_WATERMARK_SIZE;
197200
reg_val = mmACP_BTTDM_ITER;
198201
ier_val = mmACP_BTTDM_IER;
202+
buf_reg = mmACP_BT_TX_RINGBUFSIZE;
199203
break;
200204
case I2S_SP_INSTANCE:
201205
default:
202206
water_val =
203207
mmACP_I2S_TX_INTR_WATERMARK_SIZE;
204208
reg_val = mmACP_I2STDM_ITER;
205209
ier_val = mmACP_I2STDM_IER;
210+
buf_reg = mmACP_I2S_TX_RINGBUFSIZE;
206211
}
207212
} else {
208213
switch (rtd->i2s_instance) {
@@ -211,16 +216,19 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream,
211216
mmACP_BT_RX_INTR_WATERMARK_SIZE;
212217
reg_val = mmACP_BTTDM_IRER;
213218
ier_val = mmACP_BTTDM_IER;
219+
buf_reg = mmACP_BT_RX_RINGBUFSIZE;
214220
break;
215221
case I2S_SP_INSTANCE:
216222
default:
217223
water_val =
218224
mmACP_I2S_RX_INTR_WATERMARK_SIZE;
219225
reg_val = mmACP_I2STDM_IRER;
220226
ier_val = mmACP_I2STDM_IER;
227+
buf_reg = mmACP_I2S_RX_RINGBUFSIZE;
221228
}
222229
}
223230
rv_writel(period_bytes, rtd->acp3x_base + water_val);
231+
rv_writel(buf_size, rtd->acp3x_base + buf_reg);
224232
val = rv_readl(rtd->acp3x_base + reg_val);
225233
val = val | BIT(0);
226234
rv_writel(val, rtd->acp3x_base + reg_val);

sound/soc/amd/raven/acp3x-pcm-dma.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
110110
{
111111
u16 page_idx;
112112
u32 low, high, val, acp_fifo_addr, reg_fifo_addr;
113-
u32 reg_ringbuf_size, reg_dma_size, reg_fifo_size;
113+
u32 reg_dma_size, reg_fifo_size;
114114
dma_addr_t addr;
115115

116116
addr = rtd->dma_addr;
@@ -157,7 +157,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
157157
if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
158158
switch (rtd->i2s_instance) {
159159
case I2S_BT_INSTANCE:
160-
reg_ringbuf_size = mmACP_BT_TX_RINGBUFSIZE;
161160
reg_dma_size = mmACP_BT_TX_DMA_SIZE;
162161
acp_fifo_addr = ACP_SRAM_PTE_OFFSET +
163162
BT_PB_FIFO_ADDR_OFFSET;
@@ -169,7 +168,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
169168

170169
case I2S_SP_INSTANCE:
171170
default:
172-
reg_ringbuf_size = mmACP_I2S_TX_RINGBUFSIZE;
173171
reg_dma_size = mmACP_I2S_TX_DMA_SIZE;
174172
acp_fifo_addr = ACP_SRAM_PTE_OFFSET +
175173
SP_PB_FIFO_ADDR_OFFSET;
@@ -181,7 +179,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
181179
} else {
182180
switch (rtd->i2s_instance) {
183181
case I2S_BT_INSTANCE:
184-
reg_ringbuf_size = mmACP_BT_RX_RINGBUFSIZE;
185182
reg_dma_size = mmACP_BT_RX_DMA_SIZE;
186183
acp_fifo_addr = ACP_SRAM_PTE_OFFSET +
187184
BT_CAPT_FIFO_ADDR_OFFSET;
@@ -193,7 +190,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
193190

194191
case I2S_SP_INSTANCE:
195192
default:
196-
reg_ringbuf_size = mmACP_I2S_RX_RINGBUFSIZE;
197193
reg_dma_size = mmACP_I2S_RX_DMA_SIZE;
198194
acp_fifo_addr = ACP_SRAM_PTE_OFFSET +
199195
SP_CAPT_FIFO_ADDR_OFFSET;
@@ -203,7 +199,6 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction)
203199
rtd->acp3x_base + mmACP_I2S_RX_RINGBUFADDR);
204200
}
205201
}
206-
rv_writel(MAX_BUFFER, rtd->acp3x_base + reg_ringbuf_size);
207202
rv_writel(DMA_SIZE, rtd->acp3x_base + reg_dma_size);
208203
rv_writel(acp_fifo_addr, rtd->acp3x_base + reg_fifo_addr);
209204
rv_writel(FIFO_SIZE, rtd->acp3x_base + reg_fifo_size);

sound/soc/amd/raven/pci-acp3x.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,6 @@ static int acp3x_power_on(void __iomem *acp3x_base)
4545
return -ETIMEDOUT;
4646
}
4747

48-
static int acp3x_power_off(void __iomem *acp3x_base)
49-
{
50-
u32 val;
51-
int timeout;
52-
53-
rv_writel(ACP_PGFSM_CNTL_POWER_OFF_MASK,
54-
acp3x_base + mmACP_PGFSM_CONTROL);
55-
timeout = 0;
56-
while (++timeout < 500) {
57-
val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS);
58-
if ((val & ACP_PGFSM_STATUS_MASK) == ACP_POWERED_OFF)
59-
return 0;
60-
udelay(1);
61-
}
62-
return -ETIMEDOUT;
63-
}
64-
6548
static int acp3x_reset(void __iomem *acp3x_base)
6649
{
6750
u32 val;
@@ -115,12 +98,6 @@ static int acp3x_deinit(void __iomem *acp3x_base)
11598
pr_err("ACP3x reset failed\n");
11699
return ret;
117100
}
118-
/* power off */
119-
ret = acp3x_power_off(acp3x_base);
120-
if (ret) {
121-
pr_err("ACP3x power off failed\n");
122-
return ret;
123-
}
124101
return 0;
125102
}
126103

sound/soc/atmel/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ config SND_ATMEL_SOC
1010
if SND_ATMEL_SOC
1111

1212
config SND_ATMEL_SOC_PDC
13-
tristate
13+
bool
1414
depends on HAS_DMA
1515

1616
config SND_ATMEL_SOC_DMA
17-
tristate
17+
bool
1818
select SND_SOC_GENERIC_DMAENGINE_PCM
1919

2020
config SND_ATMEL_SOC_SSC

sound/soc/atmel/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ snd-soc-atmel_ssc_dai-objs := atmel_ssc_dai.o
66
snd-soc-atmel-i2s-objs := atmel-i2s.o
77
snd-soc-mchp-i2s-mcc-objs := mchp-i2s-mcc.o
88

9-
obj-$(CONFIG_SND_ATMEL_SOC_PDC) += snd-soc-atmel-pcm-pdc.o
10-
obj-$(CONFIG_SND_ATMEL_SOC_DMA) += snd-soc-atmel-pcm-dma.o
9+
# pdc and dma need to both be built-in if any user of
10+
# ssc is built-in.
11+
ifdef CONFIG_SND_ATMEL_SOC_PDC
12+
obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel-pcm-pdc.o
13+
endif
14+
ifdef CONFIG_SND_ATMEL_SOC_DMA
15+
obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel-pcm-dma.o
16+
endif
1117
obj-$(CONFIG_SND_ATMEL_SOC_SSC) += snd-soc-atmel_ssc_dai.o
1218
obj-$(CONFIG_SND_ATMEL_SOC_I2S) += snd-soc-atmel-i2s.o
1319
obj-$(CONFIG_SND_MCHP_SOC_I2S_MCC) += snd-soc-mchp-i2s-mcc.o

sound/soc/codecs/hdmi-codec.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,17 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
779779
return ret;
780780
}
781781

782+
static void hdmi_remove(struct snd_soc_component *component)
783+
{
784+
struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
785+
786+
if (hcp->hcd.ops->hook_plugged_cb)
787+
hcp->hcd.ops->hook_plugged_cb(component->dev->parent,
788+
hcp->hcd.data, NULL, NULL);
789+
}
790+
782791
static const struct snd_soc_component_driver hdmi_driver = {
792+
.remove = hdmi_remove,
783793
.dapm_widgets = hdmi_widgets,
784794
.num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
785795
.of_xlate_dai_id = hdmi_of_xlate_dai_id,

0 commit comments

Comments
 (0)