devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] Add DT Binding for Power-Supply power-supplies property
@ 2013-04-01 21:45 Rhyland Klein
       [not found] ` <1364852755-17425-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rhyland Klein @ 2013-04-01 21:45 UTC (permalink / raw)
  To: Anton Vorontsov, Grant Likely
  Cc: David Woodhouse, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Rhyland Klein

This series defines a common way for devicetree initialized
power_supplies to define their relationships between chargers and
supplicants.

This series adds a supplied_from array to complement the supplied_to
array and to allow supplies to define the list of supplies which
supply them.

Then once this property is supported, we can use a new property for
devicetree to define the relationships between nodes, and read in this
property to generate the supplied_from list.

With this logic in place, all drivers need to do to add support for
this mechanism, is to store their device tree node in the power_supply
struct. They should also handle EPROBE_DEFER properly.

Changes since:
v2:
 - Changed __power_supply_is_supplied_by to a boolean function and
   corrected return paths around it
 - took loop invariant tests out of loops
 - Fixed multiline comment style
 - fixed up return paths around power_supplies_check_supplies

RFC v2:
 - Changed to official Patch set rather than RFC
 - defined supplied_from char ** array rather than complicated
   struct device_node related array

RFC v1:
 - Inverted the logic so that supplies (batteries) contain a list of
   the supplies (chargers) which supply them.

Rhyland Klein (3):
  power_supply: Define Binding for power-supplies
  power: power_supply: Add core support for supplied_from
  power: power_supply_core: Add support for supplied_from

 .../bindings/power_supply/power_supply.txt         |   23 +++
 drivers/power/power_supply_core.c                  |  187 ++++++++++++++++++--
 include/linux/power_supply.h                       |    6 +
 3 files changed, 203 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/power_supply/power_supply.txt

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-17  1:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01 21:45 [PATCH V2 0/3] Add DT Binding for Power-Supply power-supplies property Rhyland Klein
     [not found] ` <1364852755-17425-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-01 21:45   ` [PATCH V2 1/3] power_supply: Define Binding for power-supplies Rhyland Klein
2013-04-01 21:45 ` [PATCH V2 2/3] power: power_supply: Add core support for supplied_from Rhyland Klein
     [not found]   ` <1364852755-17425-3-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-04-02 21:31     ` Stephen Warren
     [not found]       ` <515B4E32.8080006-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-04-17  1:55         ` Anton Vorontsov
2013-04-01 21:45 ` [PATCH V2 3/3] power: power_supply_core: Add " Rhyland Klein
2013-04-17  1:55   ` Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).