Skip to content

Commit 97374b6

Browse files
ranj063kv2019i
authored andcommitted
topology2: Make name a mandatory attribute in hw_config
Add an instance attribute and make the name attribute mandatory for the hw_config objects. This is required because the topology2 compiler allows for expansion of string values with variable definitions. So, if we wanted to expand the name from a variable definition(as shown below), it is only possible if it were a normal attribute instead of the node ID as it is currently. Define { SSP0_HW_CONFIG_NAME "SSP0" } Object.DAI.SSP.1 { dai_index 0 Object.Base.hw_config.1 { name $SSP0_HW_CONFIG_NAME } } Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent 969b387 commit 97374b6

File tree

11 files changed

+49
-21
lines changed

11 files changed

+49
-21
lines changed

tools/topology/topology2/cavs-mixin-mixout-hda.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ Object.Dai {
2020
dai_index 0
2121
id 4
2222
default_hw_conf_id 4
23-
Object.Base.hw_config.HDA0 {}
23+
Object.Base.hw_config.1 {
24+
name "HDA0"
25+
}
2426
direction duplex
2527
}
2628
}

tools/topology/topology2/cavs-nocodec.conf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Object.Dai {
8787
quirks "lbm_mode"
8888
io_clk $MCLK
8989

90-
Object.Base.hw_config."SSP0" {
90+
Object.Base.hw_config.1 {
91+
name "SSP0"
9192
id 0
9293
mclk_freq $MCLK
9394
bclk_freq 3072000
@@ -104,7 +105,8 @@ Object.Dai {
104105
quirks "lbm_mode"
105106
io_clk $MCLK
106107

107-
Object.Base.hw_config."SSP1" {
108+
Object.Base.hw_config.1 {
109+
name "SSP1"
108110
id 0
109111
mclk_freq $MCLK
110112
bclk_freq 3072000
@@ -121,7 +123,8 @@ Object.Dai {
121123
quirks "lbm_mode"
122124
io_clk $MCLK
123125

124-
Object.Base.hw_config."SSP2" {
126+
Object.Base.hw_config.1 {
127+
name "SSP2"
125128
id 0
126129
mclk_freq $MCLK
127130
bclk_freq 3072000

tools/topology/topology2/cavs-rt5682.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ Object.Dai {
9696
sample_bits 32
9797
io_clk $MCLK
9898

99-
Object.Base.hw_config."SSP0" {
99+
Object.Base.hw_config.1 {
100+
name "SSP0"
100101
id 0
101102
mclk_freq $MCLK
102103
bclk_freq 3072000
@@ -112,7 +113,8 @@ Object.Dai {
112113
sample_bits 32
113114
io_clk $MCLK
114115

115-
Object.Base.hw_config."SSP1" {
116+
Object.Base.hw_config.1 {
117+
name "SSP1"
116118
id 0
117119
mclk_freq $MCLK
118120
bclk_freq 3072000

tools/topology/topology2/cavs-sdw-src-gain-mixin.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ Object.Dai {
4848
rate 48000
4949
channels 2
5050

51-
Object.Base.hw_config."ALH2" {
51+
Object.Base.hw_config.1 {
5252
id 0
53+
name "ALH2"
5354
}
5455
}
5556
ALH."3" {
@@ -61,8 +62,9 @@ Object.Dai {
6162
rate 48000
6263
channels 2
6364

64-
Object.Base.hw_config."ALH3" {
65+
Object.Base.hw_config.1 {
6566
id 1
67+
name ALH3
6668
}
6769
}
6870
}

tools/topology/topology2/cavs-sdw.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ Object.Dai {
108108
rate 48000
109109
channels 2
110110

111-
Object.Base.hw_config."ALH2" {
111+
Object.Base.hw_config.1 {
112112
id 0
113+
name "ALH2"
113114
}
114115
}
115116
ALH."3" {
@@ -121,8 +122,9 @@ Object.Dai {
121122
rate 48000
122123
channels 2
123124

124-
Object.Base.hw_config."ALH3" {
125+
Object.Base.hw_config.1 {
125126
id 1
127+
name "ALH3"
126128
}
127129
}
128130
}

tools/topology/topology2/include/dais/hw_config.conf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Class.Base."hw_config" {
1616
# Argument used to construct hw config (hw config ID)
1717
#
1818
DefineAttribute."id" {}
19+
DefineAttribute."instance" {}
1920

2021
DefineAttribute."name" {
2122
type "string"
@@ -63,11 +64,14 @@ Class.Base."hw_config" {
6364
!constructor [
6465
"id"
6566
]
67+
!mandatory [
68+
"name"
69+
]
6670
#
6771
# hw_cfg objects instantiated within the same alsaconf node must have unique
68-
# 'name' attribute
72+
# 'instance' attribute
6973
#
70-
unique "name"
74+
unique "instance"
7175
}
7276

7377
#TODO: Add link flags

tools/topology/topology2/platform/intel/dmic-generic.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ Object.Dai {
1212
# the mic's are enabled or disabled in each PDM.
1313
num_pdm_active 2
1414

15-
Object.Base.hw_config."DMIC0" {
15+
Object.Base.hw_config.1 {
1616
id 0
17+
name "DMIC0"
1718
}
1819

1920
# PDM controller config
@@ -45,8 +46,9 @@ Object.Dai {
4546
# the mic's are enabled or disabled in each PDM.
4647
num_pdm_active 2
4748

48-
Object.Base.hw_config."DMIC1" {
49+
Object.Base.hw_config.1 {
4950
id 0
51+
name "DMIC1"
5052
}
5153

5254
# PDM controller config

tools/topology/topology2/platform/intel/hdmi-4th.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Object.Dai {
44
name iDisp4
55
id $HDMI4_ID
66
default_hw_conf_id 3
7-
Object.Base.hw_config.HDA6 {}
7+
Object.Base.hw_config.1 {
8+
name "HDA6"
9+
}
810
direction playback
911
}
1012
}

tools/topology/topology2/platform/intel/hdmi-generic.conf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,29 @@ Object.Dai {
44
name iDisp1
55
id $HDMI1_ID
66
default_hw_conf_id 1
7-
Object.Base.hw_config.HDA4 {}
7+
Object.Base.hw_config.1 {
8+
name "HDA4"
9+
}
810
direction playback
911
}
1012
HDA.5 {
1113
dai_index 5
1214
name iDisp2
1315
id $HDMI2_ID
1416
default_hw_conf_id 2
15-
Object.Base.hw_config.HDA5 {}
17+
Object.Base.hw_config.1 {
18+
name "HDA5"
19+
}
1620
direction playback
1721
}
1822
HDA.6 {
1923
dai_index 6
2024
name iDisp3
2125
id $HDMI3_ID
2226
default_hw_conf_id 3
23-
Object.Base.hw_config.HDA6 {}
27+
Object.Base.hw_config.1 {
28+
name "HDA6"
29+
}
2430
direction playback
2531
}
2632
}

tools/topology/topology2/platform/intel/sdw-amp-generic.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ Object.Dai {
2020
rate 48000
2121
channels 2
2222

23-
Object.Base.hw_config."ALH514" {
23+
Object.Base.hw_config.1 {
2424
id 0
25+
name "ALH514"
2526
}
2627
}
2728
ALH."2" {
@@ -33,8 +34,9 @@ Object.Dai {
3334
rate 48000
3435
channels 2
3536

36-
Object.Base.hw_config."ALH515" {
37+
Object.Base.hw_config.1 {
3738
id 1
39+
name "ALH515"
3840
}
3941
}
4042
}

0 commit comments

Comments
 (0)