linux/drivers/mmc/host/moxart-mmc.c

/*
 * MOXA ART MMC host driver.
 *
 * Copyright (C) 2014 Jonas Jensen
 *
 * Jonas Jensen <[email protected]>
 *
 * Based on code from
 * Moxa Technologies Co., Ltd. <www.moxa.com>
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/blkdev.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/mmc/host.h>
#include <linux/mmc/sd.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/clk.h>
#include <linux/bitops.h>
#include <linux/of_dma.h>
#include <linux/spinlock.h>

#define REG_COMMAND
#define REG_ARGUMENT
#define REG_RESPONSE0
#define REG_RESPONSE1
#define REG_RESPONSE2
#define REG_RESPONSE3
#define REG_RESPONSE_COMMAND
#define REG_DATA_CONTROL
#define REG_DATA_TIMER
#define REG_DATA_LENGTH
#define REG_STATUS
#define REG_CLEAR
#define REG_INTERRUPT_MASK
#define REG_POWER_CONTROL
#define REG_CLOCK_CONTROL
#define REG_BUS_WIDTH
#define REG_DATA_WINDOW
#define REG_FEATURE
#define REG_REVISION

/* REG_COMMAND */
#define CMD_SDC_RESET
#define CMD_EN
#define CMD_APP_CMD
#define CMD_LONG_RSP
#define CMD_NEED_RSP
#define CMD_IDX_MASK

/* REG_RESPONSE_COMMAND */
#define RSP_CMD_APP
#define RSP_CMD_IDX_MASK

/* REG_DATA_CONTROL */
#define DCR_DATA_FIFO_RESET
#define DCR_DATA_THRES
#define DCR_DATA_EN
#define DCR_DMA_EN
#define DCR_DATA_WRITE
#define DCR_BLK_SIZE

/* REG_DATA_LENGTH */
#define DATA_LEN_MASK

/* REG_STATUS */
#define WRITE_PROT
#define CARD_DETECT
/* 1-10 below can be sent to either registers, interrupt or clear. */
#define CARD_CHANGE
#define FIFO_ORUN
#define FIFO_URUN
#define DATA_END
#define CMD_SENT
#define DATA_CRC_OK
#define RSP_CRC_OK
#define DATA_TIMEOUT
#define RSP_TIMEOUT
#define DATA_CRC_FAIL
#define RSP_CRC_FAIL

#define MASK_RSP

#define MASK_DATA

#define MASK_INTR_PIO

/* REG_POWER_CONTROL */
#define SD_POWER_ON
#define SD_POWER_MASK

/* REG_CLOCK_CONTROL */
#define CLK_HISPD
#define CLK_OFF
#define CLK_SD
#define CLK_DIV_MASK

/* REG_BUS_WIDTH */
#define BUS_WIDTH_4_SUPPORT
#define BUS_WIDTH_4
#define BUS_WIDTH_1

#define MMC_VDD_360
#define MIN_POWER
#define MAX_RETRIES

struct moxart_host {};

static inline void moxart_init_sg(struct moxart_host *host,
				  struct mmc_data *data)
{}

static inline int moxart_next_sg(struct moxart_host *host)
{}

static int moxart_wait_for_status(struct moxart_host *host,
				  u32 mask, u32 *status)
{}


static void moxart_send_command(struct moxart_host *host,
	struct mmc_command *cmd)
{}

static void moxart_dma_complete(void *param)
{}

static bool moxart_use_dma(struct moxart_host *host)
{}

static void moxart_transfer_dma(struct mmc_data *data, struct moxart_host *host)
{}


static void moxart_transfer_pio(struct moxart_host *host)
{}

static void moxart_prepare_data(struct moxart_host *host)
{}

static void moxart_request(struct mmc_host *mmc, struct mmc_request *mrq)
{}

static irqreturn_t moxart_irq(int irq, void *devid)
{}

static void moxart_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{}


static int moxart_get_ro(struct mmc_host *mmc)
{}

static const struct mmc_host_ops moxart_ops =;

static int moxart_probe(struct platform_device *pdev)
{}

static void moxart_remove(struct platform_device *pdev)
{}

static const struct of_device_id moxart_mmc_match[] =;
MODULE_DEVICE_TABLE(of, moxart_mmc_match);

static struct platform_driver moxart_mmc_driver =;
module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();