This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] si2165: create function si2165_write_reg_list for writing 
register lists
Author:  Matthias Schwarzott <[email protected]>
Date:    Thu Nov 19 18:03:55 2015 -0200

It is common the need of writing a table of values. Add a function to provide a
helper to address such case. This will allow further code cleanups.

Signed-off-by: Matthias Schwarzott <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/dvb-frontends/si2165.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=a5293dbd7033b4d3bab63c21025f76d00a8a2585
diff --git a/drivers/media/dvb-frontends/si2165.c 
b/drivers/media/dvb-frontends/si2165.c
index a0e4600bf36f..222d7750f98d 100644
--- a/drivers/media/dvb-frontends/si2165.c
+++ b/drivers/media/dvb-frontends/si2165.c
@@ -243,6 +243,27 @@ err:
        return ret;
 }
 
+#define REG16(reg, val) { (reg), (val) & 0xff }, { (reg)+1, (val)>>8 & 0xff }
+struct si2165_reg_value_pair {
+       u16 reg;
+       u8 val;
+};
+
+static int si2165_write_reg_list(struct si2165_state *state,
+                                const struct si2165_reg_value_pair *regs,
+                                int count)
+{
+       int i;
+       int ret;
+
+       for (i = 0; i < count; i++) {
+               ret = si2165_writereg8(state, regs[i].reg, regs[i].val);
+               if (ret < 0)
+                       return ret;
+       }
+       return 0;
+}
+
 static int si2165_get_tune_settings(struct dvb_frontend *fe,
                                    struct dvb_frontend_tune_settings *s)
 {

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to