Mark Brown | 2159ad9 | 2012-10-11 11:54:02 +0900 | [diff] [blame^] | 1 | /* |
| 2 | * wm_adsp.h -- Wolfson ADSP support |
| 3 | * |
| 4 | * Copyright 2012 Wolfson Microelectronics plc |
| 5 | * |
| 6 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | |
| 13 | #ifndef __WM_ADSP_H |
| 14 | #define __WM_ADSP_H |
| 15 | |
| 16 | #include <sound/soc.h> |
| 17 | #include <sound/soc-dapm.h> |
| 18 | |
| 19 | #include "wmfw.h" |
| 20 | |
| 21 | struct wm_adsp_region { |
| 22 | int type; |
| 23 | unsigned int base; |
| 24 | }; |
| 25 | |
| 26 | struct wm_adsp { |
| 27 | const char *part; |
| 28 | int num; |
| 29 | int type; |
| 30 | struct device *dev; |
| 31 | struct regmap *regmap; |
| 32 | |
| 33 | int base; |
| 34 | |
| 35 | const struct wm_adsp_region *mem; |
| 36 | int num_mems; |
| 37 | }; |
| 38 | |
| 39 | #define WM_ADSP1(wname, num) \ |
| 40 | { .id = snd_soc_dapm_pga, .name = wname, .reg = SND_SOC_NOPM, \ |
| 41 | .shift = num, .event = wm_adsp1_event, \ |
| 42 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD } |
| 43 | |
| 44 | #define WM_ADSP2(wname, num) \ |
| 45 | { .id = snd_soc_dapm_pga, .name = wname, .reg = SND_SOC_NOPM, \ |
| 46 | .shift = num, .event = wm_adsp2_event, \ |
| 47 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD } |
| 48 | |
| 49 | int wm_adsp1_event(struct snd_soc_dapm_widget *w, |
| 50 | struct snd_kcontrol *kcontrol, int event); |
| 51 | int wm_adsp2_event(struct snd_soc_dapm_widget *w, |
| 52 | struct snd_kcontrol *kcontrol, int event); |
| 53 | |
| 54 | #endif |