28 May, 2011

1 commit

  • * git://git.infradead.org/battery-2.6:
    PXA: Use dev_pm_ops in z2_battery
    ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
    ds2760_battery: Fix indexing of the 4 active full EEPROM registers
    power: Make test_power driver more dynamic.
    bq27x00_battery: Name of cycle count property
    max8903_charger: Add GENERIC_HARDIRQS as a dependency (fixes S390 build)
    ARM: RX-51: Enable isp1704 power on/off
    isp1704_charger: Allow board specific powering routine
    gpio-charger: Add gpio_charger_resume
    power_supply: Add driver for MAX8903 charger

    Linus Torvalds
     

27 May, 2011

2 commits

  • Add support for the Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC.

    It was suggested to combine this functionality with the current ds2782
    driver. Unfortunately, I'm unable to commit the time to refactoring this
    driver to that extent and I don't have a platform with the ds2782 part to
    validate that there are no regression issues by adding this functionality.

    [akpm@linux-foundation.org: use min_t()]
    Signed-off-by: Clifton Barnes
    Tested-by: Haojian Zhuang
    Cc: Evgeniy Polyakov
    Cc: Ryan Mallon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Clifton Barnes
     
  • Avoid to get platform_data from parent device. Get it from mfd cell
    device instead.

    Signed-off-by: Haojian Zhuang
    Acked-by: Anton Vorontsov
    Cc: David Woodhouse
    Signed-off-by: Samuel Ortiz

    Haojian Zhuang
     

20 May, 2011

5 commits

  • Signed-off-by: Marek Vasut
    Signed-off-by: Anton Vorontsov

    Marek Vasut
     
  • Fix rated capacity of the HP iPAQ hx4700 3.7V 1800mAh (359113-001) battery. For this battery the value of the rated capacity EEPROM register at 0x32 is 7; thus rated_capacities[7] = 1800.

    Signed-off-by: Paul Parsons
    Signed-off-by: Anton Vorontsov

    Paul Parsons
     
  • Fix indexing of the 4 active full EEPROM registers. The indexing was out by 1, accessing the EEPROM registers at 0x23 to 0x26 instead of 0x22 to 0x25.

    Signed-off-by: Paul Parsons
    Signed-off-by: Anton Vorontsov

    Paul Parsons
     
  • In 2008 Masashi YOKOTA created the virtual
    battery driver found here:
    http://downloads.pylone.jp/src/virtual_battery/virtual_battery-0.0.1.tar.bz2

    It found use out of tree, but was never merged upstream.
    Since then the test_power driver has been merged, which provides
    very similar functionality.

    This patch extends the test_power driver to be more dynamic
    at runtime, by merging portions of the Virtual Battery Driver
    by Masashi YOKOTA.

    With this patch, I can tweak the values in:
    /sys/module/test_power/parameters/* and watch the behavior of
    the gnome power managment daemon or other battery UI software.

    CC: Anton Vorontsov
    CC: Akihiro MAEDA
    CC: Masashi YOKOTA
    Signed-off-by: John Stultz
    Signed-off-by: Anton Vorontsov

    John Stultz
     
  • This patch fix using correct property POWER_SUPPLY_PROP_CYCLE_COUNT
    for cycle count instead POWER_SUPPLY_PROP_CHARGE_COUNTER

    Signed-off-by: Pali Rohár
    Tested-by: Pali Rohár
    Signed-off-by: Anton Vorontsov

    Pali Rohár
     

26 Apr, 2011

1 commit


22 Apr, 2011

1 commit

  • S390 is special as it doesn't have IRQ lines, so these errors pop up:

    drivers/built-in.o: In function 'max8903_remove':
    drivers/power/max8903_charger.c:355: undefined reference to 'free_irq'
    drivers/power/max8903_charger.c:357: undefined reference to 'free_irq'
    drivers/power/max8903_charger.c:359: undefined reference to 'free_irq'

    This commit fixes the issue by making the driver depend on
    GENERIC_HARDIRQS feature.

    Reported-by: Stephen Rothwell
    Signed-off-by: Anton Vorontsov

    Anton Vorontsov
     

20 Apr, 2011

3 commits

  • The ISP1704/1707 chip can be put to full power down
    state by asserting the CHIP_SEL line. This patch enables
    platform or board specific hooks to put the device into
    power down mode in case not needed.

    This patch is a preparation for enabling this powering
    routine in n900 (rx-51) devices.

    Thanks to Heikki Krogerus for helping out with the patch.

    Signed-off-by: Kalle Jokiniemi
    Acked-By: Heikki Krogerus
    Signed-off-by: Anton Vorontsov

    Kalle Jokiniemi
     
  • Gpio charger should notify if the gpio state had changed
    during suspend. This will send a CHANGED event each time
    the system resumes, ensuring a plug/unplug of the charger
    is not missed.

    Signed-off-by: Benson Leung
    Acked-By: Lars-Peter Clausen
    Signed-off-by: Anton Vorontsov

    Benson Leung
     
  • MAX8903 is an integrated battery charger and selector with two
    power inputs (USB and AC adapter). This driver enables the charger,
    handles interrupts, and provides power-supply-class information to
    userland.

    Tested on Exynos4 NURI / S5PC210 SLP7 boards.

    Signed-off-by: MyungJoo Ham
    Signed-off-by: Kyungmin Park
    Signed-off-by: Anton Vorontsov

    MyungJoo Ham
     

10 Apr, 2011

1 commit


29 Mar, 2011

1 commit


26 Mar, 2011

1 commit

  • * git://git.infradead.org/battery-2.6: (30 commits)
    bq20z75: Fix time and temp units
    bq20z75: Fix issues with present and suspend
    z2_battery: Fix count of properties
    s3c_adc_battery: Fix method names when PM not set
    z2_battery: Add MODULE_DEVICE_TABLE
    ds2782_battery: Add MODULE_DEVICE_TABLE
    bq20z75: Add MODULE_DEVICE_TABLE
    power_supply: Update power_supply_is_watt_property
    bq20z75: Add i2c retry mechanism
    bq20z75: Add optional battery detect gpio
    twl4030_charger: Make the driver atomic notifier safe
    bq27x00: Use single i2c_transfer call for property read
    bq27x00: Cleanup bq27x00_i2c_read
    bq27x00: Minor cleanups
    bq27x00: Give more specific reports on battery status
    bq27x00: Add MODULE_DEVICE_TABLE
    bq27x00: Add new properties
    bq27x00: Poll battery state
    bq27x00: Cache battery registers
    bq27x00: Add bq27000 support
    ...

    Linus Torvalds
     

23 Mar, 2011

2 commits


16 Mar, 2011

4 commits

  • Corrected temperature and time to empty/full conversions.
    Temperature is in 0.1°C, time is in seconds.

    Corrected units in comment. "Convert to µWh."

    Signed-off-by: Benson Leung
    Acked-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Benson Leung
     
  • There are a few issues found around the battery not being present. If the
    battery isn't present, then a few undesirable things happen. The first was
    excessive reporting of failed properties. This was fixed by instead
    returning ENODATA for all properties other than PRESENT if the battery
    isn't present. That way the callers can identify the difference between a
    failure and the battery not being there.

    The next issue was in the suspend logic. It was found that if the battery
    wasn't present, then it would return a failure, preventing the system from
    going into suspend. If there is no battery present, the io is expected to
    fail, so in that case, we shouldn't return the failure and just
    acknowledge that it was expected.

    I also found that when a gpio was used, i didn't maintain the internal
    is_present state properly. I added a set of that to fix that.

    Lastly, the code to see io's fail and figure out that the battery isn't
    present when not using a gpio had a problem. In that code, it looked for
    the read to fail and if it did, then handled it. The problem is that in
    function to get the property, it first writes a value and that write can
    fail, causing the code to never reach the logic after the read. Fix is
    to move the logic till after the write.

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     
  • PROP_STATUS property was not counted, as result VOLTAGE_MIN property is
    missing in sysfs. Fix it.

    Signed-off-by: Vasily Khoruzhick
    Acked-by: Marek Vasut
    Signed-off-by: Anton Vorontsov

    Vasily Khoruzhick
     
  • s3c_adc_battery declares wrong method names when CONFIG_PM is not set.

    Signed-off-by: Heiko Stuebner
    Acked-by: Vasily Khoruzhick
    Signed-off-by: Anton Vorontsov

    Heiko Stuebner
     

02 Mar, 2011

5 commits

  • The device table is required to load modules based on modaliases.
    After adding the MODULE_DEVICE_TABLE, below entry will be added to
    modules.alias:
    alias i2c:aer915 z2_battery

    Signed-off-by: Axel Lin
    Signed-off-by: Anton Vorontsov

    Axel Lin
     
  • The device table is required to load modules based on modaliases.
    After adding the MODULE_DEVICE_TABLE, below entries will be added to
    modules.alias:
    alias i2c:ds2786 ds2782_battery
    alias i2c:ds2782 ds2782_battery

    Signed-off-by: Axel Lin
    Signed-off-by: Anton Vorontsov

    Axel Lin
     
  • The device table is required to load modules based on modaliases.
    After adding the MODULE_DEVICE_TABLE, below entry will be added to
    modules.alias:
    alias i2c:bq20z75 bq20z75

    Signed-off-by: Axel Lin
    Signed-off-by: Anton Vorontsov

    Axel Lin
     
  • With the support of platform data, now adding support for option i2c
    retries on read/write failures. Ths is specified through the optional
    platform data.

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     
  • Adding support for an optional gpio for battery detection. This is
    passed in through the i2c platform data. It also accepts another
    field, battery_detect_present to signify the gpio state which means
    the battery is present, either 0 (low) or 1 (high).

    Signed-off-by: Rhyland Klein
    Signed-off-by: Anton Vorontsov

    Rhyland Klein
     

28 Feb, 2011

2 commits


22 Feb, 2011

11 commits

  • Doing this by using 2 calls sometimes results in unexpected
    values being returned on OMAP3 i2c controller.

    Signed-off-by: Grazvydas Ignotas
    Signed-off-by: Lars-Peter Clausen

    Grazvydas Ignotas
     
  • Some minor stylistic cleanups.

    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • * Consistently use uppercase for hexadecimal values.
    * Clarify/fix the unit of functions return value in its comment.

    Signed-off-by: Pali Rohár
    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Pali Rohár
     
  • The current code only reports whether the battery is charging or
    discharging. But the battery also reports whether it is fully charged,
    furthermore by look at if the battery is supplied we can tell whether it
    is discharging or not charging.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Rodolfo Giometti
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • This patch adds MODULE_DEVICE_TABLE for module bq27x00_battery.

    Signed-off-by: Pali Rohár
    Tested-by: Pali Rohár
    Signed-off-by: Lars-Peter Clausen
    Acked-by: Rodolfo Giometti
    Tested-by: Grazvydas Ignotas

    Pali Rohár
     
  • This patch add support for reporting properties
    POWER_SUPPLY_PROP_CHARGE_NOW, POWER_SUPPLY_PROP_CHARGE_FULL,
    POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
    POWER_SUPPLY_PROP_CHARGE_COUNTER, POWER_SUPPLY_PROP_ENERGY_NOW in
    module bq27x00_battery.

    Signed-off-by: Pali Rohár
    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Pali Rohár
     
  • This patch adds support for polling the battery state and generating a
    power_supply_changed() event if it has changed.

    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • This patch adds a register cache to the bq27x00 battery driver.
    Usually multiple, if not all, power_supply properties are queried at once,
    for example when an uevent is generated. Since some registers are used by
    multiple properties caching the registers should reduce the number of
    reads.

    The cache is valid for 5 seconds this roughly matches the internal update
    interval of the current register for the bq27000/bq27200.

    Fast changing properties(*_NOW) which can be obtained by reading a single
    register are not cached.

    It will also be used in the follow up patch to check if the battery status
    has been changed since the last update to emit power_supply_changed events.

    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • This patch adds support for the bq27000 battery to the bq27x00 driver.
    The bq27000 is similar to the bq27200 except that it uses the HDQ bus
    instead of I2C to communicate with the host system.

    The driver is implemented as a platform driver. The driver expects to be
    provided with a read callback function through its platform data. The read
    function is assumed to do the lowlevel HDQ handling and read out the value
    of a certain register.

    Signed-off-by: Lars-Peter Clausen
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • This patch simplifies the drivers data structure and moves code to be
    shared by the bq27000 and bq27200/bq27500 init functions into a common
    function.
    This patch has no functional changes, it only moves code around.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Rodolfo Giometti
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen
     
  • This patch changes get_property callback of the bq27x00 battery to return
    -ENODEV for properties other then the PROP_PRESENT if the battery is not
    present.
    The power subsystem core expects a driver to behave that way.

    Signed-off-by: Lars-Peter Clausen
    Acked-by: Rodolfo Giometti
    Tested-by: Grazvydas Ignotas

    Lars-Peter Clausen