bfin_twi.h 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * bfin_twi.h - interface to Blackfin TWIs
  3. *
  4. * Copyright 2005-2010 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2 or later.
  7. */
  8. #ifndef __ASM_BFIN_TWI_H__
  9. #define __ASM_BFIN_TWI_H__
  10. #include <linux/types.h>
  11. /*
  12. * All Blackfin system MMRs are padded to 32bits even if the register
  13. * itself is only 16bits. So use a helper macro to streamline this.
  14. */
  15. #define __BFP(m) u16 m; u16 __pad_##m
  16. /*
  17. * bfin twi registers layout
  18. */
  19. struct bfin_twi_regs {
  20. __BFP(clkdiv);
  21. __BFP(control);
  22. __BFP(slave_ctl);
  23. __BFP(slave_stat);
  24. __BFP(slave_addr);
  25. __BFP(master_ctl);
  26. __BFP(master_stat);
  27. __BFP(master_addr);
  28. __BFP(int_stat);
  29. __BFP(int_mask);
  30. __BFP(fifo_ctl);
  31. __BFP(fifo_stat);
  32. u32 __pad[20];
  33. __BFP(xmt_data8);
  34. __BFP(xmt_data16);
  35. __BFP(rcv_data8);
  36. __BFP(rcv_data16);
  37. };
  38. #undef __BFP
  39. #endif