aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-10 08:54:07 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-23 05:42:07 -0400
commite93c53870c6d77c40de8981da238af947d6aa084 (patch)
tree4244c06a357838473962a59c199d012a846f22c0
parent09b034191acd1f95a749630fe366a84d3029930c (diff)
mfd: Add WM8994 bulk register write operation
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/wm8994-core.c23
-rw-r--r--include/linux/mfd/wm8994/core.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index e673bda21f5d..5220af26419e 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -138,6 +138,29 @@ int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
138EXPORT_SYMBOL_GPL(wm8994_reg_write); 138EXPORT_SYMBOL_GPL(wm8994_reg_write);
139 139
140/** 140/**
141 * wm8994_bulk_write: Write multiple WM8994 registers
142 *
143 * @wm8994: Device to write to
144 * @reg: First register
145 * @count: Number of registers
146 * @buf: Buffer to write from.
147 */
148int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
149 int count, u16 *buf)
150{
151 int ret;
152
153 mutex_lock(&wm8994->io_lock);
154
155 ret = wm8994_write(wm8994, reg, count * 2, buf);
156
157 mutex_unlock(&wm8994->io_lock);
158
159 return ret;
160}
161EXPORT_SYMBOL_GPL(wm8994_bulk_write);
162
163/**
141 * wm8994_set_bits: Set the value of a bitfield in a WM8994 register 164 * wm8994_set_bits: Set the value of a bitfield in a WM8994 register
142 * 165 *
143 * @wm8994: Device to write to. 166 * @wm8994: Device to write to.
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index ef4f0b6083a3..cb7d3ae7da8f 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -88,6 +88,8 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
88 unsigned short mask, unsigned short val); 88 unsigned short mask, unsigned short val);
89int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, 89int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
90 int count, u16 *buf); 90 int count, u16 *buf);
91int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
92 int count, u16 *buf);
91 93
92 94
93/* Helper to save on boilerplate */ 95/* Helper to save on boilerplate */