bfin_sport.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * bfin_sport.h - interface to Blackfin SPORTs
  3. *
  4. * Copyright 2004-2009 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __BFIN_SPORT_H__
  9. #define __BFIN_SPORT_H__
  10. #include <linux/types.h>
  11. #include <uapi/asm/bfin_sport.h>
  12. /*
  13. * All Blackfin system MMRs are padded to 32bits even if the register
  14. * itself is only 16bits. So use a helper macro to streamline this.
  15. */
  16. #define __BFP(m) u16 m; u16 __pad_##m
  17. struct sport_register {
  18. __BFP(tcr1);
  19. __BFP(tcr2);
  20. __BFP(tclkdiv);
  21. __BFP(tfsdiv);
  22. union {
  23. u32 tx32;
  24. u16 tx16;
  25. };
  26. u32 __pad_tx;
  27. union {
  28. u32 rx32; /* use the anomaly wrapper below */
  29. u16 rx16;
  30. };
  31. u32 __pad_rx;
  32. __BFP(rcr1);
  33. __BFP(rcr2);
  34. __BFP(rclkdiv);
  35. __BFP(rfsdiv);
  36. __BFP(stat);
  37. __BFP(chnl);
  38. __BFP(mcmc1);
  39. __BFP(mcmc2);
  40. u32 mtcs0;
  41. u32 mtcs1;
  42. u32 mtcs2;
  43. u32 mtcs3;
  44. u32 mrcs0;
  45. u32 mrcs1;
  46. u32 mrcs2;
  47. u32 mrcs3;
  48. };
  49. #undef __BFP
  50. struct bfin_snd_platform_data {
  51. const unsigned short *pin_req;
  52. };
  53. #define bfin_read_sport_rx32(base) \
  54. ({ \
  55. struct sport_register *__mmrs = (void *)base; \
  56. u32 __ret; \
  57. unsigned long flags; \
  58. if (ANOMALY_05000473) \
  59. local_irq_save(flags); \
  60. __ret = __mmrs->rx32; \
  61. if (ANOMALY_05000473) \
  62. local_irq_restore(flags); \
  63. __ret; \
  64. })
  65. #endif