Lines Matching full:rng
23 #define to_hisi_rng(p) container_of(p, struct hisi_rng, rng)
31 struct hwrng rng; member
34 static int hisi_rng_init(struct hwrng *rng) in hisi_rng_init() argument
36 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_init()
57 static void hisi_rng_cleanup(struct hwrng *rng) in hisi_rng_cleanup() argument
59 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_cleanup()
64 static int hisi_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in hisi_rng_read() argument
66 struct hisi_rng *hrng = to_hisi_rng(rng); in hisi_rng_read()
75 struct hisi_rng *rng; in hisi_rng_probe() local
78 rng = devm_kzalloc(&pdev->dev, sizeof(*rng), GFP_KERNEL); in hisi_rng_probe()
79 if (!rng) in hisi_rng_probe()
82 rng->base = devm_platform_ioremap_resource(pdev, 0); in hisi_rng_probe()
83 if (IS_ERR(rng->base)) in hisi_rng_probe()
84 return PTR_ERR(rng->base); in hisi_rng_probe()
86 rng->rng.name = pdev->name; in hisi_rng_probe()
87 rng->rng.init = hisi_rng_init; in hisi_rng_probe()
88 rng->rng.cleanup = hisi_rng_cleanup; in hisi_rng_probe()
89 rng->rng.read = hisi_rng_read; in hisi_rng_probe()
91 ret = devm_hwrng_register(&pdev->dev, &rng->rng); in hisi_rng_probe()
99 { .compatible = "hisilicon,hip04-rng" },
100 { .compatible = "hisilicon,hip05-rng" },
108 .name = "hisi-rng",