mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
nvmem: rockchip-otp: Add support to initialize otp when probe
Change-Id: I6ae99f68394787fc2e8e6868d788390f271073ed Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -69,6 +69,7 @@ static const char * const rockchip_otp_clocks[] = {
|
||||
|
||||
struct rockchip_data {
|
||||
int size;
|
||||
int (*init)(struct rockchip_otp *otp);
|
||||
};
|
||||
|
||||
static int rockchip_otp_reset(struct rockchip_otp *otp)
|
||||
@@ -247,6 +248,12 @@ static int rockchip_otp_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(otp->rst))
|
||||
return PTR_ERR(otp->rst);
|
||||
|
||||
if (data->init) {
|
||||
ret = data->init(otp);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
otp_config.size = data->size;
|
||||
otp_config.priv = otp;
|
||||
otp_config.dev = dev;
|
||||
|
||||
Reference in New Issue
Block a user