Skip to content

Commit 16caf0c

Browse files
committed
Merge remote-tracking branch 'asoc/for-7.1' into asoc-next
2 parents 2799018 + 2adac91 commit 16caf0c

78 files changed

Lines changed: 1010 additions & 612 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/devicetree/bindings/sound/awinic,aw88395.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ properties:
3535

3636
dvdd-supply: true
3737

38+
firmware-name:
39+
maxItems: 1
40+
description: Name of the *_acf.bin file used for amplifier initialization
41+
3842
awinic,audio-channel:
3943
description:
4044
It is used to distinguish multiple PA devices, so that different
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-cpcap.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra audio complex with CPCAP CODEC
8+
9+
maintainers:
10+
- Svyatoslav Ryhel <clamor95@gmail.com>
11+
12+
allOf:
13+
- $ref: nvidia,tegra-audio-common.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- pattern: '^motorola,tegra-audio-cpcap(-[a-z0-9]+)+$'
19+
- const: nvidia,tegra-audio-cpcap
20+
21+
nvidia,audio-routing:
22+
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
23+
description:
24+
A list of the connections between audio components. Each entry is a
25+
pair of strings, the first being the connection's sink, the second
26+
being the connection's source. Valid names for sources and sinks are
27+
the pins (documented in the binding document), and the jacks on the
28+
board.
29+
minItems: 2
30+
items:
31+
enum:
32+
# Board Connectors
33+
- Speakers
34+
- Int Spk
35+
- Earpiece
36+
- Int Mic
37+
- Headset Mic
38+
- Internal Mic 1
39+
- Internal Mic 2
40+
- Headphone
41+
- Headphones
42+
- Headphone Jack
43+
- Mic Jack
44+
45+
# CODEC Pins
46+
- MICR
47+
- HSMIC
48+
- EMUMIC
49+
- MICL
50+
- EXTR
51+
- EXTL
52+
- EP
53+
- SPKR
54+
- SPKL
55+
- LINER
56+
- LINEL
57+
- HSR
58+
- HSL
59+
- EMUR
60+
- EMUL
61+
62+
unevaluatedProperties: false
63+
64+
examples:
65+
- |
66+
#include <dt-bindings/clock/tegra20-car.h>
67+
#include <dt-bindings/soc/tegra-pmc.h>
68+
sound {
69+
compatible = "motorola,tegra-audio-cpcap-olympus",
70+
"nvidia,tegra-audio-cpcap";
71+
nvidia,model = "Motorola Atrix 4G (MB860) CPCAP";
72+
73+
nvidia,audio-routing =
74+
"Headphones", "HSR",
75+
"Headphones", "HSL",
76+
"Int Spk", "SPKR",
77+
"Int Spk", "SPKL",
78+
"Earpiece", "EP",
79+
"HSMIC", "Mic Jack",
80+
"MICR", "Internal Mic 1",
81+
"MICL", "Internal Mic 2";
82+
83+
nvidia,i2s-controller = <&tegra_i2s1>;
84+
nvidia,audio-codec = <&cpcap_audio>;
85+
86+
clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
87+
<&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
88+
<&tegra_car TEGRA20_CLK_CDEV1>;
89+
clock-names = "pll_a", "pll_a_out0", "mclk";
90+
};

Documentation/devicetree/bindings/sound/nvidia,tegra-audio-max9808x.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ properties:
3535
items:
3636
enum:
3737
# Board Connectors
38+
- Speakers
3839
- Int Spk
40+
- Headphone
41+
- Headphones
3942
- Headphone Jack
4043
- Earpiece
4144
- Headset Mic
45+
- Mic Jack
46+
- Int Mic
4247
- Internal Mic 1
4348
- Internal Mic 2
4449

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-wm8962.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NVIDIA Tegra audio complex with WM8962 CODEC
8+
9+
maintainers:
10+
- Svyatoslav Ryhel <clamor95@gmail.com>
11+
12+
allOf:
13+
- $ref: nvidia,tegra-audio-common.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- pattern: '^[a-z0-9]+,tegra-audio-wm8962(-[a-z0-9]+)+$'
19+
- const: nvidia,tegra-audio-wm8962
20+
21+
nvidia,audio-routing:
22+
$ref: /schemas/types.yaml#/definitions/non-unique-string-array
23+
description:
24+
A list of the connections between audio components. Each entry is a
25+
pair of strings, the first being the connection's sink, the second
26+
being the connection's source. Valid names for sources and sinks are
27+
the pins (documented in the binding document), and the jacks on the
28+
board.
29+
minItems: 2
30+
items:
31+
enum:
32+
# Board Connectors
33+
- Speakers
34+
- Int Spk
35+
- Earpiece
36+
- Int Mic
37+
- Headset Mic
38+
- Internal Mic 1
39+
- Internal Mic 2
40+
- Headphone
41+
- Headphones
42+
- Headphone Jack
43+
- Mic Jack
44+
45+
# CODEC Pins
46+
- IN1L
47+
- IN1R
48+
- IN2L
49+
- IN2R
50+
- IN3L
51+
- IN3R
52+
- IN4L
53+
- IN4R
54+
- DMICDAT
55+
- HPOUTL
56+
- HPOUTR
57+
- SPKOUT
58+
- SPKOUTL
59+
- SPKOUTR
60+
61+
required:
62+
- nvidia,i2s-controller
63+
64+
unevaluatedProperties: false
65+
66+
examples:
67+
- |
68+
#include <dt-bindings/clock/tegra30-car.h>
69+
#include <dt-bindings/soc/tegra-pmc.h>
70+
sound {
71+
compatible = "microsoft,tegra-audio-wm8962-surface-rt",
72+
"nvidia,tegra-audio-wm8962";
73+
nvidia,model = "Microsoft Surface RT WM8962";
74+
75+
nvidia,audio-routing =
76+
"Headphone Jack", "HPOUTR",
77+
"Headphone Jack", "HPOUTL",
78+
"Int Spk", "SPKOUTR",
79+
"Int Spk", "SPKOUTL";
80+
81+
nvidia,i2s-controller = <&tegra_i2s1>;
82+
nvidia,audio-codec = <&wm8962>;
83+
84+
clocks = <&tegra_car TEGRA30_CLK_PLL_A>,
85+
<&tegra_car TEGRA30_CLK_PLL_A_OUT0>,
86+
<&tegra_pmc TEGRA_PMC_CLK_OUT_1>;
87+
clock-names = "pll_a", "pll_a_out0", "mclk";
88+
};

drivers/firmware/cirrus/cs_dsp.c

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ void cs_dsp_init_debugfs(struct cs_dsp *dsp, struct dentry *debugfs_root)
515515

516516
debugfs_create_bool("booted", 0444, root, &dsp->booted);
517517
debugfs_create_bool("running", 0444, root, &dsp->running);
518+
debugfs_create_bool("hibernating", 0444, root, &dsp->hibernating);
518519
debugfs_create_x32("fw_id", 0444, root, &dsp->fw_id);
519520
debugfs_create_x32("fw_version", 0444, root, &dsp->fw_id_version);
520521

@@ -703,7 +704,7 @@ int cs_dsp_coeff_write_acked_control(struct cs_dsp_coeff_ctl *ctl, unsigned int
703704

704705
lockdep_assert_held(&dsp->pwr_lock);
705706

706-
if (!dsp->running)
707+
if (!dsp->running || dsp->hibernating)
707708
return -EPERM;
708709

709710
ret = cs_dsp_coeff_base_reg(ctl, &reg, 0);
@@ -827,7 +828,7 @@ int cs_dsp_coeff_write_ctrl(struct cs_dsp_coeff_ctl *ctl,
827828
}
828829

829830
ctl->set = 1;
830-
if (ctl->enabled && ctl->dsp->running)
831+
if (ctl->enabled && ctl->dsp->running && !ctl->dsp->hibernating)
831832
ret = cs_dsp_coeff_write_ctrl_raw(ctl, off, buf, len);
832833

833834
if (ret < 0)
@@ -920,12 +921,12 @@ int cs_dsp_coeff_read_ctrl(struct cs_dsp_coeff_ctl *ctl,
920921
return -EINVAL;
921922

922923
if (ctl->flags & WMFW_CTL_FLAG_VOLATILE) {
923-
if (ctl->enabled && ctl->dsp->running)
924+
if (ctl->enabled && ctl->dsp->running && !ctl->dsp->hibernating)
924925
return cs_dsp_coeff_read_ctrl_raw(ctl, off, buf, len);
925926
else
926927
return -EPERM;
927928
} else {
928-
if (!ctl->flags && ctl->enabled && ctl->dsp->running)
929+
if (!ctl->flags && ctl->enabled && ctl->dsp->running && !ctl->dsp->hibernating)
929930
ret = cs_dsp_coeff_read_ctrl_raw(ctl, 0, ctl->cache, ctl->len);
930931

931932
if (buf != ctl->cache)
@@ -1108,6 +1109,44 @@ static int cs_dsp_create_control(struct cs_dsp *dsp,
11081109
return ret;
11091110
}
11101111

1112+
1113+
/**
1114+
* cs_dsp_hibernate() - Disable or enable all controls for a DSP
1115+
* @dsp: pointer to DSP structure
1116+
* @hibernate: whether to set controls to cache only mode
1117+
*
1118+
* When @hibernate is true, the DSP is entering hibernation mode where the
1119+
* regmap is inaccessible, and all controls become cache only.
1120+
* When @hibernate is false, the DSP has exited hibernation mode. If the DSP
1121+
* is running, all controls are re-synced to the DSP.
1122+
*
1123+
*/
1124+
void cs_dsp_hibernate(struct cs_dsp *dsp, bool hibernate)
1125+
{
1126+
mutex_lock(&dsp->pwr_lock);
1127+
1128+
if (!dsp->running) {
1129+
cs_dsp_dbg(dsp, "Cannot hibernate, DSP not running\n");
1130+
goto out;
1131+
}
1132+
1133+
if (dsp->hibernating == hibernate)
1134+
goto out;
1135+
1136+
cs_dsp_dbg(dsp, "Set hibernating to %d\n", hibernate);
1137+
dsp->hibernating = hibernate;
1138+
1139+
if (!dsp->hibernating && dsp->running) {
1140+
int ret = cs_dsp_coeff_sync_controls(dsp);
1141+
1142+
if (ret)
1143+
cs_dsp_err(dsp, "Error syncing controls: %d\n", ret);
1144+
}
1145+
out:
1146+
mutex_unlock(&dsp->pwr_lock);
1147+
}
1148+
EXPORT_SYMBOL_NS_GPL(cs_dsp_hibernate, "FW_CS_DSP");
1149+
11111150
struct cs_dsp_coeff_parsed_alg {
11121151
int id;
11131152
const u8 *name;
@@ -2498,6 +2537,7 @@ int cs_dsp_adsp1_power_up(struct cs_dsp *dsp,
24982537
goto err_ena;
24992538

25002539
dsp->booted = true;
2540+
dsp->hibernating = false;
25012541

25022542
/* Start the core running */
25032543
regmap_update_bits(dsp->regmap, dsp->base + ADSP1_CONTROL_30,
@@ -2776,6 +2816,7 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
27762816
dsp->ops->disable_core(dsp);
27772817

27782818
dsp->booted = true;
2819+
dsp->hibernating = false;
27792820

27802821
mutex_unlock(&dsp->pwr_lock);
27812822

drivers/firmware/cirrus/test/cs_dsp_test_bin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,26 +2835,30 @@ static struct kunit_suite cs_dsp_bin_test_halo = {
28352835
.init = cs_dsp_bin_test_halo_init,
28362836
.exit = cs_dsp_bin_test_exit,
28372837
.test_cases = cs_dsp_bin_test_cases_halo,
2838+
.attr.speed = KUNIT_SPEED_SLOW,
28382839
};
28392840

28402841
static struct kunit_suite cs_dsp_bin_test_halo_wmdr3 = {
28412842
.name = "cs_dsp_bin_halo_wmdr_v3",
28422843
.init = cs_dsp_bin_test_halo_wmdr3_init,
28432844
.test_cases = cs_dsp_bin_test_cases_halo_wmdr3,
2845+
.attr.speed = KUNIT_SPEED_SLOW,
28442846
};
28452847

28462848
static struct kunit_suite cs_dsp_bin_test_adsp2_32bit = {
28472849
.name = "cs_dsp_bin_adsp2_32bit",
28482850
.init = cs_dsp_bin_test_adsp2_32bit_init,
28492851
.exit = cs_dsp_bin_test_exit,
28502852
.test_cases = cs_dsp_bin_test_cases_adsp2,
2853+
.attr.speed = KUNIT_SPEED_SLOW,
28512854
};
28522855

28532856
static struct kunit_suite cs_dsp_bin_test_adsp2_16bit = {
28542857
.name = "cs_dsp_bin_adsp2_16bit",
28552858
.init = cs_dsp_bin_test_adsp2_16bit_init,
28562859
.exit = cs_dsp_bin_test_exit,
28572860
.test_cases = cs_dsp_bin_test_cases_adsp2,
2861+
.attr.speed = KUNIT_SPEED_SLOW,
28582862
};
28592863

28602864
kunit_test_suites(&cs_dsp_bin_test_halo,

drivers/firmware/cirrus/test/cs_dsp_test_bin_error.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,20 +586,23 @@ static struct kunit_suite cs_dsp_bin_err_test_halo = {
586586
.init = cs_dsp_bin_err_test_halo_init,
587587
.exit = cs_dsp_bin_err_test_exit,
588588
.test_cases = cs_dsp_bin_err_test_cases,
589+
.attr.speed = KUNIT_SPEED_SLOW,
589590
};
590591

591592
static struct kunit_suite cs_dsp_bin_err_test_adsp2_32bit = {
592593
.name = "cs_dsp_bin_err_adsp2_32bit",
593594
.init = cs_dsp_bin_err_test_adsp2_32bit_init,
594595
.exit = cs_dsp_bin_err_test_exit,
595596
.test_cases = cs_dsp_bin_err_test_cases,
597+
.attr.speed = KUNIT_SPEED_SLOW,
596598
};
597599

598600
static struct kunit_suite cs_dsp_bin_err_test_adsp2_16bit = {
599601
.name = "cs_dsp_bin_err_adsp2_16bit",
600602
.init = cs_dsp_bin_err_test_adsp2_16bit_init,
601603
.exit = cs_dsp_bin_err_test_exit,
602604
.test_cases = cs_dsp_bin_err_test_cases,
605+
.attr.speed = KUNIT_SPEED_SLOW,
603606
};
604607

605608
kunit_test_suites(&cs_dsp_bin_err_test_halo,

drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,30 +3248,35 @@ static struct kunit_suite cs_dsp_ctl_cache_test_halo = {
32483248
.name = "cs_dsp_ctl_cache_wmfwV3_halo",
32493249
.init = cs_dsp_ctl_cache_test_halo_init,
32503250
.test_cases = cs_dsp_ctl_cache_test_cases_v3,
3251+
.attr.speed = KUNIT_SPEED_SLOW,
32513252
};
32523253

32533254
static struct kunit_suite cs_dsp_ctl_cache_test_adsp2_32bit_wmfw1 = {
32543255
.name = "cs_dsp_ctl_cache_wmfwV1_adsp2_32bit",
32553256
.init = cs_dsp_ctl_cache_test_adsp2_32bit_wmfw1_init,
32563257
.test_cases = cs_dsp_ctl_cache_test_cases_v1,
3258+
.attr.speed = KUNIT_SPEED_SLOW,
32573259
};
32583260

32593261
static struct kunit_suite cs_dsp_ctl_cache_test_adsp2_32bit_wmfw2 = {
32603262
.name = "cs_dsp_ctl_cache_wmfwV2_adsp2_32bit",
32613263
.init = cs_dsp_ctl_cache_test_adsp2_32bit_wmfw2_init,
32623264
.test_cases = cs_dsp_ctl_cache_test_cases_v2,
3265+
.attr.speed = KUNIT_SPEED_SLOW,
32633266
};
32643267

32653268
static struct kunit_suite cs_dsp_ctl_cache_test_adsp2_16bit_wmfw1 = {
32663269
.name = "cs_dsp_ctl_cache_wmfwV1_adsp2_16bit",
32673270
.init = cs_dsp_ctl_cache_test_adsp2_16bit_wmfw1_init,
32683271
.test_cases = cs_dsp_ctl_cache_test_cases_v1,
3272+
.attr.speed = KUNIT_SPEED_SLOW,
32693273
};
32703274

32713275
static struct kunit_suite cs_dsp_ctl_cache_test_adsp2_16bit_wmfw2 = {
32723276
.name = "cs_dsp_ctl_cache_wmfwV2_adsp2_16bit",
32733277
.init = cs_dsp_ctl_cache_test_adsp2_16bit_wmfw2_init,
32743278
.test_cases = cs_dsp_ctl_cache_test_cases_v2,
3279+
.attr.speed = KUNIT_SPEED_SLOW,
32753280
};
32763281

32773282
kunit_test_suites(&cs_dsp_ctl_cache_test_halo,

0 commit comments

Comments
 (0)