blob: fbc60d86a12b83861908fdd47b1d25e53ff786d6 [file] [log] [blame]
Laxminath Kasam38070be2017-08-17 18:21:59 +05301/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05302 *
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 Kasam38070be2017-08-17 18:21:59 +053023#if IS_ENABLED(CONFIG_SND_SOC_WSA881X)
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053024extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
Laxminath Kasam38070be2017-08-17 18:21:59 +053025 u8 num_port, unsigned int *ch_mask,
26 unsigned int *ch_rate);
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053027
28extern const u8 wsa881x_reg_readable[WSA881X_CACHE_SIZE];
29extern struct regmap_config wsa881x_regmap_config;
30extern int wsa881x_codec_info_create_codec_entry(
31 struct snd_info_entry *codec_root,
32 struct snd_soc_codec *codec);
33void wsa881x_regmap_defaults(struct regmap *regmap, u8 version);
34
Laxminath Kasam38070be2017-08-17 18:21:59 +053035#else
36extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
37 u8 num_port, unsigned int *ch_mask,
38 unsigned int *ch_rate)
39{
40 return 0;
41}
42
43extern 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
50void wsa881x_regmap_defaults(struct regmap *regmap, u8 version)
51{
52}
53
54#endif
55
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053056#endif /* _WSA881X_H */