dsp: audio_ion: Add 32 bit userspace ioctl support
Add ioctl support for 32 bit userspace on 64bit platform. Change-Id: I208c452993d10d1901eb926dcd4e4a0a1747eaea Signed-off-by: Srinivas Marka <quic_smarka@quicinc.com>
This commit is contained in:
parent
465958d84d
commit
098bc9ac84
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
@ -19,6 +19,7 @@
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/ioctl.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/device.h>
|
||||
@ -779,6 +780,15 @@ static long msm_audio_ion_ioctl(struct file *file, unsigned int ioctl_num,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* support of 32bit userspace on 64bit platforms */
|
||||
#ifdef CONFIG_COMPAT
|
||||
static long msm_audio_ion_ioctl_compat(struct file *file, unsigned int cmd,
|
||||
unsigned long arg)
|
||||
{
|
||||
return msm_audio_ion_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct of_device_id msm_audio_ion_dt_match[] = {
|
||||
{ .compatible = "qcom,msm-audio-ion" },
|
||||
{ .compatible = "qcom,msm-audio-ion-cma"},
|
||||
@ -791,6 +801,9 @@ static const struct file_operations msm_audio_ion_fops = {
|
||||
.open = msm_audio_ion_open,
|
||||
.release = msm_audio_ion_release,
|
||||
.unlocked_ioctl = msm_audio_ion_ioctl,
|
||||
#ifdef CONFIG_COMPAT
|
||||
.compat_ioctl = msm_audio_ion_ioctl_compat,
|
||||
#endif
|
||||
};
|
||||
|
||||
static int msm_audio_ion_reg_chrdev(struct msm_audio_ion_private *ion_data)
|
||||
|
Loading…
Reference in New Issue
Block a user