power: qpnp-fg: fix offset SRAM reads/writes
When a read or write is attempted at a given offset
which is determined by the address, currently the
offset is not correctly accounted for and the data
returned would be as follows:
address = offset_address - (offset_address % 4)
To allow reading from addresses where the modulus is non-zero
take into account the modulus result when doing SRAM reads
or writes.
Note that for any SRAM writes the third byte in the buffer
must be written to in order for the write to take effect.
For example a write to byte 2 must write bytes 2 and 3 at
a given address.
CRs-Fixed: 711917
Change-Id: Ic889834193223cea8046e36dc1d8f36937f6d27b
Signed-off-by:
David Keitel <dkeitel@codeaurora.org>
Loading
Please register or sign in to comment