#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/clk.h>
#include <linux/hw_random.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/interrupt.h>
#include <linux/irqreturn.h>
#include <linux/workqueue.h>
#include <linux/circ_buf.h>
#include <linux/completion.h>
#include <linux/of.h>
#include <linux/bitfield.h>
#include <linux/fips.h>
#include "cctrng.h"
#define CC_REG_LOW(name) …
#define CC_REG_HIGH(name) …
#define CC_GENMASK(name) …
#define CC_REG_FLD_GET(reg_name, fld_name, reg_val) …
#define CC_HW_RESET_LOOP_COUNT …
#define CC_TRNG_SUSPEND_TIMEOUT …
#define CCTRNG_DATA_BUF_WORDS …
#define EHR_NUM …
#define VN_COEFF …
#define EHR_LENGTH …
#define SCALE_VALUE …
#define CCTRNG_TIMEOUT(smpl_cnt) …
struct cctrng_drvdata { … };
static inline void cc_iowrite(struct cctrng_drvdata *drvdata, u32 reg, u32 val)
{ … }
static inline u32 cc_ioread(struct cctrng_drvdata *drvdata, u32 reg)
{ … }
static int cc_trng_pm_get(struct device *dev)
{ … }
static void cc_trng_pm_put_suspend(struct device *dev)
{ … }
static int cc_trng_pm_init(struct cctrng_drvdata *drvdata)
{ … }
static void cc_trng_pm_go(struct cctrng_drvdata *drvdata)
{ … }
static void cc_trng_pm_fini(struct cctrng_drvdata *drvdata)
{ … }
static inline int cc_trng_parse_sampling_ratio(struct cctrng_drvdata *drvdata)
{ … }
static int cc_trng_change_rosc(struct cctrng_drvdata *drvdata)
{ … }
static void cc_trng_enable_rnd_source(struct cctrng_drvdata *drvdata)
{ … }
static inline void circ_idx_inc(int *idx, int bytes)
{ … }
static inline size_t circ_buf_space(struct cctrng_drvdata *drvdata)
{ … }
static int cctrng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{ … }
static void cc_trng_hw_trigger(struct cctrng_drvdata *drvdata)
{ … }
static void cc_trng_compwork_handler(struct work_struct *w)
{ … }
static irqreturn_t cc_isr(int irq, void *dev_id)
{ … }
static void cc_trng_startwork_handler(struct work_struct *w)
{ … }
static int cctrng_probe(struct platform_device *pdev)
{ … }
static void cctrng_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused cctrng_suspend(struct device *dev)
{ … }
static bool cctrng_wait_for_reset_completion(struct cctrng_drvdata *drvdata)
{ … }
static int __maybe_unused cctrng_resume(struct device *dev)
{ … }
static UNIVERSAL_DEV_PM_OPS(cctrng_pm, cctrng_suspend, cctrng_resume, NULL);
static const struct of_device_id arm_cctrng_dt_match[] = …;
MODULE_DEVICE_TABLE(of, arm_cctrng_dt_match);
static struct platform_driver cctrng_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;