Lines Matching full:rng

18 /* RNG register offsets */
36 struct hwrng rng; member
39 static int ingenic_rng_init(struct hwrng *rng) in ingenic_rng_init() argument
41 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_init()
48 static void ingenic_rng_cleanup(struct hwrng *rng) in ingenic_rng_cleanup() argument
50 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_cleanup()
55 static int ingenic_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in ingenic_rng_read() argument
57 struct ingenic_rng *priv = container_of(rng, struct ingenic_rng, rng); in ingenic_rng_read()
66 pr_err("%s: Wait for RNG data ready timeout\n", __func__); in ingenic_rng_read()
71 * A delay is required so that the current RNG data is not bit shifted in ingenic_rng_read()
72 * version of previous RNG data which could happen if random data is in ingenic_rng_read()
94 pr_err("%s: Failed to map RNG registers\n", __func__); in ingenic_rng_probe()
100 priv->rng.name = pdev->name; in ingenic_rng_probe()
101 priv->rng.init = ingenic_rng_init; in ingenic_rng_probe()
102 priv->rng.cleanup = ingenic_rng_cleanup; in ingenic_rng_probe()
103 priv->rng.read = ingenic_rng_read; in ingenic_rng_probe()
105 ret = hwrng_register(&priv->rng); in ingenic_rng_probe()
113 dev_info(&pdev->dev, "Ingenic RNG driver registered\n"); in ingenic_rng_probe()
121 hwrng_unregister(&priv->rng); in ingenic_rng_remove()
129 { .compatible = "ingenic,jz4780-rng", .data = (void *) ID_JZ4780 },
130 { .compatible = "ingenic,x1000-rng", .data = (void *) ID_X1000 },
139 .name = "ingenic-rng",