Meng Wang | 43bbb87 | 2018-12-10 12:32:05 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ramprasad Katkam | e38aed4 | 2018-03-07 16:26:49 +0530 | [diff] [blame] | 2 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 3 | */ |
| 4 | |
| 5 | #ifndef _WSA881X_H |
| 6 | #define _WSA881X_H |
| 7 | |
| 8 | #include <linux/regmap.h> |
| 9 | #include <sound/soc.h> |
| 10 | #include <sound/info.h> |
| 11 | #include "wsa881x-registers.h" |
| 12 | |
| 13 | #define WSA881X_MAX_SWR_PORTS 4 |
| 14 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 15 | #if IS_ENABLED(CONFIG_SND_SOC_WSA881X) |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 16 | extern int wsa881x_set_channel_map(struct snd_soc_component *component, |
| 17 | u8 *port, u8 num_port, unsigned int *ch_mask, |
Ramprasad Katkam | e38aed4 | 2018-03-07 16:26:49 +0530 | [diff] [blame] | 18 | unsigned int *ch_rate, u8 *port_type); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 19 | |
| 20 | extern const u8 wsa881x_reg_readable[WSA881X_CACHE_SIZE]; |
| 21 | extern struct regmap_config wsa881x_regmap_config; |
| 22 | extern int wsa881x_codec_info_create_codec_entry( |
| 23 | struct snd_info_entry *codec_root, |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 24 | struct snd_soc_component *component); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 25 | void wsa881x_regmap_defaults(struct regmap *regmap, u8 version); |
| 26 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 27 | #else |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 28 | extern int wsa881x_set_channel_map(struct snd_soc_component *component, |
| 29 | u8 *port, u8 num_port, unsigned int *ch_mask, |
| 30 | unsigned int *ch_rate, u8 *port_type) |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 31 | { |
| 32 | return 0; |
| 33 | } |
| 34 | |
| 35 | extern int wsa881x_codec_info_create_codec_entry( |
| 36 | struct snd_info_entry *codec_root, |
Meng Wang | 15c825d | 2018-09-06 10:49:18 +0800 | [diff] [blame] | 37 | struct snd_soc_component *component) |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | void wsa881x_regmap_defaults(struct regmap *regmap, u8 version) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | #endif |
| 47 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 48 | #endif /* _WSA881X_H */ |