diff --git a/tools/tplgtool2.py b/tools/tplgtool2.py index 55eb7300..2c1a8090 100755 --- a/tools/tplgtool2.py +++ b/tools/tplgtool2.py @@ -234,6 +234,7 @@ class SofVendorToken(enum.IntEnum): SOF_TKN_COMP_FORMAT = 402 SOF_TKN_COMP_CORE_ID = 404 SOF_TKN_COMP_UUID = 405 + SOF_TKN_COMP_CPC = 406 # sof_ssp_tokens SOF_TKN_INTEL_SSP_CLKS_CONTROL = 500 SOF_TKN_INTEL_SSP_MCLK_ID = 501 @@ -690,10 +691,10 @@ def get_priv_element(comp: Container, token: SofVendorToken, default = None): return default @staticmethod - def get_core_id(widget: Container, default = None): - "Get widget core ID." - return GroupedTplg.get_priv_element(widget["widget"], SofVendorToken.SOF_TKN_COMP_CORE_ID, default) - + def get_widget_token_value(widget: Container, token: SofVendorToken, default = None): + "Get the value for specified token" + return GroupedTplg.get_priv_element(widget["widget"], token, default) + @staticmethod def get_widget_uuid(widget: Container, default = None): "Get widget UUID." @@ -741,7 +742,7 @@ def coreids(self): "All available core IDs." cores = set() for widget in self.widget_list: - core = self.get_core_id(widget) + core = self.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CORE_ID) if core is None: cores.add(-1) # placeholder for the lack of core ID else: @@ -917,12 +918,15 @@ def _display_node_attrs(self, name: str, widget: Container): attr = {} if not self.without_nodeinfo: sublabel = self.node_sublabel(widget) - core = GroupedTplg.get_core_id(widget) + core = GroupedTplg.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CORE_ID) if core is not None: if self.show_core == 'always' or ( self.show_core == 'auto' and self._tplg.has_core_differences ): sublabel2 += f'
core:{core}' + comp_cpc = GroupedTplg.get_widget_token_value(widget, SofVendorToken.SOF_TKN_COMP_CPC) + if comp_cpc is not None: + sublabel2 += f'
cpc:{comp_cpc}' display_name = name wname = widget.widget.name # See the *_NUM_REGEX above