blob: 75d6e0718d20ff6982b4c8dd5112438f92fa4f26 [file] [log] [blame]
Meng Wang43bbb872018-12-10 12:32:05 +08001/* SPDX-License-Identifier: GPL-2.0-only */
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302/*
Meng Wang61af6842018-09-10 17:47:55 +08003 * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05304 */
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 */
40enum {
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
52struct dolby_dap_params {
53 uint32_t value[TOTAL_LENGTH_DOLBY_PARAM + MAX_DOLBY_PARAMS];
54} __packed;
55
56int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
57 bool is_custom_stereo_on);
58void msm_dolby_dap_deinit(int port_id);
59void msm_dolby_dap_add_controls(struct snd_soc_platform *platform);
60int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
61 bool is_custom_stereo_enabled);
62/* Dolby DOLBY end */
63#else
64int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
65 bool is_custom_stereo_on)
66{
67 return 0;
68}
69void msm_dolby_dap_deinit(int port_id) { }
Meng Wangee084a02018-09-04 16:11:58 +080070void msm_dolby_dap_add_controls(struct snd_soc_component *component) { }
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053071int 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