rtsx_pcr.h (98817a84ff1c755c347ac633ff017a623a631fad) rtsx_pcr.h (849a9366cba92cb5dc9dc1161ef49416a290aae9)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/* Driver for Realtek PCI-Express card reader
3 *
4 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
5 *
6 * Author:
7 * Wei WANG <wei_wang@realsil.com.cn>
8 */

--- 39 unchanged lines hidden (view full) ---

48void rts5227_init_params(struct rtsx_pcr *pcr);
49void rts522a_init_params(struct rtsx_pcr *pcr);
50void rts5249_init_params(struct rtsx_pcr *pcr);
51void rts524a_init_params(struct rtsx_pcr *pcr);
52void rts525a_init_params(struct rtsx_pcr *pcr);
53void rtl8411b_init_params(struct rtsx_pcr *pcr);
54void rts5260_init_params(struct rtsx_pcr *pcr);
55void rts5261_init_params(struct rtsx_pcr *pcr);
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/* Driver for Realtek PCI-Express card reader
3 *
4 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
5 *
6 * Author:
7 * Wei WANG <wei_wang@realsil.com.cn>
8 */

--- 39 unchanged lines hidden (view full) ---

48void rts5227_init_params(struct rtsx_pcr *pcr);
49void rts522a_init_params(struct rtsx_pcr *pcr);
50void rts5249_init_params(struct rtsx_pcr *pcr);
51void rts524a_init_params(struct rtsx_pcr *pcr);
52void rts525a_init_params(struct rtsx_pcr *pcr);
53void rtl8411b_init_params(struct rtsx_pcr *pcr);
54void rts5260_init_params(struct rtsx_pcr *pcr);
55void rts5261_init_params(struct rtsx_pcr *pcr);
56void rts5228_init_params(struct rtsx_pcr *pcr);
56
57static inline u8 map_sd_drive(int idx)
58{
59 u8 sd_drive[4] = {
60 0x01, /* Type D */
61 0x02, /* Type C */
62 0x05, /* Type A */
63 0x03 /* Type B */
64 };
65
66 return sd_drive[idx];
67}
68
69#define rtsx_vendor_setting_valid(reg) (!((reg) & 0x1000000))
70#define rts5209_vendor_setting1_valid(reg) (!((reg) & 0x80))
71#define rts5209_vendor_setting2_valid(reg) ((reg) & 0x80)
72
57
58static inline u8 map_sd_drive(int idx)
59{
60 u8 sd_drive[4] = {
61 0x01, /* Type D */
62 0x02, /* Type C */
63 0x05, /* Type A */
64 0x03 /* Type B */
65 };
66
67 return sd_drive[idx];
68}
69
70#define rtsx_vendor_setting_valid(reg) (!((reg) & 0x1000000))
71#define rts5209_vendor_setting1_valid(reg) (!((reg) & 0x80))
72#define rts5209_vendor_setting2_valid(reg) ((reg) & 0x80)
73
74#define rtsx_check_mmc_support(reg) ((reg) & 0x10)
75#define rtsx_reg_to_rtd3(reg) ((reg) & 0x02)
73#define rtsx_reg_to_aspm(reg) (((reg) >> 28) & 0x03)
74#define rtsx_reg_to_sd30_drive_sel_1v8(reg) (((reg) >> 26) & 0x03)
75#define rtsx_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 5) & 0x03)
76#define rtsx_reg_to_card_drive_sel(reg) ((((reg) >> 25) & 0x01) << 6)
77#define rtsx_reg_check_reverse_socket(reg) ((reg) & 0x4000)
78#define rts5209_reg_to_aspm(reg) (((reg) >> 5) & 0x03)
79#define rts5209_reg_check_ms_pmos(reg) (!((reg) & 0x08))
80#define rts5209_reg_to_sd30_drive_sel_1v8(reg) (((reg) >> 3) & 0x07)

--- 14 unchanged lines hidden (view full) ---

95int rtsx_gops_pm_reset(struct rtsx_pcr *pcr);
96int rtsx_set_ltr_latency(struct rtsx_pcr *pcr, u32 latency);
97int rtsx_set_l1off_sub(struct rtsx_pcr *pcr, u8 val);
98void rtsx_pci_init_ocp(struct rtsx_pcr *pcr);
99void rtsx_pci_disable_ocp(struct rtsx_pcr *pcr);
100void rtsx_pci_enable_ocp(struct rtsx_pcr *pcr);
101int rtsx_pci_get_ocpstat(struct rtsx_pcr *pcr, u8 *val);
102void rtsx_pci_clear_ocpstat(struct rtsx_pcr *pcr);
76#define rtsx_reg_to_aspm(reg) (((reg) >> 28) & 0x03)
77#define rtsx_reg_to_sd30_drive_sel_1v8(reg) (((reg) >> 26) & 0x03)
78#define rtsx_reg_to_sd30_drive_sel_3v3(reg) (((reg) >> 5) & 0x03)
79#define rtsx_reg_to_card_drive_sel(reg) ((((reg) >> 25) & 0x01) << 6)
80#define rtsx_reg_check_reverse_socket(reg) ((reg) & 0x4000)
81#define rts5209_reg_to_aspm(reg) (((reg) >> 5) & 0x03)
82#define rts5209_reg_check_ms_pmos(reg) (!((reg) & 0x08))
83#define rts5209_reg_to_sd30_drive_sel_1v8(reg) (((reg) >> 3) & 0x07)

--- 14 unchanged lines hidden (view full) ---

98int rtsx_gops_pm_reset(struct rtsx_pcr *pcr);
99int rtsx_set_ltr_latency(struct rtsx_pcr *pcr, u32 latency);
100int rtsx_set_l1off_sub(struct rtsx_pcr *pcr, u8 val);
101void rtsx_pci_init_ocp(struct rtsx_pcr *pcr);
102void rtsx_pci_disable_ocp(struct rtsx_pcr *pcr);
103void rtsx_pci_enable_ocp(struct rtsx_pcr *pcr);
104int rtsx_pci_get_ocpstat(struct rtsx_pcr *pcr, u8 *val);
105void rtsx_pci_clear_ocpstat(struct rtsx_pcr *pcr);
106void rtsx_pci_enable_oobs_polling(struct rtsx_pcr *pcr);
107void rtsx_pci_disable_oobs_polling(struct rtsx_pcr *pcr);
103int rtsx_sd_power_off_card3v3(struct rtsx_pcr *pcr);
104int rtsx_ms_power_off_card3v3(struct rtsx_pcr *pcr);
105
106#endif
108int rtsx_sd_power_off_card3v3(struct rtsx_pcr *pcr);
109int rtsx_ms_power_off_card3v3(struct rtsx_pcr *pcr);
110
111#endif