xref: /linux/sound/soc/codecs/wm_hubs.h (revision 4537c4e7618d05c77e9f8c5259c977f927a37e2f)
1a2342ae3SMark Brown /*
2a2342ae3SMark Brown  * wm_hubs.h  --  WM899x common code
3a2342ae3SMark Brown  *
4a2342ae3SMark Brown  * Copyright 2009 Wolfson Microelectronics plc
5a2342ae3SMark Brown  *
6a2342ae3SMark Brown  * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7a2342ae3SMark Brown  *
8a2342ae3SMark Brown  *
9a2342ae3SMark Brown  * This program is free software; you can redistribute it and/or modify
10a2342ae3SMark Brown  * it under the terms of the GNU General Public License version 2 as
11a2342ae3SMark Brown  * published by the Free Software Foundation.
12a2342ae3SMark Brown  */
13a2342ae3SMark Brown 
14a2342ae3SMark Brown #ifndef _WM_HUBS_H
15a2342ae3SMark Brown #define _WM_HUBS_H
16a2342ae3SMark Brown 
17d96ca3cdSMark Brown #include <linux/completion.h>
18d96ca3cdSMark Brown #include <linux/interrupt.h>
19d96ca3cdSMark Brown 
20a2342ae3SMark Brown struct snd_soc_codec;
21a2342ae3SMark Brown 
22a2342ae3SMark Brown extern const unsigned int wm_hubs_spkmix_tlv[];
23a2342ae3SMark Brown 
243ed7074cSMark Brown /* This *must* be the first element of the codec->private_data struct */
253ed7074cSMark Brown struct wm_hubs_data {
26*4537c4e7SMark Brown 	int dcs_codes_l;
27*4537c4e7SMark Brown 	int dcs_codes_r;
288437f700SMark Brown 	int dcs_readback_mode;
293ed7074cSMark Brown 	int hp_startup_mode;
30f9acf9feSMark Brown 	int series_startup;
31780b75b4SMark Brown 	int no_series_update;
32fec6dd83SMark Brown 
33fec6dd83SMark Brown 	bool class_w;
34fec6dd83SMark Brown 	u16 class_w_dcs;
35d96ca3cdSMark Brown 
36d96ca3cdSMark Brown 	bool dcs_done_irq;
37d96ca3cdSMark Brown 	struct completion dcs_done;
383ed7074cSMark Brown };
393ed7074cSMark Brown 
40a2342ae3SMark Brown extern int wm_hubs_add_analogue_controls(struct snd_soc_codec *);
41a2342ae3SMark Brown extern int wm_hubs_add_analogue_routes(struct snd_soc_codec *, int, int);
42aa983d9dSMark Brown extern int wm_hubs_handle_analogue_pdata(struct snd_soc_codec *,
43aa983d9dSMark Brown 					 int lineout1_diff, int lineout2_diff,
44aa983d9dSMark Brown 					 int lineout1fb, int lineout2fb,
45aa983d9dSMark Brown 					 int jd_scthr, int jd_thr,
46aa983d9dSMark Brown 					 int micbias1_lvl, int micbias2_lvl);
47a2342ae3SMark Brown 
48d96ca3cdSMark Brown extern irqreturn_t wm_hubs_dcs_done(int irq, void *data);
49d96ca3cdSMark Brown 
50a2342ae3SMark Brown #endif
51