linux/drivers/staging/rts5208/rtsx_card.h

/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Driver for Realtek PCI-Express card reader
 *
 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
 *
 * Author:
 *   Wei WANG ([email protected])
 *   Micky Ching ([email protected])
 */

#ifndef __REALTEK_RTSX_CARD_H
#define __REALTEK_RTSX_CARD_H

#include "rtsx.h"
#include "rtsx_chip.h"
#include "rtsx_transport.h"
#include "sd.h"

#define SSC_POWER_DOWN
#define SD_OC_POWER_DOWN
#define MS_OC_POWER_DOWN
#define ALL_POWER_DOWN
#define OC_POWER_DOWN

#define PMOS_STRG_MASK
#define PMOS_STRG_800mA
#define PMOS_STRG_400mA

#define POWER_OFF
#define PARTIAL_POWER_ON
#define POWER_ON

#define MS_POWER_OFF
#define MS_PARTIAL_POWER_ON
#define MS_POWER_ON
#define MS_POWER_MASK

#define SD_POWER_OFF
#define SD_PARTIAL_POWER_ON
#define SD_POWER_ON
#define SD_POWER_MASK

#define XD_OUTPUT_EN
#define SD_OUTPUT_EN
#define MS_OUTPUT_EN
#define SPI_OUTPUT_EN

#define CLK_LOW_FREQ

#define CLK_DIV_1
#define CLK_DIV_2
#define CLK_DIV_4
#define CLK_DIV_8

#define SSC_80
#define SSC_100
#define SSC_120
#define SSC_150
#define SSC_200

#define XD_CLK_EN
#define SD_CLK_EN
#define MS_CLK_EN
#define SPI_CLK_EN

#define XD_MOD_SEL
#define SD_MOD_SEL
#define MS_MOD_SEL
#define SPI_MOD_SEL

#define CHANGE_CLK

#define SD_CRC7_ERR
#define SD_CRC16_ERR
#define SD_CRC_WRITE_ERR
#define SD_CRC_WRITE_ERR_MASK
#define GET_CRC_TIME_OUT
#define SD_TUNING_COMPARE_ERR

#define SD_RSP_80CLK_TIMEOUT

#define SD_CLK_TOGGLE_EN
#define SD_CLK_FORCE_STOP
#define SD_DAT3_STATUS
#define SD_DAT2_STATUS
#define SD_DAT1_STATUS
#define SD_DAT0_STATUS
#define SD_CMD_STATUS

#define SD_IO_USING_1V8
#define SD_IO_USING_3V3
#define TYPE_A_DRIVING
#define TYPE_B_DRIVING
#define TYPE_C_DRIVING
#define TYPE_D_DRIVING

#define DDR_FIX_RX_DAT
#define DDR_VAR_RX_DAT
#define DDR_FIX_RX_DAT_EDGE
#define DDR_FIX_RX_DAT_14_DELAY
#define DDR_FIX_RX_CMD
#define DDR_VAR_RX_CMD
#define DDR_FIX_RX_CMD_POS_EDGE
#define DDR_FIX_RX_CMD_14_DELAY
#define SD20_RX_POS_EDGE
#define SD20_RX_14_DELAY
#define SD20_RX_SEL_MASK

#define DDR_FIX_TX_CMD_DAT
#define DDR_VAR_TX_CMD_DAT
#define DDR_FIX_TX_DAT_14_TSU
#define DDR_FIX_TX_DAT_12_TSU
#define DDR_FIX_TX_CMD_NEG_EDGE
#define DDR_FIX_TX_CMD_14_AHEAD
#define SD20_TX_NEG_EDGE
#define SD20_TX_14_AHEAD
#define SD20_TX_SEL_MASK
#define DDR_VAR_SDCLK_POL_SWAP

#define SD_TRANSFER_START
#define SD_TRANSFER_END
#define SD_STAT_IDLE
#define SD_TRANSFER_ERR
#define SD_TM_NORMAL_WRITE
#define SD_TM_AUTO_WRITE_3
#define SD_TM_AUTO_WRITE_4
#define SD_TM_AUTO_READ_3
#define SD_TM_AUTO_READ_4
#define SD_TM_CMD_RSP
#define SD_TM_AUTO_WRITE_1
#define SD_TM_AUTO_WRITE_2
#define SD_TM_NORMAL_READ
#define SD_TM_AUTO_READ_1
#define SD_TM_AUTO_READ_2
#define SD_TM_AUTO_TUNING

#define PHASE_CHANGE
#define PHASE_NOT_RESET

#define DCMPS_CHANGE
#define DCMPS_CHANGE_DONE
#define DCMPS_ERROR
#define DCMPS_CURRENT_PHASE

#define SD_CLK_DIVIDE_0
#define SD_CLK_DIVIDE_256
#define SD_CLK_DIVIDE_128
#define SD_BUS_WIDTH_1
#define SD_BUS_WIDTH_4
#define SD_BUS_WIDTH_8
#define SD_ASYNC_FIFO_NOT_RST
#define SD_20_MODE
#define SD_DDR_MODE
#define SD_30_MODE

#define SD_CLK_DIVIDE_MASK

#define SD_CMD_IDLE

#define SD_DATA_IDLE

#define DCM_RESET
#define DCM_LOCKED
#define DCM_208M
#define DCM_TX
#define DCM_RX

#define DRP_START
#define DRP_DONE

#define DRP_WRITE
#define DRP_READ
#define DCM_WRITE_ADDRESS_50
#define DCM_WRITE_ADDRESS_51
#define DCM_READ_ADDRESS_00
#define DCM_READ_ADDRESS_51

#define SD_CALCULATE_CRC7
#define SD_NO_CALCULATE_CRC7
#define SD_CHECK_CRC16
#define SD_NO_CHECK_CRC16
#define SD_NO_CHECK_WAIT_CRC_TO
#define SD_WAIT_BUSY_END
#define SD_NO_WAIT_BUSY_END
#define SD_CHECK_CRC7
#define SD_NO_CHECK_CRC7
#define SD_RSP_LEN_0
#define SD_RSP_LEN_6
#define SD_RSP_LEN_17
#define SD_RSP_TYPE_R0
#define SD_RSP_TYPE_R1
#define SD_RSP_TYPE_R1b
#define SD_RSP_TYPE_R2
#define SD_RSP_TYPE_R3
#define SD_RSP_TYPE_R4
#define SD_RSP_TYPE_R5
#define SD_RSP_TYPE_R6
#define SD_RSP_TYPE_R7

#define SD_RSP_80CLK_TIMEOUT_EN

#define SAMPLE_TIME_RISING
#define SAMPLE_TIME_FALLING
#define PUSH_TIME_DEFAULT
#define PUSH_TIME_ODD
#define NO_EXTEND_TOGGLE
#define EXTEND_TOGGLE_CHK
#define MS_BUS_WIDTH_1
#define MS_BUS_WIDTH_4
#define MS_BUS_WIDTH_8
#define MS_2K_SECTOR_MODE
#define MS_512_SECTOR_MODE
#define MS_TOGGLE_TIMEOUT_EN
#define MS_TOGGLE_TIMEOUT_DISEN
#define MS_NO_CHECK_INT

#define WAIT_INT
#define NO_WAIT_INT
#define NO_AUTO_READ_INT_REG
#define AUTO_READ_INT_REG
#define MS_CRC16_ERR
#define MS_RDY_TIMEOUT
#define MS_INT_CMDNK
#define MS_INT_BREQ
#define MS_INT_ERR
#define MS_INT_CED

#define MS_TRANSFER_START
#define MS_TRANSFER_END
#define MS_TRANSFER_ERR
#define MS_BS_STATE
#define MS_TM_READ_BYTES
#define MS_TM_NORMAL_READ
#define MS_TM_WRITE_BYTES
#define MS_TM_NORMAL_WRITE
#define MS_TM_AUTO_READ
#define MS_TM_AUTO_WRITE

#define CARD_SHARE_MASK
#define CARD_SHARE_MULTI_LUN
#define CARD_SHARE_NORMAL
#define CARD_SHARE_48_XD
#define CARD_SHARE_48_SD
#define CARD_SHARE_48_MS
#define CARD_SHARE_BAROSSA_XD
#define CARD_SHARE_BAROSSA_SD
#define CARD_SHARE_BAROSSA_MS

#define MS_DRIVE_8
#define MS_DRIVE_4
#define MS_DRIVE_12
#define SD_DRIVE_8
#define SD_DRIVE_4
#define SD_DRIVE_12
#define XD_DRIVE_8
#define XD_DRIVE_4
#define XD_DRIVE_12

#define SPI_STOP
#define XD_STOP
#define SD_STOP
#define MS_STOP
#define SPI_CLR_ERR
#define XD_CLR_ERR
#define SD_CLR_ERR
#define MS_CLR_ERR

#define CRC_FIX_CLK
#define CRC_VAR_CLK0
#define CRC_VAR_CLK1
#define SD30_FIX_CLK
#define SD30_VAR_CLK0
#define SD30_VAR_CLK1
#define SAMPLE_FIX_CLK
#define SAMPLE_VAR_CLK0
#define SAMPLE_VAR_CLK1

#define SDIO_VER_20
#define SDIO_VER_10
#define SDIO_VER_CHG
#define SDIO_BUS_AUTO_SWITCH

#define PINGPONG_BUFFER
#define RING_BUFFER

#define RB_FLUSH

#define DMA_DONE_INT_EN
#define SUSPEND_INT_EN
#define LINK_RDY_INT_EN
#define LINK_DOWN_INT_EN

#define DMA_DONE_INT
#define SUSPEND_INT
#define LINK_RDY_INT
#define LINK_DOWN_INT

#define MRD_ERR_INT_EN
#define MWR_ERR_INT_EN
#define SCSI_CMD_INT_EN
#define TLP_RCV_INT_EN
#define TLP_TRSMT_INT_EN
#define MRD_COMPLETE_INT_EN
#define MWR_COMPLETE_INT_EN

#define MRD_ERR_INT
#define MWR_ERR_INT
#define SCSI_CMD_INT
#define TLP_RX_INT
#define TLP_TX_INT
#define MRD_COMPLETE_INT
#define MWR_COMPLETE_INT

#define MSG_RX_INT_EN
#define MRD_RX_INT_EN
#define MWR_RX_INT_EN
#define CPLD_RX_INT_EN

#define MSG_RX_INT
#define MRD_RX_INT
#define MWR_RX_INT
#define CPLD_RX_INT

#define MSG_TX_INT_EN
#define MRD_TX_INT_EN
#define MWR_TX_INT_EN
#define CPLD_TX_INT_EN

#define MSG_TX_INT
#define MRD_TX_INT
#define MWR_TX_INT
#define CPLD_TX_INT

#define DMA_RST
#define DMA_BUSY
#define DMA_DIR_TO_CARD
#define DMA_DIR_FROM_CARD
#define DMA_EN
#define DMA_128
#define DMA_256
#define DMA_512
#define DMA_1024
#define DMA_PACK_SIZE_MASK

#define XD_PWR_OFF_DELAY0
#define XD_PWR_OFF_DELAY1
#define XD_PWR_OFF_DELAY2
#define XD_PWR_OFF_DELAY3
#define XD_AUTO_PWR_OFF_EN
#define XD_NO_AUTO_PWR_OFF

#define XD_TIME_RWN_1
#define XD_TIME_RWN_STEP
#define XD_TIME_RW_1
#define XD_TIME_RW_STEP
#define XD_TIME_SETUP_1
#define XD_TIME_SETUP_STEP

#define XD_ECC2_UNCORRECTABLE
#define XD_ECC2_ERROR
#define XD_ECC1_UNCORRECTABLE
#define XD_ECC1_ERROR
#define XD_RDY
#define XD_CE_EN
#define XD_CE_DISEN
#define XD_WP_EN
#define XD_WP_DISEN

#define XD_TRANSFER_START
#define XD_TRANSFER_END
#define XD_PPB_EMPTY
#define XD_RESET
#define XD_ERASE
#define XD_READ_STATUS
#define XD_READ_ID
#define XD_READ_REDUNDANT
#define XD_READ_PAGES
#define XD_SET_CMD
#define XD_NORMAL_READ
#define XD_WRITE_PAGES
#define XD_NORMAL_WRITE
#define XD_WRITE_REDUNDANT
#define XD_SET_ADDR

#define XD_PPB_TO_SIE
#define XD_TO_PPB_ONLY
#define XD_BA_TRANSFORM
#define XD_BA_NO_TRANSFORM
#define XD_NO_CALC_ECC
#define XD_CALC_ECC
#define XD_IGNORE_ECC
#define XD_CHECK_ECC
#define XD_DIRECT_TO_RB
#define XD_ADDR_LENGTH_0
#define XD_ADDR_LENGTH_1
#define XD_ADDR_LENGTH_2
#define XD_ADDR_LENGTH_3
#define XD_ADDR_LENGTH_4

#define XD_GPG
#define XD_BPG

#define XD_GBLK
#define XD_LATER_BBLK

#define XD_ECC2_ALL1
#define XD_ECC1_ALL1
#define XD_BA2_ALL0
#define XD_BA1_ALL0
#define XD_BA1_BA2_EQL
#define XD_BA2_VALID
#define XD_BA1_VALID

#define XD_PGSTS_ZEROBIT_OVER4
#define XD_PGSTS_NOT_FF
#define XD_AUTO_CHK_DATA_STATUS

#define RSTB_MODE_DETECT
#define MODE_OUT_VLD
#define MODE_OUT_0_NONE
#define MODE_OUT_10_NONE
#define MODE_OUT_10_47
#define MODE_OUT_10_180
#define MODE_OUT_10_680
#define MODE_OUT_16_NONE
#define MODE_OUT_16_47
#define MODE_OUT_16_180
#define MODE_OUT_16_680
#define MODE_OUT_NONE_NONE
#define MODE_OUT_NONE_47
#define MODE_OUT_NONE_180
#define MODE_OUT_NONE_680

#define CARD_OC_INT_EN
#define CARD_DETECT_EN

#define MS_DETECT_EN
#define MS_OCP_INT_EN
#define MS_OCP_INT_CLR
#define MS_OC_CLR
#define SD_DETECT_EN
#define SD_OCP_INT_EN
#define SD_OCP_INT_CLR
#define SD_OC_CLR

#define CARD_OCP_DETECT
#define CARD_OC_NOW
#define CARD_OC_EVER

#define MS_OCP_DETECT
#define MS_OC_NOW
#define MS_OC_EVER
#define SD_OCP_DETECT
#define SD_OC_NOW
#define SD_OC_EVER

#define CARD_OC_INT_CLR
#define CARD_OC_CLR

#define SD_OCP_GLITCH_MASK
#define SD_OCP_GLITCH_6_4
#define SD_OCP_GLITCH_64
#define SD_OCP_GLITCH_640
#define SD_OCP_GLITCH_1000
#define SD_OCP_GLITCH_2000
#define SD_OCP_GLITCH_4000
#define SD_OCP_GLITCH_8000
#define SD_OCP_GLITCH_10000

#define MS_OCP_GLITCH_MASK
#define MS_OCP_GLITCH_6_4
#define MS_OCP_GLITCH_64
#define MS_OCP_GLITCH_640
#define MS_OCP_GLITCH_1000
#define MS_OCP_GLITCH_2000
#define MS_OCP_GLITCH_4000
#define MS_OCP_GLITCH_8000
#define MS_OCP_GLITCH_10000

#define OCP_TIME_60
#define OCP_TIME_100
#define OCP_TIME_200
#define OCP_TIME_400
#define OCP_TIME_600
#define OCP_TIME_800
#define OCP_TIME_1100
#define OCP_TIME_MASK

#define MS_OCP_TIME_60
#define MS_OCP_TIME_100
#define MS_OCP_TIME_200
#define MS_OCP_TIME_400
#define MS_OCP_TIME_600
#define MS_OCP_TIME_800
#define MS_OCP_TIME_1100
#define MS_OCP_TIME_MASK

#define SD_OCP_TIME_60
#define SD_OCP_TIME_100
#define SD_OCP_TIME_200
#define SD_OCP_TIME_400
#define SD_OCP_TIME_600
#define SD_OCP_TIME_800
#define SD_OCP_TIME_1100
#define SD_OCP_TIME_MASK

#define OCP_THD_315_417
#define OCP_THD_283_783
#define OCP_THD_244_946
#define OCP_THD_191_1080
#define OCP_THD_MASK

#define MS_OCP_THD_450
#define MS_OCP_THD_550
#define MS_OCP_THD_650
#define MS_OCP_THD_750
#define MS_OCP_THD_850
#define MS_OCP_THD_950
#define MS_OCP_THD_1050
#define MS_OCP_THD_1150
#define MS_OCP_THD_MASK

#define SD_OCP_THD_450
#define SD_OCP_THD_550
#define SD_OCP_THD_650
#define SD_OCP_THD_750
#define SD_OCP_THD_850
#define SD_OCP_THD_950
#define SD_OCP_THD_1050
#define SD_OCP_THD_1150
#define SD_OCP_THD_MASK

#define FPGA_MS_PULL_CTL_EN
#define FPGA_SD_PULL_CTL_EN
#define FPGA_XD_PULL_CTL_EN1
#define FPGA_XD_PULL_CTL_EN2
#define FPGA_XD_PULL_CTL_EN3

#define FPGA_MS_PULL_CTL_BIT
#define FPGA_SD_PULL_CTL_BIT

#define BLINK_EN
#define LED_GPIO0
#define LED_GPIO1
#define LED_GPIO2

#define SDIO_BUS_CTRL
#define SDIO_CD_CTRL

#define SSC_RSTB
#define SSC_8X_EN
#define SSC_FIX_FRAC
#define SSC_SEL_1M
#define SSC_SEL_2M
#define SSC_SEL_4M
#define SSC_SEL_8M

#define SSC_DEPTH_MASK
#define SSC_DEPTH_DISALBE
#define SSC_DEPTH_4M
#define SSC_DEPTH_2M
#define SSC_DEPTH_1M
#define SSC_DEPTH_512K
#define SSC_DEPTH_256K
#define SSC_DEPTH_128K
#define SSC_DEPTH_64K

#define XD_D3_NP
#define XD_D3_PD
#define XD_D3_PU
#define XD_D2_NP
#define XD_D2_PD
#define XD_D2_PU
#define XD_D1_NP
#define XD_D1_PD
#define XD_D1_PU
#define XD_D0_NP
#define XD_D0_PD
#define XD_D0_PU

#define SD_D7_NP
#define SD_D7_PD
#define SD_DAT7_PU
#define SD_CLK_NP
#define SD_CLK_PD
#define SD_CLK_PU
#define SD_D5_NP
#define SD_D5_PD
#define SD_D5_PU

#define MS_D1_NP
#define MS_D1_PD
#define MS_D1_PU
#define MS_D2_NP
#define MS_D2_PD
#define MS_D2_PU
#define MS_CLK_NP
#define MS_CLK_PD
#define MS_CLK_PU
#define MS_D6_NP
#define MS_D6_PD
#define MS_D6_PU

#define XD_D7_NP
#define XD_D7_PD
#define XD_D7_PU
#define XD_D6_NP
#define XD_D6_PD
#define XD_D6_PU
#define XD_D5_NP
#define XD_D5_PD
#define XD_D5_PU
#define XD_D4_NP
#define XD_D4_PD
#define XD_D4_PU

#define SD_D6_NP
#define SD_D6_PD
#define SD_D6_PU
#define SD_D0_NP
#define SD_D0_PD
#define SD_D0_PU
#define SD_D1_NP
#define SD_D1_PD
#define SD_D1_PU

#define MS_D3_NP
#define MS_D3_PD
#define MS_D3_PU
#define MS_D0_NP
#define MS_D0_PD
#define MS_D0_PU
#define MS_BS_NP
#define MS_BS_PD
#define MS_BS_PU

#define XD_WP_NP
#define XD_WP_PD
#define XD_WP_PU
#define XD_CE_NP
#define XD_CE_PD
#define XD_CE_PU
#define XD_CLE_NP
#define XD_CLE_PD
#define XD_CLE_PU
#define XD_CD_PD
#define XD_CD_PU

#define SD_D4_NP
#define SD_D4_PD
#define SD_D4_PU

#define MS_D7_NP
#define MS_D7_PD
#define MS_D7_PU

#define XD_RDY_NP
#define XD_RDY_PD
#define XD_RDY_PU
#define XD_WE_NP
#define XD_WE_PD
#define XD_WE_PU
#define XD_RE_NP
#define XD_RE_PD
#define XD_RE_PU
#define XD_ALE_NP
#define XD_ALE_PD
#define XD_ALE_PU

#define SD_D3_NP
#define SD_D3_PD
#define SD_D3_PU
#define SD_D2_NP
#define SD_D2_PD
#define SD_D2_PU

#define MS_INS_PD
#define MS_INS_PU
#define SD_WP_NP
#define SD_WP_PD
#define SD_WP_PU
#define SD_CD_PD
#define SD_CD_PU
#define SD_CMD_NP
#define SD_CMD_PD
#define SD_CMD_PU

#define MS_D5_NP
#define MS_D5_PD
#define MS_D5_PU
#define MS_D4_NP
#define MS_D4_PD
#define MS_D4_PU

#define FORCE_PM_CLOCK
#define EN_CLOCK_PM

#define HOST_ENTER_S3
#define HOST_ENTER_S1

#define AUX_PWR_DETECTED

#define PHY_DEBUG_MODE

#define SPI_COMMAND_BIT_8
#define SPI_ADDRESS_BIT_24
#define SPI_ADDRESS_BIT_32

#define SPI_TRANSFER0_START
#define SPI_TRANSFER0_END
#define SPI_C_MODE0
#define SPI_CA_MODE0
#define SPI_CDO_MODE0
#define SPI_CDI_MODE0
#define SPI_CADO_MODE0
#define SPI_CADI_MODE0
#define SPI_POLLING_MODE0

#define SPI_TRANSFER1_START
#define SPI_TRANSFER1_END
#define SPI_DO_MODE1
#define SPI_DI_MODE1

#define CS_POLARITY_HIGH
#define CS_POLARITY_LOW
#define DTO_MSB_FIRST
#define DTO_LSB_FIRST
#define SPI_MASTER
#define SPI_SLAVE
#define SPI_MODE0
#define SPI_MODE1
#define SPI_MODE2
#define SPI_MODE3
#define SPI_MANUAL
#define SPI_HALF_AUTO
#define SPI_AUTO
#define SPI_EEPROM_AUTO

#define EDO_TIMING_MASK
#define SAMPLE_RISING
#define SAMPLE_DELAY_HALF
#define SAMPLE_DELAY_ONE
#define SAPMLE_DELAY_ONE_HALF
#define TCS_MASK

#define NOT_BYPASS_SD
#define DISABLE_SDIO_FUNC
#define SELECT_1LUN

#define PWR_GATE_EN
#define LDO3318_PWR_MASK
#define LDO_ON
#define LDO_SUSPEND
#define LDO_OFF

#define SD_CFG1
#define SD_CFG2
#define SD_CFG3
#define SD_STAT1
#define SD_STAT2
#define SD_BUS_STAT
#define SD_PAD_CTL
#define SD_SAMPLE_POINT_CTL
#define SD_PUSH_POINT_CTL
#define SD_CMD0
#define SD_CMD1
#define SD_CMD2
#define SD_CMD3
#define SD_CMD4
#define SD_CMD5
#define SD_BYTE_CNT_L
#define SD_BYTE_CNT_H
#define SD_BLOCK_CNT_L
#define SD_BLOCK_CNT_H
#define SD_TRANSFER
#define SD_CMD_STATE
#define SD_DATA_STATE

#define DCM_DRP_CTL
#define DCM_DRP_TRIG
#define DCM_DRP_CFG
#define DCM_DRP_WR_DATA_L
#define DCM_DRP_WR_DATA_H
#define DCM_DRP_RD_DATA_L
#define DCM_DRP_RD_DATA_H
#define SD_VPCLK0_CTL
#define SD_VPCLK1_CTL
#define SD_DCMPS0_CTL
#define SD_DCMPS1_CTL
#define SD_VPTX_CTL
#define SD_VPRX_CTL
#define SD_DCMPS_TX_CTL
#define SD_DCMPS_RX_CTL

#define CARD_CLK_SOURCE

#define CARD_PWR_CTL
#define CARD_CLK_SWITCH
#define CARD_SHARE_MODE
#define CARD_DRIVE_SEL
#define CARD_STOP
#define CARD_OE
#define CARD_AUTO_BLINK
#define CARD_GPIO_DIR
#define CARD_GPIO

#define CARD_DATA_SOURCE
#define CARD_SELECT
#define SD30_DRIVE_SEL

#define CARD_CLK_EN

#define SDIO_CTRL

#define FPDCTL
#define PDINFO

#define CLK_CTL
#define CLK_DIV
#define CLK_SEL

#define SSC_DIV_N_0
#define SSC_DIV_N_1

#define RCCTL

#define FPGA_PULL_CTL

#define CARD_PULL_CTL1
#define CARD_PULL_CTL2
#define CARD_PULL_CTL3
#define CARD_PULL_CTL4
#define CARD_PULL_CTL5
#define CARD_PULL_CTL6

#define IRQEN0
#define IRQSTAT0
#define IRQEN1
#define IRQSTAT1
#define TLPRIEN
#define TLPRISTAT
#define TLPTIEN
#define TLPTISTAT
#define DMATC0
#define DMATC1
#define DMATC2
#define DMATC3
#define DMACTL
#define BCTL
#define RBBC0
#define RBBC1
#define RBDAT
#define RBCTL
#define CFGADDR0
#define CFGADDR1
#define CFGDATA0
#define CFGDATA1
#define CFGDATA2
#define CFGDATA3
#define CFGRWCTL
#define PHYRWCTL
#define PHYDATA0
#define PHYDATA1
#define PHYADDR
#define MSGRXDATA0
#define MSGRXDATA1
#define MSGRXDATA2
#define MSGRXDATA3
#define MSGTXDATA0
#define MSGTXDATA1
#define MSGTXDATA2
#define MSGTXDATA3
#define MSGTXCTL
#define PETXCFG

#define CDRESUMECTL
#define WAKE_SEL_CTL
#define PME_FORCE_CTL
#define ASPM_FORCE_CTL
#define PM_CLK_FORCE_CTL
#define PERST_GLITCH_WIDTH
#define CHANGE_LINK_STATE
#define RESET_LOAD_REG
#define HOST_SLEEP_STATE
#define MAIN_PWR_OFF_CTL

#define NFTS_TX_CTRL

#define PWR_GATE_CTRL
#define PWD_SUSPEND_EN

#define EFUSE_CONTENT

#define XD_INIT
#define XD_DTCTL
#define XD_CTL
#define XD_TRANSFER
#define XD_CFG
#define XD_ADDRESS0
#define XD_ADDRESS1
#define XD_ADDRESS2
#define XD_ADDRESS3
#define XD_ADDRESS4
#define XD_DAT
#define XD_PAGE_CNT
#define XD_PAGE_STATUS
#define XD_BLOCK_STATUS
#define XD_BLOCK_ADDR1_L
#define XD_BLOCK_ADDR1_H
#define XD_BLOCK_ADDR2_L
#define XD_BLOCK_ADDR2_H
#define XD_BYTE_CNT_L
#define XD_BYTE_CNT_H
#define XD_PARITY
#define XD_ECC_BIT1
#define XD_ECC_BYTE1
#define XD_ECC_BIT2
#define XD_ECC_BYTE2
#define XD_RESERVED0
#define XD_RESERVED1
#define XD_RESERVED2
#define XD_RESERVED3
#define XD_CHK_DATA_STATUS
#define XD_CATCTL

#define MS_CFG
#define MS_TPC
#define MS_TRANS_CFG
#define MS_TRANSFER
#define MS_INT_REG
#define MS_BYTE_CNT
#define MS_SECTOR_CNT_L
#define MS_SECTOR_CNT_H
#define MS_DBUS_H

#define SSC_CTL1
#define SSC_CTL2

#define OCPCTL
#define OCPSTAT
#define OCPCLR
#define OCPPARA1
#define OCPPARA2

#define EFUSE_OP
#define EFUSE_CTRL
#define EFUSE_DATA

#define SPI_COMMAND
#define SPI_ADDR0
#define SPI_ADDR1
#define SPI_ADDR2
#define SPI_ADDR3
#define SPI_CA_NUMBER
#define SPI_LENGTH0
#define SPI_LENGTH1
#define SPI_DATA
#define SPI_DATA_NUMBER
#define SPI_TRANSFER0
#define SPI_TRANSFER1
#define SPI_CONTROL
#define SPI_SIG
#define SPI_TCTL
#define SPI_SLAVE_NUM
#define SPI_CLK_DIVIDER0
#define SPI_CLK_DIVIDER1

#define SRAM_BASE
#define RBUF_BASE
#define PPBUF_BASE1
#define PPBUF_BASE2
#define IMAGE_FLAG_ADDR0
#define IMAGE_FLAG_ADDR1

#define READ_OP
#define WRITE_OP

#define LCTLR

#define POLLING_WAIT_CNT
#define IDLE_MAX_COUNT
#define SDIO_IDLE_COUNT

#define DEBOUNCE_CNT

void do_remaining_work(struct rtsx_chip *chip);
void try_to_switch_sdio_ctrl(struct rtsx_chip *chip);
void do_reset_sd_card(struct rtsx_chip *chip);
void do_reset_xd_card(struct rtsx_chip *chip);
void do_reset_ms_card(struct rtsx_chip *chip);
void rtsx_power_off_card(struct rtsx_chip *chip);
void rtsx_release_cards(struct rtsx_chip *chip);
void rtsx_reset_cards(struct rtsx_chip *chip);
void rtsx_reinit_cards(struct rtsx_chip *chip, int reset_chip);
void rtsx_init_cards(struct rtsx_chip *chip);
int switch_ssc_clock(struct rtsx_chip *chip, int clk);
int switch_normal_clock(struct rtsx_chip *chip, int clk);
int enable_card_clock(struct rtsx_chip *chip, u8 card);
int disable_card_clock(struct rtsx_chip *chip, u8 card);
int card_rw(struct scsi_cmnd *srb, struct rtsx_chip *chip,
	    u32 sec_addr, u16 sec_cnt);
void trans_dma_enable(enum dma_data_direction dir,
		      struct rtsx_chip *chip, u32 byte_cnt, u8 pack_size);
void toggle_gpio(struct rtsx_chip *chip, u8 gpio);
void turn_on_led(struct rtsx_chip *chip, u8 gpio);
void turn_off_led(struct rtsx_chip *chip, u8 gpio);

int card_share_mode(struct rtsx_chip *chip, int card);
int select_card(struct rtsx_chip *chip, int card);
int detect_card_cd(struct rtsx_chip *chip, int card);
int check_card_exist(struct rtsx_chip *chip, unsigned int lun);
int check_card_ready(struct rtsx_chip *chip, unsigned int lun);
int check_card_wp(struct rtsx_chip *chip, unsigned int lun);
void eject_card(struct rtsx_chip *chip, unsigned int lun);
u8 get_lun_card(struct rtsx_chip *chip, unsigned int lun);

static inline u32 get_card_size(struct rtsx_chip *chip, unsigned int lun)
{}

static inline int switch_clock(struct rtsx_chip *chip, int clk)
{}

int card_power_on(struct rtsx_chip *chip, u8 card);
int card_power_off(struct rtsx_chip *chip, u8 card);

static inline int card_power_off_all(struct rtsx_chip *chip)
{}

static inline void rtsx_clear_xd_error(struct rtsx_chip *chip)
{}

static inline void rtsx_clear_sd_error(struct rtsx_chip *chip)
{}

static inline void rtsx_clear_ms_error(struct rtsx_chip *chip)
{}

static inline void rtsx_clear_spi_error(struct rtsx_chip *chip)
{}

#ifdef SUPPORT_SDIO_ASPM
void dynamic_configure_sdio_aspm(struct rtsx_chip *chip);
#endif

#endif  /* __REALTEK_RTSX_CARD_H */