public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rts_pstor: MSXC card power class
@ 2011-03-07  8:11 wei_wang
  2011-03-07 18:50 ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: wei_wang @ 2011-03-07  8:11 UTC (permalink / raw)
  To: gregkh, devel, linux-kernel; +Cc: wwang

From: wwang <wei_wang@realsil.com.cn>

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>
---
 drivers/staging/rts_pstor/ms.c   |   15 ++++++++++-----
 drivers/staging/rts_pstor/rtsx.c |    1 +
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rts_pstor/ms.c b/drivers/staging/rts_pstor/ms.c
index c43f911..85048d4 100644
--- a/drivers/staging/rts_pstor/ms.c
+++ b/drivers/staging/rts_pstor/ms.c
@@ -1099,7 +1099,15 @@ 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 +1136,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);
diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
index c3f33d1..6d84838 100644
--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -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;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rts_pstor: MSXC card power class
  2011-03-07  8:11 [PATCH] staging: rts_pstor: MSXC card power class wei_wang
@ 2011-03-07 18:50 ` Dan Carpenter
  2011-03-08  2:40   ` wwang
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2011-03-07 18:50 UTC (permalink / raw)
  To: wei_wang; +Cc: gregkh, devel, linux-kernel

On Mon, Mar 07, 2011 at 04:11:01PM +0800, wei_wang@realsil.com.cn wrote:
>  #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;
> +	}

This makes scripts/checkpatch.pl complain.

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rts_pstor: MSXC card power class
  2011-03-07 18:50 ` Dan Carpenter
@ 2011-03-08  2:40   ` wwang
  2011-03-08  5:04     ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: wwang @ 2011-03-08  2:40 UTC (permalink / raw)
  To: Dan Carpenter, gregkh, devel, linux-kernel

于 2011年03月08日 02:50, Dan Carpenter 写道:
>
> This makes scripts/checkpatch.pl complain.
>
> regards,
> dan carpenter
>
Yes, it would produce a braces warning.
Should I send another patch to fix it, or just resend the patch?

wwang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: rts_pstor: MSXC card power class
  2011-03-08  2:40   ` wwang
@ 2011-03-08  5:04     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2011-03-08  5:04 UTC (permalink / raw)
  To: wwang; +Cc: Dan Carpenter, devel, linux-kernel

On Tue, Mar 08, 2011 at 10:40:31AM +0800, wwang wrote:
> 于 2011年03月08日 02:50, Dan Carpenter 写道:
> >
> > This makes scripts/checkpatch.pl complain.
> >
> > regards,
> > dan carpenter
> >
> Yes, it would produce a braces warning.
> Should I send another patch to fix it, or just resend the patch?

Resend, I've already dropped this one.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] staging: rts_pstor: MSXC card power class
@ 2011-03-08  7:22 wei_wang
  0 siblings, 0 replies; 5+ messages in thread
From: wei_wang @ 2011-03-08  7:22 UTC (permalink / raw)
  To: gregkh, devel, linux-kernel; +Cc: wwang

From: wwang <wei_wang@realsil.com.cn>

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>
---
 drivers/staging/rts_pstor/ms.c   |   14 +++++++++-----
 drivers/staging/rts_pstor/rtsx.c |    1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rts_pstor/ms.c b/drivers/staging/rts_pstor/ms.c
index c43f911..810e170 100644
--- a/drivers/staging/rts_pstor/ms.c
+++ b/drivers/staging/rts_pstor/ms.c
@@ -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);
diff --git a/drivers/staging/rts_pstor/rtsx.c b/drivers/staging/rts_pstor/rtsx.c
index c3f33d1..6d84838 100644
--- a/drivers/staging/rts_pstor/rtsx.c
+++ b/drivers/staging/rts_pstor/rtsx.c
@@ -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;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-08  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07  8:11 [PATCH] staging: rts_pstor: MSXC card power class wei_wang
2011-03-07 18:50 ` Dan Carpenter
2011-03-08  2:40   ` wwang
2011-03-08  5:04     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2011-03-08  7:22 wei_wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox