]> Pileus Git - ~andy/linux/commit
i2c: ocores: Add support for the GRLIB port of the controller and use function pointe...
authorAndreas Larsson <andreas@gaisler.com>
Thu, 15 Nov 2012 15:50:59 +0000 (16:50 +0100)
committerWolfram Sang <w.sang@pengutronix.de>
Fri, 16 Nov 2012 17:22:35 +0000 (18:22 +0100)
commita000b8c1e30115800d3de86b4b058cadd9cba59d
tree2ddea497c45de6078738975e89b3954e305b7ddd
parentf5f35a92e44a1f70fd8c77a42339318a5c8d9eb7
i2c: ocores: Add support for the GRLIB port of the controller and use function pointers for getreg and setreg functions

The registers in the GRLIB port of the controller are 32-bit and in big endian
byte order. The PRELOW and PREHIGH registers are merged into one register. The
subsequent registers have their offset decreased accordingly. Hence the register
access needs to be handled in a non-standard manner using custom getreg and
setreg functions.

Add setreg and getreg functions for different register widths and let oc_setreg
and oc_getreg use function pointers to call the appropriate functions.

A type is added as the data of the of match table entries. A new entry with a
different compatible string is added to the table. The type of that entry
triggers usage of the custom grlib functions by setting the setreg and getreg
function pointers.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Documentation/devicetree/bindings/i2c/i2c-ocores.txt
drivers/i2c/busses/i2c-ocores.c