Lines Matching full:rng

29 #define to_npcm_rng(p)	container_of(p, struct npcm_rng, rng)
33 struct hwrng rng; member
36 static int npcm_rng_init(struct hwrng *rng) in npcm_rng_init() argument
38 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_init()
46 static void npcm_rng_cleanup(struct hwrng *rng) in npcm_rng_cleanup() argument
48 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_cleanup()
53 static int npcm_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in npcm_rng_read() argument
55 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_read()
59 pm_runtime_get_sync((struct device *)priv->rng.priv); in npcm_rng_read()
81 pm_runtime_mark_last_busy((struct device *)priv->rng.priv); in npcm_rng_read()
82 pm_runtime_put_sync_autosuspend((struct device *)priv->rng.priv); in npcm_rng_read()
106 priv->rng.init = npcm_rng_init; in npcm_rng_probe()
107 priv->rng.cleanup = npcm_rng_cleanup; in npcm_rng_probe()
109 priv->rng.name = pdev->name; in npcm_rng_probe()
110 priv->rng.read = npcm_rng_read; in npcm_rng_probe()
111 priv->rng.priv = (unsigned long)&pdev->dev; in npcm_rng_probe()
112 priv->rng.quality = 1000; in npcm_rng_probe()
116 ret = devm_hwrng_register(&pdev->dev, &priv->rng); in npcm_rng_probe()
118 dev_err(&pdev->dev, "Failed to register rng device: %d\n", in npcm_rng_probe()
132 devm_hwrng_unregister(&pdev->dev, &priv->rng); in npcm_rng_remove()
144 npcm_rng_cleanup(&priv->rng); in npcm_rng_runtime_suspend()
153 return npcm_rng_init(&priv->rng); in npcm_rng_runtime_resume()
165 { .compatible = "nuvoton,npcm750-rng", },
172 .name = "npcm-rng",