#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/debugfs.h>
#include <linux/dmaengine.h>
#include <linux/seq_file.h>
#include <linux/sizes.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/timer.h>
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_device.h>
#include <linux/mmc/host.h>
#include <linux/mmc/core.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/slot-gpio.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/regulator/consumer.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/pm_wakeirq.h>
#include <linux/platform_data/hsmmc-omap.h>
#define OMAP_HSMMC_SYSSTATUS …
#define OMAP_HSMMC_CON …
#define OMAP_HSMMC_SDMASA …
#define OMAP_HSMMC_BLK …
#define OMAP_HSMMC_ARG …
#define OMAP_HSMMC_CMD …
#define OMAP_HSMMC_RSP10 …
#define OMAP_HSMMC_RSP32 …
#define OMAP_HSMMC_RSP54 …
#define OMAP_HSMMC_RSP76 …
#define OMAP_HSMMC_DATA …
#define OMAP_HSMMC_PSTATE …
#define OMAP_HSMMC_HCTL …
#define OMAP_HSMMC_SYSCTL …
#define OMAP_HSMMC_STAT …
#define OMAP_HSMMC_IE …
#define OMAP_HSMMC_ISE …
#define OMAP_HSMMC_AC12 …
#define OMAP_HSMMC_CAPA …
#define VS18 …
#define VS30 …
#define HSS …
#define SDVS18 …
#define SDVS30 …
#define SDVS33 …
#define SDVS_MASK …
#define SDVSCLR …
#define SDVSDET …
#define AUTOIDLE …
#define SDBP …
#define DTO …
#define ICE …
#define ICS …
#define CEN …
#define CLKD_MAX …
#define CLKD_MASK …
#define CLKD_SHIFT …
#define DTO_MASK …
#define DTO_SHIFT …
#define INIT_STREAM …
#define ACEN_ACMD23 …
#define DP_SELECT …
#define DDIR …
#define DMAE …
#define MSBS …
#define BCE …
#define FOUR_BIT …
#define HSPE …
#define IWE …
#define DDR …
#define CLKEXTFREE …
#define CTPL …
#define DW8 …
#define OD …
#define STAT_CLEAR …
#define INIT_STREAM_CMD …
#define DUAL_VOLT_OCR_BIT …
#define SRC …
#define SRD …
#define SOFTRESET …
#define DLEV_DAT(x) …
#define CC_EN …
#define TC_EN …
#define BWR_EN …
#define BRR_EN …
#define CIRQ_EN …
#define ERR_EN …
#define CTO_EN …
#define CCRC_EN …
#define CEB_EN …
#define CIE_EN …
#define DTO_EN …
#define DCRC_EN …
#define DEB_EN …
#define ACE_EN …
#define CERR_EN …
#define BADA_EN …
#define INT_EN_MASK …
#define CNI …
#define ACIE …
#define ACEB …
#define ACCE …
#define ACTO …
#define ACNE …
#define MMC_AUTOSUSPEND_DELAY …
#define MMC_TIMEOUT_MS …
#define MMC_TIMEOUT_US …
#define OMAP_MMC_MIN_CLOCK …
#define OMAP_MMC_MAX_CLOCK …
#define DRIVER_NAME …
#define mmc_pdata(host) …
#define OMAP_HSMMC_READ(base, reg) …
#define OMAP_HSMMC_WRITE(base, reg, val) …
struct omap_hsmmc_next { … };
struct omap_hsmmc_host { … };
struct omap_mmc_of_data { … };
static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host);
static int omap_hsmmc_enable_supply(struct mmc_host *mmc)
{ … }
static int omap_hsmmc_disable_supply(struct mmc_host *mmc)
{ … }
static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on)
{ … }
static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on)
{ … }
static int omap_hsmmc_disable_boot_regulator(struct regulator *reg)
{ … }
static int omap_hsmmc_disable_boot_regulators(struct omap_hsmmc_host *host)
{ … }
static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_start_clock(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host,
struct mmc_command *cmd)
{ … }
static void omap_hsmmc_disable_irq(struct omap_hsmmc_host *host)
{ … }
static u16 calc_divisor(struct omap_hsmmc_host *host, struct mmc_ios *ios)
{ … }
static void omap_hsmmc_set_clock(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_set_bus_width(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_set_bus_mode(struct omap_hsmmc_host *host)
{ … }
#ifdef CONFIG_PM
static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_context_save(struct omap_hsmmc_host *host)
{ … }
#else
static void omap_hsmmc_context_save(struct omap_hsmmc_host *host)
{
}
#endif
static void send_init_stream(struct omap_hsmmc_host *host)
{ … }
static ssize_t
omap_hsmmc_show_slot_name(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(slot_name, S_IRUGO, omap_hsmmc_show_slot_name, NULL);
static void
omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
struct mmc_data *data)
{ … }
static struct dma_chan *omap_hsmmc_get_dma_chan(struct omap_hsmmc_host *host,
struct mmc_data *data)
{ … }
static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_request *mrq)
{ … }
static void
omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
{ … }
static void
omap_hsmmc_cmd_done(struct omap_hsmmc_host *host, struct mmc_command *cmd)
{ … }
static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno)
{ … }
#ifdef CONFIG_MMC_DEBUG
static void omap_hsmmc_dbg_report_irq(struct omap_hsmmc_host *host, u32 status)
{ … }
#else
static inline void omap_hsmmc_dbg_report_irq(struct omap_hsmmc_host *host,
u32 status)
{
}
#endif
static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,
unsigned long bit)
{ … }
static void hsmmc_command_incomplete(struct omap_hsmmc_host *host,
int err, int end_cmd)
{ … }
static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
{ … }
static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
{ … }
static void set_sd_bus_power(struct omap_hsmmc_host *host)
{ … }
static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
{ … }
static void omap_hsmmc_dma_callback(void *param)
{ … }
static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host,
struct mmc_data *data,
struct omap_hsmmc_next *next,
struct dma_chan *chan)
{ … }
static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host,
struct mmc_request *req)
{ … }
static void set_data_timeout(struct omap_hsmmc_host *host,
unsigned long long timeout_ns,
unsigned int timeout_clks)
{ … }
static void omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host)
{ … }
static int
omap_hsmmc_prepare_data(struct omap_hsmmc_host *host, struct mmc_request *req)
{ … }
static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq,
int err)
{ … }
static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq)
{ … }
static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
{ … }
static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{ … }
static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
{ … }
static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
{ … }
static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
{ … }
static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
unsigned int direction, int blk_size)
{ … }
static struct mmc_host_ops omap_hsmmc_ops = …;
#ifdef CONFIG_DEBUG_FS
static int mmc_regs_show(struct seq_file *s, void *data)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static void omap_hsmmc_debugfs(struct mmc_host *mmc)
{ … }
#else
static void omap_hsmmc_debugfs(struct mmc_host *mmc)
{
}
#endif
#ifdef CONFIG_OF
static const struct omap_mmc_of_data omap3_pre_es3_mmc_of_data = …;
static const struct omap_mmc_of_data omap4_mmc_of_data = …;
static const struct omap_mmc_of_data am33xx_mmc_of_data = …;
static const struct of_device_id omap_mmc_of_match[] = …;
MODULE_DEVICE_TABLE(of, omap_mmc_of_match);
static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
{ … }
#else
static inline struct omap_hsmmc_platform_data
*of_get_hsmmc_pdata(struct device *dev)
{
return ERR_PTR(-EINVAL);
}
#endif
static int omap_hsmmc_probe(struct platform_device *pdev)
{ … }
static void omap_hsmmc_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int omap_hsmmc_suspend(struct device *dev)
{ … }
static int omap_hsmmc_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int omap_hsmmc_runtime_suspend(struct device *dev)
{ … }
static int omap_hsmmc_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops omap_hsmmc_dev_pm_ops = …;
static struct platform_driver omap_hsmmc_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;