Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1281750

Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree binding

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From "Simon Arlott" <simon@fire.lp0.eu>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree binding
Date Wed, 02 Dec 2015 13:50:01 +0100
Message-ID <qBf17-7eb-5@gated-at.bofh.it> (permalink)
References <qzV4t-5Ew-11@gated-at.bofh.it> <qAvB0-3vl-5@gated-at.bofh.it> <qADoR-8nQ-5@gated-at.bofh.it> <qB1rc-76P-19@gated-at.bofh.it>
X-Original-To "Mark Brown" <broonie@kernel.org>
Dkim-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=fire.lp0.eu; s=exim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID; bh=hvfQG1PYsnsPqom8stT/3DOoSMVRqFeCEti9e9JSIC8=; b=L3fniXo2C9bYeic6i3/JNm9+4gq6wG2RzNxAi4ufF7aqiyk2QqoQ2IPWuN5DlCdUzE/hvDd0w9tRuIoMoteYhUTWr4yQwQuL6gKpPH05NF6MVgmzpzRMEn9gNvcQe5kxwDb6/671PLtK440bq2kT0rAhtQ5SoA3I3Sd792c4P3SoK1MIYADMvTOI1YUA6K/0hO2dKjMNNJ/M4QoA3Y9sSKcVoC4NCKfbcH8rulsruhOvgDTgQOxiuNRJN1idwgkKFVNaebYLAny3QJe6xatBDuIGyFDhoaVjZFkWBXgbftCAqKvDT6jYWYiZCdiqbpVvehlhcPaiIQa6PZ9t0cbdWQ==;
User-Agent SquirrelMail/1.4.22
MIME-Version 1.0
Content-Type text/plain;charset=utf-8
Content-Transfer-Encoding 8bit
Importance Normal
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 112
Organization linux.* mail to news gateway
X-Original-Cc devicetree@vger.kernel.org, "Liam Girdwood" <lgirdwood@gmail.com>, "Rob Herring" <robh+dt@kernel.org>, "Pawel Moll" <pawel.moll@arm.com>, "Mark Rutland" <mark.rutland@arm.com>, "Ian Campbell" <ijc+devicetree@hellion.org.uk>, "Kumar Gala" <galak@codeaurora.org>, linux-kernel@vger.kernel.org, "Florian Fainelli" <f.fainelli@gmail.com>, "Jonas Gorski" <jogo@openwrt.org>
X-Original-Date Wed, 2 Dec 2015 12:45:50 -0000
X-Original-Message-ID <b7ecdc8ebcdf9582620c22b0e8a4a96d24ba67c1@8b5064a13e22126c1b9329f0dc35b8915774b7c3.invalid>
X-Original-References <565A18DD.60108@simon.arlott.org.uk> <20151130121043.GX1929@sirena.org.uk> <565CB1CF.5040306@simon.arlott.org.uk> <20151201221615.GY1929@sirena.org.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1281750

Show key headers only | View raw


On Tue, December 1, 2015 22:16, Mark Brown wrote:
> On Mon, Nov 30, 2015 at 08:30:07PM +0000, Simon Arlott wrote:
>
>> +- offset: register offset
>> +- mask: register enable mask
>> +- startup-delay-us: startup time in microseconds
>
> Why are these in the DT, I would expect that if this is a driver for a
> specific SoC all these properties would be known as a result of that.

This is a driver for multiple SoCs with the same regulator control in
different places on different SoCs, so the location of it within the misc
register needs to be provided in the DT:

BCM6362:
  #define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
  uint32 miscIddqCtrl; /* 0x48 */

BCM63268/BCM63168:
  #define MISC_BASE 0xb0001800 /* Miscellaneous Registers */
  uint32 miscIddqCtrl; /* 0x4c */


I'll remove the startup-delay-us property and put a default in the driver.


The mask is used as there's one bit per regulator in the register, but
there's more than one way to express this in the DT:

It currently looks like this:
  regulators {
    compatible = "simple-bus";
    #address-cells = <0>;
    #size-cells = <0>;

    sar {
      compatible = "brcm,bcm63168-regulator", "brcm,bcm6345-regulator";
      regulator-name = "sar_power";
      regmap = <&misc>;
      offset = <0x4c>;
      mask = <0x1>;
      startup-delay-us = <100000>;
    };

    ipsec {
      compatible = "brcm,bcm63168-regulator", "brcm,bcm6345-regulator";
      regulator-name = "ipsec_power";
      regmap = <&misc>;
      offset = <0x4c>;
      mask = <0x2>;
      startup-delay-us = <100000>;
    };

    ...
  };

  ubus {
    compatible = "brcm,ubus", "simple-bus";
    #address-cells = <1>;
    #size-cells = <1>;
    ranges;

    misc: syscon@10001800 {
      compatible = "syscon";
      reg = <0x10001800 0xd0>;
    };
  };

Would this be more appropriate?
  regulators {
    compatible = "simple-bus";
    #address-cells = <0>;
    #size-cells = <0>;

    misc_iddq_ctrl {
      compatible = "brcm,bcm63168-regulator", "brcm,bcm6345-regulator";
      regmap = <&misc>;
      offset = <0x4c>;
      #address-cells = <1>;
      #size-cells = <0>;

      sar@0 {
        regulator-name = "sar_power";
      };

      ipsec@1 {
        regulator-name = "ipsec_power";
      };

      ...
    };
  };

  ubus {
    compatible = "brcm,ubus", "simple-bus";
    #address-cells = <1>;
    #size-cells = <1>;
    ranges;

    misc: syscon@10001800 {
      compatible = "syscon";
      reg = <0x10001800 0xd0>;
    };
  };

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree binding Simon Arlott <simon@fire.lp0.eu> - 2015-11-30 21:40 +0100
  [PATCH 2/2] regulator: bcm63xx: Add BCM63xx fixed regulator device Simon Arlott <simon@fire.lp0.eu> - 2015-11-30 21:40 +0100
  Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-01 23:20 +0100
    Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding "Simon Arlott" <simon@fire.lp0.eu> - 2015-12-02 13:50 +0100
      Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-02 14:00 +0100
        Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Simon Arlott <simon@fire.lp0.eu> - 2015-12-02 21:30 +0100
          Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-03 01:10 +0100
            Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Simon Arlott <simon@fire.lp0.eu> - 2015-12-03 09:20 +0100
              Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-03 16:10 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Simon Arlott <simon@fire.lp0.eu> - 2015-12-04 00:40 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-04 00:50 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Simon Arlott <simon@fire.lp0.eu> - 2015-12-04 01:00 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-04 12:10 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding "Simon Arlott" <simon@fire.lp0.eu> - 2015-12-04 13:30 +0100
                Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree  binding Mark Brown <broonie@kernel.org> - 2015-12-05 18:00 +0100

csiph-web