linux/drivers/misc/cardreader/rtsx_pcr.h

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

#ifndef __RTSX_PCR_H
#define __RTSX_PCR_H

#include <linux/rtsx_pci.h>

#define MIN_DIV_N_PCR
#define MAX_DIV_N_PCR

#define RTS522A_PME_FORCE_CTL
#define RTS522A_AUTOLOAD_CFG1
#define RTS522A_PM_CTRL3

#define RTS524A_PME_FORCE_CTL
#define REG_EFUSE_BYPASS
#define REG_EFUSE_POR
#define REG_EFUSE_POWER_MASK
#define REG_EFUSE_POWERON
#define REG_EFUSE_POWEROFF
#define RTS5250_CLK_CFG3
#define RTS525A_CFG_MEM_PD
#define RTS524A_AUTOLOAD_CFG1
#define RTS524A_PM_CTRL3
#define RTS525A_BIOS_CFG
#define RTS525A_LOAD_BIOS_FLAG
#define RTS525A_CLEAR_BIOS_FLAG

#define RTS525A_EFUSE_CTL
#define REG_EFUSE_ENABLE
#define REG_EFUSE_MODE
#define RTS525A_EFUSE_ADD
#define REG_EFUSE_ADD_MASK
#define RTS525A_EFUSE_DATA

#define LTR_ACTIVE_LATENCY_DEF
#define LTR_IDLE_LATENCY_DEF
#define LTR_L1OFF_LATENCY_DEF
#define L1_SNOOZE_DELAY_DEF
#define LTR_L1OFF_SSPWRGATE_5249_DEF
#define LTR_L1OFF_SSPWRGATE_5250_DEF
#define LTR_L1OFF_SNOOZE_SSPWRGATE_5249_DEF
#define LTR_L1OFF_SNOOZE_SSPWRGATE_5250_DEF
#define CMD_TIMEOUT_DEF
#define MASK_8_BIT_DEF

#define SSC_CLOCK_STABLE_WAIT

#define RTS524A_OCP_THD_800
#define RTS525A_OCP_THD_800
#define RTS522A_OCP_THD_800


int __rtsx_pci_write_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 val);
int __rtsx_pci_read_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 *val);

void rts5209_init_params(struct rtsx_pcr *pcr);
void rts5229_init_params(struct rtsx_pcr *pcr);
void rtl8411_init_params(struct rtsx_pcr *pcr);
void rtl8402_init_params(struct rtsx_pcr *pcr);
void rts5227_init_params(struct rtsx_pcr *pcr);
void rts522a_init_params(struct rtsx_pcr *pcr);
void rts5249_init_params(struct rtsx_pcr *pcr);
void rts524a_init_params(struct rtsx_pcr *pcr);
void rts525a_init_params(struct rtsx_pcr *pcr);
void rtl8411b_init_params(struct rtsx_pcr *pcr);
void rts5260_init_params(struct rtsx_pcr *pcr);
void rts5261_init_params(struct rtsx_pcr *pcr);
void rts5228_init_params(struct rtsx_pcr *pcr);
void rts5264_init_params(struct rtsx_pcr *pcr);

static inline u8 map_sd_drive(int idx)
{}

#define rtsx_vendor_setting_valid(reg)
#define rts5209_vendor_setting1_valid(reg)
#define rts5209_vendor_setting2_valid(reg)

#define rtsx_check_mmc_support(reg)
#define rtsx_reg_to_rtd3(reg)
#define rtsx_reg_to_rtd3_uhsii(reg)
#define rtsx_reg_to_aspm(reg)
#define rtsx_reg_to_sd30_drive_sel_1v8(reg)
#define rtsx_reg_to_sd30_drive_sel_3v3(reg)
#define rtsx_reg_to_card_drive_sel(reg)
#define rtsx_reg_check_reverse_socket(reg)
#define rts5209_reg_to_aspm(reg)
#define rts5209_reg_check_ms_pmos(reg)
#define rts5209_reg_to_sd30_drive_sel_1v8(reg)
#define rts5209_reg_to_sd30_drive_sel_3v3(reg)
#define rts5209_reg_to_card_drive_sel(reg)
#define rtl8411_reg_to_sd30_drive_sel_3v3(reg)
#define rtl8411b_reg_to_sd30_drive_sel_3v3(reg)

#define set_pull_ctrl_tables(pcr, __device)

/* generic operations */
int rtsx_gops_pm_reset(struct rtsx_pcr *pcr);
int rtsx_set_ltr_latency(struct rtsx_pcr *pcr, u32 latency);
int rtsx_set_l1off_sub(struct rtsx_pcr *pcr, u8 val);
void rtsx_pci_init_ocp(struct rtsx_pcr *pcr);
void rtsx_pci_disable_ocp(struct rtsx_pcr *pcr);
void rtsx_pci_enable_ocp(struct rtsx_pcr *pcr);
int rtsx_pci_get_ocpstat(struct rtsx_pcr *pcr, u8 *val);
void rtsx_pci_clear_ocpstat(struct rtsx_pcr *pcr);
void rtsx_pci_enable_oobs_polling(struct rtsx_pcr *pcr);
void rtsx_pci_disable_oobs_polling(struct rtsx_pcr *pcr);
int rtsx_sd_power_off_card3v3(struct rtsx_pcr *pcr);
int rtsx_ms_power_off_card3v3(struct rtsx_pcr *pcr);

#endif