#define DRV_NAME …
#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <asm/byteorder.h>
#include <linux/sched.h>
#include "sm_common.h"
#include "r852.h"
static bool r852_enable_dma = …;
module_param(r852_enable_dma, bool, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int debug;
module_param(debug, int, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(…) …;
static inline uint8_t r852_read_reg(struct r852_device *dev, int address)
{ … }
static inline void r852_write_reg(struct r852_device *dev,
int address, uint8_t value)
{ … }
static inline uint32_t r852_read_reg_dword(struct r852_device *dev, int address)
{ … }
static inline void r852_write_reg_dword(struct r852_device *dev,
int address, uint32_t value)
{ … }
static inline struct r852_device *r852_get_dev(struct mtd_info *mtd)
{ … }
static void r852_dma_test(struct r852_device *dev)
{ … }
static void r852_dma_enable(struct r852_device *dev)
{ … }
static void r852_dma_done(struct r852_device *dev, int error)
{ … }
static int r852_dma_wait(struct r852_device *dev)
{ … }
static void r852_do_dma(struct r852_device *dev, uint8_t *buf, int do_read)
{ … }
static void r852_write_buf(struct nand_chip *chip, const uint8_t *buf, int len)
{ … }
static void r852_read_buf(struct nand_chip *chip, uint8_t *buf, int len)
{ … }
static uint8_t r852_read_byte(struct nand_chip *chip)
{ … }
static void r852_cmdctl(struct nand_chip *chip, int dat, unsigned int ctrl)
{ … }
static int r852_wait(struct nand_chip *chip)
{ … }
static int r852_ready(struct nand_chip *chip)
{ … }
static void r852_ecc_hwctl(struct nand_chip *chip, int mode)
{ … }
static int r852_ecc_calculate(struct nand_chip *chip, const uint8_t *dat,
uint8_t *ecc_code)
{ … }
static int r852_ecc_correct(struct nand_chip *chip, uint8_t *dat,
uint8_t *read_ecc, uint8_t *calc_ecc)
{ … }
static int r852_read_oob(struct nand_chip *chip, int page)
{ … }
static void r852_engine_enable(struct r852_device *dev)
{ … }
static void r852_engine_disable(struct r852_device *dev)
{ … }
static void r852_card_update_present(struct r852_device *dev)
{ … }
static void r852_update_card_detect(struct r852_device *dev)
{ … }
static ssize_t media_type_show(struct device *sys_dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(media_type);
static void r852_update_media_status(struct r852_device *dev)
{ … }
static int r852_register_nand_device(struct r852_device *dev)
{ … }
static void r852_unregister_nand_device(struct r852_device *dev)
{ … }
static void r852_card_detect_work(struct work_struct *work)
{ … }
static void r852_disable_irqs(struct r852_device *dev)
{ … }
static irqreturn_t r852_irq(int irq, void *data)
{ … }
static int r852_attach_chip(struct nand_chip *chip)
{ … }
static const struct nand_controller_ops r852_ops = …;
static int r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
{ … }
static void r852_remove(struct pci_dev *pci_dev)
{ … }
static void r852_shutdown(struct pci_dev *pci_dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int r852_suspend(struct device *device)
{ … }
static int r852_resume(struct device *device)
{ … }
#endif
static const struct pci_device_id r852_pci_id_tbl[] = …;
MODULE_DEVICE_TABLE(pci, r852_pci_id_tbl);
static SIMPLE_DEV_PM_OPS(r852_pm_ops, r852_suspend, r852_resume);
static struct pci_driver r852_pci_driver = …;
module_pci_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;