25 #include <linux/sched.h>
27 #include <linux/kernel.h>
106 if ((reg1 & 0xC0) && (
reg2 & 0xC0)) {
113 #ifdef SUPPORT_SDIO_ASPM
119 for (i = 0; i < 12; i++)
454 #ifdef DISABLE_CARD_INT
455 void card_cd_debounce(
struct rtsx_chip *chip,
unsigned long *need_reset,
unsigned long *need_release)
457 u8 release_map = 0, reset_map = 0;
482 int xd_cnt = 0, sd_cnt = 0, ms_cnt = 0;
519 *need_reset = reset_map;
521 *need_release = release_map;
533 #ifdef DISABLE_CARD_INT
643 return ((depth > 1) ? (depth - 1) : depth);
651 u8 N = (
u8)(clk - 2), min_N, max_N;
652 u8 mcu_cnt,
div, max_div, ssc_depth, ssc_depth_mask;
653 int sd_vpclk_phase_reset = 0;
671 sd_vpclk_phase_reset = 1;
676 if ((clk <= 2) || (N > max_N))
679 mcu_cnt = (
u8)(125/clk + 3);
689 while ((N < min_N) && (div < max_div)) {
758 ssc_depth_mask = 0x03;
769 if (sd_vpclk_phase_reset) {
789 int sd_vpclk_phase_reset = 0;
797 sd_vpclk_phase_reset = 1;
872 RTSX_DEBUGP(
"Try to switch to an illegal clock (%d)\n", clk);
877 if (sd_vpclk_phase_reset) {
884 if (sd_vpclk_phase_reset) {
1022 for (i = 0; i < 3; i++) {
1034 if (!chip->rw_need_retry) {
1039 chip->rw_need_retry = 0;
1119 temp_reg ^= (0x01 <<
gpio);
1155 if (!(status & card_cd))