mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ARM: OMAP: pcm051: Add i2c0 and at24 eeprom support
Date: Thu, 20 Jun 2013 14:50:30 +0200	[thread overview]
Message-ID: <1371732630-27966-4-git-send-email-t.gamez@phytec.de> (raw)
In-Reply-To: <1371732630-27966-1-git-send-email-t.gamez@phytec.de>

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
 arch/arm/boards/pcm051/board.c    |   18 ++++++++++++++++++
 arch/arm/configs/pcm051_defconfig |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index 0ad8cb4..eea5ebb 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -32,6 +32,8 @@
 #include <mach/cpsw.h>
 #include <spi/spi.h>
 #include <spi/flash.h>
+#include <i2c/i2c.h>
+#include <i2c/at24.h>
 
 #include "mux.h"
 
@@ -89,6 +91,12 @@ static struct cpsw_platform_data cpsw_data = {
 	.num_slaves	= ARRAY_SIZE(cpsw_slaves),
 };
 
+static struct i2c_board_info i2c0_devices[] = {
+	{
+		I2C_BOARD_INFO("24c32", 0x52),
+	},
+};
+
 static void pcm051_spi_init(void)
 {
 	int ret;
@@ -111,6 +119,15 @@ static void pcm051_eth_init(void)
 	am33xx_add_cpsw(&cpsw_data);
 }
 
+static void pcm051_i2c_init(void)
+{
+	am33xx_enable_i2c0_pin_mux();
+
+	i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
+
+	am33xx_add_i2c0(NULL);
+}
+
 static int pcm051_devices_init(void)
 {
 	pcm051_enable_mmc0_pin_mux();
@@ -119,6 +136,7 @@ static int pcm051_devices_init(void)
 
 	pcm051_spi_init();
 	pcm051_eth_init();
+	pcm051_i2c_init();
 
 	devfs_add_partition("nor0", 0x00000, SZ_128K,
 					DEVFS_PARTITION_FIXED, "xload");
diff --git a/arch/arm/configs/pcm051_defconfig b/arch/arm/configs/pcm051_defconfig
index 804ca14..8de3714 100644
--- a/arch/arm/configs/pcm051_defconfig
+++ b/arch/arm/configs/pcm051_defconfig
@@ -42,6 +42,7 @@ CONFIG_CMD_TIMEOUT=y
 CONFIG_CMD_PARTITION=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_I2C=y
 CONFIG_NET=y
 CONFIG_NET_DHCP=y
 CONFIG_NET_NFS=y
@@ -50,6 +51,8 @@ CONFIG_DRIVER_SERIAL_NS16550=y
 CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
 CONFIG_DRIVER_NET_CPSW=y
 CONFIG_DRIVER_SPI_OMAP3=y
+CONFIG_I2C=y
+CONFIG_I2C_OMAP=y
 CONFIG_MTD=y
 CONFIG_MTD_M25P80=y
 CONFIG_NAND=y
@@ -57,6 +60,7 @@ CONFIG_USB=y
 CONFIG_MCI=y
 CONFIG_MCI_STARTUP=y
 CONFIG_MCI_OMAP_HSMMC=y
+CONFIG_EEPROM_AT24=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
 CONFIG_FS_FAT_LFN=y
-- 
1.7.0.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2013-06-20 12:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 12:50 [PATCH 0/3] I2C support for AM33xx Teresa Gámez
2013-06-20 12:50 ` [PATCH 1/3] i2c-omap: cleanup cpu_is functions Teresa Gámez
2013-06-20 12:50 ` [PATCH 2/3] ARM: AM33xx: Add i2c support for AM33xx Teresa Gámez
2013-06-21  5:39   ` Sascha Hauer
2013-06-20 12:50 ` Teresa Gámez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371732630-27966-4-git-send-email-t.gamez@phytec.de \
    --to=t.gamez@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox