|
@@ -1,6 +1,7 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
/*
|
|
|
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#include <linux/slab.h>
|
|
@@ -405,6 +406,58 @@ int audio_prm_set_cdc_earpa_duty_cycling_req(struct prm_earpa_hw_intf_config *ea
|
|
|
}
|
|
|
EXPORT_SYMBOL(audio_prm_set_cdc_earpa_duty_cycling_req);
|
|
|
|
|
|
+int audio_prm_set_vote_against_sleep(uint8_t enable)
|
|
|
+{
|
|
|
+ int ret = 0;
|
|
|
+ struct gpr_pkt *pkt;
|
|
|
+ prm_cmd_request_hw_core_t prm_rsc_request;
|
|
|
+ uint32_t size;
|
|
|
+
|
|
|
+ size = GPR_HDR_SIZE + sizeof(prm_cmd_request_hw_core_t);
|
|
|
+ pkt = kzalloc(size, GFP_KERNEL);
|
|
|
+ if (!pkt)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
+ pkt->hdr.header = GPR_SET_FIELD(GPR_PKT_VERSION, GPR_PKT_VER) |
|
|
|
+ GPR_SET_FIELD(GPR_PKT_HEADER_SIZE, GPR_PKT_HEADER_WORD_SIZE_V) |
|
|
|
+ GPR_SET_FIELD(GPR_PKT_PACKET_SIZE, size);
|
|
|
+
|
|
|
+ pkt->hdr.src_port = GPR_SVC_ASM;
|
|
|
+ pkt->hdr.dst_port = PRM_MODULE_INSTANCE_ID;
|
|
|
+ pkt->hdr.dst_domain_id = GPR_IDS_DOMAIN_ID_ADSP_V;
|
|
|
+ pkt->hdr.src_domain_id = GPR_IDS_DOMAIN_ID_APPS_V;
|
|
|
+ pkt->hdr.token = 0; /* TBD */
|
|
|
+
|
|
|
+ if (enable)
|
|
|
+ pkt->hdr.opcode = PRM_CMD_REQUEST_HW_RSC;
|
|
|
+ else
|
|
|
+ pkt->hdr.opcode = PRM_CMD_RELEASE_HW_RSC;
|
|
|
+
|
|
|
+ prm_rsc_request.payload_header.payload_address_lsw = 0;
|
|
|
+ prm_rsc_request.payload_header.payload_address_msw = 0;
|
|
|
+ prm_rsc_request.payload_header.mem_map_handle = 0;
|
|
|
+ prm_rsc_request.payload_header.payload_size = sizeof(prm_cmd_request_hw_core_t) - sizeof(apm_cmd_header_t);
|
|
|
+
|
|
|
+ /** Populate the param payload */
|
|
|
+ prm_rsc_request.module_payload_0.module_instance_id = PRM_MODULE_INSTANCE_ID;
|
|
|
+ prm_rsc_request.module_payload_0.error_code = 0;
|
|
|
+ prm_rsc_request.module_payload_0.param_id = PARAM_ID_RSC_HW_CORE;
|
|
|
+ prm_rsc_request.module_payload_0.param_size =
|
|
|
+ sizeof(prm_cmd_request_hw_core_t) - sizeof(apm_cmd_header_t) - sizeof(apm_module_param_data_t);
|
|
|
+
|
|
|
+ prm_rsc_request.hw_core_id = HW_CORE_ID_LPASS;
|
|
|
+
|
|
|
+ memcpy(&pkt->payload, &prm_rsc_request, sizeof(prm_cmd_request_hw_core_t));
|
|
|
+ ret = prm_gpr_send_pkt(pkt, &g_prm.wait);
|
|
|
+ if (ret < 0) {
|
|
|
+ pr_err("%s: Unable to send packet %d\n", __func__, ret);
|
|
|
+ }
|
|
|
+
|
|
|
+ kfree(pkt);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(audio_prm_set_vote_against_sleep);
|
|
|
+
|
|
|
int audio_prm_set_lpass_clk_cfg (struct clk_cfg *clk, uint8_t enable)
|
|
|
{
|
|
|
int ret = 0;
|