rts5229.c (58e16d792a6a8c6b750f637a4649967fcac853dc) rts5229.c (22bf3251d7b7da0339f41ec27f2c3d4e0ec02255)
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 */

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

18 u8 val;
19
20 rtsx_pci_read_register(pcr, DUMMY_REG_RESET_0, &val);
21 return val & 0x0F;
22}
23
24static void rts5229_fetch_vendor_settings(struct rtsx_pcr *pcr)
25{
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 */

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

18 u8 val;
19
20 rtsx_pci_read_register(pcr, DUMMY_REG_RESET_0, &val);
21 return val & 0x0F;
22}
23
24static void rts5229_fetch_vendor_settings(struct rtsx_pcr *pcr)
25{
26 struct pci_dev *pdev = pcr->pci;
26 u32 reg;
27
27 u32 reg;
28
28 rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, &reg);
29 pci_read_config_dword(pdev, PCR_SETTING_REG1, &reg);
29 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg);
30
31 if (!rtsx_vendor_setting_valid(reg))
32 return;
33
34 pcr->aspm_en = rtsx_reg_to_aspm(reg);
35 pcr->sd30_drive_sel_1v8 =
36 map_sd_drive(rtsx_reg_to_sd30_drive_sel_1v8(reg));
37 pcr->card_drive_sel &= 0x3F;
38 pcr->card_drive_sel |= rtsx_reg_to_card_drive_sel(reg);
39
30 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg);
31
32 if (!rtsx_vendor_setting_valid(reg))
33 return;
34
35 pcr->aspm_en = rtsx_reg_to_aspm(reg);
36 pcr->sd30_drive_sel_1v8 =
37 map_sd_drive(rtsx_reg_to_sd30_drive_sel_1v8(reg));
38 pcr->card_drive_sel &= 0x3F;
39 pcr->card_drive_sel |= rtsx_reg_to_card_drive_sel(reg);
40
40 rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG2, &reg);
41 pci_read_config_dword(pdev, PCR_SETTING_REG2, &reg);
41 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg);
42 pcr->sd30_drive_sel_3v3 =
43 map_sd_drive(rtsx_reg_to_sd30_drive_sel_3v3(reg));
44}
45
46static void rts5229_force_power_down(struct rtsx_pcr *pcr, u8 pm_state)
47{
48 rtsx_pci_write_register(pcr, FPDCTL, 0x03, 0x03);

--- 213 unchanged lines hidden ---
42 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg);
43 pcr->sd30_drive_sel_3v3 =
44 map_sd_drive(rtsx_reg_to_sd30_drive_sel_3v3(reg));
45}
46
47static void rts5229_force_power_down(struct rtsx_pcr *pcr, u8 pm_state)
48{
49 rtsx_pci_write_register(pcr, FPDCTL, 0x03, 0x03);

--- 213 unchanged lines hidden ---