diff options
author | Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 2012-03-08 14:02:20 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-16 19:45:33 +0100 |
commit | bc628fd19d2d1d053b88fa225bb599be026c048b (patch) | |
tree | d314ae4ddcb2804f68179c98a17581b33356fe96 /drivers/mfd/ab8500-i2c.c | |
parent | mfd: Add a prcmu_abb_write_masked routine to db8500-prcmu (diff) | |
download | linux-bc628fd19d2d1d053b88fa225bb599be026c048b.tar.xz linux-bc628fd19d2d1d053b88fa225bb599be026c048b.zip |
mfd: Make use of the ab8500 firmware read-modify-write service
This patch updates the AB8500 driver to make use of the I2C
read-modify-write service in the PRCMU firmware.
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/ab8500-i2c.c')
-rw-r--r-- | drivers/mfd/ab8500-i2c.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mfd/ab8500-i2c.c b/drivers/mfd/ab8500-i2c.c index 70a16ae856a2..b83045f102be 100644 --- a/drivers/mfd/ab8500-i2c.c +++ b/drivers/mfd/ab8500-i2c.c @@ -11,7 +11,7 @@ #include <linux/module.h> #include <linux/platform_device.h> #include <linux/mfd/abx500/ab8500.h> -#include <linux/mfd/db8500-prcmu.h> +#include <linux/mfd/dbx500-prcmu.h> static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data) { @@ -23,6 +23,18 @@ static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data) return ret; } +static int ab8500_i2c_write_masked(struct ab8500 *ab8500, u16 addr, u8 mask, + u8 data) +{ + int ret; + + ret = prcmu_abb_write_masked((u8)(addr >> 8), (u8)(addr & 0xFF), &data, + &mask, 1); + if (ret < 0) + dev_err(ab8500->dev, "prcmu i2c error %d\n", ret); + return ret; +} + static int ab8500_i2c_read(struct ab8500 *ab8500, u16 addr) { int ret; @@ -59,6 +71,7 @@ static int __devinit ab8500_i2c_probe(struct platform_device *plf) ab8500->read = ab8500_i2c_read; ab8500->write = ab8500_i2c_write; + ab8500->write_masked = ab8500_i2c_write_masked; platform_set_drvdata(plf, ab8500); |