#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/pnp.h>
#include <linux/highmem.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sd.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <asm/dma.h>
#include "wbsd.h"
#define DRIVER_NAME …
#define DBG(x...) …
#define DBGF(f, x...) …
#ifdef CONFIG_PNP
static const struct pnp_device_id pnp_dev_table[] = …;
MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
#endif
static const int config_ports[] = …;
static const int unlock_codes[] = …;
static const int valid_ids[] = …;
#ifdef CONFIG_PNP
static unsigned int param_nopnp = …;
#else
static const unsigned int param_nopnp = 1;
#endif
static unsigned int param_io = …;
static unsigned int param_irq = …;
static int param_dma = …;
static inline void wbsd_unlock_config(struct wbsd_host *host)
{ … }
static inline void wbsd_lock_config(struct wbsd_host *host)
{ … }
static inline void wbsd_write_config(struct wbsd_host *host, u8 reg, u8 value)
{ … }
static inline u8 wbsd_read_config(struct wbsd_host *host, u8 reg)
{ … }
static inline void wbsd_write_index(struct wbsd_host *host, u8 index, u8 value)
{ … }
static inline u8 wbsd_read_index(struct wbsd_host *host, u8 index)
{ … }
static void wbsd_init_device(struct wbsd_host *host)
{ … }
static void wbsd_reset(struct wbsd_host *host)
{ … }
static void wbsd_request_end(struct wbsd_host *host, struct mmc_request *mrq)
{ … }
static inline void wbsd_init_sg(struct wbsd_host *host, struct mmc_data *data)
{ … }
static inline int wbsd_next_sg(struct wbsd_host *host)
{ … }
static inline char *wbsd_map_sg(struct wbsd_host *host)
{ … }
static inline void wbsd_sg_to_dma(struct wbsd_host *host, struct mmc_data *data)
{ … }
static inline void wbsd_dma_to_sg(struct wbsd_host *host, struct mmc_data *data)
{ … }
static inline void wbsd_get_short_reply(struct wbsd_host *host,
struct mmc_command *cmd)
{ … }
static inline void wbsd_get_long_reply(struct wbsd_host *host,
struct mmc_command *cmd)
{ … }
static void wbsd_send_command(struct wbsd_host *host, struct mmc_command *cmd)
{ … }
static void wbsd_empty_fifo(struct wbsd_host *host)
{ … }
static void wbsd_fill_fifo(struct wbsd_host *host)
{ … }
static void wbsd_prepare_data(struct wbsd_host *host, struct mmc_data *data)
{ … }
static void wbsd_finish_data(struct wbsd_host *host, struct mmc_data *data)
{ … }
static void wbsd_request(struct mmc_host *mmc, struct mmc_request *mrq)
{ … }
static void wbsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{ … }
static int wbsd_get_ro(struct mmc_host *mmc)
{ … }
static const struct mmc_host_ops wbsd_ops = …;
static void wbsd_reset_ignore(struct timer_list *t)
{ … }
static inline struct mmc_data *wbsd_get_data(struct wbsd_host *host)
{ … }
static void wbsd_card_bh_work(struct work_struct *t)
{ … }
static void wbsd_fifo_bh_work(struct work_struct *t)
{ … }
static void wbsd_crc_bh_work(struct work_struct *t)
{ … }
static void wbsd_timeout_bh_work(struct work_struct *t)
{ … }
static void wbsd_finish_bh_work(struct work_struct *t)
{ … }
static irqreturn_t wbsd_irq(int irq, void *dev_id)
{ … }
static int wbsd_alloc_mmc(struct device *dev)
{ … }
static void wbsd_free_mmc(struct device *dev)
{ … }
static int wbsd_scan(struct wbsd_host *host)
{ … }
static int wbsd_request_region(struct wbsd_host *host, int base)
{ … }
static void wbsd_release_regions(struct wbsd_host *host)
{ … }
static void wbsd_request_dma(struct wbsd_host *host, int dma)
{ … }
static void wbsd_release_dma(struct wbsd_host *host)
{ … }
static int wbsd_request_irq(struct wbsd_host *host, int irq)
{ … }
static void wbsd_release_irq(struct wbsd_host *host)
{ … }
static int wbsd_request_resources(struct wbsd_host *host,
int base, int irq, int dma)
{ … }
static void wbsd_release_resources(struct wbsd_host *host)
{ … }
static void wbsd_chip_config(struct wbsd_host *host)
{ … }
static int wbsd_chip_validate(struct wbsd_host *host)
{ … }
static void wbsd_chip_poweroff(struct wbsd_host *host)
{ … }
static int wbsd_init(struct device *dev, int base, int irq, int dma,
int pnp)
{ … }
static void wbsd_shutdown(struct device *dev, int pnp)
{ … }
static int wbsd_probe(struct platform_device *dev)
{ … }
static void wbsd_remove(struct platform_device *dev)
{ … }
#ifdef CONFIG_PNP
static int
wbsd_pnp_probe(struct pnp_dev *pnpdev, const struct pnp_device_id *dev_id)
{ … }
static void wbsd_pnp_remove(struct pnp_dev *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int wbsd_platform_suspend(struct platform_device *dev,
pm_message_t state)
{ … }
static int wbsd_platform_resume(struct platform_device *dev)
{ … }
#ifdef CONFIG_PNP
static int wbsd_pnp_suspend(struct pnp_dev *pnp_dev, pm_message_t state)
{ … }
static int wbsd_pnp_resume(struct pnp_dev *pnp_dev)
{ … }
#endif
#else
#define wbsd_platform_suspend …
#define wbsd_platform_resume …
#define wbsd_pnp_suspend …
#define wbsd_pnp_resume …
#endif
static struct platform_device *wbsd_device;
static struct platform_driver wbsd_driver = …;
#ifdef CONFIG_PNP
static struct pnp_driver wbsd_pnp_driver = …;
#endif
static int __init wbsd_drv_init(void)
{ … }
static void __exit wbsd_drv_exit(void)
{ … }
module_init(…) …;
module_exit(wbsd_drv_exit);
#ifdef CONFIG_PNP
module_param_hw_named(nopnp, param_nopnp, uint, other, 0444);
#endif
module_param_hw_named(io, param_io, uint, ioport, 0444);
module_param_hw_named(irq, param_irq, uint, irq, 0444);
module_param_hw_named(dma, param_dma, int, dma, 0444);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
#ifdef CONFIG_PNP
MODULE_PARM_DESC(…) …;
#endif
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;