/* * Copyright (C) 2013 Boris BREZILLON <b.brezillon.dev@gmail.com> * * Derived from: * https://github.com/yuq/sunxi-nfc-mtd * Copyright (C) 2013 Qiang Yu <yuq825@gmail.com> * * https://github.com/hno/Allwinner-Info * Copyright (C) 2013 Henrik Nordström <Henrik Nordström> * * Copyright (C) 2013 Dmitriy B. <rzk333@gmail.com> * Copyright (C) 2013 Sergey Lapin <slapin@ossfans.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */#include<linux/dma-mapping.h>#include<linux/slab.h>#include<linux/module.h>#include<linux/moduleparam.h>#include<linux/platform_device.h>#include<linux/of.h>#include<linux/of_device.h>#include<linux/of_gpio.h>#include<linux/of_mtd.h>#include<linux/mtd/mtd.h>#include<linux/mtd/nand.h>#include<linux/mtd/partitions.h>#include<linux/clk.h>#include<linux/delay.h>#include<linux/dmaengine.h>#include<linux/gpio.h>#include<linux/interrupt.h>#include<linux/io.h>#define NFC_REG_CTL 0x0000#define NFC_REG_ST 0x0004#define NFC_REG_INT 0x0008#define NFC_REG_TIMING_CTL 0x000C#define NFC_REG_TIMI