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

Commit 6b65cd74 authored by Russell King's avatar Russell King Committed by Jean Delvare
Browse files

i2c: New ARM Versatile/Realview bus driver



Add support for the I2C bus found on the ARM Versatile and Realview
platforms.  The I2C bus has a RTC and optionally some EEPROMs attached.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 763d9c04
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -141,6 +141,19 @@ struct platform_device realview_smc91x_device = {
	.resource	= realview_smc91x_resources,
};

static struct resource realview_i2c_resource = {
	.start		= REALVIEW_I2C_BASE,
	.end		= REALVIEW_I2C_BASE + SZ_4K - 1,
	.flags		= IORESOURCE_MEM,
};

struct platform_device realview_i2c_device = {
	.name		= "versatile-i2c",
	.id		= -1,
	.num_resources	= 1,
	.resource	= &realview_i2c_resource,
};

#define REALVIEW_SYSMCI	(__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_MCI_OFFSET)

static unsigned int realview_mmc_status(struct device *dev)
+1 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ static struct amba_device name##_device = { \

extern struct platform_device realview_flash_device;
extern struct platform_device realview_smc91x_device;
extern struct platform_device realview_i2c_device;
extern struct mmc_platform_data realview_mmc0_plat_data;
extern struct mmc_platform_data realview_mmc1_plat_data;
extern struct clk realview_clcd_clk;
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ static void __init realview_eb_init(void)

	platform_device_register(&realview_flash_device);
	platform_device_register(&realview_smc91x_device);
	platform_device_register(&realview_i2c_device);

	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
		struct amba_device *d = amba_devs[i];
+14 −0
Original line number Diff line number Diff line
@@ -325,6 +325,19 @@ static struct platform_device smc91x_device = {
	.resource	= smc91x_resources,
};

static struct resource versatile_i2c_resource = {
	.start			= VERSATILE_I2C_BASE,
	.end			= VERSATILE_I2C_BASE + SZ_4K - 1,
	.flags			= IORESOURCE_MEM,
};

static struct platform_device versatile_i2c_device = {
	.name			= "versatile-i2c",
	.id			= -1,
	.num_resources		= 1,
	.resource		= &versatile_i2c_resource,
};

#define VERSATILE_SYSMCI	(__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET)

unsigned int mmc_status(struct device *dev)
@@ -775,6 +788,7 @@ void __init versatile_init(void)
	clk_register(&versatile_clcd_clk);

	platform_device_register(&versatile_flash_device);
	platform_device_register(&versatile_i2c_device);
	platform_device_register(&smc91x_device);

	for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
+11 −0
Original line number Diff line number Diff line
@@ -476,6 +476,17 @@ config I2C_STUB

	  If you don't know what to do here, definitely say N.

config I2C_VERSATILE
	tristate "ARM Versatile/Realview I2C bus support"
	depends on I2C && (ARCH_VERSATILE || ARCH_REALVIEW)
	select I2C_ALGOBIT
	help
	  Say yes if you want to support the I2C serial bus on ARMs Versatile
	  range of platforms.

	  This driver can also be built as a module.  If so, the module
	  will be called i2c-versatile.

config I2C_VIA
	tristate "VIA 82C586B"
	depends on I2C && PCI && EXPERIMENTAL
Loading