• Home
  • Raw
  • Download

Lines Matching refs:rng

48 	struct msm_rng *rng = to_msm_rng(hwrng);  in msm_rng_enable()  local
52 ret = clk_prepare_enable(rng->clk); in msm_rng_enable()
58 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
62 val = readl_relaxed(rng->base + PRNG_LFSR_CFG); in msm_rng_enable()
65 writel(val, rng->base + PRNG_LFSR_CFG); in msm_rng_enable()
67 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
69 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable()
71 val = readl_relaxed(rng->base + PRNG_CONFIG); in msm_rng_enable()
73 writel(val, rng->base + PRNG_CONFIG); in msm_rng_enable()
77 clk_disable_unprepare(rng->clk); in msm_rng_enable()
83 struct msm_rng *rng = to_msm_rng(hwrng); in msm_rng_read() local
97 ret = clk_prepare_enable(rng->clk); in msm_rng_read()
103 val = readl_relaxed(rng->base + PRNG_STATUS); in msm_rng_read()
107 val = readl_relaxed(rng->base + PRNG_DATA_OUT); in msm_rng_read()
119 clk_disable_unprepare(rng->clk); in msm_rng_read()
137 struct msm_rng *rng; in msm_rng_probe() local
140 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in msm_rng_probe()
141 if (!rng) in msm_rng_probe()
144 platform_set_drvdata(pdev, rng); in msm_rng_probe()
147 rng->base = devm_ioremap_resource(&pdev->dev, res); in msm_rng_probe()
148 if (IS_ERR(rng->base)) in msm_rng_probe()
149 return PTR_ERR(rng->base); in msm_rng_probe()
151 rng->clk = devm_clk_get(&pdev->dev, "core"); in msm_rng_probe()
152 if (IS_ERR(rng->clk)) in msm_rng_probe()
153 return PTR_ERR(rng->clk); in msm_rng_probe()
155 rng->hwrng.name = KBUILD_MODNAME, in msm_rng_probe()
156 rng->hwrng.init = msm_rng_init, in msm_rng_probe()
157 rng->hwrng.cleanup = msm_rng_cleanup, in msm_rng_probe()
158 rng->hwrng.read = msm_rng_read, in msm_rng_probe()
160 ret = devm_hwrng_register(&pdev->dev, &rng->hwrng); in msm_rng_probe()