#include <linux/hw_random.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/err.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/delay.h>
#include <linux/timekeeping.h>
#define SA_CMD_STATUS_OFS …
#define SA_CMD_STATUS_REG_TRNG_ENABLE …
#define TRNG_CNTL_REG_TRNG_ENABLE …
#define TRNG_STATUS_REG_READY …
#define TRNG_INTACK_REG_READY …
#define TRNG_DEF_STARTUP_CYCLES …
#define TRNG_CNTL_REG_STARTUP_CYCLES_SHIFT …
#define TRNG_DEF_MIN_REFILL_CYCLES …
#define TRNG_CFG_REG_MIN_REFILL_CYCLES_SHIFT …
#define TRNG_DEF_MAX_REFILL_CYCLES …
#define TRNG_CFG_REG_MAX_REFILL_CYCLES_SHIFT …
#define TRNG_DEF_CLK_DIV_CYCLES …
#define TRNG_CFG_REG_SAMPLE_DIV_SHIFT …
#define SA_MAX_RNG_DATA_RETRIES …
#define SA_RNG_DATA_RETRY_DELAY …
struct trng_regs { … };
struct ks_sa_rng { … };
static unsigned int cycles_to_ns(unsigned long clk_rate, unsigned int cycles)
{ … }
static unsigned int startup_delay_ns(unsigned long clk_rate)
{ … }
static unsigned int refill_delay_ns(unsigned long clk_rate)
{ … }
static int ks_sa_rng_init(struct hwrng *rng)
{ … }
static void ks_sa_rng_cleanup(struct hwrng *rng)
{ … }
static int ks_sa_rng_data_read(struct hwrng *rng, u32 *data)
{ … }
static int ks_sa_rng_data_present(struct hwrng *rng, int wait)
{ … }
static int ks_sa_rng_probe(struct platform_device *pdev)
{ … }
static void ks_sa_rng_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id ks_sa_rng_dt_match[] = …;
MODULE_DEVICE_TABLE(of, ks_sa_rng_dt_match);
static struct platform_driver ks_sa_rng_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;