From: Lars-Peter Clausen Date: Fri, 23 Jan 2015 15:52:24 +0000 (-0300) Subject: [media] adv7180: Do implicit register paging X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~131^2~105 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3999e5d01da74f1a22afbb0b61b3992fea301478;p=pandora-kernel.git [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 Acked-by: Federico Vaga Acked-by: Hans Verkuil Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed