#include <linux/clk.h>
#include <linux/iopoll.h>
#include <linux/of.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/sys_soc.h>
#include "cqhci.h"
#include "sdhci-cqhci.h"
#include "sdhci-pltfm.h"
#define CTL_CFG_2 …
#define CTL_CFG_3 …
#define SLOTTYPE_MASK …
#define SLOTTYPE_EMBEDDED …
#define TUNINGFORSDR50_MASK …
#define PHY_CTRL1 …
#define PHY_CTRL2 …
#define PHY_CTRL3 …
#define PHY_CTRL4 …
#define PHY_CTRL5 …
#define PHY_CTRL6 …
#define PHY_STAT1 …
#define PHY_STAT2 …
#define IOMUX_ENABLE_SHIFT …
#define IOMUX_ENABLE_MASK …
#define OTAPDLYENA_SHIFT …
#define OTAPDLYENA_MASK …
#define OTAPDLYSEL_SHIFT …
#define OTAPDLYSEL_MASK …
#define STRBSEL_SHIFT …
#define STRBSEL_4BIT_MASK …
#define STRBSEL_8BIT_MASK …
#define SEL50_SHIFT …
#define SEL50_MASK …
#define SEL100_SHIFT …
#define SEL100_MASK …
#define FREQSEL_SHIFT …
#define FREQSEL_MASK …
#define CLKBUFSEL_SHIFT …
#define CLKBUFSEL_MASK …
#define DLL_TRIM_ICP_SHIFT …
#define DLL_TRIM_ICP_MASK …
#define DR_TY_SHIFT …
#define DR_TY_MASK …
#define ENDLL_SHIFT …
#define ENDLL_MASK …
#define DLLRDY_SHIFT …
#define DLLRDY_MASK …
#define PDB_SHIFT …
#define PDB_MASK …
#define CALDONE_SHIFT …
#define CALDONE_MASK …
#define RETRIM_SHIFT …
#define RETRIM_MASK …
#define SELDLYTXCLK_SHIFT …
#define SELDLYTXCLK_MASK …
#define SELDLYRXCLK_SHIFT …
#define SELDLYRXCLK_MASK …
#define ITAPDLYSEL_SHIFT …
#define ITAPDLYSEL_MASK …
#define ITAPDLYENA_SHIFT …
#define ITAPDLYENA_MASK …
#define ITAPCHGWIN_SHIFT …
#define ITAPCHGWIN_MASK …
#define DRIVER_STRENGTH_50_OHM …
#define DRIVER_STRENGTH_33_OHM …
#define DRIVER_STRENGTH_66_OHM …
#define DRIVER_STRENGTH_100_OHM …
#define DRIVER_STRENGTH_40_OHM …
#define CLOCK_TOO_SLOW_HZ …
#define SDHCI_AM654_AUTOSUSPEND_DELAY …
#define RETRY_TUNING_MAX …
#define SDHCI_AM654_CQE_BASE_ADDR …
static const struct regmap_config sdhci_am654_regmap_config = …;
struct timing_data { … };
static const struct timing_data td[] = …;
struct sdhci_am654_data { … };
struct window { … };
struct sdhci_am654_driver_data { … };
static void sdhci_am654_setup_dll(struct sdhci_host *host, unsigned int clock)
{ … }
static void sdhci_am654_write_itapdly(struct sdhci_am654_data *sdhci_am654,
u32 itapdly, u32 enable)
{ … }
static void sdhci_am654_setup_delay_chain(struct sdhci_am654_data *sdhci_am654,
unsigned char timing)
{ … }
static void sdhci_am654_set_clock(struct sdhci_host *host, unsigned int clock)
{ … }
static void sdhci_j721e_4bit_set_clock(struct sdhci_host *host,
unsigned int clock)
{ … }
static u8 sdhci_am654_write_power_on(struct sdhci_host *host, u8 val, int reg)
{ … }
#define MAX_POWER_ON_TIMEOUT …
static void sdhci_am654_write_b(struct sdhci_host *host, u8 val, int reg)
{ … }
static void sdhci_am654_reset(struct sdhci_host *host, u8 mask)
{ … }
static int sdhci_am654_execute_tuning(struct mmc_host *mmc, u32 opcode)
{ … }
static u32 sdhci_am654_cqhci_irq(struct sdhci_host *host, u32 intmask)
{ … }
#define ITAPDLY_LENGTH …
#define ITAPDLY_LAST_INDEX …
static int sdhci_am654_calculate_itap(struct sdhci_host *host, struct window
*fail_window, u8 num_fails, bool circular_buffer)
{ … }
static int sdhci_am654_do_tuning(struct sdhci_host *host,
u32 opcode)
{ … }
static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host,
u32 opcode)
{ … }
static const struct sdhci_ops sdhci_am654_ops = …;
static const struct sdhci_pltfm_data sdhci_am654_pdata = …;
static const struct sdhci_am654_driver_data sdhci_am654_sr1_drvdata = …;
static const struct sdhci_am654_driver_data sdhci_am654_drvdata = …;
static const struct sdhci_ops sdhci_j721e_8bit_ops = …;
static const struct sdhci_pltfm_data sdhci_j721e_8bit_pdata = …;
static const struct sdhci_am654_driver_data sdhci_j721e_8bit_drvdata = …;
static const struct sdhci_ops sdhci_j721e_4bit_ops = …;
static const struct sdhci_pltfm_data sdhci_j721e_4bit_pdata = …;
static const struct sdhci_am654_driver_data sdhci_j721e_4bit_drvdata = …;
static const struct soc_device_attribute sdhci_am654_devices[] = …;
static void sdhci_am654_dumpregs(struct mmc_host *mmc)
{ … }
static const struct cqhci_host_ops sdhci_am654_cqhci_ops = …;
static int sdhci_am654_cqe_add_host(struct sdhci_host *host)
{ … }
static int sdhci_am654_get_otap_delay(struct sdhci_host *host,
struct sdhci_am654_data *sdhci_am654)
{ … }
static int sdhci_am654_init(struct sdhci_host *host)
{ … }
static int sdhci_am654_get_of_property(struct platform_device *pdev,
struct sdhci_am654_data *sdhci_am654)
{ … }
static const struct of_device_id sdhci_am654_of_match[] = …;
MODULE_DEVICE_TABLE(of, sdhci_am654_of_match);
static int sdhci_am654_probe(struct platform_device *pdev)
{ … }
static void sdhci_am654_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM
static int sdhci_am654_restore(struct sdhci_host *host)
{ … }
static int sdhci_am654_runtime_suspend(struct device *dev)
{ … }
static int sdhci_am654_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops sdhci_am654_dev_pm_ops = …;
static struct platform_driver sdhci_am654_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;