i2c.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2009 ST-Ericsson
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2, as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef __PLAT_I2C_H
  9. #define __PLAT_I2C_H
  10. enum i2c_freq_mode {
  11. I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
  12. I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
  13. I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
  14. I2C_FREQ_MODE_HIGH_SPEED /* up to 3.4 Mb/s */
  15. };
  16. /**
  17. * struct nmk_i2c_controller - client specific controller configuration
  18. * @clk_freq: clock frequency for the operation mode
  19. * @slsu: Slave data setup time in ns.
  20. * The needed setup time for three modes of operation
  21. * are 250ns, 100ns and 10ns respectively thus leading
  22. * to the values of 14, 6, 2 for a 48 MHz i2c clk
  23. * @tft: Tx FIFO Threshold in bytes
  24. * @rft: Rx FIFO Threshold in bytes
  25. * @sm: speed mode
  26. */
  27. struct nmk_i2c_controller {
  28. unsigned long clk_freq;
  29. unsigned short slsu;
  30. unsigned char tft;
  31. unsigned char rft;
  32. enum i2c_freq_mode sm;
  33. };
  34. #endif /* __PLAT_I2C_H */