Commit | Line | Data |
---|---|---|
cd5006db | 1 | /* |
ccae941e | 2 | * Copyright 2004-2009 Simtec Electronics |
1da177e4 LT |
3 | * Ben Dooks <ben@simtec.co.uk> |
4 | * | |
c564e6ae | 5 | * S3C - I2C Controller platform_device info |
1da177e4 LT |
6 | * |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
1da177e4 LT |
10 | */ |
11 | ||
cd5006db SK |
12 | #ifndef __I2C_S3C2410_H |
13 | #define __I2C_S3C2410_H __FILE__ | |
1da177e4 LT |
14 | |
15 | #define S3C_IICFLG_FILTER (1<<0) /* enable s3c2440 filter */ | |
16 | ||
b2dc0c2b AB |
17 | struct platform_device; |
18 | ||
c564e6ae DS |
19 | /** |
20 | * struct s3c2410_platform_i2c - Platform data for s3c I2C. | |
21 | * @bus_num: The bus number to use (if possible). | |
22 | * @flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER). | |
23 | * @slave_addr: The I2C address for the slave device (if enabled). | |
24 | * @frequency: The desired frequency in Hz of the bus. This is | |
25 | * guaranteed to not be exceeded. If the caller does | |
26 | * not care, use zero and the driver will select a | |
27 | * useful default. | |
28 | * @sda_delay: The delay (in ns) applied to SDA edges. | |
29 | * @cfg_gpio: A callback to configure the pins for I2C operation. | |
30 | */ | |
1da177e4 | 31 | struct s3c2410_platform_i2c { |
c564e6ae | 32 | int bus_num; |
1da177e4 | 33 | unsigned int flags; |
c564e6ae DS |
34 | unsigned int slave_addr; |
35 | unsigned long frequency; | |
36 | unsigned int sda_delay; | |
3e1b776c BD |
37 | |
38 | void (*cfg_gpio)(struct platform_device *dev); | |
1da177e4 LT |
39 | }; |
40 | ||
3e1b776c BD |
41 | /** |
42 | * s3c_i2c0_set_platdata - set platform data for i2c0 device | |
43 | * @i2c: The platform data to set, or NULL for default data. | |
44 | * | |
45 | * Register the given platform data for use with the i2c0 device. This | |
46 | * call copies the platform data, so the caller can use __initdata for | |
47 | * their copy. | |
48 | * | |
49 | * This call will set cfg_gpio if is null to the default platform | |
50 | * implementation. | |
51 | * | |
52 | * Any user of s3c_device_i2c0 should call this, even if it is with | |
53 | * NULL to ensure that the device is given the default platform data | |
54 | * as the driver will no longer carry defaults. | |
55 | */ | |
56 | extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c); | |
1aba834d | 57 | extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c); |
c8d833bf | 58 | extern void s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *i2c); |
b7a98255 KP |
59 | extern void s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *i2c); |
60 | extern void s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *i2c); | |
61 | extern void s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *i2c); | |
62 | extern void s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *i2c); | |
63 | extern void s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *i2c); | |
c40e7e0d | 64 | extern void s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *i2c); |
3e1b776c BD |
65 | |
66 | /* defined by architecture to configure gpio */ | |
67 | extern void s3c_i2c0_cfg_gpio(struct platform_device *dev); | |
1aba834d | 68 | extern void s3c_i2c1_cfg_gpio(struct platform_device *dev); |
c8d833bf | 69 | extern void s3c_i2c2_cfg_gpio(struct platform_device *dev); |
b7a98255 KP |
70 | extern void s3c_i2c3_cfg_gpio(struct platform_device *dev); |
71 | extern void s3c_i2c4_cfg_gpio(struct platform_device *dev); | |
72 | extern void s3c_i2c5_cfg_gpio(struct platform_device *dev); | |
73 | extern void s3c_i2c6_cfg_gpio(struct platform_device *dev); | |
74 | extern void s3c_i2c7_cfg_gpio(struct platform_device *dev); | |
3e1b776c | 75 | |
696f6fc1 NKC |
76 | extern struct s3c2410_platform_i2c default_i2c_data; |
77 | ||
cd5006db | 78 | #endif /* __I2C_S3C2410_H */ |