diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-23 12:52:24 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-02 11:40:14 -0200 |
commit | 3999e5d01da74f1a22afbb0b61b3992fea301478 (patch) | |
tree | 3be79b327c87cc90a3a7ca14a3eea497ac8ccf57 /lib/crc-itu-t.c | |
parent | 029d61779189a488d5649dab43c83cc6497e8843 (diff) |
[media] adv7180: Do implicit register paging
The ad7180 has multiple register pages which can be switched between by
writing to a register. Currently the driver manually switches between pages
whenever a register outside of the default register map is accessed and
switches back after it has been accessed. This is a bit tedious and also
potential source for bugs.
This patch adds two helper functions that take care of switching between
pages and reading/writing the register. The register numbers for registers
are updated to encode both the page (in the upper 8-bits) and the register
(in the lower 8-bits) numbers.
Having multiple pages means that a register access is not a single atomic
i2c_smbus_write_byte_data() or i2c_smbus_read_byte_data() call and we need
to make sure that concurrent register access does not race against each
other.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'lib/crc-itu-t.c')
0 files changed, 0 insertions, 0 deletions