@@ -99,7 +99,8 @@ int nand_read_param_page_op(struct nand_chip *chip, u8 page, void *buf,
void nand_decode_ext_id(struct nand_chip *chip);
void panic_nand_wait(struct nand_chip *chip, unsigned long timeo);
void sanitize_string(uint8_t *s, size_t len);
-
+int nand_write_oob_nand(struct nand_chip *chip, loff_t to,
+ struct mtd_oob_ops *ops);
static inline bool nand_has_exec_op(struct nand_chip *chip)
{
if (!chip->controller || !chip->controller->ops ||
@@ -4267,6 +4267,13 @@ static int nand_write_oob(struct mtd_info *mtd, loff_t to,
struct mtd_oob_ops *ops)
{
struct nand_chip *chip = mtd_to_nand(mtd);
+
+ return chip->ops.write_oob(chip, to, ops);
+}
+
+int nand_write_oob_nand(struct nand_chip *chip, loff_t to,
+ struct mtd_oob_ops *ops)
+{
int ret;
ops->retlen = 0;
@@ -4573,6 +4580,8 @@ static void nand_set_defaults(struct nand_chip *chip)
if (!chip->buf_align)
chip->buf_align = 1;
+
+ chip->ops.write_oob = nand_write_oob_nand;
}
/* Sanitize ONFI strings so we can safely print them */
@@ -1035,6 +1035,7 @@ struct nand_legacy {
* setting the read-retry mode. Mostly needed for MLC NAND.
* @pre_erase: [FLASHSPECIFIC] prepare a physical erase block
* @post_erase: [FLASHSPECIFIC] physical block erase post
+ * @write_oob: [REPLACEABLE] Raw NAND write operation
*/
struct nand_chip_ops {
int (*suspend)(struct nand_chip *chip);
@@ -1044,6 +1045,8 @@ struct nand_chip_ops {
int (*setup_read_retry)(struct nand_chip *chip, int retry_mode);
int (*pre_erase)(struct nand_chip *chip, u32 eraseblock);
int (*post_erase)(struct nand_chip *chip, u32 eraseblock);
+ int (*write_oob)(struct nand_chip *chip, loff_t to,
+ struct mtd_oob_ops *ops);
};
/**