Lines Matching full:trng

37 	struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng);  in ingenic_trng_init()  local
40 ctrl = readl(trng->base + TRNG_REG_CFG_OFFSET); in ingenic_trng_init()
42 writel(ctrl, trng->base + TRNG_REG_CFG_OFFSET); in ingenic_trng_init()
49 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng); in ingenic_trng_cleanup() local
52 ctrl = readl(trng->base + TRNG_REG_CFG_OFFSET); in ingenic_trng_cleanup()
54 writel(ctrl, trng->base + TRNG_REG_CFG_OFFSET); in ingenic_trng_cleanup()
59 struct ingenic_trng *trng = container_of(rng, struct ingenic_trng, rng); in ingenic_trng_read() local
64 ret = readl_poll_timeout(trng->base + TRNG_REG_STATUS_OFFSET, status, in ingenic_trng_read()
71 *data = readl(trng->base + TRNG_REG_RANDOMNUM_OFFSET); in ingenic_trng_read()
78 struct ingenic_trng *trng; in ingenic_trng_probe() local
82 trng = devm_kzalloc(&pdev->dev, sizeof(*trng), GFP_KERNEL); in ingenic_trng_probe()
83 if (!trng) in ingenic_trng_probe()
86 trng->base = devm_platform_ioremap_resource(pdev, 0); in ingenic_trng_probe()
87 if (IS_ERR(trng->base)) in ingenic_trng_probe()
88 return dev_err_probe(&pdev->dev, PTR_ERR(trng->base), in ingenic_trng_probe()
96 trng->rng.name = pdev->name; in ingenic_trng_probe()
97 trng->rng.init = ingenic_trng_init; in ingenic_trng_probe()
98 trng->rng.cleanup = ingenic_trng_cleanup; in ingenic_trng_probe()
99 trng->rng.read = ingenic_trng_read; in ingenic_trng_probe()
101 ret = devm_hwrng_register(&pdev->dev, &trng->rng); in ingenic_trng_probe()
105 platform_set_drvdata(pdev, trng); in ingenic_trng_probe()
120 .name = "ingenic-trng",