Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp733540imm; Wed, 11 Jul 2018 10:02:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfu+dGfyE/HnWZCvgpZklOEFn2O94rWAuDRZ2x+AtdRZA6e0eNvhlbr0EYYFMHbu8jZa/Ph X-Received: by 2002:a65:550d:: with SMTP id f13-v6mr27963340pgr.340.1531328540782; Wed, 11 Jul 2018 10:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531328540; cv=none; d=google.com; s=arc-20160816; b=pTePX3wGp1c3KuT0woPg142WJ6qfnKj1x4xtjr5vOFD2DYzNTyB8AJAofv526BcGF5 YG7iQyDgCTSp+chYi1wm1V/TbgRrIMKgKkFnAxLgSKQ8cQ2eaZW7zPyW2a+IyL8vWMQt prf5mSmXe4MGvoTa1bV0+v5S2ku6jXWfKqGdLXPxtfj+hE0yK9cHYdY6CxzjYSWcPEIc WNy6u5FgYYLHwnwgOAv9GTdkEJdyu6JBvCBRihLtL4ZIKTd4U09zP45Vf3qQ0sWfD8Ba qcnPm2+W+gVqlpCnqWBmozx1LK/Bo3rItRdBZBuHgzVi64uQRYhoE3bazjyHtOLBiFp9 QaSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to:date :arc-authentication-results; bh=LvoAwbLg1tv2oIM9ole6SuWQPk+MZ9Vq8orCoyLZ4GM=; b=egv7QTjwrVclyRHQWIWDe1OTA6V9R5A5mmIj7y8WTopZtVbV0kR6M/NkFCJ/23B/Hn AnZzFjHg82h1X3VYP+Ai/y1Okmrckr0MP2mAkdzPz9WP3AjhHxGHX0H8NuKmxHPuNLi9 NRyJ8cKVX4gb4ujxOoDzb3QcVd4r+1/2RMzz9SEeYPsNTraSEHI1rPi0z0nvFKgmEOot dVKbx3E9ScGVSNpTPLdiZ8dtrXJd6bsaRW+nams5pC3L2YTMF+QHV3VhT8ZIGFUc9Ky+ VAPe7K70qNQpA6pj5K9GMdTkIOXz8czxMQajCt0MfYF8hf/h7B5l444NiXYMiMbz3u7G ujtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14-v6si35314pln.354.2018.07.11.10.02.03; Wed, 11 Jul 2018 10:02:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388425AbeGKOX5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Jul 2018 10:23:57 -0400 Received: from hermes.aosc.io ([199.195.250.187]:57372 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387834AbeGKOX5 (ORCPT ); Wed, 11 Jul 2018 10:23:57 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 1EE9864AC0; Wed, 11 Jul 2018 14:19:11 +0000 (UTC) Date: Wed, 11 Jul 2018 22:18:44 +0800 In-Reply-To: References: <20180711134450.43148-1-icenowy@aosc.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [linux-sunxi] [PATCH 2/2] ARM: sun8i: h3: add SY8113B regulator on Banana Pi M2 Zero board To: wens@csie.org, Chen-Yu Tsai CC: Maxime Ripard , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi From: Icenowy Zheng Message-ID: <9C53E8F0-C5F9-4730-AD72-1E6FA8793E4A@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 于 2018年7月11日 GMT+08:00 下午10:15:41, Chen-Yu Tsai 写到: >Hi, > >On Wed, Jul 11, 2018 at 9:44 PM, Icenowy Zheng wrote: >> Banana Pi M2 Zero board has a SY8113B regulator, which is controlled >via >> GPIO and capable of outputing 1.1V when the PL1 GPIO is set to output >0 >> or 1.1V when the PL6 GPIO is set to input or output 1, and the output >is >> the power supply of the ARM cores in H3 SoC. >> >> Add the device tree node of this regulator and set the cpu's >cpu-supply >> property to it. >> >> Signed-off-by: Icenowy Zheng >> --- >> .../dts/sun8i-h2-plus-bananapi-m2-zero.dts | 21 >+++++++++++++++++++ >> 1 file changed, 21 insertions(+) >> >> diff --git a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts >b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts >> index eb61dcf32797..abc8dc750f4b 100644 >> --- a/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts >> +++ b/arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts >> @@ -59,6 +59,23 @@ >> }; >> }; >> >> + reg_vdd_cpux: vdd-cpux-regulator { >> + compatible = "regulator-gpio"; >> + regulator-name = "vdd-cpux"; >> + regulator-type = "voltage"; >> + regulator-boot-on; >> + regulator-always-on; >> + regulator-min-microvolt = <1100000>; >> + regulator-max-microvolt = <1300000>; >> + regulator-ramp-delay = <50>; /* 4ms */ >> + >> + gpios = <&r_pio 0 1 GPIO_ACTIVE_HIGH>; /* PL1 */ >> + enable-active-high; >> + gpios-states = <0x1>; >> + states = <1100000 0x0 > >So looking at the schematics with the resistor values, this calculates >to roughly 1.108475 (0.6 * (1 + 10 / 11.8)) ... > >> + 1300000 0x1>; > >and this to 1.308475. But I think it cannot reach such accuracy, because of the error of component values and the error of the power voltage. In addition, set it to a too accurate value may break the common opp table. > >ChenYu > >> + }; >> + >> wifi_pwrseq: wifi_pwrseq { >> compatible = "mmc-pwrseq-simple"; >> pinctrl-names = "default"; >> @@ -66,6 +83,10 @@ >> }; >> }; >> >> +&cpu0 { >> + cpu-supply = <®_vdd_cpux>; >> +}; >> + >> &de { >> status = "okay"; >> }; >> -- >> 2.17.1 >> >> -- >> You received this message because you are subscribed to the Google >Groups "linux-sunxi" group. >> To unsubscribe from this group and stop receiving emails from it, >send an email to linux-sunxi+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout.