wm_adsp.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #ifndef __WM_ADSP_H
  13. #define __WM_ADSP_H
  14. #include <sound/soc.h>
  15. #include <sound/soc-dapm.h>
  16. #include "wmfw.h"
  17. struct regulator;
  18. struct wm_adsp_region {
  19. int type;
  20. unsigned int base;
  21. };
  22. struct wm_adsp_alg_region {
  23. struct list_head list;
  24. unsigned int alg;
  25. int type;
  26. unsigned int base;
  27. };
  28. struct wm_adsp {
  29. const char *part;
  30. int num;
  31. int type;
  32. struct device *dev;
  33. struct regmap *regmap;
  34. int base;
  35. struct list_head alg_regions;
  36. const struct wm_adsp_region *mem;
  37. int num_mems;
  38. int fw;
  39. bool running;
  40. struct regulator *dvfs;
  41. };
  42. #define WM_ADSP1(wname, num) \
  43. { .id = snd_soc_dapm_pga, .name = wname, .reg = SND_SOC_NOPM, \
  44. .shift = num, .event = wm_adsp1_event, \
  45. .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD }
  46. #define WM_ADSP2(wname, num) \
  47. { .id = snd_soc_dapm_pga, .name = wname, .reg = SND_SOC_NOPM, \
  48. .shift = num, .event = wm_adsp2_event, \
  49. .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD }
  50. extern const struct snd_kcontrol_new wm_adsp_fw_controls[];
  51. int wm_adsp2_init(struct wm_adsp *adsp, bool dvfs);
  52. int wm_adsp1_event(struct snd_soc_dapm_widget *w,
  53. struct snd_kcontrol *kcontrol, int event);
  54. int wm_adsp2_event(struct snd_soc_dapm_widget *w,
  55. struct snd_kcontrol *kcontrol, int event);
  56. #endif