+/** Enable/Disable specified clock.\r
+\r
+ @param[in] This A Pointer to SCMI_CLOCK_PROTOCOL Instance.\r
+ @param[in] ClockId Identifier for the clock device.\r
+ @param[in] Enable TRUE to enable, FALSE to disable.\r
+\r
+ @retval EFI_SUCCESS Clock enable/disable successful.\r
+ @retval EFI_DEVICE_ERROR SCP returns an SCMI error.\r
+ @retval !(EFI_SUCCESS) Other errors.\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ClockEnable (\r
+ IN SCMI_CLOCK2_PROTOCOL *This,\r
+ IN UINT32 ClockId,\r
+ IN BOOLEAN Enable\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ CLOCK_CONFIG_SET_ATTRIBUTES *ClockConfigSetAttributes;\r
+ SCMI_COMMAND Cmd;\r
+ UINT32 PayloadLength;\r
+\r
+ Status = ScmiCommandGetPayload ((UINT32**)&ClockConfigSetAttributes);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ // Fill arguments for clock protocol command.\r
+ ClockConfigSetAttributes->ClockId = ClockId;\r
+ ClockConfigSetAttributes->Attributes = Enable ? BIT0 : 0;\r
+\r
+ Cmd.ProtocolId = SCMI_PROTOCOL_ID_CLOCK;\r
+ Cmd.MessageId = SCMI_MESSAGE_ID_CLOCK_CONFIG_SET;\r
+\r
+ PayloadLength = sizeof (CLOCK_CONFIG_SET_ATTRIBUTES);\r
+\r
+ // Execute and wait for response on a SCMI channel.\r
+ Status = ScmiCommandExecute (\r
+ &Cmd,\r
+ &PayloadLength,\r
+ NULL\r
+ );\r
+\r
+ return Status;\r
+}\r
+\r