• Home
  • Raw
  • Download

Lines Matching refs:otp

36 static int mxs_ocotp_wait(struct mxs_ocotp *otp)  in mxs_ocotp_wait()  argument
42 status = readl(otp->base); in mxs_ocotp_wait()
61 struct mxs_ocotp *otp = context; in mxs_ocotp_read() local
65 ret = clk_enable(otp->clk); in mxs_ocotp_read()
69 writel(BM_OCOTP_CTRL_ERROR, otp->base + STMP_OFFSET_REG_CLR); in mxs_ocotp_read()
71 ret = mxs_ocotp_wait(otp); in mxs_ocotp_read()
76 writel(BM_OCOTP_CTRL_RD_BANK_OPEN, otp->base + STMP_OFFSET_REG_SET); in mxs_ocotp_read()
81 ret = mxs_ocotp_wait(otp); in mxs_ocotp_read()
90 *buf++ = readl(otp->base + offset); in mxs_ocotp_read()
99 writel(BM_OCOTP_CTRL_RD_BANK_OPEN, otp->base + STMP_OFFSET_REG_CLR); in mxs_ocotp_read()
102 clk_disable(otp->clk); in mxs_ocotp_read()
142 struct mxs_ocotp *otp; in mxs_ocotp_probe() local
150 otp = devm_kzalloc(dev, sizeof(*otp), GFP_KERNEL); in mxs_ocotp_probe()
151 if (!otp) in mxs_ocotp_probe()
154 otp->base = devm_platform_ioremap_resource(pdev, 0); in mxs_ocotp_probe()
155 if (IS_ERR(otp->base)) in mxs_ocotp_probe()
156 return PTR_ERR(otp->base); in mxs_ocotp_probe()
158 otp->clk = devm_clk_get(&pdev->dev, NULL); in mxs_ocotp_probe()
159 if (IS_ERR(otp->clk)) in mxs_ocotp_probe()
160 return PTR_ERR(otp->clk); in mxs_ocotp_probe()
162 ret = clk_prepare(otp->clk); in mxs_ocotp_probe()
168 ret = devm_add_action_or_reset(&pdev->dev, mxs_ocotp_action, otp->clk); in mxs_ocotp_probe()
175 ocotp_config.priv = otp; in mxs_ocotp_probe()
177 otp->nvmem = devm_nvmem_register(dev, &ocotp_config); in mxs_ocotp_probe()
178 if (IS_ERR(otp->nvmem)) in mxs_ocotp_probe()
179 return PTR_ERR(otp->nvmem); in mxs_ocotp_probe()
181 platform_set_drvdata(pdev, otp); in mxs_ocotp_probe()