Meng Wang | 43bbb87 | 2018-12-10 12:32:05 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 2 | /* |
Meng Wang | 61af684 | 2018-09-10 17:47:55 +0800 | [diff] [blame] | 3 | * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved. |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _MSM_DOLBY_DAP_CONFIG_H_ |
| 7 | #define _MSM_DOLBY_DAP_CONFIG_H_ |
| 8 | |
| 9 | #include <sound/soc.h> |
| 10 | #include "msm-dolby-common.h" |
| 11 | |
| 12 | #ifdef CONFIG_DOLBY_DAP |
| 13 | /* DOLBY DOLBY GUIDS */ |
| 14 | #define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B |
| 15 | #define NUM_DOLBY_ENDP_DEVICE 23 |
| 16 | |
| 17 | #define DOLBY_NUM_ENDP_DEPENDENT_PARAMS 3 |
| 18 | #define DOLBY_ENDDEP_PARAM_DVLO_OFFSET 0 |
| 19 | #define DOLBY_ENDDEP_PARAM_DVLO_LENGTH 1 |
| 20 | #define DOLBY_ENDDEP_PARAM_DVLI_OFFSET (DOLBY_ENDDEP_PARAM_DVLO_OFFSET + \ |
| 21 | DOLBY_ENDDEP_PARAM_DVLO_LENGTH) |
| 22 | #define DOLBY_ENDDEP_PARAM_DVLI_LENGTH 1 |
| 23 | #define DOLBY_ENDDEP_PARAM_VMB_OFFSET (DOLBY_ENDDEP_PARAM_DVLI_OFFSET + \ |
| 24 | DOLBY_ENDDEP_PARAM_DVLI_LENGTH) |
| 25 | #define DOLBY_ENDDEP_PARAM_VMB_LENGTH 1 |
| 26 | #define DOLBY_ENDDEP_PARAM_LENGTH (DOLBY_ENDDEP_PARAM_DVLO_LENGTH + \ |
| 27 | DOLBY_ENDDEP_PARAM_DVLI_LENGTH + DOLBY_ENDDEP_PARAM_VMB_LENGTH) |
| 28 | |
| 29 | #define MAX_DOLBY_PARAMS 47 |
| 30 | #define MAX_DOLBY_CTRL_PARAMS 5 |
| 31 | #define ALL_DOLBY_PARAMS (MAX_DOLBY_PARAMS + \ |
| 32 | MAX_DOLBY_CTRL_PARAMS) |
| 33 | #define DOLBY_COMMIT_ALL_IDX MAX_DOLBY_PARAMS |
| 34 | #define DOLBY_COMMIT_IDX (MAX_DOLBY_PARAMS+1) |
| 35 | #define DOLBY_USE_CACHE_IDX (MAX_DOLBY_PARAMS+2) |
| 36 | #define DOLBY_AUTO_ENDP_IDX (MAX_DOLBY_PARAMS+3) |
| 37 | #define DOLBY_AUTO_ENDDEP_IDX (MAX_DOLBY_PARAMS+4) |
| 38 | |
| 39 | /* DOLBY device definitions */ |
| 40 | enum { |
| 41 | DOLBY_ENDP_INT_SPEAKERS = 0, |
| 42 | DOLBY_ENDP_EXT_SPEAKERS, |
| 43 | DOLBY_ENDP_HEADPHONES, |
| 44 | DOLBY_ENDP_HDMI, |
| 45 | DOLBY_ENDP_SPDIF, |
| 46 | DOLBY_ENDP_DLNA, |
| 47 | DOLBY_ENDP_ANALOG, |
| 48 | }; |
| 49 | |
| 50 | /* DOLBY device definitions end */ |
| 51 | |
| 52 | struct dolby_dap_params { |
| 53 | uint32_t value[TOTAL_LENGTH_DOLBY_PARAM + MAX_DOLBY_PARAMS]; |
| 54 | } __packed; |
| 55 | |
| 56 | int msm_dolby_dap_init(int port_id, int copp_idx, int channels, |
| 57 | bool is_custom_stereo_on); |
| 58 | void msm_dolby_dap_deinit(int port_id); |
| 59 | void msm_dolby_dap_add_controls(struct snd_soc_platform *platform); |
| 60 | int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx, |
| 61 | bool is_custom_stereo_enabled); |
| 62 | /* Dolby DOLBY end */ |
| 63 | #else |
| 64 | int msm_dolby_dap_init(int port_id, int copp_idx, int channels, |
| 65 | bool is_custom_stereo_on) |
| 66 | { |
| 67 | return 0; |
| 68 | } |
| 69 | void msm_dolby_dap_deinit(int port_id) { } |
Meng Wang | ee084a0 | 2018-09-04 16:11:58 +0800 | [diff] [blame] | 70 | void msm_dolby_dap_add_controls(struct snd_soc_component *component) { } |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 71 | int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx, |
| 72 | bool is_custom_stereo_enabled) |
| 73 | { |
| 74 | return 0; |
| 75 | } |
| 76 | #endif |
| 77 | |
| 78 | #endif |