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