i2c-s3c2410.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2004-2009 Simtec Electronics
  4. * Ben Dooks <[email protected]>
  5. *
  6. * S3C - I2C Controller platform_device info
  7. */
  8. #ifndef __I2C_S3C2410_H
  9. #define __I2C_S3C2410_H __FILE__
  10. #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */
  11. struct platform_device;
  12. /**
  13. * struct s3c2410_platform_i2c - Platform data for s3c I2C.
  14. * @bus_num: The bus number to use (if possible).
  15. * @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
  16. * @slave_addr: The I2C address for the slave device (if enabled).
  17. * @frequency: The desired frequency in Hz of the bus. This is
  18. * guaranteed to not be exceeded. If the caller does
  19. * not care, use zero and the driver will select a
  20. * useful default.
  21. * @sda_delay: The delay (in ns) applied to SDA edges.
  22. * @cfg_gpio: A callback to configure the pins for I2C operation.
  23. */
  24. struct s3c2410_platform_i2c {
  25. int bus_num;
  26. unsigned int flags;
  27. unsigned int slave_addr;
  28. unsigned long frequency;
  29. unsigned int sda_delay;
  30. void (*cfg_gpio)(struct platform_device *dev);
  31. };
  32. /**
  33. * s3c_i2c0_set_platdata - set platform data for i2c0 device
  34. * @i2c: The platform data to set, or NULL for default data.
  35. *
  36. * Register the given platform data for use with the i2c0 device. This
  37. * call copies the platform data, so the caller can use __initdata for
  38. * their copy.
  39. *
  40. * This call will set cfg_gpio if is null to the default platform
  41. * implementation.
  42. *
  43. * Any user of s3c_device_i2c0 should call this, even if it is with
  44. * NULL to ensure that the device is given the default platform data
  45. * as the driver will no longer carry defaults.
  46. */
  47. extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
  48. extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
  49. extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
  50. extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c);
  51. extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);
  52. extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c);
  53. extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c);
  54. extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c);
  55. extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c);
  56. /* defined by architecture to configure gpio */
  57. extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
  58. extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
  59. extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
  60. extern void s3c_i2c3_cfg_gpio(struct platform_device *dev);
  61. extern void s3c_i2c4_cfg_gpio(struct platform_device *dev);
  62. extern void s3c_i2c5_cfg_gpio(struct platform_device *dev);
  63. extern void s3c_i2c6_cfg_gpio(struct platform_device *dev);
  64. extern void s3c_i2c7_cfg_gpio(struct platform_device *dev);
  65. extern struct s3c2410_platform_i2c default_i2c_data;
  66. #endif /* __I2C_S3C2410_H */