All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ACPI / SBS: Correct the value of power_now and power_avg in the sysfs
@ 2011-07-01  8:03 Lan Tianyu
  2011-07-14  4:02 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Lan Tianyu @ 2011-07-01  8:03 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, tianyu.lan, rui.zhang

https://bugzilla.kernel.org/show_bug.cgi?id=24492

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/acpi/sbs.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 01dad1b..c517ec8 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -230,11 +230,17 @@ static int acpi_sbs_battery_get_property(struct power_supply *psy,
 	case POWER_SUPPLY_PROP_POWER_NOW:
 		val->intval = abs(battery->rate_now) *
 				acpi_battery_ipscale(battery) * 1000;
+		val->intval *= (acpi_battery_mode(battery)) ?
+				(battery->voltage_now *
+				acpi_battery_vscale(battery) / 1000) : 1;
 		break;
 	case POWER_SUPPLY_PROP_CURRENT_AVG:
 	case POWER_SUPPLY_PROP_POWER_AVG:
 		val->intval = abs(battery->rate_avg) *
 				acpi_battery_ipscale(battery) * 1000;
+		val->intval *= (acpi_battery_mode(battery)) ?
+				(battery->voltage_now *
+				acpi_battery_vscale(battery) / 1000) : 1;
 		break;
 	case POWER_SUPPLY_PROP_CAPACITY:
 		val->intval = battery->state_of_charge;
-- 
1.7.6.rc2.8.g28eb


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

* Re: [PATCH 2/2] ACPI / SBS: Correct the value of power_now and power_avg in the sysfs
  2011-07-01  8:03 [PATCH 2/2] ACPI / SBS: Correct the value of power_now and power_avg in the sysfs Lan Tianyu
@ 2011-07-14  4:02 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2011-07-14  4:02 UTC (permalink / raw)
  To: Lan Tianyu; +Cc: linux-acpi, rui.zhang

applied

thanks,
Len Brown, Intel Open Source Technology Center


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

end of thread, other threads:[~2011-07-14  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-01  8:03 [PATCH 2/2] ACPI / SBS: Correct the value of power_now and power_avg in the sysfs Lan Tianyu
2011-07-14  4:02 ` Len Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.