#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include "ingenic_ecc.h"
#define BCH_BHCR …
#define BCH_BHCCR …
#define BCH_BHCNT …
#define BCH_BHDR …
#define BCH_BHPAR0 …
#define BCH_BHERR0 …
#define BCH_BHINT …
#define BCH_BHINTES …
#define BCH_BHINTEC …
#define BCH_BHINTE …
#define BCH_BHCR_BSEL_SHIFT …
#define BCH_BHCR_BSEL_MASK …
#define BCH_BHCR_ENCE …
#define BCH_BHCR_INIT …
#define BCH_BHCR_BCHE …
#define BCH_BHCNT_PARITYSIZE_SHIFT …
#define BCH_BHCNT_PARITYSIZE_MASK …
#define BCH_BHCNT_BLOCKSIZE_SHIFT …
#define BCH_BHCNT_BLOCKSIZE_MASK …
#define BCH_BHERR_MASK_SHIFT …
#define BCH_BHERR_MASK_MASK …
#define BCH_BHERR_INDEX_SHIFT …
#define BCH_BHERR_INDEX_MASK …
#define BCH_BHINT_ERRC_SHIFT …
#define BCH_BHINT_ERRC_MASK …
#define BCH_BHINT_TERRC_SHIFT …
#define BCH_BHINT_TERRC_MASK …
#define BCH_BHINT_DECF …
#define BCH_BHINT_ENCF …
#define BCH_BHINT_UNCOR …
#define BCH_BHINT_ERR …
#define BCH_CLK_RATE …
#define BCH_TIMEOUT_US …
static void jz4780_bch_reset(struct ingenic_ecc *bch,
struct ingenic_ecc_params *params, bool encode)
{ … }
static void jz4780_bch_disable(struct ingenic_ecc *bch)
{ … }
static void jz4780_bch_write_data(struct ingenic_ecc *bch, const void *buf,
size_t size)
{ … }
static void jz4780_bch_read_parity(struct ingenic_ecc *bch, void *buf,
size_t size)
{ … }
static bool jz4780_bch_wait_complete(struct ingenic_ecc *bch, unsigned int irq,
u32 *status)
{ … }
static int jz4780_calculate(struct ingenic_ecc *bch,
struct ingenic_ecc_params *params,
const u8 *buf, u8 *ecc_code)
{ … }
static int jz4780_correct(struct ingenic_ecc *bch,
struct ingenic_ecc_params *params,
u8 *buf, u8 *ecc_code)
{ … }
static int jz4780_bch_probe(struct platform_device *pdev)
{ … }
static const struct ingenic_ecc_ops jz4780_bch_ops = …;
static const struct of_device_id jz4780_bch_dt_match[] = …;
MODULE_DEVICE_TABLE(of, jz4780_bch_dt_match);
static struct platform_driver jz4780_bch_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;