Commit Graph

16 Commits

Author SHA1 Message Date
Ranjani Sridharan ab9449fa08 topology2: tokens: Reduce the string length of token names
In preparation for changing the name of the DAI copier which will make
them a bit longer, reduce the token name lengths by removing the
sof_tkn_ prefix. This is required because the header names in topology
have a 44 character limit and with a long name like:
dai-copier.SSP.NoCodec-0.playback.sof_tkn_comp.uuid, the limit will be
hit. Removing the sof_tkn_ prefix will reduce the number of characters
in the tuple name headers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-29 09:56:13 +03:00
Ranjani Sridharan 6339cfd5aa topology2: Removed period_sink/source_count attributes
These were added for use with IPC3 but since topology2 is not targeted
for IPC3, there's no need to keep them anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-24 10:10:51 +03:00
Ranjani Sridharan 650423feb1 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>
2023-04-05 13:32:30 -07:00
Ranjani Sridharan ada8950551 topology2: ssp: Add blob version
Add the SSP blob version and set it based on the platform.

Co-developed-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-05 13:32:30 -07:00
Ranjani Sridharan ae8ca22a59 topology2: Add instance attribute for all classes
In preparation for making it easier to write topology conf files that
can be conditionally included without having to worry about conflicting
node ID's for objects between the included file and the top-level conf
file, modify all classes to include an instance attribute. This means
that irrespective of the object type, all objects will be instantiated
as follows:

Object.Widget.gain.1 {} or Object.Base.pdm_config.2 {} etc

The instance ID's are typically only meant for the alsatplg compiler to
differentiate the nodes in the conf file and are not relevant for the
kernel or the firmware. This change will allow the alsatplg compiler to
be modified to automatically make the node ID's unique before
conditionally including conf files.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-25 12:16:29 -08:00
Ranjani Sridharan 97374b6f91 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>
2023-01-23 21:14:17 +02:00
Ranjani Sridharan 969b387584 topology2; Make dai_index a mandatory attribute for DAI objects
Add an instance attribute that will be used to instantiate DAI objects
and make dai_index a mandatory attribute for all DAI objects types. This
is in preparation to make the instance attribute default for all objects
with topology2. This is required because the topology2 compiler allows
for expansion of string values with variable definitions. So, if we
wanted to expand the value of dai_index from a variable definition(shown
as below), it is only possible if it were a normal attribute instead of
the node ID as it is currently.

Define {
	SSP_DAI_INDEX	3
}

Object.Dai.SSP.1 {
	dai_index	$SSP_DAI_INDEX
}

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-01-23 21:14:17 +02:00
Jaska Uimonen 7be11aaf28 topology2: add auxiliary data classes for ssp
Auxiliary data can be added at the end of ssp data blob to enable for
example early clocks for certain platform. Add intel_ssp_aux_config.conf
that includes all possible aux data classes. These can be used inside
ssp hw_configs and will be embedded as tlv data after basic data blob.

Example of using mn_config class inside hw_config:

Object.Base.hw_config."SSP0_0" {
	id              0
	mclk_freq       38400000
	bclk_freq       256000
	tdm_slot_width  16
	format          "DSP_A"
	bclk            "codec_provider"
	fsync           "codec_provider"
	fsync_freq      16000

	Object.Base.mn_config."MN_0" {
		m_div   100
		n_div   200
	}
}

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-12-22 16:45:24 +00:00
Jaska Uimonen ba86bb4cab topology2: add io_clk attribute to dmic and ssp
Add io_clk attribute to dmic and ssp dai class. This is the platform
dependent clock that needs to variated in upper level topology files.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-11-12 12:59:29 +00:00
Jaska Uimonen ff63219de2 topology2: add mic extension and vendor mic config classes
Add two classes to be used with dmic for nhlt conformance. Mic extension
includes snr and sensitivity values. Mic vendor config has multiple
values for defining the mic array geometry and mic positions.

Do not add tokens as these values are used currently only with nhlt
generation. Defining these classes in dmic is optional.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-11-08 12:18:06 +00:00
Ranjani Sridharan 5c7e82e944 topology2: always override array elems
Always use "!" with array definitions so that items do not get
duplicated when arrays are merged when the conf file is included
multiple times.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-11-03 21:44:19 +00:00
Jaska Uimonen c4880ff50a topology2: add dmic and pdm classes
Add classes for dmic and pdm config.

Suggested-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-08-25 15:39:43 +01:00
Rander Wang 884bfdf125 topology2.0: add some basic class definitions
Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
2021-07-30 22:44:31 +01:00
Bard Liao 4e76df5221 topology2: add ALH DAI class
Add ALH DAI class definition, ALH DAI objects can be
instantiated as:

Object.Dai.ALH."N" {
 	direction		"capture" # playback or capture
 	dai_name		"SDW0-Capture"
 	id 			2
 	Object.hw_config."2" {
 	}
}

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-07-19 13:19:12 +01:00
Chao Song 2e1d2ecabb topology2: Add HW Config class
Add class definition for HW Config, HW Config object
can be instantiated as:

  Object.Base.hw_config."NAME" {
	id		0
	mclk_freq	24000000
	bclk_freq	4800000
	tdm_slot_width	25
    }

where NAME is the unique instance name for the hw_config
object within the same alsaconf node, for example, SSP0.

Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
2021-07-09 12:02:01 +01:00
Chao Song 17902fcbf0 topology2: Add SSP DAI class
Add SSP DAI class definition, SSP DAI objects can be
instantiated as:

Object.Dai.SSP."N" {
    direction		"duplex"
    dai_name		"NoCodec-0"
    id 			0
    quirks		"lbm_mode"
    sample_bits		24
    Object.hw_config."0" {
	    mclk_freq	24000000
	    bclk_freq	4800000
	    tdm_slot_width	25
    }
    Object.dai."playback" {
	    period_source_count	2
	    period_sink_count	0
    }
    Object.dai."capture" {
	    period_source_count	0
	    period_sink_count	2
    }
}

Signed-off-by: Ranjani Sridharan <ranjani.sidharan@linux.intel.com>
Signed-off-by: Chao Song <chao.song@linux.intel.com>
2021-07-09 12:02:01 +01:00