2 * JZ4780 BCH controller
4 * Copyright (c) 2015 Imagination Technologies
5 * Author: Alex Smith <alex.smith@imgtec.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published
9 * by the Free Software Foundation.
12 #ifndef __DRIVERS_MTD_NAND_JZ4780_BCH_H__
13 #define __DRIVERS_MTD_NAND_JZ4780_BCH_H__
15 #include <linux/types.h>
22 * struct jz4780_bch_params - BCH parameters
23 * @size: data bytes per ECC step.
24 * @bytes: ECC bytes per step.
25 * @strength: number of correctable bits per ECC step.
27 struct jz4780_bch_params
{
33 int jz4780_bch_calculate(struct jz4780_bch
*bch
,
34 struct jz4780_bch_params
*params
,
35 const u8
*buf
, u8
*ecc_code
);
36 int jz4780_bch_correct(struct jz4780_bch
*bch
,
37 struct jz4780_bch_params
*params
, u8
*buf
,
40 void jz4780_bch_release(struct jz4780_bch
*bch
);
41 struct jz4780_bch
*of_jz4780_bch_get(struct device_node
*np
);
43 #endif /* __DRIVERS_MTD_NAND_JZ4780_BCH_H__ */