From patchwork Sat Mar 27 13:46: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: 410172 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2259328jai; Sat, 27 Mar 2021 06:47:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzVrUGu1cbpNej6BExQiRF7zeD0MCpmYluw03CUOWGSpUrPreJfYt3Fx/vhekyaixNzzIB X-Received: by 2002:a05:6402:3049:: with SMTP id bu9mr20778720edb.104.1616852847872; Sat, 27 Mar 2021 06:47:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616852847; cv=none; d=google.com; s=arc-20160816; b=CovxELA1+P8l1JznVuMzwNsLh2A6TRpW9H0hoMIYTjNF7bsOtiy37ZsHgBBZpyuQkS 3vx5nv80qYxM0K3488vQKM6sE4go20HF6MqUFeLhOLr5l7wKcKrcgymGnSv6qcx8L1Sc nxuY5ei06EvpcwgP5xIFW9n5tIctbt0586M44z/K0UK3B4E20uIPrrMhIqViqofd6eTQ nE8kkgluILgxnYz+8C1iLMpeoxQVzy4kzZeZAXMXv0EXLP7Te3vev/+8VSoro1PYvBtB 4Cnd/g5/Npud5WIGX6Ug8C2hNtrlzRyfg5Tyi69QeZJ3NmdaaCmWKmEq54NAYNqQgSyx s8qQ== 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=zkn5k+6HEURlRzGJapN0Gz/Q+OXhZ/P7jmOwd2cj948=; b=HB/AFp2FWixx8Y5VH6K399F7yRuGWzdgYFa5eJHEFuoIYeaOqIS4HyrOo153nwGOUd U43Oekc5Ilf9GZHOd2rxrTBULdbAYHoPzIC5nJE0A3pvsTjvmc3os3g+cViE6w3FKAoX hEY8Xogq7vI9DJYu2yViuT3qLNhWrDcm1PF80gGp28nWuyNS2GhVw6iv3H98D14/v4g7 Z5CTFZJEK0UQaJn+jXG9OVTAiKpJRJgGq8jmaopek3MNbaRRJE9d52G9jdLR/pqIgvEP a5Xd/5LvqQwz2ZddDVQmGxSxguCGOg8lr3I1ReZkGjRD8MQs9dHVKn44EuFwtal26gi/ z62A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U7Zcv90D; 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 dp12si9257201ejc.526.2021.03.27.06.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 06:47:27 -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=U7Zcv90D; 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 CFD42828EB; Sat, 27 Mar 2021 14:47:15 +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="U7Zcv90D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 74A9D828E6; Sat, 27 Mar 2021 14:47:10 +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-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 6DEA18289B for ; Sat, 27 Mar 2021 14:47: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-x102b.google.com with SMTP id s21so3903582pjq.1 for ; Sat, 27 Mar 2021 06:47: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=zkn5k+6HEURlRzGJapN0Gz/Q+OXhZ/P7jmOwd2cj948=; b=U7Zcv90DJaFhe1GMTfwbOWWfRMdfvQVCHxl3oNCeJUZiJRUz/qyKo5RMIKdzdrlz1N XDrGKQe6odwITD4M4v6DSN37nXUptDUA5RYGfOyYeXnySwsjirg/Q58QYj9W9grVak3D haoqqlkXFtiw2vWT2VsbzXhKW30Uo/xZvNMweoxb18B1oc0Jba3FYNdx2o1IOpS47mfe YVvEKMOmT/bb9FiGDseCpuUmyakMj2OyHUZnrYGhw8g+aj4lX8SGbO7kjROGI9DQDE7B kWKgEIn6TafzqZFlbARKawHVfEYs/dnUmZnGivC4aY2xKKoOoUFB1V80+AhuSiGKuAjK 6wEg== 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=zkn5k+6HEURlRzGJapN0Gz/Q+OXhZ/P7jmOwd2cj948=; b=mz4j/iusUNYYkKI8Bjpr2fjxDZpuSGWNMZ+p+DRCmC7IPVyqBmXpTpjDlNon/EtnGe oF/CmURuUQiY4lIPPptpCaO9XRaItajpoHaLVmEhYija9EVwNNkDF3AXWq/3DdDTckns 4Ful8pjRwLNrsbHi0FOIp7iqo1E17Z4FoAwHXi2CIdoPpyFHhiX0jzusxUl7vWVbXSft SOCw2HMiyUuvilAIAqVDZd8c5Nh+veR/d98lBVmy35iWOfRC8CvHeGjP13tA1oGsE/7d Ep+O6LCQiku1ZfkXYZaNiDPPvKENJUek7MQip48oJ2fImEeCcKgF2Brtx0jJI9aFZSSI YwZg== X-Gm-Message-State: AOAM5320/HrlVFX5i3peU4+bQB7drGHl2gbOj4d9Oy6CQWJ+B6xqUE6u EkLrTeFp0FnbekxulPxLy11LcWZGQPXDJA== X-Received: by 2002:a17:90a:d801:: with SMTP id a1mr18627346pjv.84.1616852824512; Sat, 27 Mar 2021 06:47: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 a29sm9285221pfg.130.2021.03.27.06.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 06:47: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 v5 1/2] power: regulator: add driver for ANATOP regulator Date: Sat, 27 Mar 2021 21:46:51 +0800 Message-Id: <20210327134652.155431-2-grandpaul@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210327134652.155431-1-grandpaul@gmail.com> References: <20210327134652.155431-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) Reviewed-by: Sean Anderson Cc: Fabio Estevam Cc: Jaehoon Chung Cc: Peng Fan --- 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 v5: fix typo "wrie" -> "write" --- 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: Jaehoon Chung 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..096a1565d5 --- /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 write 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 Sat Mar 27 13:46: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: 410173 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp2259417jai; Sat, 27 Mar 2021 06:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHAzHLIHsUEmm+MaHAK+jEOUjgqFVcAl7Qd1fnuqGrLQg8FWZKg4kq+Ha9qUQP+dEbkE8L X-Received: by 2002:a17:906:af97:: with SMTP id mj23mr21035550ejb.419.1616852858194; Sat, 27 Mar 2021 06:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616852858; cv=none; d=google.com; s=arc-20160816; b=aAzrW/3it3RoSRAXYAzapw7RPO3w0Ozib8xWYLJ9OoIqMrJK3NS48DkZ8g8n5fWX1m N+HWvnqRDmf2Uw0Stml5Kyu647F7DtgtegrG623unagViZKn3A8T6G6GzByQxw/BqVy9 L3VbFmp9OReIb18a4c/qjFGgiN98MdoBhL2H1yRpXsoGjcB8RcelbLQzFFvGc7lYRzds vQfaD6xiKY5dlb+trLi+KxGCtkW+OyAmKT2touXC5w1NRbpr8/yNulupMv9JPDmHWiEZ IReYgg8OCtzipH3SlioM9ywYim82go/7vfSz3VmbzBgiaZUgGmqBiUEkcGGjG/f7fxEr 5PQQ== 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=qWyUMFRwK0QepTr0SiWvpEflRmzJcVu5HWFYI8wgbFz7bSaUFb2Snmtqh1wMmoREHm cUSlOnw5O+MLXhfEwaD1ZtGo/fCK88tiULx7o13OWW9p0I3cWxAoYK21o+BWZL71xuv5 JAZO5otcOP5PfapczhvsvXXWEV4+Wsj3lqFdsJ2Ai7TnQTSXBggnkzeAIv8GfZWI8DbL QK4ss4tE5qWpGIaJ9+OalqA+JTQ9wINRvX74a0n1rFAPtF6dZQbEDRim2ltVhjzQ6V0+ Vvut09n9VwqUFAbOeJrxf8xCLo6MNsyuM6rcS8aPNvgJhcFsu7OQ3JbX733w2kheyswk 6Z1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hYLtHbnx; 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 gz5si9242827ejb.19.2021.03.27.06.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 06:47:38 -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=hYLtHbnx; 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 66CF7828FE; Sat, 27 Mar 2021 14:47:17 +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="hYLtHbnx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 78395828C3; Sat, 27 Mar 2021 14:47:13 +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-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 9DA34828CB for ; Sat, 27 Mar 2021 14:47:09 +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-pg1-x52f.google.com with SMTP id 33so602097pgy.4 for ; Sat, 27 Mar 2021 06:47:09 -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=hYLtHbnxPItJeWoy1d8Vi3mDd0AY0AWggBZkSM2S0htFyLkhxpKodLNsN6WrIUPTN/ CllJNem3dO3M7BhdTUDtAoJaQ/KbKCjZVexiAimJEe4O665k4Z3lBaQnPfeOzFM/icYc /362eqSWgqhaAg1szK+vVhJZ6EXnjcjRlfmmXibXnzPayXmzeqPYyrWOTY81aPG/vlvQ FMwFxpNlRNQQzyNRSj53TeToKtwPV74h9+Sm2bW6Pt06HRucWsmux9Q0zTTWtCA1I64/ aSL+MHZ353PhdSp4x5ikR6jTd4H67YNK2spaHfetx/uvAhIzaz3bsgQidf/9zXibAcX5 Uqew== 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=T7MVREwDW8QJX2Lxg6P5ZB1MIjUO6phjn3/tPXg4JQSDlSCFIYsZWp6zJK5hV6MfN+ Cf5ScoMKPdxs93Pie4E1GpCq6nwOlfvbMORRk+GokUOxAoFvJkLrymkipwKsdkVKSk80 a20T10wWA/ygaJc1tHjKoy/zr0tOK4Iv7sLuwuvk6kelOQqgMFBFWD9ltmd7XHU5vCsl jnnYZEAdu3PNZC3nsfpCSpgIyco8irrOblLCGf3Xt0FHMYh9HEcdS5JFhNS8BKy9amRN 2nvDv2cbJbzPSGE25qu87XidgNcbU0EpGq8WsvKIFB73DLfUm8njV/Dn4XCoLEyOpu4x LJXQ== X-Gm-Message-State: AOAM533sI995wQCb5xJIUxw1ab7Ac7tFnXc2Wshmx8v5epH8G836ocXu jngI6aftP7ydNadS1BbvlEjBs+73eVtzIg== X-Received: by 2002:a63:e1b:: with SMTP id d27mr16598269pgl.135.1616852827758; Sat, 27 Mar 2021 06:47:07 -0700 (PDT) Received: from localhost (host-111-184-129-17.dynamic.kbtelecom.net. [111.184.129.17]) by smtp.gmail.com with ESMTPSA id gt22sm11044509pjb.35.2021.03.27.06.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Mar 2021 06:47:07 -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 v5 2/2] doc: device-tree-bindings: regulator: anatop regulator Date: Sat, 27 Mar 2021 21:46:52 +0800 Message-Id: <20210327134652.155431-3-grandpaul@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210327134652.155431-1-grandpaul@gmail.com> References: <20210327134652.155431-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 Reviewed-by: Jaehoon Chung 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>; + };