All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix and start using supplied_from logic
@ 2013-06-10 21:26 ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rhyland Klein

This patch series first fixes a refcount issue with the dt nodes
that was introduced with the supplied_from patch series. We add
a call to of_node_put to decrement the refcount for each node we get
from calling of_parse_phandle.

After that, this series enables using the supplied_from automatic
population from dt by passing in the dt nodes for the sbs battery
driver and the tps65090-charger driver.

Finally, the last patch creates this link for the tegra114-dalmore
board.

Rhyland Klein (4):
  power_supply: Add of_node_put to fix refcount
  power: sbs-battery: Add dt to power_supply struct
  power: tps65090-charger: Add dt node to power_supply
  arm: tegra: Add power-supplies link between battery and charger

 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 drivers/power/power_supply_core.c      |    4 ++++
 drivers/power/sbs-battery.c            |    1 +
 drivers/power/tps65090-charger.c       |    1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

-- 
1.7.9.5

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

* [PATCH 0/4] Fix and start using supplied_from logic
@ 2013-06-10 21:26 ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

This patch series first fixes a refcount issue with the dt nodes
that was introduced with the supplied_from patch series. We add
a call to of_node_put to decrement the refcount for each node we get
from calling of_parse_phandle.

After that, this series enables using the supplied_from automatic
population from dt by passing in the dt nodes for the sbs battery
driver and the tps65090-charger driver.

Finally, the last patch creates this link for the tegra114-dalmore
board.

Rhyland Klein (4):
  power_supply: Add of_node_put to fix refcount
  power: sbs-battery: Add dt to power_supply struct
  power: tps65090-charger: Add dt node to power_supply
  arm: tegra: Add power-supplies link between battery and charger

 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 drivers/power/power_supply_core.c      |    4 ++++
 drivers/power/sbs-battery.c            |    1 +
 drivers/power/tps65090-charger.c       |    1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

-- 
1.7.9.5


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

* [PATCH 0/4] Fix and start using supplied_from logic
@ 2013-06-10 21:26 ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series first fixes a refcount issue with the dt nodes
that was introduced with the supplied_from patch series. We add
a call to of_node_put to decrement the refcount for each node we get
from calling of_parse_phandle.

After that, this series enables using the supplied_from automatic
population from dt by passing in the dt nodes for the sbs battery
driver and the tps65090-charger driver.

Finally, the last patch creates this link for the tegra114-dalmore
board.

Rhyland Klein (4):
  power_supply: Add of_node_put to fix refcount
  power: sbs-battery: Add dt to power_supply struct
  power: tps65090-charger: Add dt node to power_supply
  arm: tegra: Add power-supplies link between battery and charger

 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 drivers/power/power_supply_core.c      |    4 ++++
 drivers/power/sbs-battery.c            |    1 +
 drivers/power/tps65090-charger.c       |    1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

-- 
1.7.9.5

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

* [PATCH 1/4] power_supply: Add of_node_put to fix refcount
  2013-06-10 21:26 ` Rhyland Klein
  (?)
@ 2013-06-10 21:26   ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

of_parse_phandle increments the refcount for a dt node before returning
it. Add of_node_put where needed to properly decrement the refcount
when we are done using a given node.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/power_supply_core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 1c517c3..3b2d5df 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -109,8 +109,10 @@ static int __power_supply_populate_supplied_from(struct device *dev,
 				psy->name, epsy->name);
 			psy->supplied_from[i-1] = (char *)epsy->name;
 			psy->num_supplies++;
+			of_node_put(np);
 			break;
 		}
+		of_node_put(np);
 	} while (np);
 
 	return 0;
@@ -193,8 +195,10 @@ static int power_supply_check_supplies(struct power_supply *psy)
 		ret = power_supply_find_supply_from_node(np);
 		if (ret) {
 			dev_dbg(psy->dev, "Failed to find supply, defer!\n");
+			of_node_put(np);
 			return -EPROBE_DEFER;
 		}
+		of_node_put(np);
 	} while (np);
 
 	/* All supplies found, allocate char ** array for filling */
-- 
1.7.9.5

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

* [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

of_parse_phandle increments the refcount for a dt node before returning
it. Add of_node_put where needed to properly decrement the refcount
when we are done using a given node.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/power_supply_core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 1c517c3..3b2d5df 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -109,8 +109,10 @@ static int __power_supply_populate_supplied_from(struct device *dev,
 				psy->name, epsy->name);
 			psy->supplied_from[i-1] = (char *)epsy->name;
 			psy->num_supplies++;
+			of_node_put(np);
 			break;
 		}
+		of_node_put(np);
 	} while (np);
 
 	return 0;
@@ -193,8 +195,10 @@ static int power_supply_check_supplies(struct power_supply *psy)
 		ret = power_supply_find_supply_from_node(np);
 		if (ret) {
 			dev_dbg(psy->dev, "Failed to find supply, defer!\n");
+			of_node_put(np);
 			return -EPROBE_DEFER;
 		}
+		of_node_put(np);
 	} while (np);
 
 	/* All supplies found, allocate char ** array for filling */
-- 
1.7.9.5


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

* [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

of_parse_phandle increments the refcount for a dt node before returning
it. Add of_node_put where needed to properly decrement the refcount
when we are done using a given node.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/power_supply_core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 1c517c3..3b2d5df 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -109,8 +109,10 @@ static int __power_supply_populate_supplied_from(struct device *dev,
 				psy->name, epsy->name);
 			psy->supplied_from[i-1] = (char *)epsy->name;
 			psy->num_supplies++;
+			of_node_put(np);
 			break;
 		}
+		of_node_put(np);
 	} while (np);
 
 	return 0;
@@ -193,8 +195,10 @@ static int power_supply_check_supplies(struct power_supply *psy)
 		ret = power_supply_find_supply_from_node(np);
 		if (ret) {
 			dev_dbg(psy->dev, "Failed to find supply, defer!\n");
+			of_node_put(np);
 			return -EPROBE_DEFER;
 		}
+		of_node_put(np);
 	} while (np);
 
 	/* All supplies found, allocate char ** array for filling */
-- 
1.7.9.5

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

* [PATCH 2/4] power: sbs-battery: Add dt to power_supply struct
  2013-06-10 21:26 ` Rhyland Klein
  (?)
@ 2013-06-10 21:26     ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Rhyland Klein

By passing in the dt node of this device, we enable the logic for
linking power_supplies together from dt. This is specified by adding
a "power-supplies" property with a phandle to the charger for a
given supply.

Enable this logic now for the sbs-battery driver.

Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/power/sbs-battery.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index c8c78a7..b5f2a76 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -704,6 +704,7 @@ static int sbs_probe(struct i2c_client *client,
 	chip->power_supply.properties = sbs_properties;
 	chip->power_supply.num_properties = ARRAY_SIZE(sbs_properties);
 	chip->power_supply.get_property = sbs_get_property;
+	chip->power_supply.of_node = client->dev.of_node;
 	/* ignore first notification of external change, it is generated
 	 * from the power_supply_register call back
 	 */
-- 
1.7.9.5

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

* [PATCH 2/4] power: sbs-battery: Add dt to power_supply struct
@ 2013-06-10 21:26     ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

By passing in the dt node of this device, we enable the logic for
linking power_supplies together from dt. This is specified by adding
a "power-supplies" property with a phandle to the charger for a
given supply.

Enable this logic now for the sbs-battery driver.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/sbs-battery.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index c8c78a7..b5f2a76 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -704,6 +704,7 @@ static int sbs_probe(struct i2c_client *client,
 	chip->power_supply.properties = sbs_properties;
 	chip->power_supply.num_properties = ARRAY_SIZE(sbs_properties);
 	chip->power_supply.get_property = sbs_get_property;
+	chip->power_supply.of_node = client->dev.of_node;
 	/* ignore first notification of external change, it is generated
 	 * from the power_supply_register call back
 	 */
-- 
1.7.9.5


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

* [PATCH 2/4] power: sbs-battery: Add dt to power_supply struct
@ 2013-06-10 21:26     ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

By passing in the dt node of this device, we enable the logic for
linking power_supplies together from dt. This is specified by adding
a "power-supplies" property with a phandle to the charger for a
given supply.

Enable this logic now for the sbs-battery driver.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/sbs-battery.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index c8c78a7..b5f2a76 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -704,6 +704,7 @@ static int sbs_probe(struct i2c_client *client,
 	chip->power_supply.properties = sbs_properties;
 	chip->power_supply.num_properties = ARRAY_SIZE(sbs_properties);
 	chip->power_supply.get_property = sbs_get_property;
+	chip->power_supply.of_node = client->dev.of_node;
 	/* ignore first notification of external change, it is generated
 	 * from the power_supply_register call back
 	 */
-- 
1.7.9.5

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

* [PATCH 3/4] power: tps65090-charger: Add dt node to power_supply
  2013-06-10 21:26 ` Rhyland Klein
  (?)
@ 2013-06-10 21:26   ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

Passing in the dt node for this charger enables the logic in the core
to lookup this device, to see if it is supplying another power_supply,
through dt.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/tps65090-charger.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 77ab856..3f4b9cc 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -230,6 +230,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 	cdata->ac.num_properties	= ARRAY_SIZE(tps65090_ac_props);
 	cdata->ac.supplied_to		= pdata->supplied_to;
 	cdata->ac.num_supplicants	= pdata->num_supplicants;
+	cdata->ac.of_node		= pdev->dev.of_node;
 
 	ret = power_supply_register(&pdev->dev, &cdata->ac);
 	if (ret) {
-- 
1.7.9.5

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

* [PATCH 3/4] power: tps65090-charger: Add dt node to power_supply
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

Passing in the dt node for this charger enables the logic in the core
to lookup this device, to see if it is supplying another power_supply,
through dt.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/tps65090-charger.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 77ab856..3f4b9cc 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -230,6 +230,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 	cdata->ac.num_properties	= ARRAY_SIZE(tps65090_ac_props);
 	cdata->ac.supplied_to		= pdata->supplied_to;
 	cdata->ac.num_supplicants	= pdata->num_supplicants;
+	cdata->ac.of_node		= pdev->dev.of_node;
 
 	ret = power_supply_register(&pdev->dev, &cdata->ac);
 	if (ret) {
-- 
1.7.9.5


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

* [PATCH 3/4] power: tps65090-charger: Add dt node to power_supply
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

Passing in the dt node for this charger enables the logic in the core
to lookup this device, to see if it is supplying another power_supply,
through dt.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 drivers/power/tps65090-charger.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 77ab856..3f4b9cc 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -230,6 +230,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 	cdata->ac.num_properties	= ARRAY_SIZE(tps65090_ac_props);
 	cdata->ac.supplied_to		= pdata->supplied_to;
 	cdata->ac.num_supplicants	= pdata->num_supplicants;
+	cdata->ac.of_node		= pdev->dev.of_node;
 
 	ret = power_supply_register(&pdev->dev, &cdata->ac);
 	if (ret) {
-- 
1.7.9.5

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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
  2013-06-10 21:26 ` Rhyland Klein
  (?)
@ 2013-06-10 21:26   ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

The power supply core now supports detecting linkages between batteries
and chargers through the use of the power-supplies property. Adding
this to the battery, the core will use the phandle list to find
the associated charger and pair them up. This facilitates notifications
from the charger to the battery when ac power is dissconnected
or connected for instance.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index cfeb0f5..b92922f 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -727,6 +727,7 @@
 			battery-name = "battery";
 			sbs,i2c-retry-count = <2>;
 			sbs,poll-retry-count = <100>;
+			power-supplies = <&charger>;
 		};
 	};
 
@@ -763,7 +764,7 @@
 			vsys-l1-supply = <&vdd_ac_bat_reg>;
 			vsys-l2-supply = <&vdd_ac_bat_reg>;
 
-			charger {
+			charger: charger {
 				compatible = "ti,tps65090-charger";
 				ti,enable-low-current-chrg;
 			};
-- 
1.7.9.5

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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: Anton Vorontsov, Stephen Warren
  Cc: linux-arm-kernel, linux-tegra, linux-kernel, Rhyland Klein

The power supply core now supports detecting linkages between batteries
and chargers through the use of the power-supplies property. Adding
this to the battery, the core will use the phandle list to find
the associated charger and pair them up. This facilitates notifications
from the charger to the battery when ac power is dissconnected
or connected for instance.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index cfeb0f5..b92922f 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -727,6 +727,7 @@
 			battery-name = "battery";
 			sbs,i2c-retry-count = <2>;
 			sbs,poll-retry-count = <100>;
+			power-supplies = <&charger>;
 		};
 	};
 
@@ -763,7 +764,7 @@
 			vsys-l1-supply = <&vdd_ac_bat_reg>;
 			vsys-l2-supply = <&vdd_ac_bat_reg>;
 
-			charger {
+			charger: charger {
 				compatible = "ti,tps65090-charger";
 				ti,enable-low-current-chrg;
 			};
-- 
1.7.9.5


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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-10 21:26   ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-10 21:26 UTC (permalink / raw)
  To: linux-arm-kernel

The power supply core now supports detecting linkages between batteries
and chargers through the use of the power-supplies property. Adding
this to the battery, the core will use the phandle list to find
the associated charger and pair them up. This facilitates notifications
from the charger to the battery when ac power is dissconnected
or connected for instance.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
 arch/arm/boot/dts/tegra114-dalmore.dts |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index cfeb0f5..b92922f 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -727,6 +727,7 @@
 			battery-name = "battery";
 			sbs,i2c-retry-count = <2>;
 			sbs,poll-retry-count = <100>;
+			power-supplies = <&charger>;
 		};
 	};
 
@@ -763,7 +764,7 @@
 			vsys-l1-supply = <&vdd_ac_bat_reg>;
 			vsys-l2-supply = <&vdd_ac_bat_reg>;
 
-			charger {
+			charger: charger {
 				compatible = "ti,tps65090-charger";
 				ti,enable-low-current-chrg;
 			};
-- 
1.7.9.5

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
  2013-06-10 21:26   ` Rhyland Klein
  (?)
@ 2013-06-12 17:44       ` Stephen Warren
  -1 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 17:44 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Anton Vorontsov, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Rhyland, if I apply this patch without patches 1-3 being in the same
branch, will it cause any bugs? If so, I guess 1-3 should go through the
drivers/power maintainer for 3.11, and I should defer this patch to 3.12?

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 17:44       ` Stephen Warren
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 17:44 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Anton Vorontsov, linux-tegra, linux-kernel, linux-arm-kernel

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Rhyland, if I apply this patch without patches 1-3 being in the same
branch, will it cause any bugs? If so, I guess 1-3 should go through the
drivers/power maintainer for 3.11, and I should defer this patch to 3.12?

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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 17:44       ` Stephen Warren
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Rhyland, if I apply this patch without patches 1-3 being in the same
branch, will it cause any bugs? If so, I guess 1-3 should go through the
drivers/power maintainer for 3.11, and I should defer this patch to 3.12?

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
  2013-06-12 17:44       ` Stephen Warren
  (?)
@ 2013-06-12 17:46           ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-12 17:46 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Anton Vorontsov, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 6/12/2013 1:44 PM, Stephen Warren wrote:
> On 06/10/2013 03:26 PM, Rhyland Klein wrote:
>> The power supply core now supports detecting linkages between batteries
>> and chargers through the use of the power-supplies property. Adding
>> this to the battery, the core will use the phandle list to find
>> the associated charger and pair them up. This facilitates notifications
>> from the charger to the battery when ac power is dissconnected
>> or connected for instance.
> 
> Rhyland, if I apply this patch without patches 1-3 being in the same
> branch, will it cause any bugs? If so, I guess 1-3 should go through the
> drivers/power maintainer for 3.11, and I should defer this patch to 3.12?
> 

No, this alone shouldn't cause a problem. Patches 2 & 3 enable the
support for using the power-supplies property in the charger and battery
drivers. Without them, this property will just be ignored for now.

--rhyland

-- 
nvpublic

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 17:46           ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-12 17:46 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Anton Vorontsov, linux-tegra, linux-kernel, linux-arm-kernel

On 6/12/2013 1:44 PM, Stephen Warren wrote:
> On 06/10/2013 03:26 PM, Rhyland Klein wrote:
>> The power supply core now supports detecting linkages between batteries
>> and chargers through the use of the power-supplies property. Adding
>> this to the battery, the core will use the phandle list to find
>> the associated charger and pair them up. This facilitates notifications
>> from the charger to the battery when ac power is dissconnected
>> or connected for instance.
> 
> Rhyland, if I apply this patch without patches 1-3 being in the same
> branch, will it cause any bugs? If so, I guess 1-3 should go through the
> drivers/power maintainer for 3.11, and I should defer this patch to 3.12?
> 

No, this alone shouldn't cause a problem. Patches 2 & 3 enable the
support for using the power-supplies property in the charger and battery
drivers. Without them, this property will just be ignored for now.

--rhyland

-- 
nvpublic

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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 17:46           ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-06-12 17:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 6/12/2013 1:44 PM, Stephen Warren wrote:
> On 06/10/2013 03:26 PM, Rhyland Klein wrote:
>> The power supply core now supports detecting linkages between batteries
>> and chargers through the use of the power-supplies property. Adding
>> this to the battery, the core will use the phandle list to find
>> the associated charger and pair them up. This facilitates notifications
>> from the charger to the battery when ac power is dissconnected
>> or connected for instance.
> 
> Rhyland, if I apply this patch without patches 1-3 being in the same
> branch, will it cause any bugs? If so, I guess 1-3 should go through the
> drivers/power maintainer for 3.11, and I should defer this patch to 3.12?
> 

No, this alone shouldn't cause a problem. Patches 2 & 3 enable the
support for using the power-supplies property in the charger and battery
drivers. Without them, this property will just be ignored for now.

--rhyland

-- 
nvpublic

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
  2013-06-10 21:26   ` Rhyland Klein
  (?)
@ 2013-06-12 21:32       ` Stephen Warren
  -1 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 21:32 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Anton Vorontsov, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Applied to Tegra's for-3.11/dt branch.

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

* Re: [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 21:32       ` Stephen Warren
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 21:32 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Anton Vorontsov, linux-tegra, linux-kernel, linux-arm-kernel

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Applied to Tegra's for-3.11/dt branch.

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

* [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger
@ 2013-06-12 21:32       ` Stephen Warren
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Warren @ 2013-06-12 21:32 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/10/2013 03:26 PM, Rhyland Klein wrote:
> The power supply core now supports detecting linkages between batteries
> and chargers through the use of the power-supplies property. Adding
> this to the battery, the core will use the phandle list to find
> the associated charger and pair them up. This facilitates notifications
> from the charger to the battery when ac power is dissconnected
> or connected for instance.

Applied to Tegra's for-3.11/dt branch.

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

* Re: [PATCH 1/4] power_supply: Add of_node_put to fix refcount
  2013-06-10 21:26   ` Rhyland Klein
  (?)
@ 2013-06-29  1:22       ` Anton Vorontsov
  -1 siblings, 0 replies; 30+ messages in thread
From: Anton Vorontsov @ 2013-06-29  1:22 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
> of_parse_phandle increments the refcount for a dt node before returning
> it. Add of_node_put where needed to properly decrement the refcount
> when we are done using a given node.
> 
> Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---

With CONFIG_OF=n I got this:

  CC      drivers/power/sbs-battery.o
  drivers/power/sbs-battery.c: In function ‘sbs_probe’:
  drivers/power/sbs-battery.c:707:20: error: ‘struct power_supply’ has no
  member named ‘of_node’
  make[1]: *** [drivers/power/sbs-battery.o] Error 1

I fixed this by the patch below and applied your 1-3 series.

Thanks!

Anton

commit b50df95c8f0703c95625181d2eaf53855c5ebee5
Author: Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>
Date:   Fri Jun 28 18:17:22 2013 -0700

    power_supply: Move of_node out of the #ifdef CONFIG_OF
    
    Similar to linux/device.h, move of_node struct member out of the #ifdef
    CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
    
    Signed-off-by: Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3828cef..804b906 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -162,6 +162,8 @@ union power_supply_propval {
 	const char *strval;
 };
 
+struct device_node;
+
 struct power_supply {
 	const char *name;
 	enum power_supply_type type;
@@ -173,9 +175,7 @@ struct power_supply {
 
 	char **supplied_from;
 	size_t num_supplies;
-#ifdef CONFIG_OF
 	struct device_node *of_node;
-#endif
 
 	int (*get_property)(struct power_supply *psy,
 			    enum power_supply_property psp,

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

* Re: [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-06-29  1:22       ` Anton Vorontsov
  0 siblings, 0 replies; 30+ messages in thread
From: Anton Vorontsov @ 2013-06-29  1:22 UTC (permalink / raw)
  To: Rhyland Klein; +Cc: Stephen Warren, linux-arm-kernel, linux-tegra, linux-kernel

On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
> of_parse_phandle increments the refcount for a dt node before returning
> it. Add of_node_put where needed to properly decrement the refcount
> when we are done using a given node.
> 
> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
> ---

With CONFIG_OF=n I got this:

  CC      drivers/power/sbs-battery.o
  drivers/power/sbs-battery.c: In function ‘sbs_probe’:
  drivers/power/sbs-battery.c:707:20: error: ‘struct power_supply’ has no
  member named ‘of_node’
  make[1]: *** [drivers/power/sbs-battery.o] Error 1

I fixed this by the patch below and applied your 1-3 series.

Thanks!

Anton

commit b50df95c8f0703c95625181d2eaf53855c5ebee5
Author: Anton Vorontsov <anton@enomsg.org>
Date:   Fri Jun 28 18:17:22 2013 -0700

    power_supply: Move of_node out of the #ifdef CONFIG_OF
    
    Similar to linux/device.h, move of_node struct member out of the #ifdef
    CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
    
    Signed-off-by: Anton Vorontsov <anton@enomsg.org>

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3828cef..804b906 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -162,6 +162,8 @@ union power_supply_propval {
 	const char *strval;
 };
 
+struct device_node;
+
 struct power_supply {
 	const char *name;
 	enum power_supply_type type;
@@ -173,9 +175,7 @@ struct power_supply {
 
 	char **supplied_from;
 	size_t num_supplies;
-#ifdef CONFIG_OF
 	struct device_node *of_node;
-#endif
 
 	int (*get_property)(struct power_supply *psy,
 			    enum power_supply_property psp,

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

* [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-06-29  1:22       ` Anton Vorontsov
  0 siblings, 0 replies; 30+ messages in thread
From: Anton Vorontsov @ 2013-06-29  1:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
> of_parse_phandle increments the refcount for a dt node before returning
> it. Add of_node_put where needed to properly decrement the refcount
> when we are done using a given node.
> 
> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
> ---

With CONFIG_OF=n I got this:

  CC      drivers/power/sbs-battery.o
  drivers/power/sbs-battery.c: In function ?sbs_probe?:
  drivers/power/sbs-battery.c:707:20: error: ?struct power_supply? has no
  member named ?of_node?
  make[1]: *** [drivers/power/sbs-battery.o] Error 1

I fixed this by the patch below and applied your 1-3 series.

Thanks!

Anton

commit b50df95c8f0703c95625181d2eaf53855c5ebee5
Author: Anton Vorontsov <anton@enomsg.org>
Date:   Fri Jun 28 18:17:22 2013 -0700

    power_supply: Move of_node out of the #ifdef CONFIG_OF
    
    Similar to linux/device.h, move of_node struct member out of the #ifdef
    CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
    
    Signed-off-by: Anton Vorontsov <anton@enomsg.org>

diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3828cef..804b906 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -162,6 +162,8 @@ union power_supply_propval {
 	const char *strval;
 };
 
+struct device_node;
+
 struct power_supply {
 	const char *name;
 	enum power_supply_type type;
@@ -173,9 +175,7 @@ struct power_supply {
 
 	char **supplied_from;
 	size_t num_supplies;
-#ifdef CONFIG_OF
 	struct device_node *of_node;
-#endif
 
 	int (*get_property)(struct power_supply *psy,
 			    enum power_supply_property psp,

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

* Re: [PATCH 1/4] power_supply: Add of_node_put to fix refcount
  2013-06-29  1:22       ` Anton Vorontsov
  (?)
@ 2013-07-01 16:13         ` Rhyland Klein
  -1 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-07-01 16:13 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Stephen Warren,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 6/28/2013 9:22 PM, Anton Vorontsov wrote:
> On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
>> of_parse_phandle increments the refcount for a dt node before returning
>> it. Add of_node_put where needed to properly decrement the refcount
>> when we are done using a given node.
>>
>> Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>> ---
> 
> With CONFIG_OF=n I got this:
> 
>   CC      drivers/power/sbs-battery.o
>   drivers/power/sbs-battery.c: In function ‘sbs_probe’:
>   drivers/power/sbs-battery.c:707:20: error: ‘struct power_supply’ has no
>   member named ‘of_node’
>   make[1]: *** [drivers/power/sbs-battery.o] Error 1
> 
> I fixed this by the patch below and applied your 1-3 series.
> 
> Thanks!
> 
> Anton
> 
> commit b50df95c8f0703c95625181d2eaf53855c5ebee5
> Author: Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>
> Date:   Fri Jun 28 18:17:22 2013 -0700
> 
>     power_supply: Move of_node out of the #ifdef CONFIG_OF
>     
>     Similar to linux/device.h, move of_node struct member out of the #ifdef
>     CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
>     
>     Signed-off-by: Anton Vorontsov <anton-9xeibp6oKSgdnm+yROfE0A@public.gmane.org>
> 
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 3828cef..804b906 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -162,6 +162,8 @@ union power_supply_propval {
>  	const char *strval;
>  };
>  
> +struct device_node;
> +
>  struct power_supply {
>  	const char *name;
>  	enum power_supply_type type;
> @@ -173,9 +175,7 @@ struct power_supply {
>  
>  	char **supplied_from;
>  	size_t num_supplies;
> -#ifdef CONFIG_OF
>  	struct device_node *of_node;
> -#endif
>  
>  	int (*get_property)(struct power_supply *psy,
>  			    enum power_supply_property psp,
> 

Thanks!

-rhyland

-- 
nvpublic

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

* Re: [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-07-01 16:13         ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-07-01 16:13 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Stephen Warren, linux-arm-kernel, linux-tegra, linux-kernel

On 6/28/2013 9:22 PM, Anton Vorontsov wrote:
> On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
>> of_parse_phandle increments the refcount for a dt node before returning
>> it. Add of_node_put where needed to properly decrement the refcount
>> when we are done using a given node.
>>
>> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
>> ---
> 
> With CONFIG_OF=n I got this:
> 
>   CC      drivers/power/sbs-battery.o
>   drivers/power/sbs-battery.c: In function ‘sbs_probe’:
>   drivers/power/sbs-battery.c:707:20: error: ‘struct power_supply’ has no
>   member named ‘of_node’
>   make[1]: *** [drivers/power/sbs-battery.o] Error 1
> 
> I fixed this by the patch below and applied your 1-3 series.
> 
> Thanks!
> 
> Anton
> 
> commit b50df95c8f0703c95625181d2eaf53855c5ebee5
> Author: Anton Vorontsov <anton@enomsg.org>
> Date:   Fri Jun 28 18:17:22 2013 -0700
> 
>     power_supply: Move of_node out of the #ifdef CONFIG_OF
>     
>     Similar to linux/device.h, move of_node struct member out of the #ifdef
>     CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
>     
>     Signed-off-by: Anton Vorontsov <anton@enomsg.org>
> 
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 3828cef..804b906 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -162,6 +162,8 @@ union power_supply_propval {
>  	const char *strval;
>  };
>  
> +struct device_node;
> +
>  struct power_supply {
>  	const char *name;
>  	enum power_supply_type type;
> @@ -173,9 +175,7 @@ struct power_supply {
>  
>  	char **supplied_from;
>  	size_t num_supplies;
> -#ifdef CONFIG_OF
>  	struct device_node *of_node;
> -#endif
>  
>  	int (*get_property)(struct power_supply *psy,
>  			    enum power_supply_property psp,
> 

Thanks!

-rhyland

-- 
nvpublic

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

* [PATCH 1/4] power_supply: Add of_node_put to fix refcount
@ 2013-07-01 16:13         ` Rhyland Klein
  0 siblings, 0 replies; 30+ messages in thread
From: Rhyland Klein @ 2013-07-01 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

On 6/28/2013 9:22 PM, Anton Vorontsov wrote:
> On Mon, Jun 10, 2013 at 05:26:39PM -0400, Rhyland Klein wrote:
>> of_parse_phandle increments the refcount for a dt node before returning
>> it. Add of_node_put where needed to properly decrement the refcount
>> when we are done using a given node.
>>
>> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
>> ---
> 
> With CONFIG_OF=n I got this:
> 
>   CC      drivers/power/sbs-battery.o
>   drivers/power/sbs-battery.c: In function ?sbs_probe?:
>   drivers/power/sbs-battery.c:707:20: error: ?struct power_supply? has no
>   member named ?of_node?
>   make[1]: *** [drivers/power/sbs-battery.o] Error 1
> 
> I fixed this by the patch below and applied your 1-3 series.
> 
> Thanks!
> 
> Anton
> 
> commit b50df95c8f0703c95625181d2eaf53855c5ebee5
> Author: Anton Vorontsov <anton@enomsg.org>
> Date:   Fri Jun 28 18:17:22 2013 -0700
> 
>     power_supply: Move of_node out of the #ifdef CONFIG_OF
>     
>     Similar to linux/device.h, move of_node struct member out of the #ifdef
>     CONFIG_OF so that the drivers won't have to mess with #ifdefs in .c files.
>     
>     Signed-off-by: Anton Vorontsov <anton@enomsg.org>
> 
> diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
> index 3828cef..804b906 100644
> --- a/include/linux/power_supply.h
> +++ b/include/linux/power_supply.h
> @@ -162,6 +162,8 @@ union power_supply_propval {
>  	const char *strval;
>  };
>  
> +struct device_node;
> +
>  struct power_supply {
>  	const char *name;
>  	enum power_supply_type type;
> @@ -173,9 +175,7 @@ struct power_supply {
>  
>  	char **supplied_from;
>  	size_t num_supplies;
> -#ifdef CONFIG_OF
>  	struct device_node *of_node;
> -#endif
>  
>  	int (*get_property)(struct power_supply *psy,
>  			    enum power_supply_property psp,
> 

Thanks!

-rhyland

-- 
nvpublic

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

end of thread, other threads:[~2013-07-01 16:13 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-10 21:26 [PATCH 0/4] Fix and start using supplied_from logic Rhyland Klein
2013-06-10 21:26 ` Rhyland Klein
2013-06-10 21:26 ` Rhyland Klein
2013-06-10 21:26 ` [PATCH 1/4] power_supply: Add of_node_put to fix refcount Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
     [not found]   ` <1370899602-22123-2-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-29  1:22     ` Anton Vorontsov
2013-06-29  1:22       ` Anton Vorontsov
2013-06-29  1:22       ` Anton Vorontsov
2013-07-01 16:13       ` Rhyland Klein
2013-07-01 16:13         ` Rhyland Klein
2013-07-01 16:13         ` Rhyland Klein
     [not found] ` <1370899602-22123-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-10 21:26   ` [PATCH 2/4] power: sbs-battery: Add dt to power_supply struct Rhyland Klein
2013-06-10 21:26     ` Rhyland Klein
2013-06-10 21:26     ` Rhyland Klein
2013-06-10 21:26 ` [PATCH 3/4] power: tps65090-charger: Add dt node to power_supply Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
2013-06-10 21:26 ` [PATCH 4/4] arm: tegra: Add power-supplies link between battery and charger Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
2013-06-10 21:26   ` Rhyland Klein
     [not found]   ` <1370899602-22123-5-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-12 17:44     ` Stephen Warren
2013-06-12 17:44       ` Stephen Warren
2013-06-12 17:44       ` Stephen Warren
     [not found]       ` <51B8B389.8010105-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-06-12 17:46         ` Rhyland Klein
2013-06-12 17:46           ` Rhyland Klein
2013-06-12 17:46           ` Rhyland Klein
2013-06-12 21:32     ` Stephen Warren
2013-06-12 21:32       ` Stephen Warren
2013-06-12 21:32       ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.