at32-ssc.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* sound/soc/at32/at32-ssc.h
  2. * ASoC SSC interface for Atmel AT32 SoC
  3. *
  4. * Copyright (C) 2008 Long Range Systems
  5. * Geoffrey Wossum <gwossum@acm.org>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #ifndef __SOUND_SOC_AT32_AT32_SSC_H
  12. #define __SOUND_SOC_AT32_AT32_SSC_H __FILE__
  13. #include <linux/types.h>
  14. #include <linux/atmel-ssc.h>
  15. #include "at32-pcm.h"
  16. struct at32_ssc_state {
  17. u32 ssc_cmr;
  18. u32 ssc_rcmr;
  19. u32 ssc_rfmr;
  20. u32 ssc_tcmr;
  21. u32 ssc_tfmr;
  22. u32 ssc_sr;
  23. u32 ssc_imr;
  24. };
  25. struct at32_ssc_info {
  26. char *name;
  27. struct ssc_device *ssc;
  28. spinlock_t lock; /* lock for dir_mask */
  29. unsigned short dir_mask; /* 0=unused, 1=playback, 2=capture */
  30. unsigned short initialized; /* true if SSC has been initialized */
  31. unsigned short daifmt;
  32. unsigned short cmr_div;
  33. unsigned short tcmr_period;
  34. unsigned short rcmr_period;
  35. struct at32_pcm_dma_params *dma_params[2];
  36. struct at32_ssc_state ssc_state;
  37. };
  38. /* SSC divider ids */
  39. #define AT32_SSC_CMR_DIV 0 /* MCK divider for BCLK */
  40. #define AT32_SSC_TCMR_PERIOD 1 /* BCLK divider for transmit FS */
  41. #define AT32_SSC_RCMR_PERIOD 2 /* BCLK divider for receive FS */
  42. extern struct snd_soc_dai at32_ssc_dai[];
  43. #endif /* __SOUND_SOC_AT32_AT32_SSC_H */