123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620 |
- #ifndef __AUDIO_PRM_H__
- #define __AUDIO_PRM_H__
- #define PRM_MODULE_INSTANCE_ID 0x00000002
- struct prm_rsp_req_rel_hw_rsc {
-
- uint32_t param_id;
-
- uint32_t status;
- };
- struct clk_cfg {
-
- uint32_t clk_id;
-
- uint32_t clk_freq_in_hz;
-
- uint32_t clk_attri;
-
- uint32_t clk_root;
- };
- struct hw_rsc_clk_req_rel_rsp {
-
- uint32_t num_failures;
- };
- struct clock_status {
-
- uint32_t clock_id;
-
- uint32_t status;
- };
- typedef struct apm_cmd_header_t
- {
- uint32_t payload_address_lsw;
-
- uint32_t payload_address_msw;
-
- uint32_t mem_map_handle;
-
- uint32_t payload_size;
-
- }apm_cmd_header_t;
- typedef struct apm_module_param_data_t
- {
- uint32_t module_instance_id;
-
- uint32_t param_id;
-
- uint32_t param_size;
-
- uint32_t error_code;
-
- }apm_module_param_data_t;
- typedef struct audio_hw_clk_cfg_req_param_t
- {
- uint32_t num_clock_id;
-
- }audio_hw_clk_cfg_req_param_t;
- typedef struct audio_hw_clk_cfg_t
- {
- uint32_t clock_id;
-
- uint32_t clock_freq;
-
- uint32_t clock_attri;
-
- uint32_t clock_root;
-
- }audio_hw_clk_cfg_t;
- typedef struct audio_hw_clk_rel_cfg_t
- {
- uint32_t clock_id;
- }audio_hw_clk_rel_cfg_t;
- #define MAX_AUD_HW_CLK_NUM_REQ 1
- typedef struct prm_cmd_request_rsc_t
- {
- apm_cmd_header_t payload_header;
- apm_module_param_data_t module_payload_0;
- audio_hw_clk_cfg_req_param_t num_clk_id_t;
- audio_hw_clk_cfg_t clock_ids_t[MAX_AUD_HW_CLK_NUM_REQ];
- }prm_cmd_request_rsc_t;
- typedef struct prm_cmd_release_rsc_t
- {
- apm_cmd_header_t payload_header;
- apm_module_param_data_t module_payload_0;
- audio_hw_clk_cfg_req_param_t num_clk_id_t;
- audio_hw_clk_rel_cfg_t clock_ids_t[MAX_AUD_HW_CLK_NUM_REQ];
- }prm_cmd_release_rsc_t;
- typedef struct prm_cmd_request_hw_core_t
- {
- apm_cmd_header_t payload_header;
- apm_module_param_data_t module_payload_0;
- uint32_t hw_core_id;
- }prm_cmd_request_hw_core_t;
- #define LPR_CPU_SS_SLEEP_DISABLED 1
- struct prm_cpu_lpr_request_t {
- apm_cmd_header_t payload_header;
- apm_module_param_data_t module_payload_0;
- uint32_t lpr_state;
- };
- #define PRM_CMD_REQUEST_HW_RSC 0x0100100F
- #define PRM_CMD_RELEASE_HW_RSC 0x01001010
- #define PRM_CMD_RSP_REQUEST_HW_RSC 0x02001002
- #define PRM_CMD_RSP_RELEASE_HW_RSC 0x02001003
- #define PARAM_ID_RSC_AUDIO_HW_CLK 0x0800102C
- #define PARAM_ID_RSC_CPU_LPR 0x08001A6E
- #define PARAM_ID_RSC_LPASS_CORE 0x0800102B
- #define PARAM_ID_RSC_HW_CORE 0x08001032
- #define PARAM_ID_RSC_VOTE_AGAINST_ISLAND 0x0800131D
- #define HW_RSC_ID_AUDIO_HW_CLK 0x0800102C
- #define MAX_EARPA_REG 2
- #define MAX_EARPA_CDC_DUTY_CYC_OPERATION 2
- typedef struct audio_hw_codec_op_info_t {
- uint32_t hw_codec_op_id;
- uint32_t hw_codec_op_value;
- } audio_hw_codec_op_info_t;
- typedef struct audio_hw_codec_reg_op_info_t {
- uint32_t hw_codec_reg_id;
- uint32_t hw_codec_reg_addr_msw;
- uint32_t hw_codec_reg_addr_lsw;
- uint32_t num_ops;
- audio_hw_codec_op_info_t hw_codec_op[MAX_EARPA_REG];
- } audio_hw_codec_reg_op_info_t;
- typedef struct audio_hw_codec_reg_info_t {
- uint32_t num_reg_info_t;
- audio_hw_codec_reg_op_info_t hw_codec_reg[MAX_EARPA_REG];
- } audio_hw_codec_reg_info_t;
- typedef struct prm_cmd_request_cdc_duty_cycling_t {
- apm_cmd_header_t payload_header;
- apm_module_param_data_t module_payload_0;
- audio_hw_codec_reg_info_t hw_codec_reg_info_t;
- } prm_cmd_request_cdc_duty_cycling_t;
- #define DIG_MUTE_ENABLE 0x34
- #define DIG_MUTE_DISABLE 0x24
- struct lpass_swr_ear_pa_dep_cfg_t {
- uint32_t ear_pa_enable_pkd_reg_addr;
- uint32_t ear_pa_disable_pkd_reg_addr;
- } __packed;
- struct lpass_swr_ear_pa_reg_cfg_t {
- uint32_t lpass_cdc_rx0_rx_path_ctl_phy_addr;
- uint32_t lpass_wr_fifo_reg_phy_addr;
- } __packed;
- struct prm_earpa_hw_intf_config {
- struct lpass_swr_ear_pa_reg_cfg_t ear_pa_hw_reg_cfg;
- struct lpass_swr_ear_pa_dep_cfg_t ear_pa_pkd_cfg;
- uint32_t ear_pa_pkd_reg_addr;
- const char *backend_used;
- } __packed;
- #define PARAM_ID_RSC_HW_CODEC_REG_INFO 0x0800131B
- #define HW_CODEC_DIG_REG_ID_MUTE_CTRL 0x1
- #define HW_CODEC_OP_DIG_MUTE_ENABLE 0x1
- #define HW_CODEC_OP_DIG_MUTE_DISABLE 0x2
- #define HW_CODEC_ANALOG_REG_ID_CMD_FIFO_WRITE 0x2
- #define HW_CODEC_OP_ANA_PGA_ENABLE 0x3
- #define HW_CODEC_OP_ANA_PGA_DISABLE 0x4
- #define OSR_CLOCK_12_P288_MHZ 0xBB8000
- #define OSR_CLOCK_11_P2896_MHZ 0xAC4400
- #define OSR_CLOCK_9_P600_MHZ 0x927C00
- #define OSR_CLOCK_8_P192_MHZ 0x7D0000
- #define OSR_CLOCK_6_P144_MHZ 0x5DC000
- #define OSR_CLOCK_4_P096_MHZ 0x3E8000
- #define OSR_CLOCK_3_P072_MHZ 0x2EE000
- #define OSR_CLOCK_2_P048_MHZ 0x1F4000
- #define OSR_CLOCK_1_P536_MHZ 0x177000
- #define OSR_CLOCK_1_P024_MHZ 0xFA000
- #define OSR_CLOCK_768_kHZ 0xBB800
- #define OSR_CLOCK_512_kHZ 0x7D000
- #define OSR_CLOCK_DISABLE 0x0
- #define IBIT_CLOCK_12_P288_MHZ 0xBB8000
- #define IBIT_CLOCK_11_P2896_MHZ 0xAC4400
- #define IBIT_CLOCK_8_P192_MHZ 0x7D0000
- #define IBIT_CLOCK_6_P144_MHZ 0x5DC000
- #define IBIT_CLOCK_4_P096_MHZ 0x3E8000
- #define IBIT_CLOCK_3_P072_MHZ 0x2EE000
- #define IBIT_CLOCK_2_P8224_MHZ 0x2b1100
- #define IBIT_CLOCK_2_P048_MHZ 0x1F4000
- #define IBIT_CLOCK_1_P536_MHZ 0x177000
- #define IBIT_CLOCK_1_P4112_MHZ 0x158880
- #define IBIT_CLOCK_1_P024_MHZ 0xFA000
- #define IBIT_CLOCK_768_KHZ 0xBB800
- #define IBIT_CLOCK_512_KHZ 0x7D000
- #define IBIT_CLOCK_256_KHZ 0x3E800
- #define IBIT_CLOCK_DISABLE 0x0
- #define CLOCK_ID_PRI_MI2S_IBIT 0x100
- #define CLOCK_ID_PRI_MI2S_EBIT 0x101
- #define CLOCK_ID_SEC_MI2S_IBIT 0x102
- #define CLOCK_ID_SEC_MI2S_EBIT 0x103
- #define CLOCK_ID_TER_MI2S_IBIT 0x104
- #define CLOCK_ID_TER_MI2S_EBIT 0x105
- #define CLOCK_ID_QUAD_MI2S_IBIT 0x106
- #define CLOCK_ID_QUAD_MI2S_EBIT 0x107
- #define CLOCK_ID_QUI_MI2S_IBIT 0x108
- #define CLOCK_ID_QUI_MI2S_EBIT 0x109
- #define CLOCK_ID_QUI_MI2S_OSR 0x10A
- #define CLOCK_ID_SEN_MI2S_IBIT 0x10B
- #define CLOCK_ID_SEN_MI2S_EBIT 0x10C
- #define CLOCK_ID_SEP_MI2S_IBIT 0x10D
- #define CLOCK_ID_SEP_MI2S_EBIT 0x10E
- #define CLOCK_ID_INT0_I2S_IBIT 0x10D
- #define CLOCK_ID_INT1_I2S_IBIT 0x10E
- #define CLOCK_ID_INT2_I2S_IBIT 0x10F
- #define CLOCK_ID_INT3_I2S_IBIT 0x110
- #define CLOCK_ID_INT4_I2S_IBIT 0x111
- #define CLOCK_ID_INT5_I2S_IBIT 0x112
- #define CLOCK_ID_INT6_I2S_IBIT 0x113
- #define CLOCK_ID_PRI_PCM_IBIT 0x200
- #define CLOCK_ID_PRI_PCM_EBIT 0x201
- #define CLOCK_ID_SEC_PCM_IBIT 0x202
- #define CLOCK_ID_SEC_PCM_EBIT 0x203
- #define CLOCK_ID_TER_PCM_IBIT 0x204
- #define CLOCK_ID_TER_PCM_EBIT 0x205
- #define CLOCK_ID_QUAD_PCM_IBIT 0x206
- #define CLOCK_ID_QUAD_PCM_EBIT 0x207
- #define CLOCK_ID_QUI_PCM_IBIT 0x208
- #define CLOCK_ID_QUI_PCM_EBIT 0x209
- #define CLOCK_ID_QUI_PCM_OSR 0x20A
- #define CLOCK_ID_SEN_PCM_IBIT 0x20B
- #define CLOCK_ID_SEN_PCM_EBIT 0x20C
- #define CLOCK_ID_PRI_TDM_IBIT 0x200
- #define CLOCK_ID_PRI_TDM_EBIT 0x201
- #define CLOCK_ID_SEC_TDM_IBIT 0x202
- #define CLOCK_ID_SEC_TDM_EBIT 0x203
- #define CLOCK_ID_TER_TDM_IBIT 0x204
- #define CLOCK_ID_TER_TDM_EBIT 0x205
- #define CLOCK_ID_QUAD_TDM_IBIT 0x206
- #define CLOCK_ID_QUAD_TDM_EBIT 0x207
- #define CLOCK_ID_QUI_TDM_IBIT 0x208
- #define CLOCK_ID_QUI_TDM_EBIT 0x209
- #define CLOCK_ID_QUI_TDM_OSR 0x20A
- #define CLOCK_ID_SEN_TDM_IBIT 0x20B
- #define CLOCK_ID_SEN_TDM_EBIT 0x20C
- #define CLOCK_ID_SEP_TDM_IBIT 0x20D
- #define CLOCK_ID_SEP_TDM_EBIT 0x20E
- #define CLOCK_ID_MCLK_1 0x300
- #define CLOCK_ID_MCLK_2 0x301
- #define CLOCK_ID_MCLK_3 0x302
- #define CLOCK_ID_MCLK_4 0x303
- #define CLOCK_ID_MCLK_5 0x304
- #define CLOCK_ID_WSA_CORE_MCLK 0x305
- #define CLOCK_ID_WSA_CORE_NPL_MCLK 0x306
- #define CLOCK_ID_WSA_CORE_2X_MCLK CLOCK_ID_WSA_CORE_NPL_MCLK
- #define CLOCK_ID_VA_CORE_MCLK 0x307
- #define CLOCK_ID_TX_CORE_MCLK 0x30C
- #define CLOCK_ID_RX_CORE_TX_MCLK 0x312
- #define CLOCK_ID_WSA_CORE_TX_MCLK 0x314
- #define CLOCK_ID_WSA2_CORE_TX_MCLK 0x316
- #define CLOCK_ID_PRI_SPDIF_OUTPUT_CORE 0x400
- #define CLOCK_ID_SEC_SPDIF_OUTPUT_CORE 0x401
- #define CLOCK_ID_PRI_SPDIF_INPUT_CORE 0x402
- #define CLOCK_ID_SEC_SPDIF_INPUT_CORE 0x403
- #define CLOCK_ID_PRI_SPDIF_OUTPUT_NPL 0x404
- #define CLOCK_ID_SEC_SPDIF_OUTPUT_NPL 0x405
- #define CLOCK_ATTRIBUTE_INVALID 0x0
- #define CLOCK_ATTRIBUTE_COUPLE_NO 0x1
- #define CLOCK_ATTRIBUTE_COUPLE_DIVIDEND 0x2
- #define CLOCK_ATTRIBUTE_COUPLE_DIVISOR 0x3
- #define CLOCK_ATTRIBUTE_INVERT_COUPLE_NO 0x4
- #define CLOCK_ROOT_DEFAULT 0x0
- #define HW_CORE_ID_LPASS 0x1
- #define HW_CORE_ID_DCODEC 0x2
- #define CLOCK_ROOT_SRC_DEFAULT 0x0
- #define CLOCK_ROOT_SRC_XO 0x1
- #define CLOCK_ROOT_SRC_RCO 0x2
- int audio_prm_set_lpass_clk_cfg(struct clk_cfg *cfg, uint8_t enable);
- int audio_prm_set_lpass_hw_core_req(struct clk_cfg *cfg, uint32_t hw_core_id, uint8_t enable);
- int audio_prm_set_cdc_earpa_duty_cycling_req(struct prm_earpa_hw_intf_config *earpa_config,
- uint32_t enable);
- void audio_prm_set_lpi_logging_status(int lpi_pcm_logging_enable);
- int audio_prm_set_vote_against_sleep(uint8_t enable);
- #endif
|