]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rts_pstor: MSXC card power class
authorwwang <wei_wang@realsil.com.cn>
Tue, 8 Mar 2011 07:22:14 +0000 (15:22 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 10 Mar 2011 00:01:29 +0000 (16:01 -0800)
1, Initialize chip->ms_power_class_en in rtsx_init_options;
2, In reset_ms_pro, set different initial value of change_power_class
according to chip->ms_power_class_en.

Signed-off-by: wwang <wei_wang@realsil.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rts_pstor/ms.c
drivers/staging/rts_pstor/rtsx.c

index c43f9118dca9ad26d95d1299c3b97bc2b2247592..810e170894f58c3d3180047084dacc31014ec6cd 100644 (file)
@@ -1099,7 +1099,14 @@ static int reset_ms_pro(struct rtsx_chip *chip)
        struct ms_info *ms_card = &(chip->ms_card);
        int retval;
 #ifdef XC_POWERCLASS
-       u8 change_power_class = 2;
+       u8 change_power_class;
+
+       if (chip->ms_power_class_en & 0x02)
+               change_power_class = 2;
+       else if (chip->ms_power_class_en & 0x01)
+               change_power_class = 1;
+       else
+               change_power_class = 0;
 #endif
 
 #ifdef XC_POWERCLASS
@@ -1128,10 +1135,7 @@ Retry:
        }
 
        if (change_power_class && CHK_MSXC(ms_card)) {
-               u8 power_class_en = 0x03;
-
-               if (CHECK_PID(chip, 0x5209))
-                       power_class_en = chip->ms_power_class_en;
+               u8 power_class_en = chip->ms_power_class_en;
 
                RTSX_DEBUGP("power_class_en = 0x%x\n", power_class_en);
                RTSX_DEBUGP("change_power_class = %d\n", change_power_class);
index db3470e93fa1e844b5687ffacff913d84d344035..4514419a5fb88e56f9083023bb603867d0b27bbf 100644 (file)
@@ -850,6 +850,7 @@ static void rtsx_init_options(struct rtsx_chip *chip)
        chip->sd_default_rx_phase = 15;
        chip->pmos_pwr_on_interval = 200;
        chip->sd_voltage_switch_delay = 1000;
+       chip->ms_power_class_en = 3;
 
        chip->sd_400mA_ocp_thd = 1;
        chip->sd_800mA_ocp_thd = 5;