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