Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions audioreach-driver/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
obj-m += audioreach_driver.o

audioreach_driver-objs := \
q6apm_audio_mem.o \
q6apm_audio_pkt.o \
q6apm_lpass_dummy_dais.o \
q6prm_audioreach_clock.o \
q6prm_audioreach.o \
audioreach_common.o
audioreach_driver-objs = q6apm_audio_mem.o

ifdef VENDOR_QCOM
audioreach_driver-objs += q6apm_lpass_dummy_dais.o
audioreach_driver-objs += q6prm_audioreach_clock.o
audioreach_driver-objs += q6prm_audioreach.o
audioreach_driver-objs += audioreach_common.o
Copy link
Contributor

@quic-aditrath quic-aditrath Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add q6apm_audio_pkt.o object file as well for qcom vendor condition.

ccflags-y += -DQCOM_HYP_ASSIGN
else
audioreach_driver-objs += q6apm_audio_pkt_rpmsg.o
endif

ccflags-y += -I$(KERNEL_SRC)/sound/soc/qcom/qdsp6 -I$(KERNEL_SRC)/sound/soc/qcom -I$(src)/../include/uapi
13 changes: 12 additions & 1 deletion audioreach-driver/q6apm_audio_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#define MINOR_NUMBER_COUNT 1
#define QCOM_SMMU_SID_MASK 0xF

#define QCOM_HYP_ASSIGN

struct msm_audio_mem_private {
bool smmu_enabled;
struct device *cb_dev;
Expand Down Expand Up @@ -429,6 +431,7 @@ int msm_audio_get_phy_addr(int fd, dma_addr_t *paddr, size_t *pa_len)
return status;
}

#ifdef QCOM_HYP_ASSIGN
static int msm_audio_set_hyp_assign(int fd, bool assign)
{
struct msm_audio_fd_data *msm_audio_fd_data = NULL;
Expand All @@ -448,6 +451,7 @@ static int msm_audio_set_hyp_assign(int fd, bool assign)
mutex_unlock(&(msm_audio_mem_fd_list.list_mutex));
return status;
}
#endif

static void msm_audio_get_handle(int fd, void **handle)
{
Expand Down Expand Up @@ -550,6 +554,7 @@ static int msm_audio_mem_free(struct dma_buf *dma_buf, struct msm_audio_mem_priv
return 0;
}

#ifdef QCOM_HYP_ASSIGN
static int msm_audio_hyp_unassign(struct msm_audio_fd_data *msm_audio_fd_data)
{
int ret = 0;
Expand All @@ -568,6 +573,7 @@ static int msm_audio_hyp_unassign(struct msm_audio_fd_data *msm_audio_fd_data)
}
return ret;
}
#endif

/**
* msm_audio_mem_crash_handler -
Expand All @@ -588,8 +594,10 @@ void msm_audio_mem_crash_handler(void)
handle = msm_audio_fd_data->handle;
mem_data = dev_get_drvdata(msm_audio_fd_data->dev);
/* clean if CMA was used*/
#ifdef QCOM_HYP_ASSIGN
if (msm_audio_fd_data->hyp_assign)
msm_audio_hyp_unassign(msm_audio_fd_data);
#endif
if (handle)
msm_audio_mem_free(handle, mem_data);
}
Expand Down Expand Up @@ -678,6 +686,7 @@ static long msm_audio_mem_ioctl(struct file *file, unsigned int ioctl_num,
}
msm_audio_delete_fd_entry(mem_handle);
break;
#ifdef QCOM_HYP_ASSIGN
case IOCTL_MAP_HYP_ASSIGN:
ret = msm_audio_get_phy_addr((int)ioctl_param, &paddr, &pa_len);
if (ret < 0) {
Expand Down Expand Up @@ -710,6 +719,7 @@ static long msm_audio_mem_ioctl(struct file *file, unsigned int ioctl_num,
pr_debug("%s: qcom scm unassign success\n", __func__);
msm_audio_set_hyp_assign((int)ioctl_param, false);
break;
#endif
default:
pr_err_ratelimited("%s Entered default. Invalid ioctl num %u\n",
__func__, ioctl_num);
Expand Down Expand Up @@ -859,13 +869,14 @@ static int q6apm_audio_mem_probe(struct platform_device *pdev)
return 0;
}

static void q6apm_audio_mem_remove(struct platform_device *pdev)
static int q6apm_audio_mem_remove(struct platform_device *pdev)
{
struct msm_audio_mem_private *mem_data = dev_get_drvdata(&pdev->dev);

mem_data->smmu_enabled = false;
mem_data->device_status = 0;
msm_audio_mem_unreg_chrdev(mem_data);
return 0;
}

#ifdef CONFIG_OF
Expand Down
Loading
Loading