19 May, 2010

2 commits

  • This patch adds support for writeable power supply properties and
    exposes them as writeable to sysfs.

    A power supply implementation must implement two new function calls in
    order to use that feature:

    int set_property(struct power_supply *psy,
    enum power_supply_property psp,
    const union power_supply_propval *val);

    int property_is_writeable(struct power_supply *psy,
    enum power_supply_property psp);

    Signed-off-by: Daniel Mack
    Cc: David Woodhouse
    Cc: Alexey Starikovskiy
    Cc: Len Brown
    Cc: Mark Brown
    Cc: Matt Reimer
    Cc: Evgeniy Polyakov
    Cc: Tejun Heo
    Signed-off-by: Anton Vorontsov

    Daniel Mack
     
  • This fixes a race between power supply device and initial
    attributes creation, plus makes it possible to implement
    writable properties.

    [Daniel Mack - removed superflous return statement
    and dropped .mode attribute from POWER_SUPPLY_ATTR]

    Suggested-by: Greg KH
    Suggested-by: Kay Sievers
    Signed-off-by: Anton Vorontsov
    Tested-by: Daniel Mack

    Anton Vorontsov
     

16 Jan, 2010

1 commit


30 Jul, 2009

1 commit

  • 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
     

02 Jul, 2009

1 commit


01 Jul, 2009

1 commit

  • This reverts commit 8efe444038a205e79b38b7ad03878824901849a8 and
    4cbc76eadf56399cd11fb736b33c53aec9caab8c.

    Richard@laptop.org was apparently using CAPACITY_LEVEL for debugging
    battery/EC problems, and was upset that it was removed. This readds it.

    Conflicts:

    Documentation/power_supply_class.txt

    Signed-off-by: Andres Salomon
    Signed-off-by: Anton Vorontsov

    Andres Salomon
     

28 Mar, 2009

1 commit


04 Jan, 2009

1 commit


01 Sep, 2008

1 commit


13 May, 2008

1 commit

  • This adds PROP_CHARGE_COUNTER to the power supply class (documenting it
    as well). The OLPC battery driver uses this for spitting out its ACR
    values (in uAh). We have some rounding errors (the data sheet claims
    416.7, the math actually works out to 416.666667, so we're forced to
    choose between overflows or precision loss. I chose precision loss,
    and stuck w/ data sheet values), but I don't think anyone will care
    that much.

    Signed-off-by: Andres Salomon
    Signed-off-by: Anton Vorontsov

    Andres Salomon
     

06 Feb, 2008

1 commit


02 Feb, 2008

2 commits

  • Add LiMn (one of the most common for small non-rechargable batteries)
    battery technology and voltage_min/_max properties support.

    Signed-off-by: Dmitry Baryshkov
    Signed-off-by: Anton Vorontsov

    Dmitry Baryshkov
     
  • The CAPACITY_LEVEL stuff defines various levels of charge; however, what
    is the difference between them? What differentiates between HIGH and NORMAL,
    LOW and CRITICAL, etc?

    As it appears that these are fairly arbitrary, we end up making such policy
    decisions in the kernel (or in hardware). This is the sort of decision that
    should be made in userspace, not in the kernel.

    If the hardware does not support _CAPACITY and it cannot be easily calculated,
    then perhaps the driver should register a custom CAPACITY_LEVEL attribute;
    however, userspace should not become accustomed to looking for such a thing,
    and we should certainly not encourage drivers to provide CAPACITY_LEVEL
    stubs.

    The following removes support for POWER_SUPPLY_PROP_CAPACITY_LEVEL. The
    OLPC battery driver is the only driver making use of this, so it's
    removed from there as well.

    Signed-off-by: Andres Salomon
    Signed-off-by: David Woodhouse

    Andres Salomon
     

10 Jul, 2007

1 commit

  • This class is result of "external power" and "battery" classes merge,
    as suggested by David Woodhouse. He also implemented uevent support.

    Here how userspace seeing it now:

    # ls /sys/class/power\ supply/
    ac main-battery usb

    # cat /sys/class/power\ supply/ac/type
    AC

    # cat /sys/class/power\ supply/usb/type
    USB

    # cat /sys/class/power\ supply/main-battery/type
    Battery

    # cat /sys/class/power\ supply/ac/online
    1

    # cat /sys/class/power\ supply/usb/online
    0

    # cat /sys/class/power\ supply/main-battery/status
    Charging

    # cat /sys/class/leds/h5400\:red-left/trigger
    none h5400-radio timer hwtimer ac-online usb-online
    main-battery-charging-or-full [main-battery-charging]
    main-battery-full

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David Woodhouse
    Signed-off-by: Andrew Morton

    Anton Vorontsov