Ramprasad Katkam | e38aed4 | 2018-03-07 16:26:49 +0530 | [diff] [blame^] | 1 | /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 2 | * |
| 3 | * 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 _WSA881X_H |
| 14 | #define _WSA881X_H |
| 15 | |
| 16 | #include <linux/regmap.h> |
| 17 | #include <sound/soc.h> |
| 18 | #include <sound/info.h> |
| 19 | #include "wsa881x-registers.h" |
| 20 | |
| 21 | #define WSA881X_MAX_SWR_PORTS 4 |
| 22 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 23 | #if IS_ENABLED(CONFIG_SND_SOC_WSA881X) |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 24 | extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port, |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 25 | u8 num_port, unsigned int *ch_mask, |
Ramprasad Katkam | e38aed4 | 2018-03-07 16:26:49 +0530 | [diff] [blame^] | 26 | unsigned int *ch_rate, u8 *port_type); |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 27 | |
| 28 | extern const u8 wsa881x_reg_readable[WSA881X_CACHE_SIZE]; |
| 29 | extern struct regmap_config wsa881x_regmap_config; |
| 30 | extern int wsa881x_codec_info_create_codec_entry( |
| 31 | struct snd_info_entry *codec_root, |
| 32 | struct snd_soc_codec *codec); |
| 33 | void wsa881x_regmap_defaults(struct regmap *regmap, u8 version); |
| 34 | |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 35 | #else |
| 36 | extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port, |
| 37 | u8 num_port, unsigned int *ch_mask, |
Ramprasad Katkam | e38aed4 | 2018-03-07 16:26:49 +0530 | [diff] [blame^] | 38 | unsigned int *ch_rate, u8 *port_type); |
Laxminath Kasam | 38070be | 2017-08-17 18:21:59 +0530 | [diff] [blame] | 39 | { |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | extern int wsa881x_codec_info_create_codec_entry( |
| 44 | struct snd_info_entry *codec_root, |
| 45 | struct snd_soc_codec *codec) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | void wsa881x_regmap_defaults(struct regmap *regmap, u8 version) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | #endif |
| 55 | |
Asish Bhattacharya | 8e2277f | 2017-07-20 18:31:55 +0530 | [diff] [blame] | 56 | #endif /* _WSA881X_H */ |