From 3a42612479bd4eda34e75f66b21cbc2044a135e0 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 29 Sep 2025 04:17:29 +0300 Subject: [PATCH 1/5] audioreach-common: drop extra qdsp6/ prefix Other include directives include directly include files under the qdsp6 subdir of the Linux kernel. Drop extra path from the "qdsp6/qafe6.h" include directive. Signed-off-by: Dmitry Baryshkov --- audioreach-driver/audioreach_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audioreach-driver/audioreach_common.c b/audioreach-driver/audioreach_common.c index d00144a..65172ac 100644 --- a/audioreach-driver/audioreach_common.c +++ b/audioreach-driver/audioreach_common.c @@ -12,7 +12,7 @@ #include #include #include -#include "qdsp6/q6afe.h" +#include "q6afe.h" #include "sdw.h" #include "q6prm_audioreach.h" From 12ae6436db13d06d86c498ccc40b7b72ffae99d2 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 29 Sep 2025 04:24:54 +0300 Subject: [PATCH 2/5] audioreach-driver: add .gitignore Let Git ignore autogenerated files. Signed-off-by: Dmitry Baryshkov --- audioreach-driver/.gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 audioreach-driver/.gitignore diff --git a/audioreach-driver/.gitignore b/audioreach-driver/.gitignore new file mode 100644 index 0000000..4940b09 --- /dev/null +++ b/audioreach-driver/.gitignore @@ -0,0 +1,10 @@ +.*.cmd +.*.d + +*.o +Module.symvers +modules.order + +audioreach_driver.ko +audioreach_driver.mod +audioreach_driver.mod.c From c4550a7600f8e90326fa8b0397c0e8e8e2cc4bf5 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 29 Sep 2025 04:31:49 +0300 Subject: [PATCH 3/5] audioreach-driver: drop unused exports The Audioreach driver consists of a single module. Drop all EXPORT_SYMBOL_GPL declarations to prevent symbol pollution. Signed-off-by: Dmitry Baryshkov --- audioreach-driver/q6apm_audio_mem.c | 2 -- audioreach-driver/q6apm_audio_pkt.c | 5 ----- audioreach-driver/q6prm_audioreach.c | 5 ----- 3 files changed, 12 deletions(-) diff --git a/audioreach-driver/q6apm_audio_mem.c b/audioreach-driver/q6apm_audio_mem.c index f6c53bf..5ac0399 100644 --- a/audioreach-driver/q6apm_audio_mem.c +++ b/audioreach-driver/q6apm_audio_mem.c @@ -439,7 +439,6 @@ int msm_audio_get_phy_addr(int fd, dma_addr_t *paddr, size_t *pa_len) mutex_unlock(&(msm_audio_mem_fd_list.list_mutex)); return status; } -EXPORT_SYMBOL_GPL(msm_audio_get_phy_addr); int msm_audio_set_hyp_assign(int fd, bool assign) { @@ -614,7 +613,6 @@ void msm_audio_mem_crash_handler(void) } mutex_unlock(&(msm_audio_mem_fd_list.list_mutex)); } -EXPORT_SYMBOL_GPL(msm_audio_mem_crash_handler); static int msm_audio_mem_open(struct inode *inode, struct file *file) { diff --git a/audioreach-driver/q6apm_audio_pkt.c b/audioreach-driver/q6apm_audio_pkt.c index a2c893e..7af25a6 100644 --- a/audioreach-driver/q6apm_audio_pkt.c +++ b/audioreach-driver/q6apm_audio_pkt.c @@ -227,7 +227,6 @@ int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev, mutex_unlock(cmd_lock); return rc; } -EXPORT_SYMBOL_GPL(q6apm_send_audio_cmd_sync); int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode) @@ -237,7 +236,6 @@ int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint3 return q6apm_send_audio_cmd_sync(&gdev->dev, gdev, &apm->result, &apm->lock, NULL, &apm->readq, pkt, rsp_opcode); } -EXPORT_SYMBOL_GPL(q6apm_audio_send_cmd); static void *__q6apm_audio_alloc_pkt(int payload_size, uint32_t opcode, uint32_t token, uint32_t src_port, uint32_t dest_port, bool has_cmd_hdr) @@ -281,7 +279,6 @@ void *q6apm_audio_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t toke return __q6apm_audio_alloc_pkt(pkt_size, opcode, token, GPR_APM_MODULE_IID, APM_MODULE_INSTANCE_ID, true); } -EXPORT_SYMBOL_GPL(q6apm_audio_alloc_apm_cmd_pkt); static int q6apm_audio_get_apm_state(struct q6apm_audio_pkt *apm) { @@ -305,7 +302,6 @@ bool q6apm_audio_is_adsp_ready(void) return false; } -EXPORT_SYMBOL_GPL(q6apm_audio_is_adsp_ready); void q6apm_audio_close_all(void) { @@ -319,7 +315,6 @@ void q6apm_audio_close_all(void) kfree(pkt); } -EXPORT_SYMBOL_GPL(q6apm_audio_close_all); int audio_pkt_open(struct inode *inode, struct file *file) { diff --git a/audioreach-driver/q6prm_audioreach.c b/audioreach-driver/q6prm_audioreach.c index 23567a2..f7d9949 100644 --- a/audioreach-driver/q6prm_audioreach.c +++ b/audioreach-driver/q6prm_audioreach.c @@ -95,7 +95,6 @@ int q6prm_audio_send_cmd_sync(struct device *dev, gpr_device_t *gdev, mutex_unlock(cmd_lock); return rc; } -EXPORT_SYMBOL_GPL(q6prm_audio_send_cmd_sync); static int q6prm_audioreach_send_cmd_sync(struct q6prm *prm, struct gpr_pkt *pkt, uint32_t rsp_opcode) { @@ -145,7 +144,6 @@ void *q6prm_audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t { return __q6prm_audioreach_alloc_pkt(payload_size, opcode, token, src_port, dest_port, true); } -EXPORT_SYMBOL_GPL(q6prm_audioreach_alloc_cmd_pkt); static int q6prm_audioreach_set_hw_core_req(struct device *dev, uint32_t hw_block_id, bool enable) { @@ -193,13 +191,11 @@ int q6prm_audioreach_vote_lpass_core_hw(struct device *dev, uint32_t hw_block_id return q6prm_audioreach_set_hw_core_req(dev, hw_block_id, true); } -EXPORT_SYMBOL_GPL(q6prm_audioreach_vote_lpass_core_hw); int q6prm_audioreach_unvote_lpass_core_hw(struct device *dev, uint32_t hw_block_id, uint32_t client_handle) { return q6prm_audioreach_set_hw_core_req(dev, hw_block_id, false); } -EXPORT_SYMBOL_GPL(q6prm_audioreach_unvote_lpass_core_hw); static int q6prm_audioreach_request_lpass_clock(struct device *dev, int clk_id, int clk_attr, int clk_root, unsigned int freq) @@ -280,7 +276,6 @@ int q6prm_audioreach_set_lpass_clock(struct device *dev, int clk_id, int clk_att return q6prm_audioreach_release_lpass_clock(dev, clk_id, clk_attr, clk_root, freq); } -EXPORT_SYMBOL_GPL(q6prm_audioreach_set_lpass_clock); static int prm_audioreach_callback(struct gpr_resp_pkt *data, void *priv, int op) { From a902372520cc0b874af7b8722ec323e2dbf47c21 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 29 Sep 2025 04:22:41 +0300 Subject: [PATCH 4/5] audioreach-driver: drop unused functions and variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix several compiler warnings by dropping unused variables and functions. q6apm_audio_mem.c:365:6: warning: no previous prototype for ‘msm_audio_fd_list_debug’ [-Wmissing-prototypes] 365 | void msm_audio_fd_list_debug(void) | ^~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_mem.c: In function ‘q6apm_audio_mem_probe’: q6apm_audio_mem.c:807:21: warning: unused variable ‘msm_audio_mem_smmu_sid_mask’ [-Wunused-variable] 807 | const char *msm_audio_mem_smmu_sid_mask = "qcom,smmu-sid-mask"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_mem.c:806:21: warning: unused variable ‘msm_audio_mem_dt’ [-Wunused-variable] 806 | const char *msm_audio_mem_dt = "qcom,smmu-enabled"; | ^~~~~~~~~~~~~~~~ q6apm_audio_pkt.c: In function ‘q6apm_audio_pkt_callback’: q6apm_audio_pkt.c:644:24: warning: unused variable ‘dev’ [-Wunused-variable] 644 | struct device *dev = &gdev->dev; | ^~~ q6apm_audio_pkt.c: At top level: q6apm_audio_pkt.c:36:13: warning: ‘audio_pkt_probed’ defined but not used [-Wunused-variable] 36 | static bool audio_pkt_probed; | ^~~~~~~~~~~~~~~~ Signed-off-by: Dmitry Baryshkov --- audioreach-driver/q6apm_audio_mem.c | 13 ------------- audioreach-driver/q6apm_audio_pkt.c | 2 -- 2 files changed, 15 deletions(-) diff --git a/audioreach-driver/q6apm_audio_mem.c b/audioreach-driver/q6apm_audio_mem.c index 5ac0399..42a51c3 100644 --- a/audioreach-driver/q6apm_audio_mem.c +++ b/audioreach-driver/q6apm_audio_mem.c @@ -362,17 +362,6 @@ static int msm_audio_mem_map_buf(struct dma_buf *dma_buf, dma_addr_t *paddr, return rc; } -void msm_audio_fd_list_debug(void) -{ - struct msm_audio_fd_data *msm_audio_fd_data = NULL; - - list_for_each_entry(msm_audio_fd_data, - &msm_audio_mem_fd_list.fd_list, list) { - pr_debug("%s fd %d handle %pK phy. addr %pK\n", __func__, - msm_audio_fd_data->fd, msm_audio_fd_data->handle, - (void *)msm_audio_fd_data->paddr); - } -} void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data) { @@ -803,8 +792,6 @@ static int q6apm_audio_mem_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct of_phandle_args iommuspec; bool smmu_enabled = true; - const char *msm_audio_mem_dt = "qcom,smmu-enabled"; - const char *msm_audio_mem_smmu_sid_mask = "qcom,smmu-sid-mask"; struct msm_audio_mem_private *msm_audio_mem_data = NULL; if (dev->of_node == NULL) { diff --git a/audioreach-driver/q6apm_audio_pkt.c b/audioreach-driver/q6apm_audio_pkt.c index 7af25a6..87236bc 100644 --- a/audioreach-driver/q6apm_audio_pkt.c +++ b/audioreach-driver/q6apm_audio_pkt.c @@ -33,7 +33,6 @@ #define APM_CMD_SHARED_MEM_MAP_REGIONS 0x0100100C #define APM_MEMORY_MAP_BIT_MASK_IS_OFFSET_MODE 0x00000004UL -static bool audio_pkt_probed; /* Define Logging Macros */ static int audio_pkt_debug_mask; enum { @@ -641,7 +640,6 @@ static int q6apm_audio_pkt_callback(struct gpr_resp_pkt *data, void *priv, int o { gpr_device_t *gdev = priv; struct q6apm_audio_pkt *apm = dev_get_drvdata(&gdev->dev); - struct device *dev = &gdev->dev; struct gpr_ibasic_rsp_result_t *result; struct gpr_hdr *hdr = &data->hdr; uint8_t *pkt = NULL; From 7e7d5e98ff6cf79906384055cde4b9bc907cc6d2 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 29 Sep 2025 04:34:47 +0300 Subject: [PATCH 5/5] audioreach-driver: mark local functions as static MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to fix compiler warnings, declare functions without a prototype as static. q6apm_audio_mem.c:366:6: warning: no previous prototype for ‘msm_audio_update_fd_list’ [-Wmissing-prototypes] 366 | void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data) | ^~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_mem.c:384:6: warning: no previous prototype for ‘msm_audio_delete_fd_entry’ [-Wmissing-prototypes] 384 | void msm_audio_delete_fd_entry(void *handle) | ^~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_mem.c:432:5: warning: no previous prototype for ‘msm_audio_set_hyp_assign’ [-Wmissing-prototypes] 432 | int msm_audio_set_hyp_assign(int fd, bool assign) | ^~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_mem.c:452:6: warning: no previous prototype for ‘msm_audio_get_handle’ [-Wmissing-prototypes] 452 | void msm_audio_get_handle(int fd, void **handle) | ^~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:182:5: warning: no previous prototype for ‘q6apm_send_audio_cmd_sync’ [-Wmissing-prototypes] 182 | int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:231:5: warning: no previous prototype for ‘q6apm_audio_send_cmd’ [-Wmissing-prototypes] 231 | int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode) | ^~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:276:7: warning: no previous prototype for ‘q6apm_audio_alloc_apm_cmd_pkt’ [-Wmissing-prototypes] 276 | void *q6apm_audio_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:305:6: warning: no previous prototype for ‘q6apm_audio_close_all’ [-Wmissing-prototypes] 305 | void q6apm_audio_close_all(void) | ^~~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:318:5: warning: no previous prototype for ‘audio_pkt_open’ [-Wmissing-prototypes] 318 | int audio_pkt_open(struct inode *inode, struct file *file) | ^~~~~~~~~~~~~~ q6apm_audio_pkt.c:340:5: warning: no previous prototype for ‘audio_pkt_release’ [-Wmissing-prototypes] 340 | int audio_pkt_release(struct inode *inode, struct file *file) | ^~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:376:9: warning: no previous prototype for ‘audio_pkt_read’ [-Wmissing-prototypes] 376 | ssize_t audio_pkt_read(struct file *file, char __user *buf, | ^~~~~~~~~~~~~~ q6apm_audio_pkt.c:424:5: warning: no previous prototype for ‘audpkt_chk_and_update_physical_addr’ [-Wmissing-prototypes] 424 | int audpkt_chk_and_update_physical_addr(struct audio_gpr_pkt *gpr_pkt) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_audio_pkt.c:462:9: warning: no previous prototype for ‘audio_pkt_write’ [-Wmissing-prototypes] 462 | ssize_t audio_pkt_write(struct file *file, const char __user *buf, | ^~~~~~~~~~~~~~~ q6apm_lpass_dummy_dais.c:113:5: warning: no previous prototype for ‘q6apm_lpass_dummy_dais_init’ [-Wmissing-prototypes] 113 | int q6apm_lpass_dummy_dais_init(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ q6apm_lpass_dummy_dais.c:118:6: warning: no previous prototype for ‘q6apm_lpass_dummy_dais_exit’ [-Wmissing-prototypes] 118 | void q6apm_lpass_dummy_dais_exit(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ q6prm_audioreach.c:54:5: warning: no previous prototype for ‘q6prm_audio_send_cmd_sync’ [-Wmissing-prototypes] 54 | int q6prm_audio_send_cmd_sync(struct device *dev, gpr_device_t *gdev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ q6prm_audioreach.c:142:7: warning: no previous prototype for ‘q6prm_audioreach_alloc_cmd_pkt’ [-Wmissing-prototypes] 142 | void *q6prm_audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t token, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ audioreach_common.c:67:5: warning: no previous prototype for ‘qcs6490_snd_dp_jack_setup’ [-Wmissing-prototypes] 67 | int qcs6490_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, | ^~~~~~~~~~~~~~~~~~~~~~~~~ audioreach_common.c:91:5: warning: no previous prototype for ‘qcs6490_snd_wcd_jack_setup’ [-Wmissing-prototypes] 91 | int qcs6490_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ audioreach_common.c:145:6: warning: no previous prototype for ‘audioreach_get_link_name’ [-Wmissing-prototypes] 145 | void audioreach_get_link_name(const char **link_name, int dai_id) | ^~~~~~~~~~~~~~~~~~~~~~~~ audioreach_common.c:204:5: warning: no previous prototype for ‘qcs6490_snd_parse_of’ [-Wmissing-prototypes] 204 | int qcs6490_snd_parse_of(struct snd_soc_card *card) | ^~~~~~~~~~~~~~~~~~~~ Signed-off-by: Dmitry Baryshkov --- audioreach-driver/audioreach_common.c | 8 ++++---- audioreach-driver/q6apm_audio_mem.c | 8 ++++---- audioreach-driver/q6apm_audio_pkt.c | 18 +++++++++--------- audioreach-driver/q6apm_lpass_dummy_dais.c | 2 ++ audioreach-driver/q6prm_audioreach.c | 4 ++-- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/audioreach-driver/audioreach_common.c b/audioreach-driver/audioreach_common.c index 65172ac..b42ab22 100644 --- a/audioreach-driver/audioreach_common.c +++ b/audioreach-driver/audioreach_common.c @@ -64,7 +64,7 @@ static struct snd_soc_jack_pin qcs6490_headset_jack_pins[] = { }; -int qcs6490_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, +static int qcs6490_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *dp_jack, int dp_pcm_id) { struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); @@ -88,7 +88,7 @@ int qcs6490_snd_dp_jack_setup(struct snd_soc_pcm_runtime *rtd, return 0; } -int qcs6490_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, +static int qcs6490_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, struct snd_soc_jack *jack, bool *jack_setup) { struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); @@ -142,7 +142,7 @@ int qcs6490_snd_wcd_jack_setup(struct snd_soc_pcm_runtime *rtd, } -void audioreach_get_link_name(const char **link_name, int dai_id) +static void audioreach_get_link_name(const char **link_name, int dai_id) { switch (dai_id) { case WSA_CODEC_DMA_RX_0: @@ -201,7 +201,7 @@ void audioreach_get_link_name(const char **link_name, int dai_id) } } -int qcs6490_snd_parse_of(struct snd_soc_card *card) +static int qcs6490_snd_parse_of(struct snd_soc_card *card) { struct device_node *np; struct device_node *codec = NULL; diff --git a/audioreach-driver/q6apm_audio_mem.c b/audioreach-driver/q6apm_audio_mem.c index 42a51c3..188ff94 100644 --- a/audioreach-driver/q6apm_audio_mem.c +++ b/audioreach-driver/q6apm_audio_mem.c @@ -363,7 +363,7 @@ static int msm_audio_mem_map_buf(struct dma_buf *dma_buf, dma_addr_t *paddr, } -void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data) +static void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data) { struct msm_audio_fd_data *msm_audio_fd_data1 = NULL; @@ -381,7 +381,7 @@ void msm_audio_update_fd_list(struct msm_audio_fd_data *msm_audio_fd_data) mutex_unlock(&(msm_audio_mem_fd_list.list_mutex)); } -void msm_audio_delete_fd_entry(void *handle) +static void msm_audio_delete_fd_entry(void *handle) { struct msm_audio_fd_data *msm_audio_fd_data = NULL; struct list_head *ptr, *next; @@ -429,7 +429,7 @@ int msm_audio_get_phy_addr(int fd, dma_addr_t *paddr, size_t *pa_len) return status; } -int msm_audio_set_hyp_assign(int fd, bool assign) +static int msm_audio_set_hyp_assign(int fd, bool assign) { struct msm_audio_fd_data *msm_audio_fd_data = NULL; int status = -EINVAL; @@ -449,7 +449,7 @@ int msm_audio_set_hyp_assign(int fd, bool assign) return status; } -void msm_audio_get_handle(int fd, void **handle) +static void msm_audio_get_handle(int fd, void **handle) { struct msm_audio_fd_data *msm_audio_fd_data = NULL; diff --git a/audioreach-driver/q6apm_audio_pkt.c b/audioreach-driver/q6apm_audio_pkt.c index 87236bc..84f6206 100644 --- a/audioreach-driver/q6apm_audio_pkt.c +++ b/audioreach-driver/q6apm_audio_pkt.c @@ -179,7 +179,7 @@ static int fifo_pop(struct port_backup *backup) return 0; } -int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev, +static int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev, struct gpr_ibasic_rsp_result_t *result, struct mutex *cmd_lock, gpr_port_t *port, wait_queue_head_t *cmd_wait, struct gpr_pkt *pkt, uint32_t rsp_opcode) @@ -228,7 +228,7 @@ int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev, } -int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode) +static int q6apm_audio_send_cmd(struct q6apm_audio_pkt *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode) { gpr_device_t *gdev = apm->adev; @@ -273,7 +273,7 @@ static void *__q6apm_audio_alloc_pkt(int payload_size, uint32_t opcode, uint32_t return pkt; } -void *q6apm_audio_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token) +static void *q6apm_audio_alloc_apm_cmd_pkt(int pkt_size, uint32_t opcode, uint32_t token) { return __q6apm_audio_alloc_pkt(pkt_size, opcode, token, GPR_APM_MODULE_IID, APM_MODULE_INSTANCE_ID, true); @@ -302,7 +302,7 @@ bool q6apm_audio_is_adsp_ready(void) return false; } -void q6apm_audio_close_all(void) +static void q6apm_audio_close_all(void) { struct gpr_pkt *pkt; @@ -315,7 +315,7 @@ void q6apm_audio_close_all(void) kfree(pkt); } -int audio_pkt_open(struct inode *inode, struct file *file) +static int audio_pkt_open(struct inode *inode, struct file *file) { struct q6apm_audio_pkt *audpkt_dev = cdev_to_audpkt_dev(inode->i_cdev); struct device *dev = audpkt_dev->dev; @@ -337,7 +337,7 @@ int audio_pkt_open(struct inode *inode, struct file *file) * userspace client do a close() system call. All input arguments are * validated by the virtual file system before calling this function. */ -int audio_pkt_release(struct inode *inode, struct file *file) +static int audio_pkt_release(struct inode *inode, struct file *file) { struct q6apm_audio_pkt *audpkt_dev = cdev_to_audpkt_dev(inode->i_cdev); struct device *dev = audpkt_dev->dev; @@ -373,7 +373,7 @@ int audio_pkt_release(struct inode *inode, struct file *file) * userspace client do a read() system call. All input arguments are * validated by the virtual file system before calling this function. */ -ssize_t audio_pkt_read(struct file *file, char __user *buf, +static ssize_t audio_pkt_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct q6apm_audio_pkt *audpkt_dev = file->private_data; @@ -421,7 +421,7 @@ ssize_t audio_pkt_read(struct file *file, char __user *buf, * audpkt_update_physical_addr - Update physical address * audpkt_hdr: Pointer to the file structure. */ -int audpkt_chk_and_update_physical_addr(struct audio_gpr_pkt *gpr_pkt) +static int audpkt_chk_and_update_physical_addr(struct audio_gpr_pkt *gpr_pkt) { size_t pa_len = 0; dma_addr_t paddr = 0; @@ -459,7 +459,7 @@ int audpkt_chk_and_update_physical_addr(struct audio_gpr_pkt *gpr_pkt) * userspace client do a write() system call. All input arguments are * validated by the virtual file system before calling this function. */ -ssize_t audio_pkt_write(struct file *file, const char __user *buf, +static ssize_t audio_pkt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct q6apm_audio_pkt *audpkt_dev = file->private_data; diff --git a/audioreach-driver/q6apm_lpass_dummy_dais.c b/audioreach-driver/q6apm_lpass_dummy_dais.c index e01e58b..a94b1ee 100644 --- a/audioreach-driver/q6apm_lpass_dummy_dais.c +++ b/audioreach-driver/q6apm_lpass_dummy_dais.c @@ -20,6 +20,8 @@ #include "q6prm.h" #include "q6dsp-lpass-clocks.h" +#include "q6prm_audioreach.h" + #define AUDIOREACH_BE_PCM_BASE 16 struct q6apm_lpass_dai_data { diff --git a/audioreach-driver/q6prm_audioreach.c b/audioreach-driver/q6prm_audioreach.c index f7d9949..2181dd6 100644 --- a/audioreach-driver/q6prm_audioreach.c +++ b/audioreach-driver/q6prm_audioreach.c @@ -51,7 +51,7 @@ struct prm_cmd_release_rsc { struct audio_hw_clk_rel_cfg clock_id; } __packed; -int q6prm_audio_send_cmd_sync(struct device *dev, gpr_device_t *gdev, +static int q6prm_audio_send_cmd_sync(struct device *dev, gpr_device_t *gdev, struct gpr_ibasic_rsp_result_t *result, struct mutex *cmd_lock, gpr_port_t *port, wait_queue_head_t *cmd_wait, struct gpr_pkt *pkt, uint32_t rsp_opcode) @@ -139,7 +139,7 @@ static void *__q6prm_audioreach_alloc_pkt(int payload_size, uint32_t opcode, uin return pkt; } -void *q6prm_audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t token, +static void *q6prm_audioreach_alloc_cmd_pkt(int payload_size, uint32_t opcode, uint32_t token, uint32_t src_port, uint32_t dest_port) { return __q6prm_audioreach_alloc_pkt(payload_size, opcode, token, src_port, dest_port, true);