summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-07-03 10:24:35 (GMT)
committerBen Dooks <ben-linux@fluff.org>2008-07-03 15:51:26 (GMT)
commitd10d8a5f79e3e33db1a9f177c54187e2312598f2 (patch)
tree169c87061bf5ba7c8cb5aae1eef37f9f61391bcb /arch/arm
parentfd2de272b23bbb866294ff72f55d3731fe6a4c92 (diff)
downloadlinux-d10d8a5f79e3e33db1a9f177c54187e2312598f2.tar.xz
[ARM] JIVE: Add i2c device info for LIS302DL sensor
Add i2c bus definition for the LIS302DL sensor driver which is connected on the i2c bus. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 2e6350d..7f5d002 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
+#include <linux/i2c.h>
#include <video/ili9320.h>
@@ -34,6 +35,7 @@
#include <asm/plat-s3c/regs-serial.h>
#include <asm/plat-s3c/nand.h>
+#include <asm/plat-s3c/iic.h>
#include <asm/arch/regs-power.h>
#include <asm/arch/regs-gpio.h>
@@ -396,7 +398,7 @@ static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs)
}
static struct s3c2410_spigpio_info jive_lcd_spi = {
- .bus_num = 1,
+ .bus_num = 0,
.pin_clk = S3C2410_GPG8,
.pin_mosi = S3C2410_GPB8,
.chip_select = jive_lcd_spi_chipselect,
@@ -449,6 +451,24 @@ static struct spi_board_info __initdata jive_spi_devs[] = {
},
};
+/* I2C bus and device configuration. */
+
+static struct s3c2410_platform_i2c jive_i2c_cfg = {
+ .max_freq = 80 * 1000,
+ .bus_freq = 50 * 1000,
+ .flags = S3C_IICFLG_FILTER,
+ .sda_delay = 2,
+};
+
+static struct i2c_board_info jive_i2c_devs[] = {
+ [0] = {
+ I2C_BOARD_INFO("lis302dl", 0x1c),
+ .irq = IRQ_EINT14,
+ },
+};
+
+/* The platform devices being used. */
+
static struct platform_device *jive_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_rtc,
@@ -638,6 +658,9 @@ static void __init jive_machine_init(void)
spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
+ s3c_device_i2c.dev.platform_data = &jive_i2c_cfg;
+ i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
+
platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices));
}