wm8994.h 1.7 KB

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