Commit Graph

43 Commits

Author SHA1 Message Date
Abhijeet Dharmapurikar 0861965af5 power: rename ALLOW_DETECTION to DPF_DMF
The ALLOW_DETECTION property is meant to reflect that the power supply
controller should relinquish USB's DP and DM lines and put them in a
floating state.

Change to use the DP_DM property with DPF_DMF values for floating and
DPR_DMR values for removing the float of DP/DM lines.

USB: phy: msm: rename ALLOW_DETECTION prop to DP_DM

Power supply driver has changes the ALLOW_DETECTION property to
use the DP_DM property with DPF_DMF values for floating and
DPR_DMR values for removing the float of DP/DM lines.
Make changes in phy msm driver to handle it accordingly

Change-Id: I1fdfaceb88058a6d1d3f21205a1a9b0e5058e7e7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Tarun Gupta <tarung@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2015-08-04 14:35:16 +05:30
Abhijeet Dharmapurikar 2b304c13e0 power_supply: introduce properties for HVDCP 3P0
HVDCP 3P0 needs a few properties implemented by USB power
supply and battery power supply for correct operation.

Change-Id: Ia69ec459eea72703f530c7124f7cc579f4d4c423
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2015-08-04 14:34:59 +05:30
Abhijeet Dharmapurikar aaa9f28f32 power: power-supply: add property POWER_SUPPLY_PROP_ALLOW_DETECTION
There are situations when one needs to notify involved power supply
nodes that type detection is about to commence and they should
modify their state and hardware to allow it.

For example, the D+/D- lines are shared by USB Phy and the Charger
driver where the phy pullsdown the D+/D- lines. When USB is inserted
the charger power supply node will need to notify the USB power supply
node to release the pulldowns and allow for type detection.

This property serves as that indication.

Also, create a helper function to set this property.

Change-Id: I67f14de81214f0bed1bcccf71e1c28b8e5212359
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2015-03-19 12:19:18 -07:00
Abhijeet Dharmapurikar 047e1ac2d6 power: power_supply_core: Provide helper function to set usb otg
Provide helper function to set the POWER_SUPPLY_PROP_USB_OTG property.

Change-Id: I182f71b8ce3952c48c6eeaddf718d6875464ed19
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2014-05-15 18:55:07 -07:00
Anirudh Ghayal c7050dbb6d power: power_supply: Add properties to indicate power state
Properties POWER_SUPPLY_PROP_HI_POWER/POWER_SUPPLY_PROP_LOW_POWER
can be used by clients to indicate their power states.

Change-Id: I4f92f41e1ae9718680b58469a8d0cd4ec1423889
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2014-05-01 22:03:52 +05:30
David Keitel 5df7b70af0 power: core: add set_voltage_limit API
Add the power_supply_set_voltage_limit API which
allows the POWER_SUPPLY_PROP_VOLTAGE_MAX property
to be configured for a given power supply.

CRs-Fixed: 637169
Change-Id: Ib525366ff742ad31d81ffee75920c19a6f9e8de8
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2014-04-07 12:39:11 -07:00
Wu Fenglin c00e21ae14 power: qpnp-charger: add charger OVP status monitor
Enable coarse-det-usb irq for charger OVP monitor. When insert a
high voltage charger, coarse-det-usb irq trigger, after wait for
usb valid debounce time, check the OVP condition, and report usb
health state; When an OVP happened in the process of charging, a
falling usbin valid_irq trigger, check OVP condition in usb plug
out condition, and report the usb health state.

Userspace can use the charger health state change to pop up
warning message when a charger, which exceeds the OVP threshold,
is connected.

Change-Id: Idedcdd7084aa24505675cf016d869444a89ca46c
Signed-off-by: Wu Fenglin <fenglinw@codeaurora.org>
2013-09-27 09:55:31 +08:00
David Keitel 018a0d5345 power: power_supply_core: Add API to enable and disable charging
To allow external drivers enable and disable charging add
a power supply framework property POWER_SUPPLY_PROP_CHARGING_ENABLED
which reflects the status of charging being enabled or disabled.

Change-Id: I199a08797b8f2f00edee05e83735c4835400aa60
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2013-09-04 15:28:48 -07:00
David Keitel 8fe632a265 power: power_supply_core: fix documentation error
Fix mistake in documentation for power_supply_set_present.

Change-Id: I5c7cfe6cd9e5e0a4bfd38d6e38ed098acc10fd54
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2013-09-04 15:28:20 -07:00
David Keitel 9fdc0f2aa4 otg: msm_otg: add power_supply usb
To further decouple and step away from using
proprietary APIs between individual driver
have the MSM OTG driver register its own USB
power supply to allow any charger driver to
subscribe to notifications for it and also
use the power_supply_set_online and
power_supply_set_present APIs to notfiy the driver
of USB connections.

For example the 8941 charger PMIC driver handles
the USBIN_VALID interrupt and has to call
power_supply_set_present to notify the OTG driver.

This can now be done from virtually any driver that
provides a supplicant power supply such as "battery"
and provides the external_power_changed callback.

Change-Id: I188d3177f200ab00a7080cd8a361c16728aa0f73
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2013-09-04 15:27:37 -07:00
David Keitel dfb88788a5 power: power_supply_core: add power_supply_set_supply_type API
Allow other drivers to change the supply type of a given power
supply. This is required when a USB driver determines the exact
USB connection type and needs to notify the owner of the usb power
supply struct.

Change-Id: I99d377628a296704e1dcd170251ab9ceadc653ec
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2013-09-04 15:06:45 -07:00
Abhijeet Dharmapurikar 2aac4bf1f0 power_supply: add change the scope property
The scope property indicates the operating mode of the system. This
property could be used to switch to and from usb host mode.

Add a helper api to update this property.

CRs-Fixed: 373365
Change-Id: I5fb57f7b1075276ba90b0f7e0a44626e07ee196f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2013-09-04 14:57:45 -07:00
David Keitel a8545d62ea power: core: add power supply APIs
Rename power_supply_set_charging_by to power_supply_set_online to
more accurately reflect the intent of the API.

Add power_supply_set_charge_type to enable a charger driver to set
a POWER_SUPPLY_PROP_CHARGE_TYPE. Ultimately this is handled like
a request, the receiving charger driver then can handle the request
and report the adequate POWER_SUPPLY_PROP_CHARGE_TYPE once necessary
action has been taken.

Change-Id: Idf4760c7d6c0f61a9eccc656cd469a6ac5fdc6cd
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
2013-09-04 14:49:20 -07:00
Willie Ruan 684c888dcf power: core: add power supply APIs
Add two APIs, 1) set_current_limit API and 2) set_charging_by.
set_current_limit api is used for external control, such as for USB
driver to tell a charger driver the maximum current to draw.
set_charging_by is used to change the state of the charger.

Change-Id: I147eab37836b54627ca1458167eb117ba3eacd7a
Signed-off-by: Willie Ruan <wruan@codeaurora.org>
2013-09-04 14:49:19 -07:00
Todd Poynor 7df159a58e power_supply: convert wakelock to wakeup source
And supply name will be used as wakeup source name.

Change-Id: I53075491c6e1a4c66755afe8a40b7166cd8d6cb2
Signed-off-by: Todd Poynor <toddpoynor@google.com>
2013-07-01 13:40:50 -07:00
Arve Hjønnevåg e65ffa2cce power_supply: Hold a wake_lock while power supply change notifications are pending
When connecting usb or the charger the device would often go back to sleep
before the charge led and screen turned on.

Change-Id: I01def6d86ddece0d4e31d2a91d176ed0975b6b9d
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01 13:40:19 -07:00
Rhyland Klein f6e0b081fb power_supply: Populate supplied_from hierarchy from the device tree
With this patch the power_supply_core will try to populate supplied_from
hierarchy from the device tree.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16 18:51:16 -07:00
Rhyland Klein 5e0848c602 power_supply: Add core support for supplied_from
This patch adds support for supplies to register a list of char *'s which
represent the list of supplies which supply them. This is the opposite as
the supplied_to list.

This change maintains support for supplied_to until all drivers which make
use of it already are converted.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-04-16 18:35:31 -07:00
Michał Mirosław 9f3b795a62 driver-core: constify data for class_find_device()
All in-kernel users of class_find_device() don't really need mutable
data for match callback.

In two places (kernel/power/suspend_test.c, drivers/scsi/osd/osd_uld.c)
this patch changes match callbacks to use const search data.

The const is propagated to rtc_class_open() and power_supply_get_by_name()
parameters.

Note that there's a dev reference leak in suspend_test.c that's not
touched in this patch.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-06 12:18:56 -08:00
Linus Torvalds 7313264b89 Highlights:
- Two new drivers from Pali Rohár and N900 hackers: rx51_battery and
   bq2415x_charger. The drivers are a part of a solution to replace the
   proprietary Nokia BME stack;
 
 - Power supply core now registers devices with a thermal cooling
   subsystem, so we can now automatically throttle charging. Thanks to
   Ramakrishna Pallala!
 
 - Device tree support for ab8500 and max8925_power drivers;
 
 - Random fixups and enhancements for a bunch of drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQyFGdAAoJEGgI9fZJve1bYy8P/iu4XRL2kNwmPD7fMO+bZSao
 xCSi8zRCnOtDutB48MQXIDTi1+I64+Qqq5xTuHW5n/T0zJ88biGBZfmJLjM88oQ4
 ZqfO/axT6/MNFXTQtxEvXtn/AoM6lp9ZLmIbs7mkSpcnuG8iY5eovKfeyyNiAoGh
 W6ISc9d1zZl8JYZXkkX4y5uxsH/t34rPjWJqygMulJrVdePpC9fNWwDYnul6T7iF
 /bbqIH/j88HSYNDN518dv/ot+OfPn0vuxD4WzGAqC7ddHICtuaw8TBfXHmr6j4Mf
 o9ytC/dH+AQ6Tcs+h7mbz/dfL4Gs9JK2LgRX2z1DtFa6uTw5jwEtZSuDF4DKovEg
 71T67dsHDKJkQgGMDfDw1BrlLjQr8hkaWroF8CdmbRO0rRsfKamLQANG7mGkSu8B
 l1W0ZzWEbHDteNB/wCkjoncXlcqoA8YiplyVSqf38aP8YuaeHMR3LRGLFwgXK3pB
 lELh3cYSYLVpcqUgkRWcPrCUnLA2CkQy2B4INj5jFZilux7DzyIHMhWI2OuUs2rH
 1rwTYO91gTVONuagZn8+lmsjs+Yq1n2BcyrGMG2+ZYzruFaQ+brQsCbQR0hdRuaU
 zWLENqwGJ/++XrFgw3/5orMZIZQzL/yq+MbIXtrgKcFRWwoxyzJuH63RMQf3S6yy
 hxi7pYQmb9if+HPJZVVg
 =Bb5O
 -----END PGP SIGNATURE-----

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

Pull battery subsystem updates from Anton Vorontsov:
 "Highlights:

   - Two new drivers from Pali Rohár and N900 hackers: rx51_battery and
     bq2415x_charger.  The drivers are a part of a solution to replace
     the proprietary Nokia BME stack

   - Power supply core now registers devices with a thermal cooling
     subsystem, so we can now automatically throttle charging.  Thanks
     to Ramakrishna Pallala!

   - Device tree support for ab8500 and max8925_power drivers

   - Random fixups and enhancements for a bunch of drivers."

* tag 'for-v3.8-merged' of git://git.infradead.org/battery-2.6: (22 commits)
  max8925_power: Add support for device-tree initialization
  ab8500: Add devicetree support for chargalg
  ab8500: Add devicetree support for charger
  ab8500: Add devicetree support for btemp
  ab8500: Add devicetree support for fuelgauge
  twl4030_charger: Change TWL4030_MODULE_* ids to TWL_MODULE_*
  jz4740-battery: Use devm_request_and_ioremap
  jz4740-battery: Use devm_kzalloc
  bq27x00_battery: Fixup nominal available capacity reporting
  bq2415x_charger: Fix style issues
  bq2415x_charger: Add Kconfig/Makefile entries
  power_supply: Add bq2415x charger driver
  power_supply: Add new Nokia RX-51 (N900) power supply battery driver
  max17042_battery: Fix missing verify_model_lock() return value check
  ds2782_battery: Fix signedness bug in ds278x_read_reg16()
  lp8788-charger: Fix ADC channel names
  lp8788-charger: Fix wrong ADC conversion
  lp8788-charger: Use consumer device name on setting IIO channels
  power_supply: Register power supply for thermal cooling device
  power_supply: Add support for CHARGE_CONTROL_* attributes
  ...
2012-12-13 19:26:04 -08:00
Ramakrishna Pallala 952aeeb3ee power_supply: Register power supply for thermal cooling device
This patch registers the power supply as a cooling device if the power
supply has support for charge throttling.

Now with this change low level drivers need not register with thermal
framework as it is automatically done by power supply framework.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-17 20:32:33 -08:00
Durgadoss R 50125a9b27 Thermal: Pass zone parameters as argument to tzd_register
This patch adds the thermal zone parameter as an argument to
the tzd_register() function call; and updates other drivers
using this function.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2012-11-05 13:59:57 +08:00
Zhang Rui 1b7ddb840c Thermal: Remove tc1/tc2 in generic thermal layer.
Remove tc1/tc2 in generic thermal layer.
.get_trend() callback starts to take effect from this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com>
2012-09-24 14:44:36 +08:00
Anton Vorontsov e6db06a53b Merge with upstream to accommodate with thermal changes
This merge is performed to take commit c56f5c0342 ("Thermal: Make
Thermal trip points writeable") out of Linus' tree and then fixup power
supply class. This is needed since thermal stuff added a new argument:

  CC      drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function ‘psy_register_thermal’:
drivers/power/power_supply_core.c:204:6: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:154:29: note: expected ‘int’ but argument is of type ‘struct power_supply *’
drivers/power/power_supply_core.c:204:6: error: too few arguments to function ‘thermal_zone_device_register’
include/linux/thermal.h:154:29: note: declared here
make[1]: *** [drivers/power/power_supply_core.o] Error 1
make: *** [drivers/power/] Error 2

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-07-31 05:16:47 -07:00
Jenny TC 3be330bf88 power_supply: Register battery as a thermal zone
Battery and charger contribute to Thermals in most of the embedded
devices. So, it makes sense to identify them as Thermal zones in a
particular platform.

This patch registers a thermal zone if the power supply is reporting
a temperature property. The thermal zone will be used by platform's
thermal management solution.

Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-06-17 21:25:39 -07:00
Anton Vorontsov 93278d151e power_supply: Drop usage of nowarn variant of sysfs_create_link()
The function is not exported to modules, plus we do want to catch anyone
who tries to create complex hierarchy (in that case we'd need to change
'powers' symlink to a directory, probably under a different name to not
break ABI).

This patch fixes the following build error:

 ERROR: "sysfs_create_link_nowarn" [drivers/power/power_supply.ko] undefined!

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-07 15:24:51 +04:00
Jean Delvare 2530daa187 power_supply: Assume mains power by default
If no power class device is found in power_supply_is_system_supplied(),
the function currently returns 0, which basically means that the system
is supposed to be running on battery. In practice, mobile devices tend
to always implement at least one power class device and more often two
(battery and AC adapter). Systems with no registered power class
devices are more likely to be desktop systems, where the system is
always powered by mains.

So, change the default return value of
power_supply_is_system_supplied() from 0 (running on battery) to 1
(running on mains.)

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-06 05:50:32 +04:00
Jeremy Fitzhardinge 8351665195 power_supply: allow a power supply to explicitly point to powered device
If a power supply has a scope of "Device", then allow the power supply
to indicate what device it actually powers. This is represented in the
power supply's sysfs directory as a symlink named "powers", which points to
the sysfs directory of the powered device.

If the device has children, then the sub-devices are also powered by
the same power supply.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Richard Hughes <richard@hughsie.com>
2011-12-09 09:52:07 -08:00
Lars-Peter Clausen 9777467257 power_supply: Initialize changed_work before calling device_add
Calling device_add causes an inital uevent for that device to be generated.
The power_supply uevent function calls the drivers get_property function,
which might causes the driver to update its state, which again might
causes the driver to call power_supply_changed(). Since the power_supplys
changed_work has not been initialized at this point the behavior is
undefined and can result in an OOPS.

This patch fixes the issue by initializing the power_supplys changed_work
prior to adding the power_supplys device to the device tree.

Reported-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
2011-02-22 11:01:42 +01:00
Tejun Heo bc51e7ff52 power_supply: Don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed.

In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend.  Replace
flush_scheduled_work() usages with direct cancels and flushes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2010-12-22 02:39:56 +03:00
Vasiliy Kulikov 3a2dbd611b power_supply: Fix use after free and memory leak
device_unregister() might free its argument.  This leads to freed
memory use in kfree().  Also use put_device() instead of kfree()
as dev may be already used in another layer after call to device_add().

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2010-12-22 02:39:55 +03:00
Anton Vorontsov 5f487cd34f power_supply: Use attribute groups
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 <gregkh@suse.de>
Suggested-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Tested-by: Daniel Mack <daniel@caiaq.de>
2010-05-19 12:14:28 +04:00
Daniel Mack e5f5ccb646 power_supply: get_by_name and set_charged functionality
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 <daniel@caiaq.de>
Cc: Ian Molton <spyro@f2s.com>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-07-30 17:49:15 +04:00
Daniel Mack ff3417e7ef power_supply: EXPORT_SYMBOL cleanups
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 <daniel@caiaq.de>
Cc: Ian Molton <spyro@f2s.com>
Cc: Matt Reimer <mreimer@vpop.net>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2009-07-30 17:49:00 +04:00
Anton Vorontsov ed8c3174dd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:

	drivers/power/Makefile
2008-10-18 20:28:24 +04:00
Greg Kroah-Hartman a9b12619f7 device create: misc: convert device_create_drvdata to device_create
Now that device_create() has been audited, rename things back to the
original call to be sane.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-16 09:24:43 -07:00
Matthew Garrett 942ed16194 power_supply: Add function to return system-wide power state
Certain drivers benefit from knowing whether the system is on ac or
battery, for instance when determining which backlight registers to
read. This adds a simple call to determine whether there's an online
power supply other than any batteries.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2008-09-01 02:42:54 +04:00
Greg Kroah-Hartman 93562b5376 Driver Core: add ability for class_for_each_device to start in middle of list
This mirrors the functionality that driver_for_each_device has as well.

We add a start variable, and all callers of the function are fixed up at
the same time.

The block layer will be using this new functionality in a follow-on
patch.


Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:54:47 -07:00
Greg Kroah-Hartman 54d29ad33e Power Supply: fix race in device_create
There is a race from when a device is created with device_create() and
then the drvdata is set with a call to dev_set_drvdata() in which a
sysfs file could be open, yet the drvdata will be NULL, causing all
sorts of bad things to happen.

This patch fixes the problem by using the new function,
device_create_drvdata().

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-20 13:31:55 -07:00
Harvey Harrison 0cddc0a906 power: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:05:58 -07:00
Dave Young 443cad920a power supply : use class iteration api
Convert to use the class iteration api.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-24 20:40:44 -08:00
Anton Vorontsov 7b3d54a8c3 Power supply class and drivers: remove non obligatory return statements
Per Jeff Garzik request.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2007-07-15 22:32:38 +04:00
Anton Vorontsov 4a11b59d82 [BATTERY] Universal power supply class (was: battery class)
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 <cbou@mail.ru>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2007-07-10 11:25:44 +01:00