Skip to content

Commit d3e82ce

Browse files
committed
Merge tag 'asoc-fix-v6.11-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.11 Quite a lot of fixes have come in since the merge window, there's some repetitive fixes over the Qualcomm drivers increasing the patch count, along with a large batch of fixes from Cirrus. We also have some quirks and some individual fixes.
2 parents 0389869 + 7277677 commit d3e82ce

36 files changed

+291
-84
lines changed

Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,11 @@ additionalProperties: false
199199

200200
examples:
201201
- |
202+
#include <dt-bindings/gpio/gpio.h>
202203
codec@1,0{
203204
compatible = "slim217,250";
204205
reg = <1 0>;
205-
reset-gpios = <&tlmm 64 0>;
206+
reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
206207
slim-ifc-dev = <&wcd9340_ifd>;
207208
#sound-dai-cells = <1>;
208209
interrupt-parent = <&tlmm>;

Documentation/devicetree/bindings/sound/qcom,wcd937x.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ examples:
4242
pinctrl-names = "default", "sleep";
4343
pinctrl-0 = <&wcd_reset_n>;
4444
pinctrl-1 = <&wcd_reset_n_sleep>;
45-
reset-gpios = <&tlmm 83 GPIO_ACTIVE_HIGH>;
45+
reset-gpios = <&tlmm 83 GPIO_ACTIVE_LOW>;
4646
vdd-buck-supply = <&vreg_l17b_1p8>;
4747
vdd-rxtx-supply = <&vreg_l18b_1p8>;
4848
vdd-px-supply = <&vreg_l18b_1p8>;

Documentation/devicetree/bindings/sound/qcom,wcd938x.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ unevaluatedProperties: false
3434

3535
examples:
3636
- |
37+
#include <dt-bindings/gpio/gpio.h>
3738
codec {
3839
compatible = "qcom,wcd9380-codec";
39-
reset-gpios = <&tlmm 32 0>;
40+
reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
4041
#sound-dai-cells = <1>;
4142
qcom,tx-device = <&wcd938x_tx>;
4243
qcom,rx-device = <&wcd938x_rx>;

Documentation/devicetree/bindings/sound/qcom,wcd939x.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ unevaluatedProperties: false
5252

5353
examples:
5454
- |
55-
#include <dt-bindings/interrupt-controller/irq.h>
55+
#include <dt-bindings/gpio/gpio.h>
5656
codec {
5757
compatible = "qcom,wcd9390-codec";
58-
reset-gpios = <&tlmm 32 IRQ_TYPE_NONE>;
58+
reset-gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
5959
#sound-dai-cells = <1>;
6060
qcom,tx-device = <&wcd939x_tx>;
6161
qcom,rx-device = <&wcd939x_rx>;

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5306,7 +5306,7 @@ F: drivers/media/cec/i2c/ch7322.c
53065306
CIRRUS LOGIC AUDIO CODEC DRIVERS
53075307
M: David Rhodes <[email protected]>
53085308
M: Richard Fitzgerald <[email protected]>
5309-
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5309+
53105310
53115311
S: Maintained
53125312
F: Documentation/devicetree/bindings/sound/cirrus,cs*
@@ -5375,7 +5375,7 @@ F: sound/soc/codecs/lochnagar-sc.c
53755375
CIRRUS LOGIC MADERA CODEC DRIVERS
53765376
M: Charles Keepax <[email protected]>
53775377
M: Richard Fitzgerald <[email protected]>
5378-
L: alsa-devel@alsa-project.org (moderated for non-subscribers)
5378+
53795379
53805380
S: Supported
53815381
W: https://github.com/CirrusLogic/linux-drivers/wiki

include/sound/cs35l56.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ static inline int cs35l56_force_sync_asp1_registers_from_cache(struct cs35l56_ba
277277
return 0;
278278
}
279279

280+
static inline bool cs35l56_is_otp_register(unsigned int reg)
281+
{
282+
return (reg >> 16) == 3;
283+
}
284+
280285
extern struct regmap_config cs35l56_regmap_i2c;
281286
extern struct regmap_config cs35l56_regmap_spi;
282287
extern struct regmap_config cs35l56_regmap_sdw;

include/sound/soc-component.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@ int snd_soc_component_force_enable_pin_unlocked(
462462
const char *pin);
463463

464464
/* component controls */
465+
struct snd_kcontrol *snd_soc_component_get_kcontrol(struct snd_soc_component *component,
466+
const char * const ctl);
467+
struct snd_kcontrol *
468+
snd_soc_component_get_kcontrol_locked(struct snd_soc_component *component,
469+
const char * const ctl);
465470
int snd_soc_component_notify_control(struct snd_soc_component *component,
466471
const char * const ctl);
467472

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
220220
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
221221
}
222222
},
223+
{
224+
.driver_data = &acp6x_card,
225+
.matches = {
226+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
227+
DMI_MATCH(DMI_PRODUCT_NAME, "21M3"),
228+
}
229+
},
223230
{
224231
.driver_data = &acp6x_card,
225232
.matches = {
@@ -409,6 +416,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
409416
DMI_MATCH(DMI_BOARD_NAME, "8A43"),
410417
}
411418
},
419+
{
420+
.driver_data = &acp6x_card,
421+
.matches = {
422+
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
423+
DMI_MATCH(DMI_BOARD_NAME, "8A44"),
424+
}
425+
},
412426
{
413427
.driver_data = &acp6x_card,
414428
.matches = {
@@ -423,6 +437,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
423437
DMI_MATCH(DMI_BOARD_NAME, "8A3E"),
424438
}
425439
},
440+
{
441+
.driver_data = &acp6x_card,
442+
.matches = {
443+
DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
444+
DMI_MATCH(DMI_BOARD_NAME, "8B27"),
445+
}
446+
},
426447
{
427448
.driver_data = &acp6x_card,
428449
.matches = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static efi_status_t cs_amp_get_efi_variable(efi_char16_t *name,
108108

109109
KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid, size, buf);
110110

111-
if (IS_ENABLED(CONFIG_EFI))
111+
if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
112112
return efi.get_variable(name, guid, &attr, size, buf);
113113

114114
return EFI_NOT_FOUND;

sound/soc/codecs/cs35l45.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,10 @@ static int cs35l45_activate_ctl(struct snd_soc_component *component,
176176
struct snd_kcontrol *kcontrol;
177177
struct snd_kcontrol_volatile *vd;
178178
unsigned int index_offset;
179-
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
180179

181-
if (component->name_prefix)
182-
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s %s",
183-
component->name_prefix, ctl_name);
184-
else
185-
snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name);
186-
187-
kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name);
180+
kcontrol = snd_soc_component_get_kcontrol_locked(component, ctl_name);
188181
if (!kcontrol) {
189-
dev_err(component->dev, "Can't find kcontrol %s\n", name);
182+
dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name);
190183
return -EINVAL;
191184
}
192185

sound/soc/codecs/cs35l56-sdw.c

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,79 @@
2323
/* Register addresses are offset when sent over SoundWire */
2424
#define CS35L56_SDW_ADDR_OFFSET 0x8000
2525

26+
/* Cirrus bus bridge registers */
27+
#define CS35L56_SDW_MEM_ACCESS_STATUS 0xd0
28+
#define CS35L56_SDW_MEM_READ_DATA 0xd8
29+
30+
#define CS35L56_SDW_LAST_LATE BIT(3)
31+
#define CS35L56_SDW_CMD_IN_PROGRESS BIT(2)
32+
#define CS35L56_SDW_RDATA_RDY BIT(0)
33+
34+
#define CS35L56_LATE_READ_POLL_US 10
35+
#define CS35L56_LATE_READ_TIMEOUT_US 1000
36+
37+
static int cs35l56_sdw_poll_mem_status(struct sdw_slave *peripheral,
38+
unsigned int mask,
39+
unsigned int match)
40+
{
41+
int ret, val;
42+
43+
ret = read_poll_timeout(sdw_read_no_pm, val,
44+
(val < 0) || ((val & mask) == match),
45+
CS35L56_LATE_READ_POLL_US, CS35L56_LATE_READ_TIMEOUT_US,
46+
false, peripheral, CS35L56_SDW_MEM_ACCESS_STATUS);
47+
if (ret < 0)
48+
return ret;
49+
50+
if (val < 0)
51+
return val;
52+
53+
return 0;
54+
}
55+
56+
static int cs35l56_sdw_slow_read(struct sdw_slave *peripheral, unsigned int reg,
57+
u8 *buf, size_t val_size)
58+
{
59+
int ret, i;
60+
61+
reg += CS35L56_SDW_ADDR_OFFSET;
62+
63+
for (i = 0; i < val_size; i += sizeof(u32)) {
64+
/* Poll for bus bridge idle */
65+
ret = cs35l56_sdw_poll_mem_status(peripheral,
66+
CS35L56_SDW_CMD_IN_PROGRESS,
67+
0);
68+
if (ret < 0) {
69+
dev_err(&peripheral->dev, "!CMD_IN_PROGRESS fail: %d\n", ret);
70+
return ret;
71+
}
72+
73+
/* Reading LSByte triggers read of register to holding buffer */
74+
sdw_read_no_pm(peripheral, reg + i);
75+
76+
/* Wait for data available */
77+
ret = cs35l56_sdw_poll_mem_status(peripheral,
78+
CS35L56_SDW_RDATA_RDY,
79+
CS35L56_SDW_RDATA_RDY);
80+
if (ret < 0) {
81+
dev_err(&peripheral->dev, "RDATA_RDY fail: %d\n", ret);
82+
return ret;
83+
}
84+
85+
/* Read data from buffer */
86+
ret = sdw_nread_no_pm(peripheral, CS35L56_SDW_MEM_READ_DATA,
87+
sizeof(u32), &buf[i]);
88+
if (ret) {
89+
dev_err(&peripheral->dev, "Late read @%#x failed: %d\n", reg + i, ret);
90+
return ret;
91+
}
92+
93+
swab32s((u32 *)&buf[i]);
94+
}
95+
96+
return 0;
97+
}
98+
2699
static int cs35l56_sdw_read_one(struct sdw_slave *peripheral, unsigned int reg, void *buf)
27100
{
28101
int ret;
@@ -48,6 +121,10 @@ static int cs35l56_sdw_read(void *context, const void *reg_buf,
48121
int ret;
49122

50123
reg = le32_to_cpu(*(const __le32 *)reg_buf);
124+
125+
if (cs35l56_is_otp_register(reg))
126+
return cs35l56_sdw_slow_read(peripheral, reg, buf8, val_size);
127+
51128
reg += CS35L56_SDW_ADDR_OFFSET;
52129

53130
if (val_size == 4)

sound/soc/codecs/cs35l56-shared.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static const struct reg_sequence cs35l56_patch[] = {
3636
{ CS35L56_SWIRE_DP3_CH2_INPUT, 0x00000019 },
3737
{ CS35L56_SWIRE_DP3_CH3_INPUT, 0x00000029 },
3838
{ CS35L56_SWIRE_DP3_CH4_INPUT, 0x00000028 },
39+
{ CS35L56_IRQ1_MASK_18, 0x1f7df0ff },
3940

4041
/* These are not reset by a soft-reset, so patch to defaults. */
4142
{ CS35L56_MAIN_RENDER_USER_MUTE, 0x00000000 },

sound/soc/codecs/cs35l56.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,11 @@ int cs35l56_system_resume(struct device *dev)
10951095
}
10961096
EXPORT_SYMBOL_GPL(cs35l56_system_resume);
10971097

1098+
static int cs35l56_control_add_nop(struct wm_adsp *dsp, struct cs_dsp_coeff_ctl *cs_ctl)
1099+
{
1100+
return 0;
1101+
}
1102+
10981103
static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
10991104
{
11001105
struct wm_adsp *dsp;
@@ -1117,6 +1122,12 @@ static int cs35l56_dsp_init(struct cs35l56_private *cs35l56)
11171122
dsp->fw = 12;
11181123
dsp->wmfw_optional = true;
11191124

1125+
/*
1126+
* None of the firmware controls need to be exported so add a no-op
1127+
* callback that suppresses creating an ALSA control.
1128+
*/
1129+
dsp->control_add = &cs35l56_control_add_nop;
1130+
11201131
dev_dbg(cs35l56->base.dev, "DSP system name: '%s'\n", dsp->system_name);
11211132

11221133
ret = wm_halo_init(dsp);

0 commit comments

Comments
 (0)