i2c: tegra: apply size limit quirk
authorWolfram Sang <wsa@the-dreams.de>
Tue, 16 Jun 2015 17:57:29 +0000 (19:57 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 21 Jun 2015 19:24:10 +0000 (21:24 +0200)
commit3aaa34b9923b994c13267e05ce8246faa1e8c8eb
tree37df588435266a1613ee980474cfa12d1efb2f49
parent4bb28e37765f4b5b18cb3b9242aa8542e8c4b8b4
i2c: tegra: apply size limit quirk

payload_size is a 12 bit field in the HW register, so add a limit for
this size. That way we gracefully reject the message beforehand instead
of generating an OOPS while transferring. Verified using some older
Tegra2 documentation and a more recent Jetson TK1 board.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
drivers/i2c/busses/i2c-tegra.c