All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: "Bruno Prémont"
	<bonbons-ud5FBsm0p/xEiooADzr8i9i2O/JbrIOy@public.gmane.org>
Cc: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Dmitry Eremin-Solenikov
	<dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	David Woodhouse <dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Olliver Schinagl
	<oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org>
Subject: Re: [RFC Patch 1/4] mfd: AXP20x: Add power supply bindings documentation
Date: Tue, 4 Nov 2014 15:31:17 +0100	[thread overview]
Message-ID: <20141104143117.GC26729@lukather> (raw)
In-Reply-To: <20141103210244.1425e0c7-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2408 bytes --]

Hi Bruno,

On Mon, Nov 03, 2014 at 09:02:44PM +0100, Bruno Prémont wrote: 
> Doing something like this?:
> 
> --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
> +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
> @@ -126,9 +126,11 @@
>                                 interrupt-controller;
>                                 #interrupt-cells = <1>;
>  
> -                               backup = <3000000 200>;
> -                               battery.resistance = <100>;
> -                               battery.capacity = <2000>;
> +                               x-powers,backup = <3000000 200>;

I don't really remember what was that property used for. Would it make
sense to put it into the battery node?

> +                               battery: battery@0 {
> +                                       x-powers,resistance = <100>;
> +                                       x-powers,capacity = <2000>;
> +                               };
>                         };
>                 };
> 
> What are the rules to define the label after the colon?
> Looking at the existing nodes it's either some address or a number...

It's not called the label, but the node name, and it's defined in the
ePAPR.

It's <device-class>[@<address>]

The address being something to identify the node on a bus, so it can
be a chip select number, a memory address, an i2c address,
etc. there's really no absolute answer here.

I don't think you really need one in this case.

> and then the following in driver code (also adjusting the other
> property names accessed)?:
> 
> @@ -678,11 +677,11 @@ static int axp20x_battery_config(struct platform_device *pdev,
>         if (ret)
>                 return ret;
>  
> -       np = of_node_get(axp20x->dev->of_node);
> +       np = of_find_node_by_name(axp20x->dev->of_node, "battery");
>         if (!np)
>                 return -ENODEV;
>  
> -       ret = of_property_read_u32_array(np, "battery.ocv", ocv, 16);
> +       ret = of_property_read_u32_array(np, "x-powers,ocv", ocv, 16);
>         for (i = 0; ret == 0 && i < ARRAY_SIZE(ocv); i++)
>                 if (ocv[i] > 100) {
>                         dev_warn(&pdev->dev, "OCV[%d] %u > 100\n", i, ocv[i]);

Yep, it looks sensible.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC Patch 1/4] mfd: AXP20x: Add power supply bindings documentation
Date: Tue, 4 Nov 2014 15:31:17 +0100	[thread overview]
Message-ID: <20141104143117.GC26729@lukather> (raw)
In-Reply-To: <20141103210244.1425e0c7@neptune.home>

Hi Bruno,

On Mon, Nov 03, 2014 at 09:02:44PM +0100, Bruno Pr?mont wrote: 
> Doing something like this?:
> 
> --- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
> +++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
> @@ -126,9 +126,11 @@
>                                 interrupt-controller;
>                                 #interrupt-cells = <1>;
>  
> -                               backup = <3000000 200>;
> -                               battery.resistance = <100>;
> -                               battery.capacity = <2000>;
> +                               x-powers,backup = <3000000 200>;

I don't really remember what was that property used for. Would it make
sense to put it into the battery node?

> +                               battery: battery at 0 {
> +                                       x-powers,resistance = <100>;
> +                                       x-powers,capacity = <2000>;
> +                               };
>                         };
>                 };
> 
> What are the rules to define the label after the colon?
> Looking at the existing nodes it's either some address or a number...

It's not called the label, but the node name, and it's defined in the
ePAPR.

It's <device-class>[@<address>]

The address being something to identify the node on a bus, so it can
be a chip select number, a memory address, an i2c address,
etc. there's really no absolute answer here.

I don't think you really need one in this case.

> and then the following in driver code (also adjusting the other
> property names accessed)?:
> 
> @@ -678,11 +677,11 @@ static int axp20x_battery_config(struct platform_device *pdev,
>         if (ret)
>                 return ret;
>  
> -       np = of_node_get(axp20x->dev->of_node);
> +       np = of_find_node_by_name(axp20x->dev->of_node, "battery");
>         if (!np)
>                 return -ENODEV;
>  
> -       ret = of_property_read_u32_array(np, "battery.ocv", ocv, 16);
> +       ret = of_property_read_u32_array(np, "x-powers,ocv", ocv, 16);
>         for (i = 0; ret == 0 && i < ARRAY_SIZE(ocv); i++)
>                 if (ocv[i] > 100) {
>                         dev_warn(&pdev->dev, "OCV[%d] %u > 100\n", i, ocv[i]);

Yep, it looks sensible.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141104/5727ccb9/attachment.sig>

  parent reply	other threads:[~2014-11-04 14:31 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20141020215954.7f1d5502@neptune.home>
2014-10-20 20:19 ` [RFC Patch 0/4] mfd: AXP20x: Add power supply sub-driver Bruno Prémont
2014-10-20 20:19   ` Bruno Prémont
2014-10-20 20:33   ` [RFC Patch 2/4] " Bruno Prémont
2014-10-20 20:33     ` Bruno Prémont
     [not found]     ` <20141020223320.2b4ecba9-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-10-21 20:27       ` Maxime Ripard
2014-10-21 20:27         ` Maxime Ripard
2014-10-22  6:30         ` Bruno Prémont
2014-10-22  6:30           ` Bruno Prémont
     [not found]           ` <20141022083013.6b90be7e-I2t2yFIzmohO7ya8xxV06g@public.gmane.org>
2014-10-23  9:29             ` Maxime Ripard
2014-10-23  9:29               ` Maxime Ripard
     [not found]     ` <20141023201235.3b94cc82@smutje.local>
2014-11-03 20:14       ` Bruno Prémont
2014-11-03 20:14         ` Bruno Prémont
2014-10-20 20:33   ` [RFC Patch 4/4] mfd: AXP20x: Add backup battery DTS entry for Cubietruck Bruno Prémont
2014-10-20 20:33     ` Bruno Prémont
     [not found] ` <20141020215954.7f1d5502-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
     [not found]   ` <20141020221959.2f312906-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-10-20 20:33     ` [RFC Patch 1/4] mfd: AXP20x: Add power supply bindings documentation Bruno Prémont
2014-10-20 20:33       ` Bruno Prémont
     [not found]       ` <20141020223314.0484f795-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-10-21 10:15         ` Lee Jones
2014-10-21 10:15           ` Lee Jones
2014-10-21 16:09           ` Bruno Prémont
2014-10-21 16:09             ` Bruno Prémont
     [not found]             ` <20141021180916.432f02e1-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-10-21 19:19               ` Maxime Ripard
2014-10-21 19:19                 ` Maxime Ripard
2014-11-03 20:02                 ` Bruno Prémont
2014-11-03 20:02                   ` Bruno Prémont
     [not found]                   ` <20141103210244.1425e0c7-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-11-04 14:09                     ` Ezaul Zillmer
2014-11-04 21:21                       ` Bruno Prémont
2014-11-04 21:21                         ` Bruno Prémont
     [not found]                         ` <20141104222124.1bc7e6ec-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-11-05 12:29                           ` Ezaul Zillmer
2014-11-04 14:31                     ` Maxime Ripard [this message]
2014-11-04 14:31                       ` Maxime Ripard
2014-11-04 21:08                       ` Bruno Prémont
2014-11-04 21:08                         ` Bruno Prémont
     [not found]                         ` <20141104220827.773c53d0-hY15tx4IgV39zxVx7UNMDg@public.gmane.org>
2014-11-05 14:48                           ` Maxime Ripard
2014-11-05 14:48                             ` Maxime Ripard
2014-11-05 14:55                             ` Koen Kooi
2014-11-05 14:55                               ` [linux-sunxi] " Koen Kooi
2014-10-21 20:10       ` Maxime Ripard
2014-10-21 20:10         ` Maxime Ripard
2014-10-20 20:33     ` [RFC Patch 3/4] mfd: AXP20x: Add power supply defconfig entries Bruno Prémont
2014-10-20 20:33       ` Bruno Prémont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141104143117.GC26729@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=bonbons-ud5FBsm0p/xEiooADzr8i9i2O/JbrIOy@public.gmane.org \
    --cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=oliver+list-dxLnbx3+1qmEVqv0pETR8A@public.gmane.org \
    --cc=sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.