blob: b2b7139071305939c2ef4ff8ea2111cd22cecff4 [file] [log] [blame]
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05301/*
2 * Copyright (c) 2013-2014, 2017 The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _MSM_DOLBY_DAP_CONFIG_H_
14#define _MSM_DOLBY_DAP_CONFIG_H_
15
16#include <sound/soc.h>
17#include "msm-dolby-common.h"
18
19#ifdef CONFIG_DOLBY_DAP
20/* DOLBY DOLBY GUIDS */
21#define DOLBY_ADM_COPP_TOPOLOGY_ID 0x0001033B
22#define NUM_DOLBY_ENDP_DEVICE 23
23
24#define DOLBY_NUM_ENDP_DEPENDENT_PARAMS 3
25#define DOLBY_ENDDEP_PARAM_DVLO_OFFSET 0
26#define DOLBY_ENDDEP_PARAM_DVLO_LENGTH 1
27#define DOLBY_ENDDEP_PARAM_DVLI_OFFSET (DOLBY_ENDDEP_PARAM_DVLO_OFFSET + \
28 DOLBY_ENDDEP_PARAM_DVLO_LENGTH)
29#define DOLBY_ENDDEP_PARAM_DVLI_LENGTH 1
30#define DOLBY_ENDDEP_PARAM_VMB_OFFSET (DOLBY_ENDDEP_PARAM_DVLI_OFFSET + \
31 DOLBY_ENDDEP_PARAM_DVLI_LENGTH)
32#define DOLBY_ENDDEP_PARAM_VMB_LENGTH 1
33#define DOLBY_ENDDEP_PARAM_LENGTH (DOLBY_ENDDEP_PARAM_DVLO_LENGTH + \
34 DOLBY_ENDDEP_PARAM_DVLI_LENGTH + DOLBY_ENDDEP_PARAM_VMB_LENGTH)
35
36#define MAX_DOLBY_PARAMS 47
37#define MAX_DOLBY_CTRL_PARAMS 5
38#define ALL_DOLBY_PARAMS (MAX_DOLBY_PARAMS + \
39 MAX_DOLBY_CTRL_PARAMS)
40#define DOLBY_COMMIT_ALL_IDX MAX_DOLBY_PARAMS
41#define DOLBY_COMMIT_IDX (MAX_DOLBY_PARAMS+1)
42#define DOLBY_USE_CACHE_IDX (MAX_DOLBY_PARAMS+2)
43#define DOLBY_AUTO_ENDP_IDX (MAX_DOLBY_PARAMS+3)
44#define DOLBY_AUTO_ENDDEP_IDX (MAX_DOLBY_PARAMS+4)
45
46/* DOLBY device definitions */
47enum {
48 DOLBY_ENDP_INT_SPEAKERS = 0,
49 DOLBY_ENDP_EXT_SPEAKERS,
50 DOLBY_ENDP_HEADPHONES,
51 DOLBY_ENDP_HDMI,
52 DOLBY_ENDP_SPDIF,
53 DOLBY_ENDP_DLNA,
54 DOLBY_ENDP_ANALOG,
55};
56
57/* DOLBY device definitions end */
58
59struct dolby_dap_params {
60 uint32_t value[TOTAL_LENGTH_DOLBY_PARAM + MAX_DOLBY_PARAMS];
61} __packed;
62
63int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
64 bool is_custom_stereo_on);
65void msm_dolby_dap_deinit(int port_id);
66void msm_dolby_dap_add_controls(struct snd_soc_platform *platform);
67int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
68 bool is_custom_stereo_enabled);
69/* Dolby DOLBY end */
70#else
71int msm_dolby_dap_init(int port_id, int copp_idx, int channels,
72 bool is_custom_stereo_on)
73{
74 return 0;
75}
76void msm_dolby_dap_deinit(int port_id) { }
77void msm_dolby_dap_add_controls(struct snd_soc_platform *platform) { }
78int dolby_dap_set_custom_stereo_onoff(int port_id, int copp_idx,
79 bool is_custom_stereo_enabled)
80{
81 return 0;
82}
83#endif
84
85#endif