sound.h 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (C) 2012 Samsung Electronics
  3. * R. Chandrasekar < rcsekar@samsung.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef __SOUND_H__
  8. #define __SOUND_H__
  9. /* sound codec enum */
  10. enum en_sound_codec {
  11. CODEC_WM_8994,
  12. CODEC_WM_8995,
  13. CODEC_MAX_98095,
  14. CODEC_MAX
  15. };
  16. /* sound codec enum */
  17. enum sound_compat {
  18. AUDIO_COMPAT_SPI,
  19. AUDIO_COMPAT_I2C,
  20. };
  21. /* Codec information structure to store the info from device tree */
  22. struct sound_codec_info {
  23. int i2c_bus;
  24. int i2c_dev_addr;
  25. enum en_sound_codec codec_type;
  26. };
  27. /*
  28. * Initialises audio sub system
  29. * @param blob Pointer of device tree node or NULL if none.
  30. * @return int value 0 for success, -1 for error
  31. */
  32. int sound_init(const void *blob);
  33. /*
  34. * plays the pcm data buffer in pcm_data.h through i2s1 to make the
  35. * sine wave sound
  36. *
  37. * @return int 0 for success, -1 for error
  38. */
  39. int sound_play(uint32_t msec, uint32_t frequency);
  40. #endif /* __SOUND__H__ */