#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/math64.h>
#include <linux/mmc/host.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include "sdhci-pltfm.h"
#define ASPEED_SDC_INFO …
#define ASPEED_SDC_S1_MMC8 …
#define ASPEED_SDC_S0_MMC8 …
#define ASPEED_SDC_PHASE …
#define ASPEED_SDC_S1_PHASE_IN …
#define ASPEED_SDC_S0_PHASE_IN …
#define ASPEED_SDC_S1_PHASE_OUT …
#define ASPEED_SDC_S1_PHASE_IN_EN …
#define ASPEED_SDC_S1_PHASE_OUT_EN …
#define ASPEED_SDC_S0_PHASE_OUT …
#define ASPEED_SDC_S0_PHASE_IN_EN …
#define ASPEED_SDC_S0_PHASE_OUT_EN …
#define ASPEED_SDC_PHASE_MAX …
#define ASPEED_SDC_CAP1_1_8V …
#define ASPEED_SDC_CAP2_SDR104 …
struct aspeed_sdc { … };
struct aspeed_sdhci_tap_param { … };
struct aspeed_sdhci_tap_desc { … };
struct aspeed_sdhci_phase_desc { … };
struct aspeed_sdhci_pdata { … };
struct aspeed_sdhci { … };
static void aspeed_sdc_set_slot_capability(struct sdhci_host *host, struct aspeed_sdc *sdc,
int capability, bool enable, u8 slot)
{ … }
static void aspeed_sdc_configure_8bit_mode(struct aspeed_sdc *sdc,
struct aspeed_sdhci *sdhci,
bool bus8)
{ … }
static u32
aspeed_sdc_set_phase_tap(const struct aspeed_sdhci_tap_desc *desc,
u8 tap, bool enable, u32 reg)
{ … }
static void
aspeed_sdc_set_phase_taps(struct aspeed_sdc *sdc,
const struct aspeed_sdhci_phase_desc *desc,
const struct aspeed_sdhci_tap_param *taps)
{ … }
#define PICOSECONDS_PER_SECOND …
#define ASPEED_SDHCI_NR_TAPS …
#define ASPEED_SDHCI_MAX_TAP_DELAY_PS …
static int aspeed_sdhci_phase_to_tap(struct device *dev, unsigned long rate_hz,
int phase_deg)
{ … }
static void
aspeed_sdhci_phases_to_taps(struct device *dev, unsigned long rate,
const struct mmc_clk_phase *phases,
struct aspeed_sdhci_tap_param *taps)
{ … }
static void
aspeed_sdhci_configure_phase(struct sdhci_host *host, unsigned long rate)
{ … }
static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
{ … }
static unsigned int aspeed_sdhci_get_max_clock(struct sdhci_host *host)
{ … }
static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width)
{ … }
static u32 aspeed_sdhci_readl(struct sdhci_host *host, int reg)
{ … }
static const struct sdhci_ops aspeed_sdhci_ops = …;
static const struct sdhci_pltfm_data aspeed_sdhci_pdata = …;
static inline int aspeed_sdhci_calculate_slot(struct aspeed_sdhci *dev,
struct resource *res)
{ … }
static int aspeed_sdhci_probe(struct platform_device *pdev)
{ … }
static void aspeed_sdhci_remove(struct platform_device *pdev)
{ … }
static const struct aspeed_sdhci_pdata ast2400_sdhci_pdata = …;
static const struct aspeed_sdhci_phase_desc ast2600_sdhci_phase[] = …;
static const struct aspeed_sdhci_pdata ast2600_sdhci_pdata = …;
static const struct of_device_id aspeed_sdhci_of_match[] = …;
static struct platform_driver aspeed_sdhci_driver = …;
static int aspeed_sdc_probe(struct platform_device *pdev)
{ … }
static void aspeed_sdc_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id aspeed_sdc_of_match[] = …;
MODULE_DEVICE_TABLE(of, aspeed_sdc_of_match);
static struct platform_driver aspeed_sdc_driver = …;
#if defined(CONFIG_MMC_SDHCI_OF_ASPEED_TEST)
#include "sdhci-of-aspeed-test.c"
#endif
static int __init aspeed_sdc_init(void)
{ … }
module_init(…) …;
static void __exit aspeed_sdc_exit(void)
{ … }
module_exit(aspeed_sdc_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;