From: Ladislav Michl Date: Sat, 9 Feb 2008 00:25:35 +0100 Subject: [U-Boot-Users] [PATCH] I2C register access functions for omap1510_i2c driver Message-ID: <20080208232535.GA24190@michl.2n.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de drivers/i2c/omap1510_i2c.c does not implement i2c_reg_read and i2c_reg_write which leads to unresolved symbols when using ds1307 driver. While there, enable CONFIG_CMD_DATE for Voiceblue board to have nice test case :-) Signed-off-by: Ladislav Michl diff --git a/drivers/i2c/omap1510_i2c.c b/drivers/i2c/omap1510_i2c.c index 04400fb..f0fc15e 100644 --- a/drivers/i2c/omap1510_i2c.c +++ b/drivers/i2c/omap1510_i2c.c @@ -240,6 +240,19 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len) return 0; } +uchar i2c_reg_read (uchar chip, uchar reg) +{ + uchar val; + + i2c_read_byte(chip, reg, &val); + return val; +} + +void i2c_reg_write(uchar chip, uchar reg, uchar val) +{ + i2c_write_byte(chip, reg, val); +} + static void wait_for_bb (void) { int timeout = 10; diff --git a/include/configs/voiceblue.h b/include/configs/voiceblue.h index 8c827af..63e3530 100644 --- a/include/configs/voiceblue.h +++ b/include/configs/voiceblue.h @@ -126,6 +126,7 @@ #define CONFIG_CMD_BDI #define CONFIG_CMD_BOOTD +#define CONFIG_CMD_DATE #define CONFIG_CMD_DHCP #define CONFIG_CMD_ENV #define CONFIG_CMD_FLASH diff --git a/board/voiceblue/voiceblue.c b/board/voiceblue/voiceblue.c index c8dde36..fbbbe9d 100644 --- a/board/voiceblue/voiceblue.c +++ b/board/voiceblue/voiceblue.c @@ -56,6 +56,7 @@ int dram_init(void) int misc_init_r(void) { *((volatile unsigned short *) VOICEBLUE_LED_REG) = 0x55; + i2c_reg_write(CFG_I2C_RTC_ADDR, 0x10, 0xaa); /* Trickle charge */ return 0; }