Meng Wang | 43bbb87 | 2018-12-10 12:32:05 +0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 2 | /* Copyright (c) 2018, The Linux Foundation. All rights reserved. |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 3 | */ |
| 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 | */ |
| 11 | enum { |
Laxminath Kasam | 21c8b22 | 2018-06-21 18:47:22 +0530 | [diff] [blame] | 12 | WSA_MACRO_SPKR_MODE_DEFAULT, |
| 13 | WSA_MACRO_SPKR_MODE_1, /* COMP Gain = 12dB, Smartboost Max = 5.5V */ |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | /* Rx path gain offsets */ |
| 17 | enum { |
Laxminath Kasam | 21c8b22 | 2018-06-21 18:47:22 +0530 | [diff] [blame] | 18 | WSA_MACRO_GAIN_OFFSET_M1P5_DB, |
| 19 | WSA_MACRO_GAIN_OFFSET_0_DB, |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | |
| 23 | #if IS_ENABLED(CONFIG_WSA_MACRO) |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 24 | extern int wsa_macro_set_spkr_mode(struct snd_soc_component *component, |
| 25 | int mode); |
| 26 | extern int wsa_macro_set_spkr_gain_offset(struct snd_soc_component *component, |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 27 | int offset); |
| 28 | #else /* CONFIG_WSA_MACRO */ |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 29 | static inline int wsa_macro_set_spkr_mode(struct snd_soc_component *component, |
| 30 | int mode) |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 31 | { |
| 32 | return 0; |
| 33 | } |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 34 | static inline int wsa_macro_set_spkr_gain_offset( |
| 35 | struct snd_soc_component *component, |
| 36 | int offset); |
Laxminath Kasam | 243e275 | 2018-04-12 00:40:19 +0530 | [diff] [blame] | 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | #endif /* CONFIG_WSA_MACRO */ |
| 41 | #endif |