Commit b6972489 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (9657): em28xx: add a functio to write on a single register

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: default avatarDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f8de18d4
...@@ -196,6 +196,12 @@ int em28xx_write_regs(struct em28xx *dev, u16 reg, char *buf, int len) ...@@ -196,6 +196,12 @@ int em28xx_write_regs(struct em28xx *dev, u16 reg, char *buf, int len)
return rc; 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() * em28xx_write_reg_bits()
* sets only some bits (specified by bitmask) of a register, by first reading * sets only some bits (specified by bitmask) of a register, by first reading
......
...@@ -555,6 +555,8 @@ int em28xx_read_reg(struct em28xx *dev, u16 reg); ...@@ -555,6 +555,8 @@ int em28xx_read_reg(struct em28xx *dev, u16 reg);
int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf,
int len); int len);
int em28xx_write_regs(struct em28xx *dev, 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_analog_set(struct em28xx *dev);
int em28xx_audio_setup(struct em28xx *dev); int em28xx_audio_setup(struct em28xx *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment