Skip to content

Commit

Permalink
drivers: power: p3_battery: export batt_current to sysfs
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansaraev authored and pershoot committed Oct 6, 2012
1 parent 1a7e99c commit 9ef1e2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/power/p3_battery.c
Expand Up @@ -786,6 +786,7 @@ static struct device_attribute p3_battery_attrs[] = {
#ifdef CONFIG_MACH_SAMSUNG_P5
SEC_BATTERY_ATTR(batt_temp_cels),
#endif
SEC_BATTERY_ATTR(batt_current),
SEC_BATTERY_ATTR(force_usb_charging),
SEC_BATTERY_ATTR(batt_charging_source),
SEC_BATTERY_ATTR(fg_soc),
Expand All @@ -808,6 +809,7 @@ enum {
#ifdef CONFIG_MACH_SAMSUNG_P5
BATT_TEMP_CELS,
#endif
BATT_CURRENT,
FORCE_USB_CHARGING,
BATT_CHARGING_SOURCE,
BATT_FG_SOC,
Expand Down Expand Up @@ -868,6 +870,10 @@ static ssize_t p3_bat_show_property(struct device *dev,
temp);
break;
#endif
case BATT_CURRENT:
i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n",
get_fuelgauge_value(FG_CURRENT_AVG));
break;
case FORCE_USB_CHARGING:
i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n",
test_batterydata->info.force_usb_charging);
Expand Down

0 comments on commit 9ef1e2e

Please sign in to comment.