From b7a9825553e9213e5129f7e8e53065e918981a70 Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Tue, 12 Oct 2010 07:49:24 +0900 Subject: ARM: S5PV310: Add I2C channel 3, 4, 5, 6, and 7 device support S5PV310 and S5PC210 support more I2C devices than previous SoCs. Add the device support code for them. Signed-off-by: Kyungmin Park Signed-off-by: Marek Szyprowski Signed-off-by: Kukjin Kim --- arch/arm/plat-samsung/dev-i2c3.c | 68 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 arch/arm/plat-samsung/dev-i2c3.c (limited to 'arch/arm/plat-samsung/dev-i2c3.c') diff --git a/arch/arm/plat-samsung/dev-i2c3.c b/arch/arm/plat-samsung/dev-i2c3.c new file mode 100644 index 00000000000..8586a10014b --- /dev/null +++ b/arch/arm/plat-samsung/dev-i2c3.c @@ -0,0 +1,68 @@ +/* linux/arch/arm/plat-samsung/dev-i2c3.c + * + * Copyright (c) 2010 Samsung Electronics Co., Ltd. + * http://www.samsung.com/ + * + * S5P series device definition for i2c device 3 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +static struct resource s3c_i2c_resource[] = { + [0] = { + .start = S3C_PA_IIC3, + .end = S3C_PA_IIC3 + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_IIC3, + .end = IRQ_IIC3, + .flags = IORESOURCE_IRQ, + }, +}; + +struct platform_device s3c_device_i2c3 = { + .name = "s3c2440-i2c", + .id = 3, + .num_resources = ARRAY_SIZE(s3c_i2c_resource), + .resource = s3c_i2c_resource, +}; + +static struct s3c2410_platform_i2c default_i2c_data3 __initdata = { + .flags = 0, + .bus_num = 3, + .slave_addr = 0x10, + .frequency = 100*1000, + .sda_delay = 100, +}; + +void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd) +{ + struct s3c2410_platform_i2c *npd; + + if (!pd) + pd = &default_i2c_data3; + + npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL); + if (!npd) + printk(KERN_ERR "%s: no memory for platform data\n", __func__); + else if (!npd->cfg_gpio) + npd->cfg_gpio = s3c_i2c3_cfg_gpio; + + s3c_device_i2c3.dev.platform_data = npd; +} -- cgit v1.2.3