Skip to content

Commit 650423f

Browse files
committed
topology2: Move the hw_config class definition
Move and rename the hw_config class to platform/intel/hw_config_cardinal_clk.conf. This hw_config is specific to Intel SSP DAI that use the cardinal clock for the mclk frequency. Ideally, this class should have immutable mclk_frequency and link clock source. But because the alsatplg compiler expects the name of the hw config class to be "hw_config" without any extensions, it is left as modifiable for now. Once the topology compiler is modified, this will be made immutable in a follow up PR. Also, introduce a new hw_config_simple.conf file that contains the hw_config definition for the HDA/DMIC/SDW type DAIs with only the ID and name attributes. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent ada8950 commit 650423f

File tree

11 files changed

+121
-23
lines changed

11 files changed

+121
-23
lines changed

tools/topology/topology2/cavs-nocodec-bt.conf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<searchdir:include/components>
44
<searchdir:include/dais>
55
<searchdir:include/pipelines/cavs>
6+
<searchdir:platform>
67
<searchdir:platform/intel>
78

89
<vendor-token.conf>
@@ -20,7 +21,7 @@
2021
<fe_dai.conf>
2122
<ssp.conf>
2223
<dmic.conf>
23-
<hw_config.conf>
24+
<intel/hw_config_cardinal_clk.conf>
2425
<manifest.conf>
2526
<route.conf>
2627
<common_definitions.conf>
@@ -83,9 +84,12 @@ Object.Dai.SSP [
8384
Object.Base.hw_config.1 {
8485
name "SSP0"
8586
id 0
86-
mclk_freq $MCLK
8787
bclk_freq 3072000
8888
tdm_slot_width 32
89+
# TODO: remove this. Needs alsaptlg change.
90+
Object.Base.link_config.1 {
91+
clock_source 1
92+
}
8993
}
9094
}
9195
{
@@ -101,9 +105,12 @@ Object.Dai.SSP [
101105
Object.Base.hw_config.1 {
102106
name "SSP1"
103107
id 0
104-
mclk_freq $MCLK
105108
bclk_freq 3072000
106109
tdm_slot_width 32
110+
# TODO: remove this. Needs alsaptlg change.
111+
Object.Base.link_config.1 {
112+
clock_source 1
113+
}
107114
}
108115
}
109116
]

tools/topology/topology2/cavs-nocodec.conf

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<searchdir:include/components>
44
<searchdir:include/dais>
55
<searchdir:include/pipelines/cavs>
6+
<searchdir:platform>
67
<searchdir:platform/intel>
78

89
<vendor-token.conf>
@@ -30,7 +31,7 @@
3031
<fe_dai.conf>
3132
<ssp.conf>
3233
<dmic.conf>
33-
<hw_config.conf>
34+
<intel/hw_config_cardinal_clk.conf>
3435
<manifest.conf>
3536
<route.conf>
3637
<common_definitions.conf>
@@ -113,9 +114,12 @@ Object.Dai.SSP [
113114
Object.Base.hw_config.1 {
114115
name "SSP0"
115116
id 0
116-
mclk_freq $MCLK
117117
bclk_freq 3072000
118118
tdm_slot_width 32
119+
# TODO: remove this. Needs alsaptlg change.
120+
Object.Base.link_config.1 {
121+
clock_source 1
122+
}
119123
}
120124
}
121125
{
@@ -131,9 +135,12 @@ Object.Dai.SSP [
131135
Object.Base.hw_config.1 {
132136
name "SSP2"
133137
id 0
134-
mclk_freq $MCLK
135138
bclk_freq 3072000
136139
tdm_slot_width 32
140+
# TODO: remove this. Needs alsaptlg change.
141+
Object.Base.link_config.1 {
142+
clock_source 1
143+
}
137144
}
138145
}
139146
]
@@ -695,9 +702,12 @@ IncludeByKey.SSP1_ENABLED {
695702
Object.Base.hw_config.1 {
696703
name "SSP1"
697704
id 0
698-
mclk_freq $MCLK
699705
bclk_freq 3072000
700706
tdm_slot_width 32
707+
# TODO: remove this. Needs alsaptlg change.
708+
Object.Base.link_config.1 {
709+
clock_source 1
710+
}
701711
}
702712
}
703713
]

tools/topology/topology2/cavs-rt5682.conf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<searchdir:include/components>
44
<searchdir:include/dais>
55
<searchdir:include/pipelines/cavs>
6+
<searchdir:platform>
67
<searchdir:platform/intel>
78

89
<vendor-token.conf>
@@ -27,7 +28,7 @@
2728
<ssp.conf>
2829
<dmic.conf>
2930
<hda.conf>
30-
<hw_config.conf>
31+
<intel/hw_config_cardinal_clk.conf>
3132
<manifest.conf>
3233
<route.conf>
3334
<common_definitions.conf>
@@ -132,9 +133,12 @@ Object.Dai.SSP [
132133
Object.Base.hw_config.1 {
133134
name $HEADSET_HW_CONFIG_NAME
134135
id 0
135-
mclk_freq $MCLK
136136
bclk_freq 3072000
137137
tdm_slot_width 32
138+
# TODO: remove this. Needs alsaptlg change.
139+
Object.Base.link_config.1 {
140+
clock_source 1
141+
}
138142
}
139143
}
140144
{
@@ -157,9 +161,12 @@ Object.Dai.SSP [
157161
Object.Base.hw_config.1 {
158162
name $SPEAKER_HW_CONFIG_NAME
159163
id 0
160-
mclk_freq $MCLK
161164
bclk_freq 3072000
162165
tdm_slot_width 32
166+
# TODO: remove this. Needs alsaptlg change.
167+
Object.Base.link_config.1 {
168+
clock_source 1
169+
}
163170
}
164171
}
165172
]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<searchdir:include/dais>
55
<searchdir:include/controls>
66
<searchdir:include/pipelines/cavs>
7+
<searchdir:platform/intel>
78

89
<vendor-token.conf>
910
<tokens.conf>
@@ -17,7 +18,7 @@
1718
<pcm_caps.conf>
1819
<fe_dai.conf>
1920
<alh.conf>
20-
<hw_config.conf>
21+
<hw_config_simple.conf>
2122
<manifest.conf>
2223
<route.conf>
2324
<common_definitions.conf>

tools/topology/topology2/cavs-sdw.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<alh.conf>
2828
<hda.conf>
2929
<dmic.conf>
30-
<hw_config.conf>
30+
<hw_config_simple.conf>
3131
<manifest.conf>
3232
<route.conf>
3333
<common_definitions.conf>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Simple hardware config class definition for HDA/SDW/DMIC type DAIs. All attributes defined herein
2+
# are namespaced by alsatplg to "Object.Base.hw_config.1.attribute_name"
3+
#
4+
# Object.Base.hw_config.1 {
5+
# id 0
6+
# name "HDA0"
7+
# }
8+
#
9+
# where 1 is the unique instance ID for the hw_config object within the same alsaconf
10+
# node.
11+
12+
Class.Base."hw_config" {
13+
#
14+
# Argument used to construct hw config (hw config ID)
15+
#
16+
DefineAttribute."id" {}
17+
DefineAttribute."instance" {}
18+
19+
DefineAttribute."name" {
20+
type "string"
21+
}
22+
23+
attributes {
24+
!constructor [
25+
"id"
26+
]
27+
!mandatory [
28+
"name"
29+
]
30+
#
31+
# hw_config objects instantiated within the same alsaconf node must have unique
32+
# 'instance' attribute
33+
unique "instance"
34+
}
35+
}

tools/topology/topology2/platform/intel/bt-ssp-config-lbm.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Object.Dai.SSP [
2222
tdm_slots 1
2323
tx_slots 1
2424
rx_slots 1
25+
Object.Base.link_config.1 {
26+
clock_source 0
27+
}
2528
}
2629
Object.Base.hw_config.2 {
2730
id 1
@@ -37,6 +40,9 @@ Object.Dai.SSP [
3740
tdm_slots 1
3841
tx_slots 1
3942
rx_slots 1
43+
Object.Base.link_config.1 {
44+
clock_source 0
45+
}
4046
}
4147
Object.Base.hw_config.3 {
4248
id 2
@@ -51,6 +57,9 @@ Object.Dai.SSP [
5157
tdm_slots 2
5258
tx_slots 3
5359
rx_slots 3
60+
Object.Base.link_config.1 {
61+
clock_source 0
62+
}
5463
}
5564
}
5665
]

tools/topology/topology2/platform/intel/bt-ssp-config.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Object.Dai.SSP [
2121
tdm_slots 1
2222
tx_slots 1
2323
rx_slots 1
24+
Object.Base.link_config.1 {
25+
clock_source 0
26+
}
2427
}
2528
Object.Base.hw_config.2 {
2629
id 1
@@ -36,6 +39,9 @@ Object.Dai.SSP [
3639
tdm_slots 1
3740
tx_slots 1
3841
rx_slots 1
42+
Object.Base.link_config.1 {
43+
clock_source 0
44+
}
3945
}
4046
Object.Base.hw_config.3 {
4147
id 2
@@ -50,6 +56,9 @@ Object.Dai.SSP [
5056
tdm_slots 2
5157
tx_slots 3
5258
rx_slots 0
59+
Object.Base.link_config.1 {
60+
clock_source 0
61+
}
5362
}
5463
}
5564
]

tools/topology/topology2/include/dais/hw_config.conf renamed to tools/topology/topology2/platform/intel/hw_config_cardinal_clk.conf

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# Hardware config class definition DAIs. All attributes defined herein
1+
# Hardware config class definition. All attributes defined herein
22
# are namespaced by alsatplg to "Object.Base.hw_config.NAME.attribute_name"
33
#
4-
# Object.Base.hw_config."NAME" {
4+
# Object.Base.hw_config.1 {
55
# id 0
6-
# mclk_freq 24000000
7-
# bclk_freq 4800000
8-
# tdm_slot_width 25
6+
# bclk_freq 3072000
7+
# tdm_slot_width 32
98
# }
109
#
11-
# where NAME is the unique instance name for the hw_config object
12-
# within the same alsaconf node.
10+
# where 1 is the unique instance ID for the hw_config object within the same alsaconf
11+
# node.
12+
13+
<platform/intel/ssp_aux_config.conf>
1314

1415
Class.Base."hw_config" {
1516
#
@@ -44,7 +45,21 @@ Class.Base."hw_config" {
4445
type "string"
4546
}
4647

47-
DefineAttribute."bclk_freq" {}
48+
DefineAttribute."bclk_freq" {
49+
constraints {
50+
# Allowed values of bclk derived from mclk_freq of 24.576MHz
51+
!valid_values [
52+
"12288000"
53+
"6144000"
54+
"3072000"
55+
"1536000"
56+
"768000"
57+
"384000"
58+
"256000"
59+
"128000"
60+
]
61+
}
62+
}
4863

4964
DefineAttribute."fsync" {
5065
type "string"
@@ -68,15 +83,20 @@ Class.Base."hw_config" {
6883
"name"
6984
]
7085
#
71-
# hw_cfg objects instantiated within the same alsaconf node must have unique
86+
# hw_config objects instantiated within the same alsaconf node must have unique
7287
# 'instance' attribute
73-
#
7488
unique "instance"
7589
}
7690

91+
Object.Base.link_config.1 {
92+
clock_source 1
93+
}
94+
7795
#TODO: Add link flags
7896

7997
format "I2S"
98+
# TODO: Make this immutable
99+
mclk_freq 24576000
80100
mclk "codec_mclk_in"
81101
bclk "codec_consumer"
82102
fsync "codec_consumer"

tools/topology/topology2/include/dais/intel/intel_ssp_aux_config.conf renamed to tools/topology/topology2/platform/intel/ssp_aux_config.conf

File renamed without changes.

0 commit comments

Comments
 (0)