Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137234
b: refs/heads/master
c: 7920675
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer committed Mar 13, 2009
1 parent d7d5996 commit c6f6d27
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2aaac70cd00cf5d4687cc35f462e3888c9ac76f
refs/heads/master: 792067507b8bf5eaf220ee6994423381b7ae5c0b
51 changes: 51 additions & 0 deletions trunk/arch/arm/mach-mx3/pcm037.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <linux/gpio.h>
#include <linux/smc911x.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/i2c/at24.h>

#include <mach/hardware.h>
#include <asm/mach-types.h>
Expand All @@ -37,6 +39,9 @@
#include <mach/iomux-mx3.h>
#include <mach/board-pcm037.h>
#include <mach/mxc_nand.h>
#ifdef CONFIG_I2C_IMX
#include <mach/i2c.h>
#endif

#include "devices.h"

Expand Down Expand Up @@ -117,6 +122,46 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
.hw_ecc = 1,
};

#ifdef CONFIG_I2C_IMX
static int i2c_1_pins[] = {
MX31_PIN_CSPI2_MOSI__SCL,
MX31_PIN_CSPI2_MISO__SDA,
};

static int pcm037_i2c_1_init(struct device *dev)
{
return mxc_iomux_setup_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins),
"i2c-1");
}

static void pcm037_i2c_1_exit(struct device *dev)
{
mxc_iomux_release_multiple_pins(i2c_1_pins, ARRAY_SIZE(i2c_1_pins));
}

static struct imxi2c_platform_data pcm037_i2c_1_data = {
.bitrate = 100000,
.init = pcm037_i2c_1_init,
.exit = pcm037_i2c_1_exit,
};

static struct at24_platform_data board_eeprom = {
.byte_len = 4096,
.page_size = 32,
.flags = AT24_FLAG_ADDR16,
};

static struct i2c_board_info pcm037_i2c_devices[] = {
{
I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */
.platform_data = &board_eeprom,
}, {
I2C_BOARD_INFO("rtc-pcf8563", 0x51),
.type = "pcf8563",
}
};
#endif

static struct platform_device *devices[] __initdata = {
&pcm037_flash,
&pcm037_eth,
Expand Down Expand Up @@ -156,6 +201,12 @@ static void __init mxc_board_init(void)
"pcm037-eth"))
gpio_direction_input(MX31_PIN_GPIO3_1);

#ifdef CONFIG_I2C_IMX
i2c_register_board_info(1, pcm037_i2c_devices,
ARRAY_SIZE(pcm037_i2c_devices));

mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data);
#endif
mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
}

Expand Down

0 comments on commit c6f6d27

Please sign in to comment.