blob: f2553c02d30a50d2f7d4c0ef07c563eab968042f [file] [log] [blame]
Meng Wang61af6842018-09-10 17:47:55 +08001/* SPDX-License-Identifier: GPL-2.0 */
Laxminath Kasam243e2752018-04-12 00:40:19 +05302/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
Laxminath Kasam243e2752018-04-12 00:40:19 +05303 */
4#ifndef WSA_MACRO_H
5#define WSA_MACRO_H
6
7/*
8 * Selects compander and smart boost settings
9 * for a given speaker mode
10 */
11enum {
Laxminath Kasam21c8b222018-06-21 18:47:22 +053012 WSA_MACRO_SPKR_MODE_DEFAULT,
13 WSA_MACRO_SPKR_MODE_1, /* COMP Gain = 12dB, Smartboost Max = 5.5V */
Laxminath Kasam243e2752018-04-12 00:40:19 +053014};
15
16/* Rx path gain offsets */
17enum {
Laxminath Kasam21c8b222018-06-21 18:47:22 +053018 WSA_MACRO_GAIN_OFFSET_M1P5_DB,
19 WSA_MACRO_GAIN_OFFSET_0_DB,
Laxminath Kasam243e2752018-04-12 00:40:19 +053020};
21
22
23#if IS_ENABLED(CONFIG_WSA_MACRO)
Meng Wang15c825d2018-09-06 10:49:18 +080024extern int wsa_macro_set_spkr_mode(struct snd_soc_component *component,
25 int mode);
26extern int wsa_macro_set_spkr_gain_offset(struct snd_soc_component *component,
Laxminath Kasam243e2752018-04-12 00:40:19 +053027 int offset);
28#else /* CONFIG_WSA_MACRO */
Meng Wang15c825d2018-09-06 10:49:18 +080029static inline int wsa_macro_set_spkr_mode(struct snd_soc_component *component,
30 int mode)
Laxminath Kasam243e2752018-04-12 00:40:19 +053031{
32 return 0;
33}
Meng Wang15c825d2018-09-06 10:49:18 +080034static inline int wsa_macro_set_spkr_gain_offset(
35 struct snd_soc_component *component,
36 int offset);
Laxminath Kasam243e2752018-04-12 00:40:19 +053037{
38 return 0;
39}
40#endif /* CONFIG_WSA_MACRO */
41#endif