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

Commit 640762f0 authored by Chaithanya Krishna Bacharaju's avatar Chaithanya Krishna Bacharaju Committed by Revathi Uddaraju
Browse files

uapi: lsm_params: Add interface to disable polling



Polling needs to be disabled when LSM connects to ADM.
Add interface to enable or disable polling through
set_params. Add support to set port.
Also move LSM_PARAM_MAX macro definition from uapi
to required source files.

Change-Id: If027418a6d8a1ea48dcb6a0c146f68e7dd7a2664
Signed-off-by: default avatarChaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Signed-off-by: default avatarRevathi Uddaraju <revathiu@codeaurora.org>
parent ef3068bf
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
#ifndef _UAPI_LSM_PARAMS_H__
#define _UAPI_LSM_PARAMS_H__

#define LSM_POLLING_ENABLE_SUPPORT

#include <linux/types.h>
#include <sound/asound.h>

@@ -43,8 +45,7 @@ enum LSM_PARAM_TYPE {
	LSM_REG_SND_MODEL,
	LSM_DEREG_SND_MODEL,
	LSM_CUSTOM_PARAMS,
	/* driver ioctl will parse only so many params */
	LSM_PARAMS_MAX,
	LSM_POLLING_ENABLE,
};

/*
@@ -75,6 +76,14 @@ struct snd_lsm_gain {
	__u16 gain;
};

/*
 * Data for LSM_POLLING_ENABLE param_type
 * @poll_en: Polling enable or disable
 */
struct snd_lsm_poll_enable {
	bool poll_en;
};


struct snd_lsm_sound_model_v2 {
	__u8 __user *data;
@@ -100,6 +109,7 @@ struct snd_lsm_detection_params {
	enum lsm_detection_mode detect_mode;
	__u8 num_confidence_levels;
	bool detect_failure;
	bool poll_enable;
};

/*
@@ -171,5 +181,6 @@ struct snd_lsm_output_format_cfg {
					struct snd_lsm_module_params)
#define SNDRV_LSM_OUT_FORMAT_CFG _IOW('U', 0x0C, \
				      struct snd_lsm_output_format_cfg)
#define SNDRV_LSM_SET_PORT	_IO('U', 0x0D)

#endif
+6 −0
Original line number Diff line number Diff line
@@ -43,6 +43,12 @@

#define MSM_CPE_LAB_THREAD_TIMEOUT (3 * (HZ/10))

/*
 * Driver ioctl will parse only so many params
 * size of LSM_PARAMS_MAX is last LSM_PARAM_TYPE + 1
 */
#define LSM_PARAMS_MAX (LSM_POLLING_ENABLE + 1)

#define MSM_CPE_LSM_GRAB_LOCK(lock, name)		\
{						\
	pr_debug("%s: %s lock acquire\n",	\
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@
#define LAB_BUFFER_ALLOC 1
#define LAB_BUFFER_DEALLOC 0

/*
 * Driver ioctl will parse only so many params
 * size of LSM_PARAMS_MAX is last LSM_PARAM_TYPE + 1
 */
#define LSM_PARAMS_MAX (LSM_POLLING_ENABLE + 1)

static struct snd_pcm_hardware msm_pcm_hardware_capture = {
	.info =                 (SNDRV_PCM_INFO_MMAP |
				SNDRV_PCM_INFO_BLOCK_TRANSFER |