lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1395060227-23378-1-git-send-email-cw00.choi@samsung.com>
Date:	Mon, 17 Mar 2014 21:43:43 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	dbaryshkov@...il.com, dwmw2@...radead.org
Cc:	myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
	linux-kernel@...r.kernel.org, Chanwoo Choi <cw00.choi@...sung.com>
Subject: [RFC PATCH 0/4] power_supply: Add DT helper function to get
 power-supply dev from dt

This patchset add DT helper function to get power-supply device from devicetree.
- of_power_supply_get_dev(struct device *dev, enum power_supply_dev_type type,
			  int index)
Power-supply class provides 'power_supply_get_by_name()' to users who want to
find power-supply device with the name of power-supply device.

If CONFIG_OF is enabled, device drivers which want to get power-supply device
would directly get the power-supply device from devicetree by using of_power_
supply_get_dev(). This function can be used instead of power_supply_get_by_name().

For example,

[After]
	The charger-manager must need the power-supply device of fuelgauge to
	read the battery capacity. The charger-manager dt don't need to consider
	the name of power-supply device for fuelgauge because of only needing
	phandle of fuelgauge power-supply device.

	fuelgauge0: max17047@36 {
		compatible = "maxim,max17047";
		interrupt-parent = <&gpx2>;
		interrputs = <3 2>;
		reg = <0x36>;
	};

	charger-manager@0 {
		compatible = "charger-manager";
		...
		fuel-gauge = <&fuelgauge0>;	/* Need phandle of fuelgauge
						 phandle name is always same. */
		...
	};

[Before]
	Previous way use the name of fuelgauge power-supply device to get
	fuel-gauge device using power_supply_get_by_name(). If change the name
	of fuelgauge device, we have to modify both fuelgauge dt and charger-
	manager dt. The charger-manager has dependency on the name of fuel-gague
	power-supply device.

	max17047@36 {
		compatible = "maxim,max17047";
		interrupt-parent = <&gpx2>;
		interrputs = <3 2>;
		reg = <0x36>;
	};

	charger-manager@0 {
		compatible = "charger-manager";
		...
		cm-fuel-gauge = "max170xx_battery";	/* Need the name of fuel-gauge */
		...
	};


Chanwoo Choi (4):
  power_supply: of: Add an API to get power_supply device from dt node
  charger-manager: Get power_supply device using of_power_supply_get_dev()
  Documentation: dt: charger-manager: Change the way to get fuel-gauge power-supply device
  max17042_battery: Change battery name instead of static name according to device type

 .../bindings/power_supply/charger-manager.txt      |  8 ++-
 drivers/power/Kconfig                              |  4 ++
 drivers/power/Makefile                             |  2 +
 drivers/power/charger-manager.c                    | 22 ++++--
 drivers/power/max17042_battery.c                   |  2 +-
 drivers/power/of_power_supply.c                    | 82 ++++++++++++++++++++++
 include/linux/power/charger-manager.h              |  2 +
 include/linux/power/of_power_supply.h              | 46 ++++++++++++
 8 files changed, 159 insertions(+), 9 deletions(-)
 create mode 100644 drivers/power/of_power_supply.c
 create mode 100644 include/linux/power/of_power_supply.h

-- 
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ