blob: fa5147631a440950b99c7001b2cedb850d327153 [file] [log] [blame]
Meng Wang43bbb872018-12-10 12:32:05 +08001/* SPDX-License-Identifier: GPL-2.0-only */
Meng Wang8db822a2019-06-11 10:46:48 +08002/* Copyright (c) 2018-2019, 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,
Meng Wang8db822a2019-06-11 10:46:48 +080036 int offset)
Laxminath Kasam243e2752018-04-12 00:40:19 +053037{
38 return 0;
39}
40#endif /* CONFIG_WSA_MACRO */
41#endif