wm8994.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2012 Samsung Electronics
  3. * R. Chadrasekar <rcsekar@samsung.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __WM8994_H__
  8. #define __WM8994_H__
  9. /* Sources for AIF1/2 SYSCLK - use with set_dai_sysclk() */
  10. #define WM8994_SYSCLK_MCLK1 1
  11. #define WM8994_SYSCLK_MCLK2 2
  12. #define WM8994_SYSCLK_FLL1 3
  13. #define WM8994_SYSCLK_FLL2 4
  14. /* Avilable audi interface ports in wm8994 codec */
  15. enum en_audio_interface {
  16. WM8994_AIF1 = 1,
  17. WM8994_AIF2,
  18. WM8994_AIF3
  19. };
  20. /* OPCLK is also configured with set_dai_sysclk, specify division*10 as rate. */
  21. #define WM8994_SYSCLK_OPCLK 5
  22. #define WM8994_FLL1 1
  23. #define WM8994_FLL2 2
  24. #define WM8994_FLL_SRC_MCLK1 1
  25. #define WM8994_FLL_SRC_MCLK2 2
  26. #define WM8994_FLL_SRC_LRCLK 3
  27. #define WM8994_FLL_SRC_BCLK 4
  28. /* maximum available digital interfac in the dac to configure */
  29. #define WM8994_MAX_AIF 2
  30. #define WM8994_MAX_INPUT_CLK_FREQ 13500000
  31. #define WM8994_ID 0x8994
  32. enum wm8994_vmid_mode {
  33. WM8994_VMID_NORMAL,
  34. WM8994_VMID_FORCE,
  35. };
  36. /* wm 8994 family devices */
  37. enum wm8994_type {
  38. WM8994 = 0,
  39. WM8958 = 1,
  40. WM1811 = 2,
  41. };
  42. /*
  43. * intialise wm8994 sound codec device for the given configuration
  44. *
  45. * @param blob FDT node for codec values
  46. * @param aif_id enum value of codec interface port in which
  47. * soc i2s is connected
  48. * @param sampling_rate Sampling rate ranges between from 8khz to 96khz
  49. * @param mclk_freq Master clock frequency.
  50. * @param bits_per_sample bits per Sample can be 16 or 24
  51. * @param channels Number of channnels, maximum 2
  52. *
  53. * @returns -1 for error and 0 Success.
  54. */
  55. int wm8994_init(const void *blob, enum en_audio_interface aif_id,
  56. int sampling_rate, int mclk_freq,
  57. int bits_per_sample, unsigned int channels);
  58. #endif /*__WM8994_H__ */