Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright 2004-2009 Simtec Electronics
0004  *  Ben Dooks <ben@simtec.co.uk>
0005  *
0006  * S3C - I2C Controller platform_device info
0007 */
0008 
0009 #ifndef __I2C_S3C2410_H
0010 #define __I2C_S3C2410_H __FILE__
0011 
0012 #define S3C_IICFLG_FILTER   (1<<0)  /* enable s3c2440 filter */
0013 
0014 struct platform_device;
0015 
0016 /**
0017  *  struct s3c2410_platform_i2c - Platform data for s3c I2C.
0018  *  @bus_num: The bus number to use (if possible).
0019  *  @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
0020  *  @slave_addr: The I2C address for the slave device (if enabled).
0021  *  @frequency: The desired frequency in Hz of the bus.  This is
0022  *                  guaranteed to not be exceeded.  If the caller does
0023  *                  not care, use zero and the driver will select a
0024  *                  useful default.
0025  *  @sda_delay: The delay (in ns) applied to SDA edges.
0026  *  @cfg_gpio: A callback to configure the pins for I2C operation.
0027  */
0028 struct s3c2410_platform_i2c {
0029     int     bus_num;
0030     unsigned int    flags;
0031     unsigned int    slave_addr;
0032     unsigned long   frequency;
0033     unsigned int    sda_delay;
0034 
0035     void    (*cfg_gpio)(struct platform_device *dev);
0036 };
0037 
0038 /**
0039  * s3c_i2c0_set_platdata - set platform data for i2c0 device
0040  * @i2c: The platform data to set, or NULL for default data.
0041  *
0042  * Register the given platform data for use with the i2c0 device. This
0043  * call copies the platform data, so the caller can use __initdata for
0044  * their copy.
0045  *
0046  * This call will set cfg_gpio if is null to the default platform
0047  * implementation.
0048  *
0049  * Any user of s3c_device_i2c0 should call this, even if it is with
0050  * NULL to ensure that the device is given the default platform data
0051  * as the driver will no longer carry defaults.
0052  */
0053 extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
0054 extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
0055 extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c);
0056 extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c);
0057 extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c);
0058 extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c);
0059 extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c);
0060 extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c);
0061 extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c);
0062 
0063 /* defined by architecture to configure gpio */
0064 extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
0065 extern void s3c_i2c1_cfg_gpio(struct platform_device *dev);
0066 extern void s3c_i2c2_cfg_gpio(struct platform_device *dev);
0067 extern void s3c_i2c3_cfg_gpio(struct platform_device *dev);
0068 extern void s3c_i2c4_cfg_gpio(struct platform_device *dev);
0069 extern void s3c_i2c5_cfg_gpio(struct platform_device *dev);
0070 extern void s3c_i2c6_cfg_gpio(struct platform_device *dev);
0071 extern void s3c_i2c7_cfg_gpio(struct platform_device *dev);
0072 
0073 extern struct s3c2410_platform_i2c default_i2c_data;
0074 
0075 #endif /* __I2C_S3C2410_H */