Skip to content

Commit 8e13caa

Browse files
committed
Merge tag 'asoc-fix-v6.6-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.6 A fairly large set of fixes here but all driver specific, the biggest block is Johan's work shaking out issues with device setup and teardown for the wcd938x driver which is a relatively large but clearly broken down set of changes. There is one core helper function added as part of a fix for wsa-macro.
2 parents c8c0a03 + e8ecffd commit 8e13caa

File tree

15 files changed

+119
-34
lines changed

15 files changed

+119
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ properties:
8282
description:
8383
Current at which the headset micbias sense clamp will engage, 0 to
8484
disable.
85-
enum: [ 0, 14, 23, 41, 50, 60, 68, 86, 95 ]
85+
enum: [ 0, 14, 24, 43, 52, 61, 71, 90, 99 ]
8686
default: 0
8787

8888
cirrus,bias-ramp-ms:

include/sound/soc-dapm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
469469

470470
int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
471471
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai);
472+
int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s);
472473

473474
/* dapm path setup */
474475
int snd_soc_dapm_new_widgets(struct snd_soc_card *card);

sound/soc/codecs/cs35l56.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ static void cs35l56_patch(struct cs35l56_private *cs35l56)
706706

707707
mutex_lock(&cs35l56->base.irq_lock);
708708

709-
init_completion(&cs35l56->init_completion);
709+
reinit_completion(&cs35l56->init_completion);
710710

711711
cs35l56->soft_resetting = true;
712712
cs35l56_system_reset(&cs35l56->base, !!cs35l56->sdw_peripheral);
@@ -1186,6 +1186,12 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
11861186
/* Registers could be dirty after soft reset or SoundWire enumeration */
11871187
regcache_sync(cs35l56->base.regmap);
11881188

1189+
/* Set ASP1 DOUT to high-impedance when it is not transmitting audio data. */
1190+
ret = regmap_set_bits(cs35l56->base.regmap, CS35L56_ASP1_CONTROL3,
1191+
CS35L56_ASP1_DOUT_HIZ_CTRL_MASK);
1192+
if (ret)
1193+
return dev_err_probe(cs35l56->base.dev, ret, "Failed to write ASP1_CONTROL3\n");
1194+
11891195
cs35l56->base.init_done = true;
11901196
complete(&cs35l56->init_completion);
11911197

sound/soc/codecs/cs42l42-sdw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <linux/acpi.h>
88
#include <linux/device.h>
9+
#include <linux/gpio/consumer.h>
910
#include <linux/iopoll.h>
1011
#include <linux/module.h>
1112
#include <linux/mod_devicetable.h>

sound/soc/codecs/cs42l43-jack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const unsigned int cs42l43_accdet_db_ms[] = {
3434
static const unsigned int cs42l43_accdet_ramp_ms[] = { 10, 40, 90, 170 };
3535

3636
static const unsigned int cs42l43_accdet_bias_sense[] = {
37-
14, 23, 41, 50, 60, 68, 86, 95, 0,
37+
14, 24, 43, 52, 61, 71, 90, 99, 0,
3838
};
3939

4040
static int cs42l43_find_index(struct cs42l43_codec *priv, const char * const prop,

sound/soc/codecs/da7219-aad.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ static void da7219_aad_btn_det_work(struct work_struct *work)
5959
bool micbias_up = false;
6060
int retries = 0;
6161

62-
/* Disable ground switch */
63-
snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00);
64-
6562
/* Drive headphones/lineout */
6663
snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
6764
DA7219_HP_L_AMP_OE_MASK,
@@ -155,9 +152,6 @@ static void da7219_aad_hptest_work(struct work_struct *work)
155152
tonegen_freq_hptest = cpu_to_le16(DA7219_AAD_HPTEST_RAMP_FREQ_INT_OSC);
156153
}
157154

158-
/* Disable ground switch */
159-
snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00);
160-
161155
/* Ensure gain ramping at fastest rate */
162156
gain_ramp_ctrl = snd_soc_component_read(component, DA7219_GAIN_RAMP_CTRL);
163157
snd_soc_component_write(component, DA7219_GAIN_RAMP_CTRL, DA7219_GAIN_RAMP_RATE_X8);
@@ -421,6 +415,11 @@ static irqreturn_t da7219_aad_irq_thread(int irq, void *data)
421415
* handle a removal, and we can check at the end of
422416
* hptest if we have a valid result or not.
423417
*/
418+
419+
cancel_delayed_work_sync(&da7219_aad->jack_det_work);
420+
/* Disable ground switch */
421+
snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00);
422+
424423
if (statusa & DA7219_JACK_TYPE_STS_MASK) {
425424
report |= SND_JACK_HEADSET;
426425
mask |= SND_JACK_HEADSET | SND_JACK_LINEOUT;

sound/soc/codecs/lpass-wsa-macro.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,12 +1675,12 @@ static int wsa_macro_spk_boost_event(struct snd_soc_dapm_widget *w,
16751675
u16 boost_path_ctl, boost_path_cfg1;
16761676
u16 reg, reg_mix;
16771677

1678-
if (!strcmp(w->name, "WSA_RX INT0 CHAIN")) {
1678+
if (!snd_soc_dapm_widget_name_cmp(w, "WSA_RX INT0 CHAIN")) {
16791679
boost_path_ctl = CDC_WSA_BOOST0_BOOST_PATH_CTL;
16801680
boost_path_cfg1 = CDC_WSA_RX0_RX_PATH_CFG1;
16811681
reg = CDC_WSA_RX0_RX_PATH_CTL;
16821682
reg_mix = CDC_WSA_RX0_RX_PATH_MIX_CTL;
1683-
} else if (!strcmp(w->name, "WSA_RX INT1 CHAIN")) {
1683+
} else if (!snd_soc_dapm_widget_name_cmp(w, "WSA_RX INT1 CHAIN")) {
16841684
boost_path_ctl = CDC_WSA_BOOST1_BOOST_PATH_CTL;
16851685
boost_path_cfg1 = CDC_WSA_RX1_RX_PATH_CFG1;
16861686
reg = CDC_WSA_RX1_RX_PATH_CTL;

sound/soc/codecs/rt5645.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,6 +3257,8 @@ int rt5645_set_jack_detect(struct snd_soc_component *component,
32573257
RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ);
32583258
regmap_update_bits(rt5645->regmap, RT5645_GEN_CTRL1,
32593259
RT5645_DIG_GATE_CTRL, RT5645_DIG_GATE_CTRL);
3260+
regmap_update_bits(rt5645->regmap, RT5645_DEPOP_M1,
3261+
RT5645_HP_CB_MASK, RT5645_HP_CB_PU);
32603262
}
32613263
rt5645_irq(0, rt5645);
32623264

sound/soc/codecs/tas2780.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static void tas2780_reset(struct tas2780_priv *tas2780)
3939
usleep_range(2000, 2050);
4040
}
4141

42-
snd_soc_component_write(tas2780->component, TAS2780_SW_RST,
42+
ret = snd_soc_component_write(tas2780->component, TAS2780_SW_RST,
4343
TAS2780_RST);
4444
if (ret)
4545
dev_err(tas2780->dev, "%s:errCode:0x%x Reset error!\n",

sound/soc/codecs/wcd938x-sdw.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,31 @@ static int wcd9380_probe(struct sdw_slave *pdev,
12781278
pm_runtime_set_active(dev);
12791279
pm_runtime_enable(dev);
12801280

1281-
return component_add(dev, &wcd938x_sdw_component_ops);
1281+
ret = component_add(dev, &wcd938x_sdw_component_ops);
1282+
if (ret)
1283+
goto err_disable_rpm;
1284+
1285+
return 0;
1286+
1287+
err_disable_rpm:
1288+
pm_runtime_disable(dev);
1289+
pm_runtime_set_suspended(dev);
1290+
pm_runtime_dont_use_autosuspend(dev);
1291+
1292+
return ret;
1293+
}
1294+
1295+
static int wcd9380_remove(struct sdw_slave *pdev)
1296+
{
1297+
struct device *dev = &pdev->dev;
1298+
1299+
component_del(dev, &wcd938x_sdw_component_ops);
1300+
1301+
pm_runtime_disable(dev);
1302+
pm_runtime_set_suspended(dev);
1303+
pm_runtime_dont_use_autosuspend(dev);
1304+
1305+
return 0;
12821306
}
12831307

12841308
static const struct sdw_device_id wcd9380_slave_id[] = {
@@ -1320,6 +1344,7 @@ static const struct dev_pm_ops wcd938x_sdw_pm_ops = {
13201344

13211345
static struct sdw_driver wcd9380_codec_driver = {
13221346
.probe = wcd9380_probe,
1347+
.remove = wcd9380_remove,
13231348
.ops = &wcd9380_slave_ops,
13241349
.id_table = wcd9380_slave_id,
13251350
.driver = {

0 commit comments

Comments
 (0)