From patchwork Fri Mar 26 11:44:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying-Chun Liu X-Patchwork-Id: 409483 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1348796jai; Fri, 26 Mar 2021 04:45:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpV+kh0dwP2j0lgXtTdu41HjX5TYRXasdIBBOYtZf2B5ZjajXwt5P/T27iqO7qvCjsLjAu X-Received: by 2002:a17:906:704a:: with SMTP id r10mr14810200ejj.312.1616759129412; Fri, 26 Mar 2021 04:45:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616759129; cv=none; d=google.com; s=arc-20160816; b=l05bAsjzkeVl/1VrkwGQuIQxDQDuw7U4kVcSlg1m6OloA2VaFCw06EuM6Wzke5Vs4j IHDnJM/+6e5mwruzSZiTCzVpM4btTnt5ituvXD0POfolEdf9vkx7rJ7Nj5C1u5U9a0Tk 4R9llHgkE2XqJLw+TBJkQ05Eeqg5Fb40CXSJwHYjm2/FjLgFUWAWCw7R8yfhUCm3YkY+ 50kVtPYaM+Y+SBmMR7zoslXkq9vKYYR51AmUlca3h72bhOQZGFV9g2TG3op6szsFKYwa U7fef8yFsvJz1/8RdEMN7RnVwdYT1+VkFcAUdz7KvgSLjuo7A0ONaiIsYjD4X4Wy/tSr cBEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qNQp/7+PAN4kZe+P10bkeAiEbcNBYy3bJpOBEYSsS5Q=; b=R1y+S84r60rAF4Ch1McpHIbxIJVsNOoMcOJ3RwvKvE5xrQ4he1hOUDbFiFNd3U0Yo6 L6akcLfC+vqVC0yigWOQO9Pxax8ePxdfdZJfNrv1/DBomxf4riPimGN6fLplF0iso2hB CM1C5dksfDQEjDCwmWGSiBkgInCwcyTmY16lwEMr7hdPuNy0+pm32wSB7QaD6kedHBAO NY0yovhW6j+C8zLhk5ZrXIZhOWVTec+mqcRVXGADVOfJq6zTGDtkf0fJz+tDNfn7XJO3 mwd1uNBFCLmukRsVviZQM3PlK1Pex/xhjCywD4L2bmL+x1XtOyPNBw7o1xKR4anQR+b8 ZR/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EFm5F6/g"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id t13si6503773ejr.172.2021.03.26.04.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:45:29 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="EFm5F6/g"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A70482887; Fri, 26 Mar 2021 12:45:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EFm5F6/g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12D2B805BF; Fri, 26 Mar 2021 12:45:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A1601805BF for ; Fri, 26 Mar 2021 12:45:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=grandpaul@gmail.com Received: by mail-pf1-x429.google.com with SMTP id l3so4699831pfc.7 for ; Fri, 26 Mar 2021 04:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qNQp/7+PAN4kZe+P10bkeAiEbcNBYy3bJpOBEYSsS5Q=; b=EFm5F6/gMHyDc6zEa6f41YcauLv2ujD7IdVUQ1rw6zj+25Y9sQ0w+BlavKVCZIcy4v ZQP+rwankhgf/C1k+piBduTs9/AxzJp/FN9MWoULDe/6+FK5Z9PQjTCmDMMJ1ICgElxA N2i9f+eBwy1mj18OzNCsx0CfWFGhpZjnzbYSFPlo59zCftq6gpQgPjFzhFtx4l/Pt3aC zGukXOJRjPAKRq+RPo6a1yK9iNpJplJSzsHXRrPCyCrvwSM4AkJK56CcWAcsYHl+07/C hqCuDipPdySghtBR6CDfQ+pkey2lXZkbKZa2AEAnghuLRox2kAAQdTNpvxkzg1YBX0Zp yPyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qNQp/7+PAN4kZe+P10bkeAiEbcNBYy3bJpOBEYSsS5Q=; b=S22flHfcJIIu1eaov9ioLDYZykVfHD5dCb/kJneXLxG+2VtTvla5pTcQ3x2uPNz5ZN /mGRyTy+qdvRSGJVEBtMI2OAZy5DtwSJtDKR0CPDDU95sE4OhWvDbNLKdDErEGKUtGLC YmcXxTQCqHw/FCXjKjUxrD9UsvJYWocvYvFygD08QxNzAFLm382hOcT3ep3/6Ew4MJ+P xnZB5vFCQOoIR9pwEvFKKh7w4VQxiMd8yuDis9YXMnAb+8AkwPjPbGRoVj0InIBTir9G EoGuoVEutSpLUaaLHOCgRW3D/C3B6tNO/4a3Zx8NmPVimCgxIUt15ItiubWfLsbfJV5d NzCw== X-Gm-Message-State: AOAM530Kr/8xPG4lqptJCCiWX+p0cbHJ2yCicuMdAZzQDpJ1plXL9n2l Hi8EZXe+Kzq4xFKjFNcsJe41ZdRNYA32Lw== X-Received: by 2002:a63:5517:: with SMTP id j23mr10408276pgb.209.1616759101874; Fri, 26 Mar 2021 04:45:01 -0700 (PDT) Received: from localhost (host-111-184-129-17.dynamic.kbtelecom.net. [111.184.129.17]) by smtp.gmail.com with ESMTPSA id k17sm8481853pfa.68.2021.03.26.04.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:45:01 -0700 (PDT) From: Ying-Chun Liu To: u-boot@lists.denx.de Cc: "Ying-Chun Liu (PaulLiu)" , Fabio Estevam , Jaehoon Chung , Peng Fan , Sean Anderson Subject: [PATCH v4 1/2] power: regulator: add driver for ANATOP regulator Date: Fri, 26 Mar 2021 19:44:51 +0800 Message-Id: <20210326114452.71281-2-grandpaul@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210326114452.71281-1-grandpaul@gmail.com> References: <20210326114452.71281-1-grandpaul@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: "Ying-Chun Liu (PaulLiu)" Anatop is an integrated regulator inside i.MX6 SoC. There are 3 digital regulators which controls PU, CORE (ARM), and SOC. And 3 analog regulators which controls 1P1, 2P5, 3P0 (USB). This patch adds the Anatop regulator driver. Signed-off-by: Ying-Chun Liu (PaulLiu) Cc: Fabio Estevam Cc: Jaehoon Chung Cc: Peng Fan Cc: Sean Anderson --- v2: add functions for set selector and delay. Define ANATOP_REGULATOR_STEP v3: add vin-supply. move regmap retrival to probe v4: check control_reg and return -ENOSYS if error. check vin-supply error --- drivers/power/regulator/Kconfig | 10 + drivers/power/regulator/Makefile | 1 + drivers/power/regulator/anatop_regulator.c | 278 +++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 drivers/power/regulator/anatop_regulator.c -- 2.30.2 Reviewed-by: Sean Anderson diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig index fbbea18c7d..faab311191 100644 --- a/drivers/power/regulator/Kconfig +++ b/drivers/power/regulator/Kconfig @@ -312,6 +312,16 @@ config DM_REGULATOR_STPMIC1 by the PMIC device. This driver is controlled by a device tree node which includes voltage limits. +config DM_REGULATOR_ANATOP + bool "Enable driver for ANATOP regulators" + depends on DM_REGULATOR + select REGMAP + select SYSCON + help + Enable support for the Freescale i.MX on-chip ANATOP LDO + regulators. It is recommended that this option be enabled on + i.MX6 platform. + config SPL_DM_REGULATOR_STPMIC1 bool "Enable driver for STPMIC1 regulators in SPL" depends on SPL_DM_REGULATOR && PMIC_STPMIC1 diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile index 9d58112dcb..e7198da911 100644 --- a/drivers/power/regulator/Makefile +++ b/drivers/power/regulator/Makefile @@ -30,3 +30,4 @@ obj-$(CONFIG_DM_REGULATOR_TPS65910) += tps65910_regulator.o obj-$(CONFIG_DM_REGULATOR_TPS62360) += tps62360_regulator.o obj-$(CONFIG_$(SPL_)DM_REGULATOR_STPMIC1) += stpmic1.o obj-$(CONFIG_DM_REGULATOR_TPS65941) += tps65941_regulator.o +obj-$(CONFIG_$(SPL_)DM_REGULATOR_ANATOP) += anatop_regulator.o diff --git a/drivers/power/regulator/anatop_regulator.c b/drivers/power/regulator/anatop_regulator.c new file mode 100644 index 0000000000..0eeb020df5 --- /dev/null +++ b/drivers/power/regulator/anatop_regulator.c @@ -0,0 +1,278 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2021 Linaro + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LDO_RAMP_UP_UNIT_IN_CYCLES 64 /* 64 cycles per step */ +#define LDO_RAMP_UP_FREQ_IN_MHZ 24 /* cycle based on 24M OSC */ + +#define LDO_POWER_GATE 0x00 +#define LDO_FET_FULL_ON 0x1f + +#define BIT_WIDTH_MAX 32 + +#define ANATOP_REGULATOR_STEP 25000 +#define MIN_DROPOUT_UV 125000 + +struct anatop_regulator { + const char *name; + struct regmap *regmap; + struct udevice *supply; + u32 control_reg; + u32 vol_bit_shift; + u32 vol_bit_width; + u32 min_bit_val; + u32 min_voltage; + u32 max_voltage; + u32 delay_reg; + u32 delay_bit_shift; + u32 delay_bit_width; +}; + +static u32 anatop_get_bits(struct udevice *dev, u32 addr, int bit_shift, + int bit_width) +{ + const struct anatop_regulator *anatop_reg = dev_get_plat(dev); + int err; + u32 val, mask; + + if (bit_width == BIT_WIDTH_MAX) + mask = ~0; + else + mask = (1 << bit_width) - 1; + + err = regmap_read(anatop_reg->regmap, addr, &val); + if (err) { + dev_dbg(dev, "cannot read reg (%d)\n", err); + return err; + } + + val = (val >> bit_shift) & mask; + + return val; +} + +static int anatop_set_bits(struct udevice *dev, u32 addr, int bit_shift, + int bit_width, u32 data) +{ + const struct anatop_regulator *anatop_reg = dev_get_plat(dev); + int err; + u32 val, mask; + + if (bit_width == 32) + mask = ~0; + else + mask = (1 << bit_width) - 1; + + err = regmap_read(anatop_reg->regmap, addr, &val); + if (err) { + dev_dbg(dev, "cannot read reg (%d)\n", err); + return err; + } + val = val & ~(mask << bit_shift); + err = regmap_write(anatop_reg->regmap, + addr, (data << bit_shift) | val); + if (err) { + dev_dbg(dev, "cannot wrie reg (%d)\n", err); + return err; + } + + return 0; +} + +static int anatop_get_voltage(struct udevice *dev) +{ + const struct anatop_regulator *anatop_reg = dev_get_plat(dev); + u32 sel; + u32 val; + + if (!anatop_reg->control_reg) + return -ENOSYS; + + val = anatop_get_bits(dev, + anatop_reg->control_reg, + anatop_reg->vol_bit_shift, + anatop_reg->vol_bit_width); + + sel = val - anatop_reg->min_bit_val; + + return sel * ANATOP_REGULATOR_STEP + anatop_reg->min_voltage; +} + +static int anatop_set_voltage(struct udevice *dev, int uV) +{ + const struct anatop_regulator *anatop_reg = dev_get_plat(dev); + u32 val; + u32 sel; + int ret; + + dev_dbg(dev, "uv %d, min %d, max %d\n", uV, anatop_reg->min_voltage, + anatop_reg->max_voltage); + + if (uV < anatop_reg->min_voltage) + return -EINVAL; + + if (!anatop_reg->control_reg) + return -ENOSYS; + + sel = DIV_ROUND_UP(uV - anatop_reg->min_voltage, + ANATOP_REGULATOR_STEP); + if (sel * ANATOP_REGULATOR_STEP + anatop_reg->min_voltage > + anatop_reg->max_voltage) + return -EINVAL; + val = anatop_reg->min_bit_val + sel; + dev_dbg(dev, "calculated val %d\n", val); + + if (anatop_reg->supply) { + ret = regulator_set_value(anatop_reg->supply, + uV + MIN_DROPOUT_UV); + if (ret) + return ret; + } + + ret = anatop_set_bits(dev, + anatop_reg->control_reg, + anatop_reg->vol_bit_shift, + anatop_reg->vol_bit_width, + val); + + return ret; +} + +static const struct dm_regulator_ops anatop_regulator_ops = { + .set_value = anatop_set_voltage, + .get_value = anatop_get_voltage, +}; + +static int anatop_regulator_probe(struct udevice *dev) +{ + struct anatop_regulator *anatop_reg; + struct dm_regulator_uclass_plat *uc_pdata; + struct udevice *syscon; + int ret = 0; + u32 val; + + anatop_reg = dev_get_plat(dev); + uc_pdata = dev_get_uclass_plat(dev); + + anatop_reg->name = ofnode_read_string(dev_ofnode(dev), + "regulator-name"); + if (!anatop_reg->name) + return log_msg_ret("regulator-name", -EINVAL); + + ret = device_get_supply_regulator(dev, "vin-supply", + &anatop_reg->supply); + if (ret != -ENODEV) { + if (ret) + return log_msg_ret("get vin-supply", ret); + + ret = regulator_set_enable(anatop_reg->supply, true); + if (ret) + return ret; + } + + ret = dev_read_u32(dev, + "anatop-reg-offset", + &anatop_reg->control_reg); + if (ret) + return log_msg_ret("anatop-reg-offset", ret); + + ret = dev_read_u32(dev, + "anatop-vol-bit-width", + &anatop_reg->vol_bit_width); + if (ret) + return log_msg_ret("anatop-vol-bit-width", ret); + + ret = dev_read_u32(dev, + "anatop-vol-bit-shift", + &anatop_reg->vol_bit_shift); + if (ret) + return log_msg_ret("anatop-vol-bit-shift", ret); + + ret = dev_read_u32(dev, + "anatop-min-bit-val", + &anatop_reg->min_bit_val); + if (ret) + return log_msg_ret("anatop-min-bit-val", ret); + + ret = dev_read_u32(dev, + "anatop-min-voltage", + &anatop_reg->min_voltage); + if (ret) + return log_msg_ret("anatop-min-voltage", ret); + + ret = dev_read_u32(dev, + "anatop-max-voltage", + &anatop_reg->max_voltage); + if (ret) + return log_msg_ret("anatop-max-voltage", ret); + + /* read LDO ramp up setting, only for core reg */ + dev_read_u32(dev, "anatop-delay-reg-offset", + &anatop_reg->delay_reg); + dev_read_u32(dev, "anatop-delay-bit-width", + &anatop_reg->delay_bit_width); + dev_read_u32(dev, "anatop-delay-bit-shift", + &anatop_reg->delay_bit_shift); + + syscon = dev_get_parent(dev); + if (!syscon) { + dev_dbg(dev, "unable to find syscon device\n"); + return -ENOENT; + } + + anatop_reg->regmap = syscon_get_regmap(syscon); + if (IS_ERR(anatop_reg->regmap)) { + dev_dbg(dev, "unable to find regmap (%ld)\n", + PTR_ERR(anatop_reg->regmap)); + return -ENOENT; + } + + /* check whether need to care about LDO ramp up speed */ + if (anatop_reg->delay_bit_width) { + /* + * the delay for LDO ramp up time is + * based on the register setting, we need + * to calculate how many steps LDO need to + * ramp up, and how much delay needed. (us) + */ + val = anatop_get_bits(dev, + anatop_reg->delay_reg, + anatop_reg->delay_bit_shift, + anatop_reg->delay_bit_width); + uc_pdata->ramp_delay = (LDO_RAMP_UP_UNIT_IN_CYCLES << val) + / LDO_RAMP_UP_FREQ_IN_MHZ + 1; + } + + return 0; +} + +static const struct udevice_id of_anatop_regulator_match_tbl[] = { + { .compatible = "fsl,anatop-regulator", }, + { /* end */ } +}; + +U_BOOT_DRIVER(anatop_regulator) = { + .name = "anatop_regulator", + .id = UCLASS_REGULATOR, + .ops = &anatop_regulator_ops, + .of_match = of_anatop_regulator_match_tbl, + .plat_auto = sizeof(struct anatop_regulator), + .probe = anatop_regulator_probe, +}; From patchwork Fri Mar 26 11:44:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ying-Chun Liu X-Patchwork-Id: 409484 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1348938jai; Fri, 26 Mar 2021 04:45:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEvq8qA+yfw84kGASv2q7iYB8f1AT8gDzcA54PcLp76Q7dClzi9JfJRibcMEFhjJQvN0k5 X-Received: by 2002:a05:6402:1c98:: with SMTP id cy24mr14425005edb.296.1616759141194; Fri, 26 Mar 2021 04:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616759141; cv=none; d=google.com; s=arc-20160816; b=OD/M4uo4ThARfYB+MaDzBOyocBv6ralV3vTlc2Me4bXHzCwzqcUjsloaavdI1/NZm1 VZdnfjiwbBRG3bCb3IytRqeJPjNW6R3gU1jM2rwrJuz0tuwLPoL0LjuuOEAumTmGTcHJ MBaDnaysRqshCKBITJtmi8vZDagoKLCeLYlg/Qv0KHlOJDivB+E8Fu0ySS6APmgQPAav PxsqGjRSx0XdHLNFI7qY57Jd3I2XLAEhrmZc9LGhkEQotPMJjLv3jnU4751McZkZp9iZ 4iNvc3YRVpiykhi9+fT+fKH9gsdxkk9ewxqjM9vwXzk06sVz2edhltewK+eTeNjw56mS NDNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5dBDWLwf9dCVjVcZT2nhOBe8IS7F0NG6pQfg2JZo3f8=; b=brfzh2oPoI40eeiwynsyQ3Msh403KizgYER4TMqE19rpN3ih/+wKKEABl1rgyxqIXx mLm95LcsXXfEkBaa3wLdBQ2ZUZLGmZsuJDfIxQs1uohdgl8we2/GsTZlUm7Uishbn4HE SoDzjUF579l1UXZs+JFElay8/jC9ipMijr5RAVkGQQE1VvQB10EeCbmu7bU6xIc5L3hV Hb6WXyHRYp9Ychvyz8zt74GPFkVa8OkeLs1ElJFz4zFr9YTPyoH2pzT+EzsZsrVuOYIf TgbkUaNA/IPK8rW12URbErhPFQ8ba0lFKu5ikMZ4dJW8iGv3a9psfeYVqExpgGWYbik+ qnTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W4PQrO6r; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id q9si6296347edd.324.2021.03.26.04.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:45:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W4PQrO6r; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 84A57825BF; Fri, 26 Mar 2021 12:45:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="W4PQrO6r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B865825BF; Fri, 26 Mar 2021 12:45:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 77198801FC for ; Fri, 26 Mar 2021 12:45:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=grandpaul@gmail.com Received: by mail-pj1-x102d.google.com with SMTP id kk2-20020a17090b4a02b02900c777aa746fso2335130pjb.3 for ; Fri, 26 Mar 2021 04:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5dBDWLwf9dCVjVcZT2nhOBe8IS7F0NG6pQfg2JZo3f8=; b=W4PQrO6rVAACL8RYYvbTEX+HY6dLne1nUrrAGwDBUYkCqkGnQWmXxNxFrpf8Itctmn aoekyJlRF2DEfJ0b9ZYrnZFXcjjIcQlx086NTQOxTpJasT1V7zedZHPDOfSj/EaHlYCh MkC7huVjRnyewxgBrtxri0cL5nDoxZAZetaa6EYOBZvp0h6LVXbXeIm2olb4p1oZwfaD PRd6GXoWuNyUGTefCjmih7QVVPIyKn1hhWSdF2NRqyW4XWoURm67FK/dEVuxe9T4tcEq 7gddQafKp8H+iq13lDtq0poKEgM4xGDUqxKVpGVQhCQ+qw4hFuqPT2fnTPi/8AByKw3M NV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5dBDWLwf9dCVjVcZT2nhOBe8IS7F0NG6pQfg2JZo3f8=; b=sUMCFpmWIPB1VElyJPOSIcjNiCk6Q6Kobdca+3c8Q0/HBVY1p7exFmTixlyMddZpPS V/u7uLNTNvyEgc8Q7LpcPzaO1yZKz7/86EKykC1oNEohK0n2g3FKN9ZhkmX1N9gzhK4B HiGGMKo71O+Bnrxsayaj/4wErdj70OaBP/oN5HWQQ4/U8q1WEX12V8bW3kRjIz8A4WQ9 2B6HM0lkdkXvBJWxwVe+kGj8Z0MnsK7FV5k94wPH5lfWJHTPWSTD2DPABEJ8koZb6UEs uM81FZEIdyjXUtczfUO590jFf+bujjiQncQq9zqmOo+ktjdYcUS1Ngv5T3DX2URUmRqY /DsA== X-Gm-Message-State: AOAM530MX4gbMcsCwbxXABK72ZYzU0Z/FWU4Y/nQ0HeNqDiIUumgY2EK ffVvB+4y/TUdlrVba/VIBHRRA30z2y+qJg== X-Received: by 2002:a17:90b:1198:: with SMTP id gk24mr13462731pjb.84.1616759104596; Fri, 26 Mar 2021 04:45:04 -0700 (PDT) Received: from localhost (host-111-184-129-17.dynamic.kbtelecom.net. [111.184.129.17]) by smtp.gmail.com with ESMTPSA id bg16sm8295978pjb.43.2021.03.26.04.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:45:04 -0700 (PDT) From: Ying-Chun Liu To: u-boot@lists.denx.de Cc: "Ying-Chun Liu (PaulLiu)" , Sean Anderson , Fabio Estevam , Jaehoon Chung , Peng Fan Subject: [PATCH v4 2/2] doc: device-tree-bindings: regulator: anatop regulator Date: Fri, 26 Mar 2021 19:44:52 +0800 Message-Id: <20210326114452.71281-3-grandpaul@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210326114452.71281-1-grandpaul@gmail.com> References: <20210326114452.71281-1-grandpaul@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: "Ying-Chun Liu (PaulLiu)" Document the bindings for fsl,anatop-regulator Signed-off-by: Ying-Chun Liu (PaulLiu) Reviewed-by: Sean Anderson Cc: Fabio Estevam Cc: Jaehoon Chung Cc: Peng Fan --- .../regulator/fsl,anatop-regulator.txt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 doc/device-tree-bindings/regulator/fsl,anatop-regulator.txt -- 2.30.2 diff --git a/doc/device-tree-bindings/regulator/fsl,anatop-regulator.txt b/doc/device-tree-bindings/regulator/fsl,anatop-regulator.txt new file mode 100644 index 0000000000..2a60e4941b --- /dev/null +++ b/doc/device-tree-bindings/regulator/fsl,anatop-regulator.txt @@ -0,0 +1,45 @@ +ANATOP REGULATOR + +Anatop is an integrated regulator inside i.MX6 SoC. + +Required properties: +- compatible: Must be "fsl,anatop-regulator". +- regulator-name: Name of the regulator +- anatop-reg-offset: u32 value representing the anatop MFD register offset. +- anatop-vol-bit-shift: u32 value representing the bit shift for the register. +- anatop-vol-bit-width: u32 value representing the number of bits used in the + register. +- anatop-min-bit-val: u32 value representing the minimum value of this + register. +- anatop-min-voltage: u32 value representing the minimum voltage of this + regulator. +- anatop-max-voltage: u32 value representing the maximum voltage of this + regulator. + +Optional properties: +- anatop-delay-reg-offset: u32 value representing the anatop MFD step time + register offset. +- anatop-delay-bit-shift: u32 value representing the bit shift for the step + time register. +- anatop-delay-bit-width: u32 value representing the number of bits used in + the step time register. +- anatop-enable-bit: u32 value representing regulator enable bit offset. +- vin-supply: input supply phandle. + +Example: + regulator-vddpu { + compatible = "fsl,anatop-regulator"; + regulator-name = "vddpu"; + regulator-min-microvolt = <725000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; + anatop-reg-offset = <0x140>; + anatop-vol-bit-shift = <9>; + anatop-vol-bit-width = <5>; + anatop-delay-reg-offset = <0x170>; + anatop-delay-bit-shift = <24>; + anatop-delay-bit-width = <2>; + anatop-min-bit-val = <1>; + anatop-min-voltage = <725000>; + anatop-max-voltage = <1300000>; + };