Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8d833bf authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Ben Dooks
Browse files

ARM: S5PV210: add common I2C device helpers



This patch adds I2C platform helpers required by s3c2440-i2c driver.

Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 5b696a67
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,3 +25,5 @@ obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o

obj-y				+= dev-audio.o
obj-$(CONFIG_S5PV210_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
+6 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
#include <plat/devs.h>
#include <plat/clock.h>
#include <plat/s5pv210.h>
#include <plat/iic-core.h>

/* Initial IO mappings */

@@ -75,6 +76,11 @@ static void s5pv210_idle(void)
void __init s5pv210_map_io(void)
{
	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));

	/* the i2c devices are directly compatible with s3c2440 */
	s3c_i2c0_setname("s3c2440-i2c");
	s3c_i2c1_setname("s3c2440-i2c");
	s3c_i2c2_setname("s3c2440-i2c");
}

void __init s5pv210_init_clocks(int xtal)
+4 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
#define S5P_PA_GPIO		S5PV210_PA_GPIO

#define S5PV210_PA_IIC0		(0xE1800000)
#define S5PV210_PA_IIC1		(0xFAB00000)
#define S5PV210_PA_IIC2		(0xE1A00000)

#define S5PV210_PA_TIMER	(0xE2500000)
#define S5P_PA_TIMER		S5PV210_PA_TIMER
@@ -80,6 +82,8 @@
/* compatibiltiy defines. */
#define S3C_PA_UART		S5PV210_PA_UART
#define S3C_PA_IIC		S5PV210_PA_IIC0
#define S3C_PA_IIC1		S5PV210_PA_IIC1
#define S3C_PA_IIC2		S5PV210_PA_IIC2
#define S3C_PA_FB		S5PV210_PA_FB

#endif /* __ASM_ARCH_MAP_H */
+7 −2
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5pv210/setup-i2c0.c
 *
 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * I2C0 GPIO configuration.
@@ -17,9 +17,14 @@

struct platform_device; /* don't need the contents */

#include <mach/gpio.h>
#include <plat/iic.h>
#include <plat/gpio-cfg.h>

void s3c_i2c0_cfg_gpio(struct platform_device *dev)
{
	/* Will be populated later */
	s3c_gpio_cfgpin(S5PV210_GPD1(0), S3C_GPIO_SFN(2));
	s3c_gpio_setpull(S5PV210_GPD1(0), S3C_GPIO_PULL_UP);
	s3c_gpio_cfgpin(S5PV210_GPD1(1), S3C_GPIO_SFN(2));
	s3c_gpio_setpull(S5PV210_GPD1(1), S3C_GPIO_PULL_UP);
}
+30 −0
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5pv210/setup-i2c1.c
 *
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * I2C1 GPIO configuration.
 *
 * Based on plat-s3c64xx/setup-i2c1.c
 *
 * 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 <linux/kernel.h>
#include <linux/types.h>

struct platform_device; /* don't need the contents */

#include <mach/gpio.h>
#include <plat/iic.h>
#include <plat/gpio-cfg.h>

void s3c_i2c1_cfg_gpio(struct platform_device *dev)
{
	s3c_gpio_cfgpin(S5PV210_GPD1(2), S3C_GPIO_SFN(2));
	s3c_gpio_setpull(S5PV210_GPD1(2), S3C_GPIO_PULL_UP);
	s3c_gpio_cfgpin(S5PV210_GPD1(3), S3C_GPIO_SFN(2));
	s3c_gpio_setpull(S5PV210_GPD1(3), S3C_GPIO_PULL_UP);
}
Loading