#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/hw_random.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/random.h>
#include <linux/reset.h>
#define STARFIVE_CTRL …
#define STARFIVE_STAT …
#define STARFIVE_MODE …
#define STARFIVE_SMODE …
#define STARFIVE_IE …
#define STARFIVE_ISTAT …
#define STARFIVE_RAND0 …
#define STARFIVE_RAND1 …
#define STARFIVE_RAND2 …
#define STARFIVE_RAND3 …
#define STARFIVE_RAND4 …
#define STARFIVE_RAND5 …
#define STARFIVE_RAND6 …
#define STARFIVE_RAND7 …
#define STARFIVE_AUTO_RQSTS …
#define STARFIVE_AUTO_AGE …
#define STARFIVE_CTRL_EXEC_NOP …
#define STARFIVE_CTRL_GENE_RANDNUM …
#define STARFIVE_CTRL_EXEC_RANDRESEED …
#define STARFIVE_STAT_NONCE_MODE …
#define STARFIVE_STAT_R256 …
#define STARFIVE_STAT_MISSION_MODE …
#define STARFIVE_STAT_SEEDED …
#define STARFIVE_STAT_LAST_RESEED(x) …
#define STARFIVE_STAT_SRVC_RQST …
#define STARFIVE_STAT_RAND_GENERATING …
#define STARFIVE_STAT_RAND_SEEDING …
#define STARFIVE_MODE_R256 …
#define STARFIVE_SMODE_NONCE_MODE …
#define STARFIVE_SMODE_MISSION_MODE …
#define STARFIVE_SMODE_MAX_REJECTS(x) …
#define STARFIVE_IE_RAND_RDY_EN …
#define STARFIVE_IE_SEED_DONE_EN …
#define STARFIVE_IE_LFSR_LOCKUP_EN …
#define STARFIVE_IE_GLBL_EN …
#define STARFIVE_IE_ALL …
#define STARFIVE_ISTAT_RAND_RDY …
#define STARFIVE_ISTAT_SEED_DONE …
#define STARFIVE_ISTAT_LFSR_LOCKUP …
#define STARFIVE_RAND_LEN …
#define to_trng(p) …
enum reseed { … };
enum mode { … };
struct starfive_trng { … };
static u16 autoreq;
module_param(autoreq, ushort, 0);
MODULE_PARM_DESC(…) …;
static u16 autoage;
module_param(autoage, ushort, 0);
MODULE_PARM_DESC(…) …;
static inline int starfive_trng_wait_idle(struct starfive_trng *trng)
{ … }
static inline void starfive_trng_irq_mask_clear(struct starfive_trng *trng)
{ … }
static int starfive_trng_cmd(struct starfive_trng *trng, u32 cmd, bool wait)
{ … }
static int starfive_trng_init(struct hwrng *rng)
{ … }
static irqreturn_t starfive_trng_irq(int irq, void *priv)
{ … }
static void starfive_trng_cleanup(struct hwrng *rng)
{ … }
static int starfive_trng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
{ … }
static int starfive_trng_probe(struct platform_device *pdev)
{ … }
static int __maybe_unused starfive_trng_suspend(struct device *dev)
{ … }
static int __maybe_unused starfive_trng_resume(struct device *dev)
{ … }
static const struct dev_pm_ops starfive_trng_pm_ops = …;
static const struct of_device_id trng_dt_ids[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, trng_dt_ids);
static struct platform_driver starfive_trng_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;