aboutsummaryrefslogtreecommitdiff
path: root/techpack/audio/include/dsp/apr_mius.h
blob: 8a372ffe65a21b9eaa614f3d9990962ff660d854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <linux/types.h>
#include <dsp/apr_audio-v2.h>
#include <mius/mius_data_io.h>
#include <linux/delay.h>

#define MIUS_SET_PARAMS_SIZE			114
#define MIUS_ULTRASOUND_MODULE_TX			0x0F010201
#define MIUS_ULTRASOUND_MODULE_RX			0x0FF10202
#define MI_ULTRASOUND_OPCODE				0x0FF10208

/* This need to be updated for all platforms */
#define MIUS_PORT_ID				SLIMBUS_2_TX

/** Sequence of MI Ultrasound module parameters */
struct afe_mi_ultrasound_set_params_t {
	uint32_t  payload[MIUS_SET_PARAMS_SIZE];
} __packed;

/** Sequence of MI Ultrasound module parameters */

/** Elliptic APR public  */

int32_t mi_ultrasound_apr_set_parameter(int32_t port_id, uint32_t param_id,
	u8 *user_params, int32_t length);

int32_t mius_process_apr_payload(uint32_t *payload);

int mius_notify_gain_change_msg(int component_id, int gaindb);

typedef struct afe_mi_ultrasound_state {
	atomic_t us_apr_state;
	void **ptr_apr;
	atomic_t *ptr_status;
	atomic_t *ptr_state;
	wait_queue_head_t *ptr_wait;
	int timeout_ms;
} afe_mi_ultrasound_state_t;

extern afe_mi_ultrasound_state_t mius_afe;