Skip to content

Commit 5948342

Browse files
committed
Merge tag 'asoc-fix-v5.17-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.18 More fixes that have arrived in the past few -rcs, plus a MAINTAINERS update. The biggest update here is the fix for control change notifications in ASoC generic controls found by mixer-test.
2 parents 2a84583 + a887f9c commit 5948342

12 files changed

Lines changed: 72 additions & 45 deletions

File tree

Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC
88

99
maintainers:
1010
- Cheng-Yi Chiang <cychiang@chromium.org>
11+
- Tzung-Bi Shih <tzungbi@google.com>
1112

1213
description: |
1314
Google's ChromeOS EC codec is a digital mic codec provided by the

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,7 @@ F: drivers/platform/chrome/
45434543

45444544
CHROMEOS EC CODEC DRIVER
45454545
M: Cheng-Yi Chiang <cychiang@chromium.org>
4546+
M: Tzung-Bi Shih <tzungbi@google.com>
45464547
R: Guenter Roeck <groeck@chromium.org>
45474548
S: Maintained
45484549
F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

drivers/soc/mediatek/mtk-scpsys.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
411411
return ret;
412412
}
413413

414-
static int init_clks(struct platform_device *pdev, struct clk **clk)
414+
static void init_clks(struct platform_device *pdev, struct clk **clk)
415415
{
416416
int i;
417417

418-
for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
418+
for (i = CLK_NONE + 1; i < CLK_MAX; i++)
419419
clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
420-
if (IS_ERR(clk[i]))
421-
return PTR_ERR(clk[i]);
422-
}
423-
424-
return 0;
425420
}
426421

427422
static struct scp *init_scp(struct platform_device *pdev,
@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platform_device *pdev,
431426
{
432427
struct genpd_onecell_data *pd_data;
433428
struct resource *res;
434-
int i, j, ret;
429+
int i, j;
435430
struct scp *scp;
436431
struct clk *clk[CLK_MAX];
437432

@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platform_device *pdev,
486481

487482
pd_data->num_domains = num;
488483

489-
ret = init_clks(pdev, clk);
490-
if (ret)
491-
return ERR_PTR(ret);
484+
init_clks(pdev, clk);
492485

493486
for (i = 0; i < num; i++) {
494487
struct scp_domain *scpd = &scp->domains[i];

sound/soc/amd/acp/acp-mach.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/gpio/consumer.h>
2222

2323
#define EN_SPKR_GPIO_GB 0x11F
24-
#define EN_SPKR_GPIO_NK 0x146
2524
#define EN_SPKR_GPIO_NONE -EINVAL
2625

2726
enum be_id {

sound/soc/amd/acp/acp-sof-mach.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static struct acp_card_drvdata sof_rt5682_max_data = {
3737
.hs_codec_id = RT5682,
3838
.amp_codec_id = MAX98360A,
3939
.dmic_codec_id = DMIC,
40-
.gpio_spkr_en = EN_SPKR_GPIO_NK,
40+
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
4141
};
4242

4343
static struct acp_card_drvdata sof_rt5682s_max_data = {
@@ -47,7 +47,7 @@ static struct acp_card_drvdata sof_rt5682s_max_data = {
4747
.hs_codec_id = RT5682S,
4848
.amp_codec_id = MAX98360A,
4949
.dmic_codec_id = DMIC,
50-
.gpio_spkr_en = EN_SPKR_GPIO_NK,
50+
.gpio_spkr_en = EN_SPKR_GPIO_NONE,
5151
};
5252

5353
static const struct snd_kcontrol_new acp_controls[] = {

sound/soc/codecs/rt5668.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,11 +1022,13 @@ static void rt5668_jack_detect_handler(struct work_struct *work)
10221022
container_of(work, struct rt5668_priv, jack_detect_work.work);
10231023
int val, btn_type;
10241024

1025-
while (!rt5668->component)
1026-
usleep_range(10000, 15000);
1027-
1028-
while (!rt5668->component->card->instantiated)
1029-
usleep_range(10000, 15000);
1025+
if (!rt5668->component || !rt5668->component->card ||
1026+
!rt5668->component->card->instantiated) {
1027+
/* card not yet ready, try later */
1028+
mod_delayed_work(system_power_efficient_wq,
1029+
&rt5668->jack_detect_work, msecs_to_jiffies(15));
1030+
return;
1031+
}
10301032

10311033
mutex_lock(&rt5668->calibrate_mutex);
10321034

sound/soc/codecs/rt5682.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,11 +1092,13 @@ void rt5682_jack_detect_handler(struct work_struct *work)
10921092
struct snd_soc_dapm_context *dapm;
10931093
int val, btn_type;
10941094

1095-
while (!rt5682->component)
1096-
usleep_range(10000, 15000);
1097-
1098-
while (!rt5682->component->card->instantiated)
1099-
usleep_range(10000, 15000);
1095+
if (!rt5682->component || !rt5682->component->card ||
1096+
!rt5682->component->card->instantiated) {
1097+
/* card not yet ready, try later */
1098+
mod_delayed_work(system_power_efficient_wq,
1099+
&rt5682->jack_detect_work, msecs_to_jiffies(15));
1100+
return;
1101+
}
11001102

11011103
dapm = snd_soc_component_get_dapm(rt5682->component);
11021104

sound/soc/codecs/rt5682s.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,13 @@ static void rt5682s_jack_detect_handler(struct work_struct *work)
824824
container_of(work, struct rt5682s_priv, jack_detect_work.work);
825825
int val, btn_type;
826826

827-
while (!rt5682s->component)
828-
usleep_range(10000, 15000);
829-
830-
while (!rt5682s->component->card->instantiated)
831-
usleep_range(10000, 15000);
827+
if (!rt5682s->component || !rt5682s->component->card ||
828+
!rt5682s->component->card->instantiated) {
829+
/* card not yet ready, try later */
830+
mod_delayed_work(system_power_efficient_wq,
831+
&rt5682s->jack_detect_work, msecs_to_jiffies(15));
832+
return;
833+
}
832834

833835
mutex_lock(&rt5682s->jdet_mutex);
834836
mutex_lock(&rt5682s->calibrate_mutex);

sound/soc/codecs/tas2770.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770)
3838
gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
3939
msleep(20);
4040
gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
41+
usleep_range(1000, 2000);
4142
}
4243

4344
snd_soc_component_write(tas2770->component, TAS2770_SW_RST,
4445
TAS2770_RST);
46+
usleep_range(1000, 2000);
4547
}
4648

4749
static int tas2770_set_bias_level(struct snd_soc_component *component,
@@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component)
110112

111113
if (tas2770->sdz_gpio) {
112114
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
115+
usleep_range(1000, 2000);
113116
} else {
114117
ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
115118
TAS2770_PWR_CTRL_MASK,
@@ -510,8 +513,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
510513

511514
tas2770->component = component;
512515

513-
if (tas2770->sdz_gpio)
516+
if (tas2770->sdz_gpio) {
514517
gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
518+
usleep_range(1000, 2000);
519+
}
515520

516521
tas2770_reset(tas2770);
517522

sound/soc/codecs/wm_adsp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,8 @@ static int wm_adsp_buffer_parse_coeff(struct cs_dsp_coeff_ctl *cs_ctl)
14411441
int ret, i;
14421442

14431443
for (i = 0; i < 5; ++i) {
1444-
ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, &coeff_v1, sizeof(coeff_v1));
1444+
ret = cs_dsp_coeff_read_ctrl(cs_ctl, 0, &coeff_v1,
1445+
min(cs_ctl->len, sizeof(coeff_v1)));
14451446
if (ret < 0)
14461447
return ret;
14471448

0 commit comments

Comments
 (0)