[RESEND][PATCH 1/2] em28xx: add em28xx_write_reg() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

The following patch introduces a new function that writes to a single
register.  This is useful because the vast majority of register writes
are a single register, and this format permits or'ing register value
bits together.

Please let me know if you have any questions,

Devin

-- 
Devin J. Heitmueller
http://www.devinheitmueller.com
AIM: devinheitmueller
em28xx: add em28xx_write_reg() function

From: Devin Heitmueller <devin.heitmueller@xxxxxxxxx>

Introduce a new function that writes to a single register.  This is
useful because the vast majority of register writes are a single
register, and this format permits or'ing register value bits together.

Signed-off-by: Devin Heitmueller <devin.heitmueller@xxxxxxxxx>
Index: v4l-dvb/linux/drivers/media/video/em28xx/em28xx-core.c
===================================================================
--- v4l-dvb.orig/linux/drivers/media/video/em28xx/em28xx-core.c	2008-11-19 23:36:10.000000000 -0500
+++ v4l-dvb/linux/drivers/media/video/em28xx/em28xx-core.c	2008-11-19 23:37:16.000000000 -0500
@@ -196,6 +196,12 @@
 	return rc;
 }
 
+/* Write a single register */
+int em28xx_write_reg(struct em28xx *dev, u16 reg, u8 val)
+{
+	return em28xx_write_regs(dev, reg, &val, 1);
+}
+
 /*
  * em28xx_write_reg_bits()
  * sets only some bits (specified by bitmask) of a register, by first reading
Index: v4l-dvb/linux/drivers/media/video/em28xx/em28xx.h
===================================================================
--- v4l-dvb.orig/linux/drivers/media/video/em28xx/em28xx.h	2008-11-19 23:36:03.000000000 -0500
+++ v4l-dvb/linux/drivers/media/video/em28xx/em28xx.h	2008-11-19 23:37:42.000000000 -0500
@@ -553,6 +553,8 @@
 int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf,
 			  int len);
 int em28xx_write_regs(struct em28xx *dev, u16 reg, char *buf, int len);
+int em28xx_write_reg(struct em28xx *dev, u16 reg, u8 val);
+
 int em28xx_audio_analog_set(struct em28xx *dev);
 int em28xx_audio_setup(struct em28xx *dev);
 
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux