0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef _WM8731_H
0013 #define _WM8731_H
0014
0015 #include <linux/mutex.h>
0016 #include <linux/regmap.h>
0017 #include <linux/regulator/consumer.h>
0018
0019 struct clk;
0020 struct snd_pcm_hw_constraint_list;
0021
0022
0023
0024 #define WM8731_LINVOL 0x00
0025 #define WM8731_RINVOL 0x01
0026 #define WM8731_LOUT1V 0x02
0027 #define WM8731_ROUT1V 0x03
0028 #define WM8731_APANA 0x04
0029 #define WM8731_APDIGI 0x05
0030 #define WM8731_PWR 0x06
0031 #define WM8731_IFACE 0x07
0032 #define WM8731_SRATE 0x08
0033 #define WM8731_ACTIVE 0x09
0034 #define WM8731_RESET 0x0f
0035
0036 #define WM8731_CACHEREGNUM 10
0037
0038 #define WM8731_SYSCLK_MCLK 0
0039 #define WM8731_SYSCLK_XTAL 1
0040
0041 #define WM8731_DAI 0
0042
0043 #define WM8731_NUM_SUPPLIES 4
0044
0045
0046 struct wm8731_priv {
0047 struct regmap *regmap;
0048 struct clk *mclk;
0049 struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES];
0050 const struct snd_pcm_hw_constraint_list *constraints;
0051 unsigned int sysclk;
0052 int sysclk_type;
0053 int playback_fs;
0054 bool deemph;
0055
0056 struct mutex lock;
0057 };
0058
0059 extern const struct regmap_config wm8731_regmap;
0060
0061 int wm8731_init(struct device *dev, struct wm8731_priv *wm8731);
0062
0063 #endif