Skip to content

Commit b13efb5

Browse files
committed
Merge tag 'asoc-fix-v6.19-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.19 A small pile of fixes that came in during the merge window, it's all fairly standard device specific stuff.
2 parents 161a0c6 + f34836a commit b13efb5

15 files changed

Lines changed: 82 additions & 38 deletions

File tree

Documentation/devicetree/bindings/sound/cirrus,cs42xx8.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ title: Cirrus Logic CS42448/CS42888 audio CODEC
99
maintainers:
1010
- patches@opensource.cirrus.com
1111

12+
allOf:
13+
- $ref: dai-common.yaml#
14+
1215
properties:
1316
compatible:
1417
enum:
@@ -63,7 +66,7 @@ then:
6366
- VLC-supply
6467
- VLS-supply
6568

66-
additionalProperties: false
69+
unevaluatedProperties: false
6770

6871
examples:
6972
- |

sound/soc/amd/acp/acp-i2s.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas
157157

158158
spin_lock_irq(&chip->acp_lock);
159159
list_for_each_entry(stream, &chip->stream_list, list) {
160+
if (dai->id != stream->dai_id)
161+
continue;
160162
switch (chip->acp_rev) {
161163
case ACP_RN_PCI_ID:
162164
case ACP_RMB_PCI_ID:

sound/soc/amd/acp/acp-legacy-common.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,21 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
219219
SP_PB_FIFO_ADDR_OFFSET;
220220
reg_fifo_addr = ACP_I2S_TX_FIFOADDR(chip);
221221
reg_fifo_size = ACP_I2S_TX_FIFOSIZE(chip);
222-
phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset;
222+
if (chip->acp_rev >= ACP70_PCI_ID)
223+
phy_addr = ACP7x_I2S_SP_TX_MEM_WINDOW_START;
224+
else
225+
phy_addr = I2S_SP_TX_MEM_WINDOW_START + stream->reg_offset;
223226
writel(phy_addr, chip->base + ACP_I2S_TX_RINGBUFADDR(chip));
224227
} else {
225228
reg_dma_size = ACP_I2S_RX_DMA_SIZE(chip);
226229
acp_fifo_addr = rsrc->sram_pte_offset +
227230
SP_CAPT_FIFO_ADDR_OFFSET;
228231
reg_fifo_addr = ACP_I2S_RX_FIFOADDR(chip);
229232
reg_fifo_size = ACP_I2S_RX_FIFOSIZE(chip);
230-
phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset;
233+
if (chip->acp_rev >= ACP70_PCI_ID)
234+
phy_addr = ACP7x_I2S_SP_RX_MEM_WINDOW_START;
235+
else
236+
phy_addr = I2S_SP_RX_MEM_WINDOW_START + stream->reg_offset;
231237
writel(phy_addr, chip->base + ACP_I2S_RX_RINGBUFADDR(chip));
232238
}
233239
break;
@@ -238,15 +244,21 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
238244
BT_PB_FIFO_ADDR_OFFSET;
239245
reg_fifo_addr = ACP_BT_TX_FIFOADDR(chip);
240246
reg_fifo_size = ACP_BT_TX_FIFOSIZE(chip);
241-
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
247+
if (chip->acp_rev >= ACP70_PCI_ID)
248+
phy_addr = ACP7x_I2S_BT_TX_MEM_WINDOW_START;
249+
else
250+
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
242251
writel(phy_addr, chip->base + ACP_BT_TX_RINGBUFADDR(chip));
243252
} else {
244253
reg_dma_size = ACP_BT_RX_DMA_SIZE(chip);
245254
acp_fifo_addr = rsrc->sram_pte_offset +
246255
BT_CAPT_FIFO_ADDR_OFFSET;
247256
reg_fifo_addr = ACP_BT_RX_FIFOADDR(chip);
248257
reg_fifo_size = ACP_BT_RX_FIFOSIZE(chip);
249-
phy_addr = I2S_BT_TX_MEM_WINDOW_START + stream->reg_offset;
258+
if (chip->acp_rev >= ACP70_PCI_ID)
259+
phy_addr = ACP7x_I2S_BT_RX_MEM_WINDOW_START;
260+
else
261+
phy_addr = I2S_BT_RX_MEM_WINDOW_START + stream->reg_offset;
250262
writel(phy_addr, chip->base + ACP_BT_RX_RINGBUFADDR(chip));
251263
}
252264
break;
@@ -257,15 +269,21 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream,
257269
HS_PB_FIFO_ADDR_OFFSET;
258270
reg_fifo_addr = ACP_HS_TX_FIFOADDR;
259271
reg_fifo_size = ACP_HS_TX_FIFOSIZE;
260-
phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset;
272+
if (chip->acp_rev >= ACP70_PCI_ID)
273+
phy_addr = ACP7x_I2S_HS_TX_MEM_WINDOW_START;
274+
else
275+
phy_addr = I2S_HS_TX_MEM_WINDOW_START + stream->reg_offset;
261276
writel(phy_addr, chip->base + ACP_HS_TX_RINGBUFADDR);
262277
} else {
263278
reg_dma_size = ACP_HS_RX_DMA_SIZE;
264279
acp_fifo_addr = rsrc->sram_pte_offset +
265280
HS_CAPT_FIFO_ADDR_OFFSET;
266281
reg_fifo_addr = ACP_HS_RX_FIFOADDR;
267282
reg_fifo_size = ACP_HS_RX_FIFOSIZE;
268-
phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset;
283+
if (chip->acp_rev >= ACP70_PCI_ID)
284+
phy_addr = ACP7x_I2S_HS_RX_MEM_WINDOW_START;
285+
else
286+
phy_addr = I2S_HS_RX_MEM_WINDOW_START + stream->reg_offset;
269287
writel(phy_addr, chip->base + ACP_HS_RX_RINGBUFADDR);
270288
}
271289
break;

sound/soc/bcm/bcm63xx-pcm-whistler.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ static int bcm63xx_soc_pcm_new(struct snd_soc_component *component,
358358

359359
i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev);
360360

361-
of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1);
361+
ret = of_dma_configure(pcm->card->dev, pcm->card->dev->of_node, 1);
362+
if (ret)
363+
return ret;
362364

363365
ret = dma_coerce_mask_and_coherent(pcm->card->dev, DMA_BIT_MASK(32));
364366
if (ret)

sound/soc/codecs/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,6 @@ config SND_SOC_CQ0093VC
777777
config SND_SOC_CROS_EC_CODEC
778778
tristate "codec driver for ChromeOS EC"
779779
depends on CROS_EC
780-
select CRYPTO
781780
select CRYPTO_LIB_SHA256
782781
help
783782
If you say yes here you will get support for the
@@ -918,7 +917,7 @@ config SND_SOC_CS35L56_CAL_DEBUGFS
918917
config SND_SOC_CS35L56_CAL_SET_CTRL
919918
bool "CS35L56 ALSA control to restore factory calibration"
920919
default N
921-
select SND_SOC_CS35L56_CAL_SYSFS_COMMON
920+
select SND_SOC_CS35L56_CAL_DEBUGFS_COMMON
922921
help
923922
Allow restoring factory calibration data through an ALSA
924923
control. This is only needed on platforms without UEFI or

sound/soc/codecs/ak4458.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,15 @@ static int ak4458_runtime_resume(struct device *dev)
671671
regcache_cache_only(ak4458->regmap, false);
672672
regcache_mark_dirty(ak4458->regmap);
673673

674-
return regcache_sync(ak4458->regmap);
674+
ret = regcache_sync(ak4458->regmap);
675+
if (ret)
676+
goto err;
677+
678+
return 0;
679+
err:
680+
regcache_cache_only(ak4458->regmap, true);
681+
regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
682+
return ret;
675683
}
676684

677685
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {

sound/soc/codecs/ak5558.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,15 @@ static int ak5558_runtime_resume(struct device *dev)
372372
regcache_cache_only(ak5558->regmap, false);
373373
regcache_mark_dirty(ak5558->regmap);
374374

375-
return regcache_sync(ak5558->regmap);
375+
ret = regcache_sync(ak5558->regmap);
376+
if (ret)
377+
goto err;
378+
379+
return 0;
380+
err:
381+
regcache_cache_only(ak5558->regmap, true);
382+
regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies);
383+
return ret;
376384
}
377385

378386
static const struct dev_pm_ops ak5558_pm = {

sound/soc/codecs/cs-amp-lib.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include <asm/byteorder.h>
99
#include <kunit/static_stub.h>
10-
#include <linux/cleanup.h>
1110
#include <linux/debugfs.h>
1211
#include <linux/dev_printk.h>
1312
#include <linux/efi.h>
@@ -310,8 +309,9 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
310309
efi_guid_t **guid,
311310
u32 *attr)
312311
{
313-
struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL;
312+
struct cirrus_amp_efi_data *efi_data;
314313
unsigned long data_size = 0;
314+
u8 *data;
315315
efi_status_t status;
316316
int i, ret;
317317

@@ -339,18 +339,19 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
339339
}
340340

341341
/* Get variable contents into buffer */
342-
efi_data = kmalloc(data_size, GFP_KERNEL);
343-
if (!efi_data)
342+
data = kmalloc(data_size, GFP_KERNEL);
343+
if (!data)
344344
return ERR_PTR(-ENOMEM);
345345

346346
status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name,
347347
cs_amp_lib_cal_efivars[i].guid,
348-
attr, &data_size, efi_data);
348+
attr, &data_size, data);
349349
if (status != EFI_SUCCESS) {
350350
ret = -EINVAL;
351351
goto err;
352352
}
353353

354+
efi_data = (struct cirrus_amp_efi_data *)data;
354355
dev_dbg(dev, "Calibration: Size=%d, Amp Count=%d\n", efi_data->size, efi_data->count);
355356

356357
if ((efi_data->count > 128) ||
@@ -364,9 +365,10 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev,
364365
if (efi_data->size == 0)
365366
efi_data->size = data_size;
366367

367-
return_ptr(efi_data);
368+
return efi_data;
368369

369370
err:
371+
kfree(data);
370372
dev_err(dev, "Failed to read calibration data from EFI: %d\n", ret);
371373

372374
return ERR_PTR(ret);
@@ -389,9 +391,9 @@ static int cs_amp_set_cal_efi_buffer(struct device *dev,
389391
static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
390392
struct cirrus_amp_cal_data *out_data)
391393
{
392-
struct cirrus_amp_efi_data *efi_data __free(kfree) = NULL;
394+
struct cirrus_amp_efi_data *efi_data;
393395
struct cirrus_amp_cal_data *cal = NULL;
394-
int i;
396+
int i, ret;
395397

396398
efi_data = cs_amp_get_cal_efi_buffer(dev, NULL, NULL, NULL);
397399
if (IS_ERR(efi_data))
@@ -432,14 +434,17 @@ static int _cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid,
432434
dev_warn(dev, "Calibration entry %d does not match silicon ID", amp_index);
433435
}
434436

435-
if (!cal) {
437+
if (cal) {
438+
memcpy(out_data, cal, sizeof(*out_data));
439+
ret = 0;
440+
} else {
436441
dev_warn(dev, "No calibration for silicon ID %#llx\n", target_uid);
437-
return -ENOENT;
442+
ret = -ENOENT;
438443
}
439444

440-
memcpy(out_data, cal, sizeof(*out_data));
445+
kfree(efi_data);
441446

442-
return 0;
447+
return ret;
443448
}
444449

445450
static int _cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,

sound/soc/codecs/cs35l41.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,13 +1188,14 @@ static int cs35l41_get_system_name(struct cs35l41_private *cs35l41)
11881188
}
11891189
}
11901190

1191-
err:
11921191
if (sub) {
11931192
cs35l41->dsp.system_name = sub;
11941193
dev_info(cs35l41->dev, "Subsystem ID: %s\n", cs35l41->dsp.system_name);
1195-
} else
1196-
dev_warn(cs35l41->dev, "Subsystem ID not found\n");
1194+
return 0;
1195+
}
11971196

1197+
err:
1198+
dev_warn(cs35l41->dev, "Subsystem ID not found\n");
11981199
return ret;
11991200
}
12001201

sound/soc/codecs/nau8325.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ static int nau8325_clksrc_choose(struct nau8325 *nau8325,
386386
const struct nau8325_srate_attr **srate_table,
387387
int *n1_sel, int *mult_sel, int *n2_sel)
388388
{
389-
int i, j, mclk, mclk_max, ratio, ratio_sel, n2_max;
389+
int i, j, mclk, ratio;
390+
int mclk_max = 0, ratio_sel = 0, n2_max = 0;
390391

391392
if (!nau8325->mclk || !nau8325->fs)
392393
goto proc_err;
@@ -408,7 +409,6 @@ static int nau8325_clksrc_choose(struct nau8325 *nau8325,
408409
}
409410

410411
/* Get MCLK_SRC through 1/N, Multiplier, and then 1/N2. */
411-
mclk_max = 0;
412412
for (i = 0; i < ARRAY_SIZE(mclk_n1_div); i++) {
413413
for (j = 0; j < ARRAY_SIZE(mclk_n3_mult); j++) {
414414
mclk = nau8325->mclk << mclk_n3_mult[j].param;

0 commit comments

Comments
 (0)