Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 227bc34f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm: qdsp6v2: Update support for dolby license validation"

parents 92e19dbe 6b31c7d6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ struct dolby_param_data {
	int32_t __user *data;
};

struct dolby_param_license {
	int32_t dmid;
	int32_t license_key;
};

#define SNDRV_DEVDEP_DAP_IOCTL_SET_PARAM\
		_IOWR('U', 0x10, struct dolby_param_data)
#define SNDRV_DEVDEP_DAP_IOCTL_GET_PARAM\
@@ -30,7 +35,7 @@ struct dolby_param_data {
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_COMMAND\
		_IOWR('U', 0x13, struct dolby_param_data)
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE\
		_IOWR('U', 0x14, void *)
		_IOWR('U', 0x14, struct dolby_param_license)
#define SNDRV_DEVDEP_DAP_IOCTL_GET_VISUALIZER\
		_IOR('U', 0x15, struct dolby_param_data)
#endif
+1 −0
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ config SND_SOC_MSM8X16
	select QTI_PP
	select DTS_SRS_TM
	select DOLBY_DAP
	select DOLBY_DS2
	select MSM_QDSP6_APRV3
	select MSM_QDSP6V2_CODECS
	select SND_SOC_CPE
+17 −11
Original line number Diff line number Diff line
@@ -1673,9 +1673,12 @@ end:

int msm_ds2_dap_set_security_control(u32 cmd, void *arg)
{
	int *manufacturer_id = ((int *)arg);
	pr_debug("%s: manufacturer_id %d\n", __func__, *manufacturer_id);
	core_set_dolby_manufacturer_id(*manufacturer_id);
	struct dolby_param_license *dolby_license =
				 ((struct dolby_param_license *)arg);
	pr_err("%s: dmid %d license key %d\n", __func__,
		dolby_license->dmid, dolby_license->license_key);
	core_set_dolby_manufacturer_id(dolby_license->dmid);
	core_set_license(dolby_license->license_key, DOLBY_DS1_LICENSE_ID);
	return 0;
}

@@ -1775,14 +1778,14 @@ int msm_ds2_dap_ioctl(struct snd_hwdep *hw, struct file *file,
		break;
	}
	case SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE: {
		int manufacturer_id = 0;
		if (copy_from_user((void *)&manufacturer_id,
			arg, sizeof(manufacturer_id))) {
		struct dolby_param_license dolby_license;
		if (copy_from_user((void *)&dolby_license, (void *)arg,
				sizeof(struct dolby_param_license))) {
			pr_err("%s: Copy from user failed\n", __func__);
			ret = -EFAULT;
			goto end;
		}
		ret = msm_ds2_dap_ioctl_shared(hw, file, cmd, &manufacturer_id);
		ret = msm_ds2_dap_ioctl_shared(hw, file, cmd, &dolby_license);
		break;
	}
	case SNDRV_DEVDEP_DAP_IOCTL_GET_PARAM:
@@ -1886,15 +1889,18 @@ handle_get_ioctl:
		break;
	}
	case SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE32: {
		int manufacturer_id = 0;
		struct dolby_param_license32 dolby_license32;
		struct dolby_param_license dolby_license;
		cmd = SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE;
		if (copy_from_user((void *)&manufacturer_id,
			arg, sizeof(manufacturer_id))) {
		if (copy_from_user((void *)&dolby_license32, (void *)arg,
			sizeof(struct dolby_param_license32))) {
			pr_err("%s: Copy from user failed\n", __func__);
			ret = -EFAULT;
			goto end;
		}
		ret = msm_ds2_dap_ioctl_shared(hw, file, cmd, &manufacturer_id);
		dolby_license.dmid = dolby_license32.dmid;
		dolby_license.license_key = dolby_license32.license_key;
		ret = msm_ds2_dap_ioctl_shared(hw, file, cmd, &dolby_license);
		break;
	}
	default:
+7 −1
Original line number Diff line number Diff line
@@ -27,6 +27,12 @@ struct dolby_param_data32 {
	compat_uptr_t data;
};

struct dolby_param_license32 {
	compat_uptr_t dmid;
	compat_uptr_t license_key;
};


#define SNDRV_DEVDEP_DAP_IOCTL_SET_PARAM32\
		_IOWR('U', 0x10, struct dolby_param_data32)
#define SNDRV_DEVDEP_DAP_IOCTL_GET_PARAM32\
@@ -34,7 +40,7 @@ struct dolby_param_data32 {
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_COMMAND32\
		_IOWR('U', 0x13, struct dolby_param_data32)
#define SNDRV_DEVDEP_DAP_IOCTL_DAP_LICENSE32\
		_IOWR('U', 0x14, compat_uptr_t)
		_IOWR('U', 0x14, struct dolby_param_license32)
#define SNDRV_DEVDEP_DAP_IOCTL_GET_VISUALIZER32\
		_IOR('U', 0x15, struct dolby_param_data32)
#endif
+3 −0
Original line number Diff line number Diff line
@@ -221,6 +221,9 @@ int32_t core_set_license(uint32_t key, uint32_t module_id)
				__func__, metainfo->nKey, key);
		rc = -EINVAL;
		goto unlock2;
	} else if (key == 0) {
		pr_err("%s: metainfo key is %d a invalid key", __func__, key);
		goto unlock2;
	}

	paycket_size = sizeof(struct avcs_cmd_set_license) +