devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] power_supply: tps65090: Update bindings for subnode
@ 2013-03-21 20:33 Rhyland Klein
  2013-03-21 20:33 ` [PATCH 2/2] power_supply: tps65090: Setup compatible property for dt Rhyland Klein
  0 siblings, 1 reply; 3+ messages in thread
From: Rhyland Klein @ 2013-03-21 20:33 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

This updates the DT documentation to reflect that the tps65090-charger
should be represented as a child node of the tps65090 device itself.

Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 .../devicetree/bindings/power_supply/tps65090.txt  |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/power_supply/tps65090.txt b/Documentation/devicetree/bindings/power_supply/tps65090.txt
index 56370c7..8e5e0d3 100644
--- a/Documentation/devicetree/bindings/power_supply/tps65090.txt
+++ b/Documentation/devicetree/bindings/power_supply/tps65090.txt
@@ -1,23 +1,17 @@
 TPS65090 Frontend PMU with Switchmode Charger
 
 Required Properties:
--compatible: "ti,tps65090"
--reg: I2C slave address
--interrupts: the interrupt output to which this device connects
+-compatible: "ti,tps65090-charger"
 
 Optional Properties:
 -ti,enable-low-current-chrg: Enables charging when a low current is detected
  while the default logic is to stop charging.
 
-Example:
+This node is a subnode of the tps65090 PMIC.
 
-	tps65090@48 {
-		compatible = "ti,tps65090";
-		reg = <0x48>;
-		interrupts = <0 88 0x4>;
+Example:
 
+	tps65090-charger {
+		compatible = "ti,tps65090-charger";
 		ti,enable-low-current-chrg;
-
-		regulators {
-			...
-		};
+	};
-- 
1.7.9.5

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

* [PATCH 2/2] power_supply: tps65090: Setup compatible property for dt
  2013-03-21 20:33 [PATCH 1/2] power_supply: tps65090: Update bindings for subnode Rhyland Klein
@ 2013-03-21 20:33 ` Rhyland Klein
  2013-04-01  6:18   ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: Rhyland Klein @ 2013-03-21 20:33 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: devicetree-discuss, linux-kernel, Rhyland Klein

Setup the compatible property so that when this device is registered
through device tree, it can match the expected compatiblity string
used in the tps65090 driver.

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

diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
index 0c66c66..3b3dafd 100644
--- a/drivers/power/tps65090-charger.c
+++ b/drivers/power/tps65090-charger.c
@@ -168,7 +168,7 @@ static struct tps65090_platform_data *
 		tps65090_parse_dt_charger_data(struct platform_device *pdev)
 {
 	struct tps65090_platform_data *pdata;
-	struct device_node *np = pdev->dev.parent->of_node;
+	struct device_node *np = pdev->dev.of_node;
 	unsigned int prop;
 
 	pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
@@ -204,7 +204,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 
 	pdata = dev_get_platdata(pdev->dev.parent);
 
-	if (!pdata && tps65090_mfd->dev->of_node)
+	if (!pdata && pdev->dev.of_node)
 		pdata = tps65090_parse_dt_charger_data(pdev);
 
 	if (!pdata) {
@@ -300,9 +300,15 @@ static int tps65090_charger_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static struct of_device_id of_tps65090_charger_match[] = {
+	{ .compatible = "ti,tps65090-charger", },
+	{ /* end */ }
+};
+
 static struct platform_driver tps65090_charger_driver = {
 	.driver	= {
 		.name	= "tps65090-charger",
+		.of_match_table = of_tps65090_charger_match,
 		.owner	= THIS_MODULE,
 	},
 	.probe	= tps65090_charger_probe,
-- 
1.7.9.5

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

* Re: [PATCH 2/2] power_supply: tps65090: Setup compatible property for dt
  2013-03-21 20:33 ` [PATCH 2/2] power_supply: tps65090: Setup compatible property for dt Rhyland Klein
@ 2013-04-01  6:18   ` Anton Vorontsov
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Vorontsov @ 2013-04-01  6:18 UTC (permalink / raw)
  To: Rhyland Klein; +Cc: devicetree-discuss, linux-kernel

On Thu, Mar 21, 2013 at 04:33:05PM -0400, Rhyland Klein wrote:
> Setup the compatible property so that when this device is registered
> through device tree, it can match the expected compatiblity string
> used in the tps65090 driver.
> 
> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
> ---
>  drivers/power/tps65090-charger.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
> index 0c66c66..3b3dafd 100644
> --- a/drivers/power/tps65090-charger.c
> +++ b/drivers/power/tps65090-charger.c
> @@ -204,7 +204,7 @@ static int tps65090_charger_probe(struct platform_device *pdev)
>  
>  	pdata = dev_get_platdata(pdev->dev.parent);
>  
> -	if (!pdata && tps65090_mfd->dev->of_node)
> +	if (!pdata && pdev->dev.of_node)

  CC      drivers/power/tps65090-charger.o
drivers/power/tps65090-charger.c: In function ‘tps65090_charger_probe’:
drivers/power/tps65090-charger.c:198:19: warning: unused variable ‘tps65090_mfd’ [-Wunused-variable]

...I fixed this up and applied the patches.

Thanks!

Anton

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

end of thread, other threads:[~2013-04-01  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 20:33 [PATCH 1/2] power_supply: tps65090: Update bindings for subnode Rhyland Klein
2013-03-21 20:33 ` [PATCH 2/2] power_supply: tps65090: Setup compatible property for dt Rhyland Klein
2013-04-01  6:18   ` 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).