nvmem: rockchip-efuse: add optional property to get efuse size

The exact efuse size is defined in property <reg> before, this assume
that the length of registers is equal to efuse size, but it not true
for some chips, so we need anothor property to redefine efuse size.

Change-Id: I9cdab8adc2a13b55cfcacc3c2248295c4387a806
Signed-off-by: Chen Liang <cl@rock-chips.com>
This commit is contained in:
Chen Liang
2017-04-11 15:51:23 +08:00
committed by Huang, Tao
parent 8c606fb4f6
commit 976deff0db
2 changed files with 10 additions and 1 deletions

View File

@@ -13,6 +13,10 @@ Required properties:
- clocks: Should be the clock id of eFuse
- clock-names: Should be "pclk_efuse"
Optional properties:
- rockchip,efuse-size: Should be exact eFuse size in byte, the eFuse
size in property <reg> will be invalid if define this property.
Deprecated properties:
- compatible: "rockchip,rockchip-efuse"
Old efuse compatible value compatible to rk3066a, rk3188 and rk3288

View File

@@ -361,7 +361,12 @@ static int __init rockchip_efuse_probe(struct platform_device *pdev)
return PTR_ERR(efuse->clk);
efuse->dev = &pdev->dev;
econfig.size = resource_size(res);
if (of_property_read_u32_index(dev->of_node,
"rockchip,efuse-size",
0,
&econfig.size))
econfig.size = resource_size(res);
econfig.reg_read = match->data;
econfig.priv = efuse;
econfig.dev = efuse->dev;