Skip to content

Commit cfee987

Browse files
committed
ASoC: Merge up fixes
For the benefit of CI.
2 parents 44cb08f + ab0b507 commit cfee987

8 files changed

Lines changed: 114 additions & 45 deletions

File tree

MAINTAINERS

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21063,6 +21063,39 @@ S: Maintained
2106321063
F: Documentation/devicetree/bindings/sound/davinci-mcasp-audio.yaml
2106421064
F: sound/soc/ti/
2106521065

21066+
TEXAS INSTRUMENTS AUDIO (ASoC/HDA) DRIVERS
21067+
M: Shenghao Ding <shenghao-ding@ti.com>
21068+
M: Kevin Lu <kevin-lu@ti.com>
21069+
M: Baojun Xu <x1077012@ti.com>
21070+
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
21071+
S: Maintained
21072+
F: Documentation/devicetree/bindings/sound/tas2552.txt
21073+
F: Documentation/devicetree/bindings/sound/tas2562.yaml
21074+
F: Documentation/devicetree/bindings/sound/tas2770.yaml
21075+
F: Documentation/devicetree/bindings/sound/tas27xx.yaml
21076+
F: Documentation/devicetree/bindings/sound/ti,pcm1681.txt
21077+
F: Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
21078+
F: Documentation/devicetree/bindings/sound/ti,tlv320*.yaml
21079+
F: Documentation/devicetree/bindings/sound/tlv320adcx140.yaml
21080+
F: Documentation/devicetree/bindings/sound/tlv320aic31xx.txt
21081+
F: Documentation/devicetree/bindings/sound/tpa6130a2.txt
21082+
F: include/sound/tas2*.h
21083+
F: include/sound/tlv320*.h
21084+
F: include/sound/tpa6130a2-plat.h
21085+
F: sound/pci/hda/tas2781_hda_i2c.c
21086+
F: sound/soc/codecs/pcm1681.c
21087+
F: sound/soc/codecs/pcm1789*.*
21088+
F: sound/soc/codecs/pcm179x*.*
21089+
F: sound/soc/codecs/pcm186x*.*
21090+
F: sound/soc/codecs/pcm3008.*
21091+
F: sound/soc/codecs/pcm3060*.*
21092+
F: sound/soc/codecs/pcm3168a*.*
21093+
F: sound/soc/codecs/pcm5102a.c
21094+
F: sound/soc/codecs/pcm512x*.*
21095+
F: sound/soc/codecs/tas2*.*
21096+
F: sound/soc/codecs/tlv320*.*
21097+
F: sound/soc/codecs/tpa6130a2.*
21098+
2106621099
TEXAS INSTRUMENTS DMA DRIVERS
2106721100
M: Peter Ujfalusi <peter.ujfalusi@gmail.com>
2106821101
L: dmaengine@vger.kernel.org

sound/soc/codecs/cs35l56-i2c.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,19 @@ static const struct i2c_device_id cs35l56_id_i2c[] = {
6262
};
6363
MODULE_DEVICE_TABLE(i2c, cs35l56_id_i2c);
6464

65+
#ifdef CONFIG_ACPI
66+
static const struct acpi_device_id cs35l56_asoc_acpi_match[] = {
67+
{ "CSC355C", 0 },
68+
{},
69+
};
70+
MODULE_DEVICE_TABLE(acpi, cs35l56_asoc_acpi_match);
71+
#endif
72+
6573
static struct i2c_driver cs35l56_i2c_driver = {
6674
.driver = {
6775
.name = "cs35l56",
6876
.pm = &cs35l56_pm_ops_i2c_spi,
77+
.acpi_match_table = ACPI_PTR(cs35l56_asoc_acpi_match),
6978
},
7079
.id_table = cs35l56_id_i2c,
7180
.probe = cs35l56_i2c_probe,

sound/soc/codecs/cs35l56-spi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,19 @@ static const struct spi_device_id cs35l56_id_spi[] = {
5959
};
6060
MODULE_DEVICE_TABLE(spi, cs35l56_id_spi);
6161

62+
#ifdef CONFIG_ACPI
63+
static const struct acpi_device_id cs35l56_asoc_acpi_match[] = {
64+
{ "CSC355C", 0 },
65+
{},
66+
};
67+
MODULE_DEVICE_TABLE(acpi, cs35l56_asoc_acpi_match);
68+
#endif
69+
6270
static struct spi_driver cs35l56_spi_driver = {
6371
.driver = {
6472
.name = "cs35l56",
6573
.pm = &cs35l56_pm_ops_i2c_spi,
74+
.acpi_match_table = ACPI_PTR(cs35l56_asoc_acpi_match),
6675
},
6776
.id_table = cs35l56_id_spi,
6877
.probe = cs35l56_spi_probe,

sound/soc/codecs/cs35l56.c

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// Copyright (C) 2023 Cirrus Logic, Inc. and
66
// Cirrus Logic International Semiconductor Ltd.
77

8-
#include <linux/acpi.h>
98
#include <linux/completion.h>
109
#include <linux/debugfs.h>
1110
#include <linux/delay.h>
@@ -1029,26 +1028,22 @@ static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
10291028
return 0;
10301029
}
10311030

1032-
static int cs35l56_acpi_get_name(struct cs35l56_private *cs35l56)
1031+
static int cs35l56_get_firmware_uid(struct cs35l56_private *cs35l56)
10331032
{
1034-
acpi_handle handle = ACPI_HANDLE(cs35l56->base.dev);
1035-
const char *sub;
1033+
struct device *dev = cs35l56->base.dev;
1034+
const char *prop;
1035+
int ret;
10361036

1037-
/* If there is no ACPI_HANDLE, there is no ACPI for this system, return 0 */
1038-
if (!handle)
1037+
ret = device_property_read_string(dev, "cirrus,firmware-uid", &prop);
1038+
/* If bad sw node property, return 0 and fallback to legacy firmware path */
1039+
if (ret < 0)
10391040
return 0;
10401041

1041-
sub = acpi_get_subsystem_id(handle);
1042-
if (IS_ERR(sub)) {
1043-
/* If bad ACPI, return 0 and fallback to legacy firmware path, otherwise fail */
1044-
if (PTR_ERR(sub) == -ENODATA)
1045-
return 0;
1046-
else
1047-
return PTR_ERR(sub);
1048-
}
1042+
cs35l56->dsp.system_name = devm_kstrdup(dev, prop, GFP_KERNEL);
1043+
if (cs35l56->dsp.system_name == NULL)
1044+
return -ENOMEM;
10491045

1050-
cs35l56->dsp.system_name = sub;
1051-
dev_dbg(cs35l56->base.dev, "Subsystem ID: %s\n", cs35l56->dsp.system_name);
1046+
dev_dbg(dev, "Firmware UID: %s\n", cs35l56->dsp.system_name);
10521047

10531048
return 0;
10541049
}
@@ -1095,7 +1090,7 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
10951090
gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 1);
10961091
}
10971092

1098-
ret = cs35l56_acpi_get_name(cs35l56);
1093+
ret = cs35l56_get_firmware_uid(cs35l56);
10991094
if (ret != 0)
11001095
goto err;
11011096

@@ -1217,8 +1212,6 @@ void cs35l56_remove(struct cs35l56_private *cs35l56)
12171212

12181213
regcache_cache_only(cs35l56->base.regmap, true);
12191214

1220-
kfree(cs35l56->dsp.system_name);
1221-
12221215
gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 0);
12231216
regulator_bulk_disable(ARRAY_SIZE(cs35l56->supplies), cs35l56->supplies);
12241217
}

sound/soc/codecs/rt1308-sdw.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static bool rt1308_volatile_register(struct device *dev, unsigned int reg)
5252
case 0x300a:
5353
case 0xc000:
5454
case 0xc710:
55+
case 0xcf01:
5556
case 0xc860 ... 0xc863:
5657
case 0xc870 ... 0xc873:
5758
return true;
@@ -213,7 +214,7 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
213214
{
214215
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
215216
int ret = 0;
216-
unsigned int tmp;
217+
unsigned int tmp, hibernation_flag;
217218

218219
if (rt1308->hw_init)
219220
return 0;
@@ -231,6 +232,10 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
231232

232233
pm_runtime_get_noresume(&slave->dev);
233234

235+
regmap_read(rt1308->regmap, 0xcf01, &hibernation_flag);
236+
if ((hibernation_flag != 0x00) && rt1308->first_hw_init)
237+
goto _preset_ready_;
238+
234239
/* sw reset */
235240
regmap_write(rt1308->regmap, RT1308_SDW_RESET, 0);
236241

@@ -271,6 +276,12 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
271276
regmap_write(rt1308->regmap, 0xc100, 0xd7);
272277
regmap_write(rt1308->regmap, 0xc101, 0xd7);
273278

279+
/* apply BQ params */
280+
rt1308_apply_bq_params(rt1308);
281+
282+
regmap_write(rt1308->regmap, 0xcf01, 0x01);
283+
284+
_preset_ready_:
274285
if (rt1308->first_hw_init) {
275286
regcache_cache_bypass(rt1308->regmap, false);
276287
regcache_mark_dirty(rt1308->regmap);

sound/soc/codecs/tas2781-comlib.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@ static int tasdevice_change_chn_book(struct tasdevice_priv *tas_priv,
5757

5858
if (client->addr != tasdev->dev_addr) {
5959
client->addr = tasdev->dev_addr;
60-
if (tasdev->cur_book == book) {
61-
ret = regmap_write(map,
62-
TASDEVICE_PAGE_SELECT, 0);
63-
if (ret < 0) {
64-
dev_err(tas_priv->dev, "%s, E=%d\n",
65-
__func__, ret);
66-
goto out;
67-
}
60+
/* All tas2781s share the same regmap, clear the page
61+
* inside regmap once switching to another tas2781.
62+
* Register 0 at any pages and any books inside tas2781
63+
* is the same one for page-switching.
64+
*/
65+
ret = regmap_write(map, TASDEVICE_PAGE_SELECT, 0);
66+
if (ret < 0) {
67+
dev_err(tas_priv->dev, "%s, E=%d\n",
68+
__func__, ret);
69+
goto out;
6870
}
69-
goto out;
7071
}
7172

7273
if (tasdev->cur_book != book) {

sound/soc/meson/axg-tdm-formatter.c

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,32 @@ int axg_tdm_formatter_set_channel_masks(struct regmap *map,
3030
struct axg_tdm_stream *ts,
3131
unsigned int offset)
3232
{
33-
unsigned int val, ch = ts->channels;
34-
unsigned long mask;
35-
int i, j;
33+
unsigned int ch = ts->channels;
34+
u32 val[AXG_TDM_NUM_LANES];
35+
int i, j, k;
36+
37+
/*
38+
* We need to mimick the slot distribution used by the HW to keep the
39+
* channel placement consistent regardless of the number of channel
40+
* in the stream. This is why the odd algorithm below is used.
41+
*/
42+
memset(val, 0, sizeof(*val) * AXG_TDM_NUM_LANES);
3643

3744
/*
3845
* Distribute the channels of the stream over the available slots
39-
* of each TDM lane
46+
* of each TDM lane. We need to go over the 32 slots ...
4047
*/
41-
for (i = 0; i < AXG_TDM_NUM_LANES; i++) {
42-
val = 0;
43-
mask = ts->mask[i];
44-
45-
for (j = find_first_bit(&mask, 32);
46-
(j < 32) && ch;
47-
j = find_next_bit(&mask, 32, j + 1)) {
48-
val |= 1 << j;
49-
ch -= 1;
48+
for (i = 0; (i < 32) && ch; i += 2) {
49+
/* ... of all the lanes ... */
50+
for (j = 0; j < AXG_TDM_NUM_LANES; j++) {
51+
/* ... then distribute the channels in pairs */
52+
for (k = 0; k < 2; k++) {
53+
if ((BIT(i + k) & ts->mask[j]) && ch) {
54+
val[j] |= BIT(i + k);
55+
ch -= 1;
56+
}
57+
}
5058
}
51-
52-
regmap_write(map, offset, val);
53-
offset += regmap_get_reg_stride(map);
5459
}
5560

5661
/*
@@ -63,6 +68,11 @@ int axg_tdm_formatter_set_channel_masks(struct regmap *map,
6368
return -EINVAL;
6469
}
6570

71+
for (i = 0; i < AXG_TDM_NUM_LANES; i++) {
72+
regmap_write(map, offset, val[i]);
73+
offset += regmap_get_reg_stride(map);
74+
}
75+
6676
return 0;
6777
}
6878
EXPORT_SYMBOL_GPL(axg_tdm_formatter_set_channel_masks);

sound/soc/sof/ipc4-pcm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,9 @@ static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component,
709709
struct snd_sof_pcm *spcm;
710710

711711
spcm = snd_sof_find_spcm_dai(component, rtd);
712+
if (!spcm)
713+
return -EINVAL;
714+
712715
time_info = spcm->stream[substream->stream].private;
713716
/* delay calculation is not supported by current fw_reg ABI */
714717
if (!time_info)

0 commit comments

Comments
 (0)