btfmcodec: Update usecase start
This change will notify client about usecase start if transport selected is bt advance audio. Change-Id: I5c85d32e0701cec4f36e0dda4110cc20338bf6a4 Signed-off-by: Balakrishna Godavarthi <quic_bgodavar@quicinc.com>
This commit is contained in:
@@ -527,6 +527,19 @@ int btfmcodec_hwep_prepare(struct btfmcodec_data *btfmcodec, uint32_t sampling_r
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int btfmcodec_notify_usecase_start(struct btfmcodec_data *btfmcodec,
|
||||||
|
uint8_t transport)
|
||||||
|
{
|
||||||
|
struct btfmcodec_char_device *btfmcodec_dev = btfmcodec->btfmcodec_dev;
|
||||||
|
struct btm_usecase_start_ind ind;
|
||||||
|
|
||||||
|
ind.opcode = BTM_BTFMCODEC_USECASE_START_IND;
|
||||||
|
ind.len = BTM_USECASE_START_IND_LEN;
|
||||||
|
ind.transport = transport;
|
||||||
|
return btfmcodec_dev_enqueue_pkt(btfmcodec_dev, &ind, (ind.len +
|
||||||
|
BTM_HEADER_LEN));
|
||||||
|
}
|
||||||
|
|
||||||
static int btfmcodec_dai_prepare(struct snd_pcm_substream *substream,
|
static int btfmcodec_dai_prepare(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *dai)
|
struct snd_soc_dai *dai)
|
||||||
{
|
{
|
||||||
@@ -550,6 +563,7 @@ static int btfmcodec_dai_prepare(struct snd_pcm_substream *substream,
|
|||||||
btfmcodec_get_current_transport(state) != BT_Connected) {
|
btfmcodec_get_current_transport(state) != BT_Connected) {
|
||||||
BTFMCODEC_WARN("cached required info as state is:%s",
|
BTFMCODEC_WARN("cached required info as state is:%s",
|
||||||
coverttostring(btfmcodec_get_current_transport(state)));
|
coverttostring(btfmcodec_get_current_transport(state)));
|
||||||
|
btfmcodec_notify_usecase_start(btfmcodec, BTADV);
|
||||||
} else {
|
} else {
|
||||||
ret = btfmcodec_hwep_prepare(btfmcodec, sampling_rate, direction, id);
|
ret = btfmcodec_hwep_prepare(btfmcodec, sampling_rate, direction, id);
|
||||||
/* if (ret >= 0) {
|
/* if (ret >= 0) {
|
||||||
|
@@ -54,6 +54,9 @@ struct btm_ctrl_pkt {
|
|||||||
#define BTM_LOG_LVL_IND_LEN 1
|
#define BTM_LOG_LVL_IND_LEN 1
|
||||||
#define BTM_ADSP_STATE_IND_LEN 4
|
#define BTM_ADSP_STATE_IND_LEN 4
|
||||||
|
|
||||||
|
#define BTM_BTFMCODEC_USECASE_START_IND 0x58000008
|
||||||
|
#define BTM_USECASE_START_IND_LEN 1
|
||||||
|
|
||||||
enum rx_status {
|
enum rx_status {
|
||||||
/* Waiting for response */
|
/* Waiting for response */
|
||||||
BTM_WAITING_RSP,
|
BTM_WAITING_RSP,
|
||||||
@@ -91,6 +94,12 @@ struct btm_master_config_req {
|
|||||||
}__attribute__((packed));
|
}__attribute__((packed));
|
||||||
|
|
||||||
|
|
||||||
|
struct btm_usecase_start_ind {
|
||||||
|
btm_opcode opcode;
|
||||||
|
uint32_t len;
|
||||||
|
uint8_t transport;
|
||||||
|
} __packed;
|
||||||
|
|
||||||
struct btm_master_shutdown_req {
|
struct btm_master_shutdown_req {
|
||||||
btm_opcode opcode;
|
btm_opcode opcode;
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
|
Reference in New Issue
Block a user