summaryrefslogtreecommitdiff
path: root/drivers/nvmem
diff options
context:
space:
mode:
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>2017-12-15 17:06:07 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-19 12:39:33 +0300
commit683618b0639387c5eda79b2f2753c35f3dd648d7 (patch)
tree6a59915a1704c4a9eb7c5c977601a4a283db193c /drivers/nvmem
parentfc2f997035fef8463abcf8a0a1f3d92c7c6fdf0a (diff)
downloadlinux-683618b0639387c5eda79b2f2753c35f3dd648d7.tar.xz
nvmem: uniphier: change access unit from 32bit to 8bit
The efuse on UniPhier allows 8bit access according to the specification. Since bit offset of nvmem is limited to 0-7, it is desiable to change access unit of nvmem to 8bit. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r--drivers/nvmem/uniphier-efuse.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c
index 9d278b4e1dc7..be11880a1358 100644
--- a/drivers/nvmem/uniphier-efuse.c
+++ b/drivers/nvmem/uniphier-efuse.c
@@ -27,11 +27,11 @@ static int uniphier_reg_read(void *context,
unsigned int reg, void *_val, size_t bytes)
{
struct uniphier_efuse_priv *priv = context;
- u32 *val = _val;
+ u8 *val = _val;
int offs;
- for (offs = 0; offs < bytes; offs += sizeof(u32))
- *val++ = readl(priv->base + reg + offs);
+ for (offs = 0; offs < bytes; offs += sizeof(u8))
+ *val++ = readb(priv->base + reg + offs);
return 0;
}
@@ -53,8 +53,8 @@ static int uniphier_efuse_probe(struct platform_device *pdev)
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
- econfig.stride = 4;
- econfig.word_size = 4;
+ econfig.stride = 1;
+ econfig.word_size = 1;
econfig.read_only = true;
econfig.reg_read = uniphier_reg_read;
econfig.size = resource_size(res);