nvmem: sc27xx: Convert nvmem offset to block index
authorFreeman Liu <freeman.liu@unisoc.com>
Mon, 28 Jan 2019 15:54:54 +0000 (15:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 15:24:14 +0000 (16:24 +0100)
commit996e39bb03ba0ec31dbe8c1c7df11130ba9de639
treea9e3b8bd802539a2b4cc3f5af84f250d7189d94e
parent38cd7ad5bd25a7e63f17fa58bb54d1df8ff3fbf8
nvmem: sc27xx: Convert nvmem offset to block index

The Spreadtrum SC27XX efuse data are organized by blocks and each block
contains 2 bytes data. Moreover the nvmem core always pass the offset
in byte to the controller, so we should change the offset in byte to
the correct block index and block offset to read the data.

Signed-off-by: Freeman Liu <freeman.liu@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/sc27xx-efuse.c