.. | .. |
---|
83 | 83 | #endif /* !defined(OOB_INTR_ONLY) */ |
---|
84 | 84 | static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, uint32 regaddr); |
---|
85 | 85 | #if defined(ENABLE_INSMOD_NO_FW_LOAD) && !defined(BUS_POWER_RESTORE) |
---|
86 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) && defined(MMC_SW_RESET) |
---|
| 86 | +#if defined(MMC_SW_RESET) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) |
---|
| 87 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) |
---|
| 88 | +extern int mmc_sw_reset(struct mmc_card *card); |
---|
| 89 | +#else |
---|
87 | 90 | extern int mmc_sw_reset(struct mmc_host *host); |
---|
| 91 | +#endif |
---|
| 92 | +#elif defined(MMC_HW_RESET) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) |
---|
| 93 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) |
---|
| 94 | +extern int mmc_hw_reset(struct mmc_card *card); |
---|
| 95 | +#else |
---|
| 96 | +extern int mmc_hw_reset(struct mmc_host *host); |
---|
| 97 | +#endif |
---|
88 | 98 | #else |
---|
89 | 99 | extern int sdio_reset_comm(struct mmc_card *card); |
---|
90 | 100 | #endif |
---|
.. | .. |
---|
184 | 194 | err_ret = sdio_enable_func(sd->func[1]); |
---|
185 | 195 | sdio_release_host(sd->func[1]); |
---|
186 | 196 | if (err_ret) { |
---|
187 | | - sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x\n", err_ret)); |
---|
| 197 | + sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: %d\n", err_ret)); |
---|
188 | 198 | } |
---|
189 | 199 | |
---|
190 | 200 | return FALSE; |
---|
.. | .. |
---|
1222 | 1232 | if (err_ret) |
---|
1223 | 1233 | #endif /* MMC_SDIO_ABORT */ |
---|
1224 | 1234 | { |
---|
1225 | | - sd_err(("bcmsdh_sdmmc: Failed to %s word F%d:@0x%05x=%02x, Err: 0x%08x\n", |
---|
| 1235 | + sd_err(("bcmsdh_sdmmc: Failed to %s word F%d:@0x%05x=%02x, Err: %d\n", |
---|
1226 | 1236 | rw ? "Write" : "Read", func, addr, *word, err_ret)); |
---|
1227 | 1237 | } |
---|
1228 | 1238 | } |
---|
.. | .. |
---|
1772 | 1782 | #if defined(ENABLE_INSMOD_NO_FW_LOAD) && !defined(BUS_POWER_RESTORE) |
---|
1773 | 1783 | static int sdio_sw_reset(sdioh_info_t *sd) |
---|
1774 | 1784 | { |
---|
1775 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) && defined(MMC_SW_RESET) |
---|
1776 | | - struct mmc_host *host = sd->func[0]->card->host; |
---|
1777 | | -#endif |
---|
| 1785 | + struct mmc_card *card = sd->func[0]->card; |
---|
1778 | 1786 | int err = 0; |
---|
1779 | 1787 | |
---|
1780 | | -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) && defined(MMC_SW_RESET) |
---|
1781 | | - printf("%s: Enter\n", __FUNCTION__); |
---|
| 1788 | +#if defined(MMC_SW_RESET) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) |
---|
| 1789 | + /* MMC_SW_RESET */ |
---|
| 1790 | + printf("%s: call mmc_sw_reset\n", __FUNCTION__); |
---|
1782 | 1791 | sdio_claim_host(sd->func[0]); |
---|
1783 | | - err = mmc_sw_reset(host); |
---|
| 1792 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) |
---|
| 1793 | + err = mmc_sw_reset(card); |
---|
| 1794 | +#else |
---|
| 1795 | + err = mmc_sw_reset(card->host); |
---|
| 1796 | +#endif |
---|
| 1797 | + sdio_release_host(sd->func[0]); |
---|
| 1798 | +#elif defined(MMC_HW_RESET) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) |
---|
| 1799 | + /* MMC_HW_RESET */ |
---|
| 1800 | + printf("%s: call mmc_hw_reset\n", __FUNCTION__); |
---|
| 1801 | + sdio_claim_host(sd->func[0]); |
---|
| 1802 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) |
---|
| 1803 | + while (atomic_read(&card->sdio_funcs_probed) > 1) { |
---|
| 1804 | + atomic_dec(&card->sdio_funcs_probed); |
---|
| 1805 | + } |
---|
| 1806 | +#endif |
---|
| 1807 | +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) |
---|
| 1808 | + err = mmc_hw_reset(card); |
---|
| 1809 | +#else |
---|
| 1810 | + err = mmc_hw_reset(card->host); |
---|
| 1811 | +#endif |
---|
1784 | 1812 | sdio_release_host(sd->func[0]); |
---|
1785 | 1813 | #else |
---|
1786 | | - err = sdio_reset_comm(sd->func[0]->card); |
---|
| 1814 | + /* sdio_reset_comm */ |
---|
| 1815 | + err = sdio_reset_comm(card); |
---|
1787 | 1816 | #endif |
---|
1788 | 1817 | |
---|
1789 | 1818 | if (err) |
---|