blob: 0486a0fe9779421425bcf91356033a8579614133 [file] [log] [blame]
Meng Wang43bbb872018-12-10 12:32:05 +08001/* SPDX-License-Identifier: GPL-2.0-only */
Ramprasad Katkame38aed42018-03-07 16:26:49 +05302/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +05303 */
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 Kasam38070be2017-08-17 18:21:59 +053015#if IS_ENABLED(CONFIG_SND_SOC_WSA881X)
Meng Wang15c825d2018-09-06 10:49:18 +080016extern int wsa881x_set_channel_map(struct snd_soc_component *component,
17 u8 *port, u8 num_port, unsigned int *ch_mask,
Ramprasad Katkame38aed42018-03-07 16:26:49 +053018 unsigned int *ch_rate, u8 *port_type);
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053019
20extern const u8 wsa881x_reg_readable[WSA881X_CACHE_SIZE];
21extern struct regmap_config wsa881x_regmap_config;
22extern int wsa881x_codec_info_create_codec_entry(
23 struct snd_info_entry *codec_root,
Meng Wang15c825d2018-09-06 10:49:18 +080024 struct snd_soc_component *component);
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053025void wsa881x_regmap_defaults(struct regmap *regmap, u8 version);
26
Laxminath Kasam38070be2017-08-17 18:21:59 +053027#else
Meng Wang15c825d2018-09-06 10:49:18 +080028extern 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 Kasam38070be2017-08-17 18:21:59 +053031{
32 return 0;
33}
34
35extern int wsa881x_codec_info_create_codec_entry(
36 struct snd_info_entry *codec_root,
Meng Wang15c825d2018-09-06 10:49:18 +080037 struct snd_soc_component *component)
Laxminath Kasam38070be2017-08-17 18:21:59 +053038{
39 return 0;
40}
41
42void wsa881x_regmap_defaults(struct regmap *regmap, u8 version)
43{
44}
45
46#endif
47
Asish Bhattacharya8e2277f2017-07-20 18:31:55 +053048#endif /* _WSA881X_H */