diff options
author | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-11 19:43:27 +0100 |
---|---|---|
committer | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-11 19:49:30 +0100 |
commit | 0b72f6adee19ef13d7671765969200f8c29e62f1 (patch) | |
tree | 4a9df39b3046f46818d325bbe8ca1dbfd604c235 /arch/arm/mach-mx5/pm_da9053.c | |
parent | d4a05fa57a0ca93d01354a607336b9efe48e94c4 (diff) |
ccxmx5x: Configure da9053 pm with the correct I2C address.
Depending on the module revision, the PMIC has one I2C address or another.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/mach-mx5/pm_da9053.c')
-rw-r--r-- | arch/arm/mach-mx5/pm_da9053.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/mach-mx5/pm_da9053.c b/arch/arm/mach-mx5/pm_da9053.c index 259ab8dad098..ccd5b81fdb1d 100644 --- a/arch/arm/mach-mx5/pm_da9053.c +++ b/arch/arm/mach-mx5/pm_da9053.c @@ -29,6 +29,7 @@ #include <linux/io.h> #include <linux/clk.h> #include <linux/mfd/da9052/reg.h> +#include <linux/mfd/da9052/da9052.h> #include <asm/mach-types.h> #include <mach/hardware.h> @@ -62,6 +63,7 @@ static void __iomem *base; static int stopped; +static int i2caddr = DA9052_I2C_ADDR >> 1; /** Functions for IMX I2C adapter driver *************************************** *******************************************************************************/ @@ -247,9 +249,10 @@ fail0: return (result < 0) ? result : num; } -void pm_da9053_i2c_init(u32 base_addr) +void pm_da9053_i2c_init(u32 base_addr , u32 i2c_addr) { base = ioremap(base_addr, SZ_4K); + i2caddr = i2c_addr; } void pm_da9053_i2c_deinit(void) @@ -262,13 +265,13 @@ void pm_da9053_read_reg(u8 reg, u8 *value) unsigned char buf[2] = {0, 0}; struct i2c_msg i2cmsg[2]; buf[0] = reg; - i2cmsg[0].addr = 0x48 ; + i2cmsg[0].addr = i2caddr ; i2cmsg[0].len = 1; i2cmsg[0].buf = &buf[0]; i2cmsg[0].flags = 0; - i2cmsg[1].addr = 0x48 ; + i2cmsg[1].addr = i2caddr ; i2cmsg[1].len = 1; i2cmsg[1].buf = &buf[1]; @@ -284,7 +287,7 @@ void pm_da9053_write_reg(u8 reg, u8 value) struct i2c_msg i2cmsg[2]; buf[0] = reg; buf[1] = value; - i2cmsg[0].addr = 0x48 ; + i2cmsg[0].addr = i2caddr ; i2cmsg[0].len = 2; i2cmsg[0].buf = &buf[0]; i2cmsg[0].flags = 0; |