linux/drivers/char/hw_random/mtk-rng.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Driver for Mediatek Hardware Random Number Generator
 *
 * Copyright (C) 2017 Sean Wang <[email protected]>
 */
#define MTK_RNG_DEV

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/hw_random.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>

/* Runtime PM autosuspend timeout: */
#define RNG_AUTOSUSPEND_TIMEOUT

#define USEC_POLL
#define TIMEOUT_POLL

#define RNG_CTRL
#define RNG_EN
#define RNG_READY

#define RNG_DATA

#define to_mtk_rng(p)

struct mtk_rng {};

static int mtk_rng_init(struct hwrng *rng)
{}

static void mtk_rng_cleanup(struct hwrng *rng)
{}

static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait)
{}

static int mtk_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
{}

static int mtk_rng_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_PM
static int mtk_rng_runtime_suspend(struct device *dev)
{}

static int mtk_rng_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops mtk_rng_pm_ops =;

#define MTK_RNG_PM_OPS
#else	/* CONFIG_PM */
#define MTK_RNG_PM_OPS
#endif	/* CONFIG_PM */

static const struct of_device_id mtk_rng_match[] =;
MODULE_DEVICE_TABLE(of, mtk_rng_match);

static struct platform_driver mtk_rng_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();