Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757963AbbLBMp7 (ORCPT ); Wed, 2 Dec 2015 07:45:59 -0500 Received: from proxima.lp0.eu ([81.2.80.65]:35545 "EHLO proxima.lp0.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756199AbbLBMp5 (ORCPT ); Wed, 2 Dec 2015 07:45:57 -0500 Message-ID: In-Reply-To: <20151201221615.GY1929@sirena.org.uk> References: <565A18DD.60108@simon.arlott.org.uk> <20151130121043.GX1929@sirena.org.uk> <565CB1CF.5040306@simon.arlott.org.uk> <20151201221615.GY1929@sirena.org.uk> Date: Wed, 2 Dec 2015 12:45:50 -0000 Subject: Re: [PATCH 1/2] regulator: Add brcm,bcm63xx-regulator device tree binding From: "Simon Arlott" To: "Mark Brown" Cc: devicetree@vger.kernel.org, "Liam Girdwood" , "Rob Herring" , "Pawel Moll" , "Mark Rutland" , "Ian Campbell" , "Kumar Gala" , linux-kernel@vger.kernel.org, "Florian Fainelli" , "Jonas Gorski" User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2756 Lines: 112 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/