blob: 999b8851226b6840371ec041493355ffd6f3d905 [file] [log] [blame]
Mark Brown9e6e96a2010-01-29 17:47:12 +00001/*
2 * wm8994.h -- WM8994 Soc Audio driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _WM8994_H
10#define _WM8994_H
11
12#include <sound/soc.h>
13
Mark Brown9e6e96a2010-01-29 17:47:12 +000014/* Sources for AIF1/2 SYSCLK - use with set_dai_sysclk() */
15#define WM8994_SYSCLK_MCLK1 1
16#define WM8994_SYSCLK_MCLK2 2
17#define WM8994_SYSCLK_FLL1 3
18#define WM8994_SYSCLK_FLL2 4
19
Mark Brown66b47fd2010-07-08 11:25:43 +090020/* OPCLK is also configured with set_dai_sysclk, specify division*10 as rate. */
21#define WM8994_SYSCLK_OPCLK 5
22
Mark Brown9e6e96a2010-01-29 17:47:12 +000023#define WM8994_FLL1 1
24#define WM8994_FLL2 2
25
Mark Brown136ff2a2010-04-20 12:56:18 +090026#define WM8994_FLL_SRC_MCLK1 1
27#define WM8994_FLL_SRC_MCLK2 2
28#define WM8994_FLL_SRC_LRCLK 3
29#define WM8994_FLL_SRC_BCLK 4
30
Mark Brown821edd22010-11-26 15:21:09 +000031typedef void (*wm8958_micdet_cb)(u16 status, void *data);
32
Mark Brown88766982010-03-29 20:57:12 +010033int wm8994_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
34 int micbias, int det, int shrt);
Mark Brown821edd22010-11-26 15:21:09 +000035int wm8958_mic_detect(struct snd_soc_codec *codec, struct snd_soc_jack *jack,
36 wm8958_micdet_cb cb, void *cb_data);
Mark Brown88766982010-03-29 20:57:12 +010037
Mark Brown7b306da2010-11-16 20:11:40 +000038#define WM8994_CACHE_SIZE 1570
39
40struct wm8994_access_mask {
41 unsigned short readable; /* Mask of readable bits */
42 unsigned short writable; /* Mask of writable bits */
43};
44
45extern const struct wm8994_access_mask wm8994_access_masks[WM8994_CACHE_SIZE];
Mark Brownb993f92b92011-03-07 16:42:20 +000046extern const u16 wm8994_reg_defaults[WM8994_CACHE_SIZE];
Mark Brown7b306da2010-11-16 20:11:40 +000047
Mark Brown9e6e96a2010-01-29 17:47:12 +000048#endif