xref: /openbmc/linux/sound/soc/codecs/rl6347a.h (revision b8d312aa)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * rl6347a.h - RL6347A class device shared support
4  *
5  * Copyright 2015 Realtek Semiconductor Corp.
6  *
7  * Author: Oder Chiou <oder_chiou@realtek.com>
8  */
9 #ifndef __RL6347A_H__
10 #define __RL6347A_H__
11 
12 #include <sound/hda_verbs.h>
13 
14 #define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D)
15 
16 #define RL6347A_VENDOR_REGISTERS	0x20
17 
18 #define RL6347A_COEF_INDEX\
19 	VERB_CMD(AC_VERB_SET_COEF_INDEX, RL6347A_VENDOR_REGISTERS, 0)
20 #define RL6347A_PROC_COEF\
21 	VERB_CMD(AC_VERB_SET_PROC_COEF, RL6347A_VENDOR_REGISTERS, 0)
22 
23 struct rl6347a_priv {
24 	struct reg_default *index_cache;
25 	int index_cache_size;
26 };
27 
28 int rl6347a_hw_write(void *context, unsigned int reg, unsigned int value);
29 int rl6347a_hw_read(void *context, unsigned int reg, unsigned int *value);
30 
31 #endif /* __RL6347A_H__ */
32