Skip to content

Commit 0d47242

Browse files
authored
Merge pull request #5369 from bardliao/merge/sound-upstream-20250320
Merge/sound upstream 20250320
2 parents b5a488f + bb95710 commit 0d47242

254 files changed

Lines changed: 5518 additions & 1928 deletions

File tree

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/allwinner,sun4i-a10-codec.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ properties:
102102
maxItems: 1
103103
description: GPIO to enable the external amplifier
104104

105+
hp-det-gpios:
106+
maxItems: 1
107+
description: GPIO for headphone/line-out detection
108+
105109
required:
106110
- "#sound-dai-cells"
107111
- compatible
@@ -251,8 +255,10 @@ allOf:
251255
allwinner,audio-routing:
252256
items:
253257
enum:
258+
- Headphone
254259
- LINEOUT
255260
- Line Out
261+
- Speaker
256262

257263
dmas:
258264
items:

Documentation/devicetree/bindings/sound/audio-graph-card2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ properties:
3737
codec2codec:
3838
type: object
3939
description: Codec to Codec node
40+
hp-det-gpios:
41+
$ref: audio-graph.yaml#/properties/hp-det-gpios
42+
widgets:
43+
$ref: audio-graph.yaml#/properties/widgets
4044

4145
required:
4246
- compatible

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ properties:
1919
enum:
2020
- awinic,aw88081
2121
- awinic,aw88083
22+
- awinic,aw88166
2223
- awinic,aw88261
2324
- awinic,aw88395
2425
- awinic,aw88399
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/fsl,imx95-cm7-sof.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP imx95 CM7 core
8+
9+
maintainers:
10+
- Daniel Baluta <daniel.baluta@nxp.com>
11+
12+
description: NXP imx95 CM7 core used for audio processing
13+
14+
properties:
15+
compatible:
16+
const: fsl,imx95-cm7-sof
17+
18+
reg:
19+
maxItems: 1
20+
21+
reg-names:
22+
const: sram
23+
24+
memory-region:
25+
maxItems: 1
26+
27+
memory-region-names:
28+
const: dma
29+
30+
port:
31+
description: SAI3 port
32+
$ref: audio-graph-port.yaml#
33+
unevaluatedProperties: false
34+
35+
required:
36+
- compatible
37+
- reg
38+
- reg-names
39+
- memory-region
40+
- memory-region-names
41+
- port
42+
43+
allOf:
44+
- $ref: fsl,sof-cpu.yaml#
45+
46+
unevaluatedProperties: false
47+
48+
examples:
49+
- |
50+
cm7-cpu@80000000 {
51+
compatible = "fsl,imx95-cm7-sof";
52+
reg = <0x80000000 0x6100000>;
53+
reg-names = "sram";
54+
mboxes = <&mu7 2 0>, <&mu7 2 1>, <&mu7 3 0>, <&mu7 3 1>;
55+
mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
56+
memory-region = <&adma_res>;
57+
memory-region-names = "dma";
58+
port {
59+
/* SAI3-WM8962 link */
60+
endpoint {
61+
remote-endpoint = <&wm8962_ep>;
62+
};
63+
};
64+
};

Documentation/devicetree/bindings/sound/fsl,sai.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ properties:
4141
- fsl,imx93-sai
4242
- fsl,imx95-sai
4343
- fsl,vf610-sai
44+
- items:
45+
- enum:
46+
- fsl,imx94-sai
47+
- const: fsl,imx95-sai
4448

4549
reg:
4650
maxItems: 1
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/sound/fsl,sof-cpu.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: NXP audio processor common properties
8+
9+
maintainers:
10+
- Daniel Baluta <daniel.baluta@nxp.com>
11+
12+
properties:
13+
mboxes:
14+
maxItems: 4
15+
16+
mbox-names:
17+
items:
18+
- const: txdb0
19+
- const: txdb1
20+
- const: rxdb0
21+
- const: rxdb1
22+
23+
required:
24+
- mboxes
25+
- mbox-names
26+
27+
additionalProperties: true

Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ properties:
4040
hardware that provides additional audio functionalities if present.
4141
The AFE will link to ADSP when the phandle is provided.
4242

43+
mediatek,accdet:
44+
$ref: /schemas/types.yaml#/definitions/phandle
45+
description:
46+
The phandle to the MT6359 accessory detection block, which detects audio
47+
jack insertion and removal. This property should only be present if the
48+
accdet block is actually wired to the audio jack pins and to be used for
49+
jack detection.
50+
4351
patternProperties:
4452
"^dai-link-[0-9]+$":
4553
type: object

Documentation/devicetree/bindings/sound/ti,tas2770.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ properties:
2323
compatible:
2424
enum:
2525
- ti,tas2770
26+
- ti,tas5770l # Apple variant
2627

2728
reg:
2829
maxItems: 1

Documentation/devicetree/bindings/sound/ti,tas27xx.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ properties:
2424
enum:
2525
- ti,tas2764
2626
- ti,tas2780
27+
- ti,sn012776 # Apple variant of TAS2764
2728

2829
reg:
2930
maxItems: 1

include/sound/sdca_function.h

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ struct sdca_function_desc;
4444
*/
4545
#define SDCA_MAX_DELAY_COUNT 256
4646

47+
/*
48+
* Sanity check on size of affected controls data, can be expanded if needed.
49+
*/
50+
#define SDCA_MAX_AFFECTED_COUNT 2048
51+
4752
/**
4853
* enum sdca_function_type - SDCA Function Type codes
4954
* @SDCA_FUNCTION_TYPE_SMART_AMP: Amplifier with protection features.
@@ -600,6 +605,27 @@ enum sdca_entity0_controls {
600605
#define SDCA_CTL_DEVICE_VERSION_NAME "Device Version"
601606
#define SDCA_CTL_DEVICE_SDCA_VERSION_NAME "Device SDCA Version"
602607

608+
/**
609+
* enum sdca_control_datatype - SDCA Control Data Types
610+
*
611+
* Data Types as described in the SDCA specification v1.0 section
612+
* 7.3.
613+
*/
614+
enum sdca_control_datatype {
615+
SDCA_CTL_DATATYPE_ONEBIT,
616+
SDCA_CTL_DATATYPE_INTEGER,
617+
SDCA_CTL_DATATYPE_SPEC_ENCODED_VALUE,
618+
SDCA_CTL_DATATYPE_BCD,
619+
SDCA_CTL_DATATYPE_Q7P8DB,
620+
SDCA_CTL_DATATYPE_BYTEINDEX,
621+
SDCA_CTL_DATATYPE_POSTURENUMBER,
622+
SDCA_CTL_DATATYPE_DP_INDEX,
623+
SDCA_CTL_DATATYPE_BITINDEX,
624+
SDCA_CTL_DATATYPE_BITMAP,
625+
SDCA_CTL_DATATYPE_GUID,
626+
SDCA_CTL_DATATYPE_IMPDEF,
627+
};
628+
603629
/**
604630
* enum sdca_access_mode - SDCA Control access mode
605631
*
@@ -653,6 +679,7 @@ struct sdca_control_range {
653679
* @cn_list: A bitmask showing the valid Control Numbers within this Control,
654680
* Control Numbers typically represent channels.
655681
* @range: Buffer describing valid range of values for the Control.
682+
* @type: Format of the data in the Control.
656683
* @mode: Access mode of the Control.
657684
* @layers: Bitmask of access layers of the Control.
658685
* @deferrable: Indicates if the access to the Control can be deferred.
@@ -669,6 +696,7 @@ struct sdca_control {
669696
u64 cn_list;
670697

671698
struct sdca_control_range range;
699+
enum sdca_control_datatype type;
672700
enum sdca_access_mode mode;
673701
u8 layers;
674702

@@ -904,11 +932,51 @@ enum sdca_entity_type {
904932
SDCA_ENTITY_TYPE_HIDE = 0x31,
905933
};
906934

935+
/**
936+
* struct sdca_ge_control - control entry in the affected controls list
937+
* @id: Entity ID of the Control affected.
938+
* @sel: Control Selector of the Control affected.
939+
* @cn: Control Number of the Control affected.
940+
* @val: Value written to Control for this Mode.
941+
*/
942+
struct sdca_ge_control {
943+
int id;
944+
int sel;
945+
int cn;
946+
int val;
947+
};
948+
949+
/**
950+
* struct sdca_ge_mode - mode entry in the affected controls list
951+
* @controls: Dynamically allocated array of controls written for this Mode.
952+
* @num_controls: Number of controls written in this Mode.
953+
* @val: GE Selector Mode value.
954+
*/
955+
struct sdca_ge_mode {
956+
struct sdca_ge_control *controls;
957+
int num_controls;
958+
int val;
959+
};
960+
961+
/**
962+
* struct sdca_entity_ge - information specific to Group Entities
963+
* @kctl: ALSA control pointer that can be used by linked Entities.
964+
* @modes: Dynamically allocated array of Modes and the Controls written
965+
* in each mode.
966+
* @num_modes: Number of Modes.
967+
*/
968+
struct sdca_entity_ge {
969+
struct snd_kcontrol_new *kctl;
970+
struct sdca_ge_mode *modes;
971+
int num_modes;
972+
};
973+
907974
/**
908975
* struct sdca_entity - information for one SDCA Entity
909976
* @label: String such as "OT 12".
910977
* @id: Identifier used for addressing.
911978
* @type: Type code for the Entity.
979+
* @group: Pointer to Group Entity controlling this one, NULL if N/A.
912980
* @sources: Dynamically allocated array pointing to each input Entity
913981
* connected to this Entity.
914982
* @controls: Dynamically allocated array of Controls.
@@ -917,12 +985,14 @@ enum sdca_entity_type {
917985
* @iot: Input/Output Terminal specific Entity properties.
918986
* @cs: Clock Source specific Entity properties.
919987
* @pde: Power Domain Entity specific Entity properties.
988+
* @ge: Group Entity specific Entity properties.
920989
*/
921990
struct sdca_entity {
922991
const char *label;
923992
int id;
924993
enum sdca_entity_type type;
925994

995+
struct sdca_entity *group;
926996
struct sdca_entity **sources;
927997
struct sdca_control *controls;
928998
int num_sources;
@@ -931,6 +1001,7 @@ struct sdca_entity {
9311001
struct sdca_entity_iot iot;
9321002
struct sdca_entity_cs cs;
9331003
struct sdca_entity_pde pde;
1004+
struct sdca_entity_ge ge;
9341005
};
9351006
};
9361007

@@ -1113,6 +1184,25 @@ struct sdca_function_data {
11131184
unsigned int busy_max_delay;
11141185
};
11151186

1187+
static inline u32 sdca_range(struct sdca_control_range *range,
1188+
unsigned int col, unsigned int row)
1189+
{
1190+
return range->data[(row * range->cols) + col];
1191+
}
1192+
1193+
static inline u32 sdca_range_search(struct sdca_control_range *range,
1194+
int search_col, int value, int result_col)
1195+
{
1196+
int i;
1197+
1198+
for (i = 0; i < range->rows; i++) {
1199+
if (sdca_range(range, search_col, i) == value)
1200+
return sdca_range(range, result_col, i);
1201+
}
1202+
1203+
return 0;
1204+
}
1205+
11161206
int sdca_parse_function(struct device *dev,
11171207
struct sdca_function_desc *desc,
11181208
struct sdca_function_data *function);

0 commit comments

Comments
 (0)