23 Sep, 2009

1 commit


05 Sep, 2009

5 commits


31 Jul, 2009

1 commit


30 Jul, 2009

8 commits

  • The ds2760's internal current meter is not reliable enough as it has an
    inacurracy of around ~15%. Without any correction for that error, the
    current accumulator is couting up all the time, even though the battery
    is already fully charged and hence destroys the static information. The
    longer it is connected, the worse is the aberration.

    Fortunately, this can be corrected by the DS2760_CURRENT_OFFSET_BIAS
    register. Using the external power_supply_set_battery_charged()
    function, this register is now gauging the measurement.

    A delayed work is used to debounce flaky GPIO signals and to let the
    current value settle. Also see Maxim's application note AN4188.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Cc: Matt Reimer
    Cc: Anton Vorontsov
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • This adds a function that indicates that a battery is fully charged.
    It also includes functions to get a power_supply device from the class
    of registered devices by name reference. These can be used to find a
    specific battery to call power_supply_set_battery_charged() on.

    Some battery drivers might need this information to calibrate
    themselves.

    Signed-off-by: Daniel Mack
    Cc: Ian Molton
    Cc: Anton Vorontsov
    Cc: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • While I'm at it, cleanup the power supply code so that EXPORT_SYMBOL_GPL
    appears directly after the symbole declaration. checkpatch.pl wants it
    that way.

    Signed-off-by: Daniel Mack
    Cc: Ian Molton
    Cc: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • When connecting a ds2760 to a partly loaded battery the first time,
    there must be a way to bootstrap the current_accum value. Without that,
    the current capactity value is bogus until the battery is fully charged
    for the first time.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Cc: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • In systems where the battery monitor is not part of the battery pack and
    is hence not bootstrapped with sane values, the full_active_uAh is
    likely to be zero.

    Handle that case by defaulting to the rated_capacity information which
    can be passed to the driver using the new module parameter.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • For systems where the ds2760 is soldered directly on the PCB, the 'rated
    capacity' register is not set to anything useful.

    In order to allow users to bootstrap this value, introduce a new module
    parameter 'rated_capacity' and use it to write the internal EEPROM in
    case the value differes from what's been given.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • Export POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW and POWER_SUPPLY_PROP_CAPACITY
    features to the power supply core.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • This fixes a race condition I recently introduced with the PMOD feature
    addition (cef437e3: "w1: ds2760_battery: add support for sleep mode
    feature").

    Postpone the call to power_supply_register() to fix it.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     

14 Jul, 2009

1 commit


13 Jul, 2009

1 commit


02 Jul, 2009

1 commit


01 Jul, 2009

5 commits


09 Jun, 2009

4 commits

  • There are cases when charging monitor and the event handler try to
    change the charger state simultaneously. For instance, a charger is
    connected to the system, there's the detection event and the event
    handler tries to enable charging. It is possible that the periodic
    charging monitor runs at the same time and it still thinks there's
    no external charger. So it tries to disable the charging. As the
    result, even if the conditions necessary to charge the battery hold,
    there will be no actual charging.

    The patch changes the event handler so that instead of enabling/
    disabling the charger immediately it would rather make the monitor
    run. The monitor code then decides what should be the charger state.

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Signed-off-by: Anton Vorontsov

    Mike Rapoport
     
  • The MAX17040 is a I2C interfaced Fuel Gauge systems for lithium-ion
    batteries This patch adds support the MAX17040 Fuel Gauge

    Signed-off-by: Minkyu Kang
    Signed-off-by: Anton Vorontsov

    Minkyu Kang
     
  • This adds support for ds2760's sleep mode feature. With this feature
    enabled, the chip enters a deep sleep mode and disconnects from the
    battery when the w1 line is held down for more than 2 seconds.

    This new behaviour can be switched on and off using a new module
    parameter.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Acked-by: Evgeniy Polyakov
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • Removed struct ds2760_platform_data which wasn't defined anywhere.
    Indentation cleanups.

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     

09 Apr, 2009

1 commit


05 Apr, 2009

1 commit


30 Mar, 2009

1 commit


28 Mar, 2009

1 commit


13 Mar, 2009

1 commit

  • The 'battery remaining capacity' calculation in
    drivers/power/ds2760_battery.c lacks a parameter check to a division
    operation which causes the kernel to oops on my board.

    [ 21.233750] Division by zero in kernel.
    [ 21.237646] [] (__div0+0x0/0x20) from [] (Ldiv0+0x8/0x10)
    [ 21.244816] [] (ds2760_battery_read_status+0x0/0x2a4) from [] (ds2760_battery_get_property+0x30/0xdc)
    [ 21.255803] r8:c03a22c0 r7:c7886100 r6:00000009 r5:c782fe7c r4:c7886084
    [ 21.262518] [] (ds2760_battery_get_property+0x0/0xdc) from [] (power_supply_show_property+0x48/0x114)
    [ 21.273480] r6:c7996000 r5:00000009 r4:00000000
    [ 21.278111] [] (power_supply_show_property+0x0/0x114) from [] (power_supply_uevent+0x188/0x280)
    [ 21.288537] r8:00000001 r7:c7886100 r6:c7996000 r5:000000b4 r4:00000000
    [ 21.295222] [] (power_supply_uevent+0x0/0x280) from [] (dev_uevent+0xd4/0x10c)
    [ 21.304199] [] (dev_uevent+0x0/0x10c) from [] (kobject_uevent_env+0x180/0x390)
    [ 21.313170] r5:00000000 r4:c78860ac
    [ 21.316725] [] (kobject_uevent_env+0x0/0x390) from [] (kobject_uevent+0x14/0x18)
    [ 21.325850] [] (kobject_uevent+0x0/0x18) from [] (power_supply_changed_work+0x5c/0x70)
    [ 21.335506] [] (power_supply_changed_work+0x0/0x70) from [] (run_workqueue+0xbc/0x144)
    [ 21.345167] r4:c7812040
    [ 21.347716] [] (run_workqueue+0x0/0x144) from [] (worker_thread+0xa8/0xbc)
    [ 21.356296] r7:c7812040 r6:c7820b00 r5:c782ffa4 r4:c7812048
    [ 21.361957] [] (worker_thread+0x0/0xbc) from [] (kthread+0x5c/0x94)
    [ 21.369971] r7:00000000 r6:c004d8a4 r5:c7812040 r4:c782e000
    [ 21.375612] [] (kthread+0x0/0x94) from [] (do_exit+0x0/0x688)

    Signed-off-by: Daniel Mack
    Cc: Szabolcs Gyurko
    Acked-by: Matt Reimer
    Acked-by: Anton Vorontsov
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Mack
     

03 Feb, 2009

4 commits

  • This patch allows machines to use an OTG transceiver driver instead of
    supplying a custom is_usb_online callback to check USB power.
    Also, in the case that the OTG transceiver handles charger control when
    connected to USB, a regulator named "ac_draw" can be supplied instead of
    the custom set_charge callback to control the charger when connected to
    AC.

    The check for (transceiver->state == OTG_STATE_B_PERIPHERAL) in
    otg_is_usb_online is probably too simple, I'm just using this with a
    peripheral only device and gpio_vbus + bq24022. I'm not sure which other
    OTG states can supply power.

    Signed-off-by: Philipp Zabel
    Signed-off-by: Anton Vorontsov

    Philipp Zabel
     
  • The 'pcf50633_mbc_set_status' function is unused, so remove it.

    Signed-off-by: Balaji Rao
    Cc: Andy Green
    Signed-off-by: Anton Vorontsov

    Balaji Rao
     
  • The battery charger state machine switches into charging mode when
    the battery voltage falls below 96% of a battery float voltage. But
    the voltage drop in Li-ion batteries is marginal(1~2 %) till about
    80% of its capacity - which means, after a BATFULL, charging won't
    be restarted until 80%.

    This work_struct function restarts charging at regular intervals to
    make sure the battery doesn't discharge too much.

    Signed-off-by: Balaji Rao
    Cc: Andy Green
    Signed-off-by: Anton Vorontsov

    Balaji Rao
     
  • container_of(psy, struct pcf50633_mbc, usb); should be
    container_of(psy, struct pcf50633_mbc, adapter);

    Signed-off-by: Balaji Rao
    Cc: Andy Green
    Signed-off-by: Anton Vorontsov

    Balaji Rao
     

26 Jan, 2009

1 commit


11 Jan, 2009

1 commit


07 Jan, 2009

1 commit


04 Jan, 2009

1 commit