From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbbCFCvg (ORCPT ); Thu, 5 Mar 2015 21:51:36 -0500 Received: from mail-by2on0106.outbound.protection.outlook.com ([207.46.100.106]:5522 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753120AbbCFCvd (ORCPT ); Thu, 5 Mar 2015 21:51:33 -0500 Date: Fri, 6 Mar 2015 10:51:16 +0800 From: Peter Chen To: Mark Brown CC: , , Subject: Re: parent/child hierarchy for regulator Message-ID: <20150306025115.GB12879@shlinux2> References: <20150305103534.GA19600@shlinux2> <20150305122234.GL21293@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20150305122234.GL21293@sirena.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=peter.chen@freescale.com; gmail.com; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;BMV:0;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(199003)(189002)(24454002)(51704005)(85426001)(110136001)(50466002)(575784001)(104016003)(33656002)(46406003)(77096005)(86362001)(92566002)(105606002)(50986999)(77156002)(76176999)(87936001)(46102003)(62966003)(54356999)(106466001)(2950100001)(97756001)(83506001)(23726002)(19580395003)(47776003)(33716001)(19580405001)(6806004);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1440;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1440; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5001007)(5005006);SRVR:CY1PR03MB1440;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1440; X-Forefront-PRVS: 05079D8470 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2015 02:51:30.2131 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1440 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 05, 2015 at 12:22:34PM +0000, Mark Brown wrote: > On Thu, Mar 05, 2015 at 06:35:36PM +0800, Peter Chen wrote: > > > Any good ways at code/dts to show parent/child hierarchy for regulator? > > There's plenty of examples in mainline... > thanks, I am back to study again. > > The related regulators at my platforms like below: > > PMIC (SWB 5v) --> Switch Chip (GPIO Regulator) --> USB VBUS > > > PMIC has one 5V regulator (eg, swbst at pfuse), and it is the input > > for USB power switch chip, and there are two gpios at this switch > > chip to control if 5V is output or not, we register these two gpios as > > fixed regulators, currently, if regulator swbst is disabled, the > > gpio regulator has no way to know, and cause the vbus voltage is wrong. > > Can you please clarify why you're registering two fixed voltage > regulators for the switch chip and how you're doing that? Two fixed regulators for two USB vbus, there are no relationships beween them, but both of them needs PMIC 5V (swbst at pfuse) to be enabled. > The picture > above looks like you should just have a single regulator there and > nothing should care if the either regulator is enabled when querying the > parent for its voltage. I need to care about its parent's status, currently, the usb code does not consider parent regulator, so after below patch, the voltage of vbus is incorrect, due to parent regulator is disabled after boots up, there is no user for this parent regulator. commit a6dcf9782f99a0d844b4d06f65cc990468424068 Author: Sean Cross Date: Mon May 26 16:45:40 2014 +0800 regulator: pfuze100: Support SWB enable/disable The SWB regulators have the ability to be turned on and off. Add enable/disable support for these regulators. -- Best Regards, Peter Chen