iic.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* arch/arm/mach-s3c2410/include/mach/iic.h
  2. *
  3. * Copyright (c) 2004 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * S3C2410 - I2C Controller platfrom_device info
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __ASM_ARCH_IIC_H
  13. #define __ASM_ARCH_IIC_H __FILE__
  14. #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
  15. /* Notes:
  16. * 1) All frequencies are expressed in Hz
  17. * 2) A value of zero is `do not care`
  18. */
  19. struct s3c2410_platform_i2c {
  20. int bus_num; /* bus number to use */
  21. unsigned int flags;
  22. unsigned int slave_addr; /* slave address for controller */
  23. unsigned long bus_freq; /* standard bus frequency */
  24. unsigned long max_freq; /* max frequency for the bus */
  25. unsigned long min_freq; /* min frequency for the bus */
  26. unsigned int sda_delay; /* pclks (s3c2440 only) */
  27. void (*cfg_gpio)(struct platform_device *dev);
  28. };
  29. /**
  30. * s3c_i2c0_set_platdata - set platform data for i2c0 device
  31. * @i2c: The platform data to set, or NULL for default data.
  32. *
  33. * Register the given platform data for use with the i2c0 device. This
  34. * call copies the platform data, so the caller can use __initdata for
  35. * their copy.
  36. *
  37. * This call will set cfg_gpio if is null to the default platform
  38. * implementation.
  39. *
  40. * Any user of s3c_device_i2c0 should call this, even if it is with
  41. * NULL to ensure that the device is given the default platform data
  42. * as the driver will no longer carry defaults.
  43. */
  44. extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
  45. extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
  46. /* defined by architecture to configure gpio */
  47. extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
  48. extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
  49. #endif /* __ASM_ARCH_IIC_H */