rts5227.c (9b031c86506cef9acae45e61339fcf9deaabb793) | rts5227.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 * Roger Tseng <rogerable@realtek.com> --- 42 unchanged lines hidden (view full) --- 51 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD30_CMD_DRIVE_SEL, 52 0xFF, driving[drive_sel][1]); 53 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD30_DAT_DRIVE_SEL, 54 0xFF, driving[drive_sel][2]); 55} 56 57static void rts5227_fetch_vendor_settings(struct rtsx_pcr *pcr) 58{ | 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 * Roger Tseng <rogerable@realtek.com> --- 42 unchanged lines hidden (view full) --- 51 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD30_CMD_DRIVE_SEL, 52 0xFF, driving[drive_sel][1]); 53 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SD30_DAT_DRIVE_SEL, 54 0xFF, driving[drive_sel][2]); 55} 56 57static void rts5227_fetch_vendor_settings(struct rtsx_pcr *pcr) 58{ |
59 struct pci_dev *pdev = pcr->pci; |
|
59 u32 reg; 60 | 60 u32 reg; 61 |
61 rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG1, ®); | 62 pci_read_config_dword(pdev, PCR_SETTING_REG1, ®); |
62 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg); 63 64 if (!rtsx_vendor_setting_valid(reg)) 65 return; 66 67 pcr->aspm_en = rtsx_reg_to_aspm(reg); 68 pcr->sd30_drive_sel_1v8 = rtsx_reg_to_sd30_drive_sel_1v8(reg); 69 pcr->card_drive_sel &= 0x3F; 70 pcr->card_drive_sel |= rtsx_reg_to_card_drive_sel(reg); 71 | 63 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG1, reg); 64 65 if (!rtsx_vendor_setting_valid(reg)) 66 return; 67 68 pcr->aspm_en = rtsx_reg_to_aspm(reg); 69 pcr->sd30_drive_sel_1v8 = rtsx_reg_to_sd30_drive_sel_1v8(reg); 70 pcr->card_drive_sel &= 0x3F; 71 pcr->card_drive_sel |= rtsx_reg_to_card_drive_sel(reg); 72 |
72 rtsx_pci_read_config_dword(pcr, PCR_SETTING_REG2, ®); | 73 pci_read_config_dword(pdev, PCR_SETTING_REG2, ®); |
73 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg); 74 pcr->sd30_drive_sel_3v3 = rtsx_reg_to_sd30_drive_sel_3v3(reg); 75 if (rtsx_reg_check_reverse_socket(reg)) 76 pcr->flags |= PCR_REVERSE_SOCKET; 77} 78 79static void rts5227_force_power_down(struct rtsx_pcr *pcr, u8 pm_state) 80{ --- 327 unchanged lines hidden --- | 74 pcr_dbg(pcr, "Cfg 0x%x: 0x%x\n", PCR_SETTING_REG2, reg); 75 pcr->sd30_drive_sel_3v3 = rtsx_reg_to_sd30_drive_sel_3v3(reg); 76 if (rtsx_reg_check_reverse_socket(reg)) 77 pcr->flags |= PCR_REVERSE_SOCKET; 78} 79 80static void rts5227_force_power_down(struct rtsx_pcr *pcr, u8 pm_state) 81{ --- 327 unchanged lines hidden --- |