Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e665faa4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-v3.7' of git://git.infradead.org/battery-2.6

Pull battery updates from Anton Vorontsov:
 "1. New drivers:
     - Marvell 88pm860x charger and battery drivers;
     - Texas Instruments LP8788 charger driver;
  2. Two new power supply properties: whether a battery is authentic,
     and chargers' maximal currents and voltages;
  3. A lot of TI LP8727 Charger cleanups;
  4. New features for Charger Manager, mainly now we can disable
     specific regulators;
  5. Random fixes and cleanups for other drivers."

Fix up trivial conflicts in <linux/mfd/88pm860x.h>

* tag 'for-v3.7' of git://git.infradead.org/battery-2.6: (52 commits)
  pda_power: Remove ac_draw_failed goto and label
  charger-manager: Add support sysfs entry for charger
  charger-manager: Support limit of maximum possible
  charger-manager: Check fully charged state of battery periodically
  lp8727_charger: More pure cosmetic improvements
  lp8727_charger: Fix checkpatch warning
  lp8727_charger: Add description in the private data
  lp8727_charger: Fix a typo - chg_parm to chg_param
  lp8727_charger: Make some cosmetic changes in lp8727_delayed_func()
  lp8727_charger: Clean up lp8727_charger_changed()
  lp8727_charger: Return if the battery is discharging
  lp8727_charger: Make lp8727_charger_get_propery() simpler
  lp8727_charger: Make lp8727_ctrl_switch() inline
  lp8727_charger: Make lp8727_init_device() shorter
  lp8727_charger: Clean up lp8727_is_charger_attached()
  lp8727_charger: Use specific definition
  lp8727_charger: Clean up lp8727 definitions
  lp8727_charger: Use the definition rather than enum
  lp8727_charger: Fix code for getting battery temp
  lp8727_charger: Clear interrrupts at inital time
  ...
parents ca4da694 18766f09
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ This defines trickle and fast charges. For batteries that
are already charged or discharging, 'n/a' can be displayed (or
'unknown', if the status is not known).

AUTHENTIC - indicates the power supply (battery or charger) connected
to the platform is authentic(1) or non authentic(0).

HEALTH - represents health of the battery, values corresponds to
POWER_SUPPLY_HEALTH_*, defined in battery.h.

@@ -113,8 +116,12 @@ be negative; there is no empty or full value. It is only useful for
relative, time-based measurements.

CONSTANT_CHARGE_CURRENT - constant charge current programmed by charger.
CONSTANT_CHARGE_CURRENT_MAX - maximum charge current supported by the
power supply object.

CONSTANT_CHARGE_VOLTAGE - constant charge voltage programmed by charger.
CONSTANT_CHARGE_VOLTAGE_MAX - maximum charge voltage supported by the
power supply object.

ENERGY_FULL, ENERGY_EMPTY - same as above but for energy.

+21 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/mfd/core.h>
#include <linux/mfd/88pm860x.h>
#include <linux/regulator/machine.h>
#include <linux/power/charger-manager.h>

#define INT_STATUS_NUM			3

@@ -150,7 +151,8 @@ static struct resource battery_resources[] __devinitdata = {
static struct resource charger_resources[] __devinitdata = {
	{PM8607_IRQ_CHG,  PM8607_IRQ_CHG,  "charger detect",  IORESOURCE_IRQ,},
	{PM8607_IRQ_CHG_DONE,  PM8607_IRQ_CHG_DONE,  "charging done",       IORESOURCE_IRQ,},
	{PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging timeout",    IORESOURCE_IRQ,},
	{PM8607_IRQ_CHG_FAIL,  PM8607_IRQ_CHG_FAIL,  "charging timeout",    IORESOURCE_IRQ,},
	{PM8607_IRQ_CHG_FAULT, PM8607_IRQ_CHG_FAULT, "charging fault",	    IORESOURCE_IRQ,},
	{PM8607_IRQ_GPADC1,    PM8607_IRQ_GPADC1,    "battery temperature", IORESOURCE_IRQ,},
	{PM8607_IRQ_VBAT, PM8607_IRQ_VBAT, "battery voltage", IORESOURCE_IRQ,},
	{PM8607_IRQ_VCHG, PM8607_IRQ_VCHG, "vchg voltage",    IORESOURCE_IRQ,},
@@ -318,10 +320,15 @@ static struct regulator_init_data preg_init_data = {
	.consumer_supplies	= &preg_supply[0],
};

static struct charger_regulator chg_desc_regulator_data[] = {
	{ .regulator_name = "preg", },
};

static struct mfd_cell power_devs[] = {
	{"88pm860x-battery", -1,},
	{"88pm860x-charger", -1,},
	{"88pm860x-preg",    -1,},
	{"charger-manager", -1,},
};

static struct mfd_cell rtc_devs[] = {
@@ -929,6 +936,19 @@ static void __devinit device_power_init(struct pm860x_chip *chip,
			      NULL, chip->irq_base, NULL);
	if (ret < 0)
		dev_err(chip->dev, "Failed to add preg subdev\n");

	if (pdata->chg_desc) {
		pdata->chg_desc->charger_regulators =
			&chg_desc_regulator_data[0];
		pdata->chg_desc->num_charger_regulators	=
			ARRAY_SIZE(chg_desc_regulator_data),
		power_devs[3].platform_data = pdata->chg_desc;
		power_devs[3].pdata_size = sizeof(*pdata->chg_desc);
		ret = mfd_add_devices(chip->dev, 0, &power_devs[3], 1,
				      NULL, chip->irq_base, NULL);
		if (ret < 0)
			dev_err(chip->dev, "Failed to add chg-manager subdev\n");
	}
}

static void __devinit device_onkey_init(struct pm860x_chip *chip,
Loading