spmi: pmic-arb: Fix multibyte transfer bug and enforce buffer len

Bug fix for reading and writing multiple bytes. The bug causes holes
in the first 4 bytes when the byte count = 4, 5, or 6. Additionally,
on attempt to write more then the PMIC-arbiter supports, an error
message is logged and error value is returned. The SPMI framework
allows up to 16 byte per transfer, as supported by SPMI spec. However,
the PMIC arbiter supports up to 8 bytes per transfer.

Change-Id: I5c192fc22af51b1c61ed8ce31b75261cb8ad49ce
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
1 file changed