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. Change-Id: If027418a6d8a1ea48dcb6a0c146f68e7dd7a2664 Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org> Signed-off-by: Revathi Uddaraju <revathiu@codeaurora.org>
This commit is contained in:
parent
958e36a73f
commit
dc9fbad38f
7 changed files with 33 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2016, Linux Foundation. All rights reserved.
|
* Copyright (c) 2013-2017, Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -162,7 +162,7 @@ struct wcd_cpe_lsm_ops {
|
||||||
int (*lsm_set_one_param)(void *core_handle,
|
int (*lsm_set_one_param)(void *core_handle,
|
||||||
struct cpe_lsm_session *session,
|
struct cpe_lsm_session *session,
|
||||||
struct lsm_params_info *p_info,
|
struct lsm_params_info *p_info,
|
||||||
void *data, enum LSM_PARAM_TYPE param_type);
|
void *data, uint32_t param_type);
|
||||||
void (*lsm_get_snd_model_offset)
|
void (*lsm_get_snd_model_offset)
|
||||||
(void *core_handle, struct cpe_lsm_session *,
|
(void *core_handle, struct cpe_lsm_session *,
|
||||||
size_t *offset);
|
size_t *offset);
|
||||||
|
|
|
@ -274,7 +274,7 @@ int q6lsm_read(struct lsm_client *client, struct lsm_cmd_read *read);
|
||||||
int q6lsm_lab_buffer_alloc(struct lsm_client *client, bool alloc);
|
int q6lsm_lab_buffer_alloc(struct lsm_client *client, bool alloc);
|
||||||
int q6lsm_set_one_param(struct lsm_client *client,
|
int q6lsm_set_one_param(struct lsm_client *client,
|
||||||
struct lsm_params_info *p_info, void *data,
|
struct lsm_params_info *p_info, void *data,
|
||||||
enum LSM_PARAM_TYPE param_type);
|
uint32_t param_type);
|
||||||
void q6lsm_sm_set_param_data(struct lsm_client *client,
|
void q6lsm_sm_set_param_data(struct lsm_client *client,
|
||||||
struct lsm_params_info *p_info,
|
struct lsm_params_info *p_info,
|
||||||
size_t *offset);
|
size_t *offset);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _UAPI_LSM_PARAMS_H__
|
#ifndef _UAPI_LSM_PARAMS_H__
|
||||||
#define _UAPI_LSM_PARAMS_H__
|
#define _UAPI_LSM_PARAMS_H__
|
||||||
|
|
||||||
|
#define LSM_POLLING_ENABLE_SUPPORT
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <sound/asound.h>
|
#include <sound/asound.h>
|
||||||
|
|
||||||
|
@ -18,6 +20,16 @@
|
||||||
#define LSM_OUT_TRANSFER_MODE_RT (0)
|
#define LSM_OUT_TRANSFER_MODE_RT (0)
|
||||||
#define LSM_OUT_TRANSFER_MODE_FTRT (1)
|
#define LSM_OUT_TRANSFER_MODE_FTRT (1)
|
||||||
|
|
||||||
|
#define LSM_ENDPOINT_DETECT_THRESHOLD (0)
|
||||||
|
#define LSM_OPERATION_MODE (1)
|
||||||
|
#define LSM_GAIN (2)
|
||||||
|
#define LSM_MIN_CONFIDENCE_LEVELS (3)
|
||||||
|
#define LSM_REG_SND_MODEL (4)
|
||||||
|
#define LSM_DEREG_SND_MODEL (5)
|
||||||
|
#define LSM_CUSTOM_PARAMS (6)
|
||||||
|
#define LSM_POLLING_ENABLE (7)
|
||||||
|
#define LSM_PARAMS_MAX (LSM_POLLING_ENABLE + 1)
|
||||||
|
|
||||||
enum lsm_app_id {
|
enum lsm_app_id {
|
||||||
LSM_VOICE_WAKEUP_APP_ID = 1,
|
LSM_VOICE_WAKEUP_APP_ID = 1,
|
||||||
LSM_VOICE_WAKEUP_APP_ID_V2 = 2,
|
LSM_VOICE_WAKEUP_APP_ID_V2 = 2,
|
||||||
|
@ -35,18 +47,6 @@ enum lsm_vw_status {
|
||||||
LSM_VOICE_WAKEUP_STATUS_REJECTED
|
LSM_VOICE_WAKEUP_STATUS_REJECTED
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LSM_PARAM_TYPE {
|
|
||||||
LSM_ENDPOINT_DETECT_THRESHOLD = 0,
|
|
||||||
LSM_OPERATION_MODE,
|
|
||||||
LSM_GAIN,
|
|
||||||
LSM_MIN_CONFIDENCE_LEVELS,
|
|
||||||
LSM_REG_SND_MODEL,
|
|
||||||
LSM_DEREG_SND_MODEL,
|
|
||||||
LSM_CUSTOM_PARAMS,
|
|
||||||
/* driver ioctl will parse only so many params */
|
|
||||||
LSM_PARAMS_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data for LSM_ENDPOINT_DETECT_THRESHOLD param_type
|
* Data for LSM_ENDPOINT_DETECT_THRESHOLD param_type
|
||||||
* @epd_begin: Begin threshold
|
* @epd_begin: Begin threshold
|
||||||
|
@ -75,6 +75,14 @@ struct snd_lsm_gain {
|
||||||
__u16 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 {
|
struct snd_lsm_sound_model_v2 {
|
||||||
__u8 __user *data;
|
__u8 __user *data;
|
||||||
|
@ -100,6 +108,7 @@ struct snd_lsm_detection_params {
|
||||||
enum lsm_detection_mode detect_mode;
|
enum lsm_detection_mode detect_mode;
|
||||||
__u8 num_confidence_levels;
|
__u8 num_confidence_levels;
|
||||||
bool detect_failure;
|
bool detect_failure;
|
||||||
|
bool poll_enable;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -122,7 +131,7 @@ struct lsm_params_info {
|
||||||
__u32 param_id;
|
__u32 param_id;
|
||||||
__u32 param_size;
|
__u32 param_size;
|
||||||
__u8 __user *param_data;
|
__u8 __user *param_data;
|
||||||
enum LSM_PARAM_TYPE param_type;
|
uint32_t param_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -171,5 +180,6 @@ struct snd_lsm_output_format_cfg {
|
||||||
struct snd_lsm_module_params)
|
struct snd_lsm_module_params)
|
||||||
#define SNDRV_LSM_OUT_FORMAT_CFG _IOW('U', 0x0C, \
|
#define SNDRV_LSM_OUT_FORMAT_CFG _IOW('U', 0x0C, \
|
||||||
struct snd_lsm_output_format_cfg)
|
struct snd_lsm_output_format_cfg)
|
||||||
|
#define SNDRV_LSM_SET_PORT _IO('U', 0x0D)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3029,7 +3029,7 @@ err_ret:
|
||||||
|
|
||||||
static int wcd_cpe_set_one_param(void *core_handle,
|
static int wcd_cpe_set_one_param(void *core_handle,
|
||||||
struct cpe_lsm_session *session, struct lsm_params_info *p_info,
|
struct cpe_lsm_session *session, struct lsm_params_info *p_info,
|
||||||
void *data, enum LSM_PARAM_TYPE param_type)
|
void *data, uint32_t param_type)
|
||||||
{
|
{
|
||||||
struct wcd_cpe_core *core = core_handle;
|
struct wcd_cpe_core *core = core_handle;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
@ -3081,13 +3081,13 @@ static int wcd_cpe_set_one_param(void *core_handle,
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pr_err("%s: wrong param_type 0x%x\n",
|
pr_err("%s: wrong param_type 0x%x\n",
|
||||||
__func__, p_info->param_type);
|
__func__, param_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
dev_err(core->dev,
|
dev_err(core->dev,
|
||||||
"%s: send_param(%d) failed, err %d\n",
|
"%s: send_param(%d) failed, err %d\n",
|
||||||
__func__, p_info->param_type, rc);
|
__func__, param_type, rc);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2013-2016, Linux Foundation. All rights reserved.
|
* Copyright (c) 2013-2017, Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -2297,7 +2297,7 @@ struct lsm_params_info_32 {
|
||||||
u32 param_id;
|
u32 param_id;
|
||||||
u32 param_size;
|
u32 param_size;
|
||||||
compat_uptr_t param_data;
|
compat_uptr_t param_data;
|
||||||
enum LSM_PARAM_TYPE param_type;
|
uint32_t param_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct snd_lsm_module_params_32 {
|
struct snd_lsm_module_params_32 {
|
||||||
|
|
|
@ -1074,7 +1074,7 @@ struct lsm_params_info_32 {
|
||||||
u32 param_id;
|
u32 param_id;
|
||||||
u32 param_size;
|
u32 param_size;
|
||||||
compat_uptr_t param_data;
|
compat_uptr_t param_data;
|
||||||
enum LSM_PARAM_TYPE param_type;
|
uint32_t param_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct snd_lsm_module_params_32 {
|
struct snd_lsm_module_params_32 {
|
||||||
|
|
|
@ -1390,7 +1390,7 @@ static int q6lsm_send_param_gain(
|
||||||
|
|
||||||
int q6lsm_set_one_param(struct lsm_client *client,
|
int q6lsm_set_one_param(struct lsm_client *client,
|
||||||
struct lsm_params_info *p_info, void *data,
|
struct lsm_params_info *p_info, void *data,
|
||||||
enum LSM_PARAM_TYPE param_type)
|
uint32_t param_type)
|
||||||
{
|
{
|
||||||
int rc = 0, pkt_sz;
|
int rc = 0, pkt_sz;
|
||||||
struct lsm_module_param_ids ids;
|
struct lsm_module_param_ids ids;
|
||||||
|
|
Loading…
Add table
Reference in a new issue