media: dvb-frontends/stv0910: field and register access helpers
authorDaniel Scheller <d.scheller@gmx.net>
Tue, 26 Dec 2017 23:37:58 +0000 (18:37 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 3 Jan 2018 09:48:07 +0000 (04:48 -0500)
commitbdd7682b16988a0fac07f9cf630e4fddb73e161c
tree4c18e0ce99b35012b9a70b2d9f681109630c81f8
parent8042e98c387b02fc4239eee0075d0f318efcf1d7
media: dvb-frontends/stv0910: field and register access helpers

Add a write_field() function that acts as helper to update specific bits
specified in the field defines (FSTV0910_*) in stv0910_regs.h, which was
recently updated to carry the missing offset values. With that, add the
SET_FIELD(), SET_REG() and GET_REG() macros that wrap the write_field(),
write_reg() and read_reg() functions to allow for making all demod
access code cleaner.

The write_field() function is annotated with __maybe_unused temporarily
to silence eventual compile warnings.

Picked up from the dddvb upstream, with the macro names made uppercase
so they are distinguishable as such.

Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/stv0910.c