Lines Matching full:rng
30 #define to_npcm_rng(p) container_of(p, struct npcm_rng, rng)
34 struct hwrng rng; member
38 static int npcm_rng_init(struct hwrng *rng) in npcm_rng_init() argument
40 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_init()
47 static void npcm_rng_cleanup(struct hwrng *rng) in npcm_rng_cleanup() argument
49 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_cleanup()
54 static int npcm_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) in npcm_rng_read() argument
56 struct npcm_rng *priv = to_npcm_rng(rng); in npcm_rng_read()
60 pm_runtime_get_sync((struct device *)priv->rng.priv); in npcm_rng_read()
82 pm_runtime_mark_last_busy((struct device *)priv->rng.priv); in npcm_rng_read()
83 pm_runtime_put_sync_autosuspend((struct device *)priv->rng.priv); in npcm_rng_read()
107 priv->rng.init = npcm_rng_init; in npcm_rng_probe()
108 priv->rng.cleanup = npcm_rng_cleanup; in npcm_rng_probe()
110 priv->rng.name = pdev->name; in npcm_rng_probe()
111 priv->rng.read = npcm_rng_read; in npcm_rng_probe()
112 priv->rng.priv = (unsigned long)&pdev->dev; in npcm_rng_probe()
117 ret = devm_hwrng_register(&pdev->dev, &priv->rng); in npcm_rng_probe()
119 dev_err(&pdev->dev, "Failed to register rng device: %d\n", in npcm_rng_probe()
133 devm_hwrng_unregister(&pdev->dev, &priv->rng); in npcm_rng_remove()
143 npcm_rng_cleanup(&priv->rng); in npcm_rng_runtime_suspend()
152 return npcm_rng_init(&priv->rng); in npcm_rng_runtime_resume()
164 { .compatible = "nuvoton,npcm750-rng",
166 { .compatible = "nuvoton,npcm845-rng",
174 .name = "npcm-rng",