Skip to contentSkip to conversation

mfd: Add WM8994 bulk register write operation

PATCH In review Mark Brown 2 participants 2 messages Mar 10, 2011 – Mar 14, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mfd: Add WM8994 bulk register write operation

---
 drivers/mfd/wm8994-core.c       |   23 +++++++++++++++++++++++
 include/linux/mfd/wm8994/core.h |    2 ++
 2 files changed, 25 insertions(+), 0 deletions(-)
drivers/mfd/wm8994-core.c +23 -0
index e673bda2..5220af2 100644
@@ -138,6 +138,29 @@ int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
 EXPORT_SYMBOL_GPL(wm8994_reg_write);
 
 /**
+ * wm8994_bulk_write: Write multiple WM8994 registers
+ *
+ * @wm8994: Device to write to
+ * @reg: First register
+ * @count: Number of registers
+ * @buf: Buffer to write from.
+ */
+int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
+		      int count, u16 *buf)
+{
+	int ret;
+
+	mutex_lock(&wm8994->io_lock);
+
+	ret = wm8994_write(wm8994, reg, count * 2, buf);
+
+	mutex_unlock(&wm8994->io_lock);
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(wm8994_bulk_write);
+
+/**
  * wm8994_set_bits: Set the value of a bitfield in a WM8994 register
  *
  * @wm8994: Device to write to.
include/linux/mfd/wm8994/core.h +2 -0
index ef4f0b6..cb7d3ae 100644
@@ -88,6 +88,8 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
 		    unsigned short mask, unsigned short val);
 int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
 		     int count, u16 *buf);
+int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
+		     int count, u16 *buf);
 
 
 /* Helper to save on boilerplate */
Signature · 1 line
1.7.2.3