From patchwork Mon Jul 1 08:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 11025243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EEE7746 for ; Mon, 1 Jul 2019 08:15:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 896B3201B1 for ; Mon, 1 Jul 2019 08:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A7BC204BE; Mon, 1 Jul 2019 08:15:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 183F6201B1 for ; Mon, 1 Jul 2019 08:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o5YNYPVwAc82ajZv5jyq9YW6xwB+lI+oN5rA3ulqpfQ=; b=Ss4F0SMATMVesZ YH23cZbTu4spON6GOJaxd/OMiIu4rGgp+K4qSGTFMgVf6ExCTBEMHRYALSZz6UN4DYcCwEh4zvWCc yGhY+VmpQVaOUxPyMfoaqbL71kEk9C8RY2ex+wW09qh3b1pcg1xz0V+jvjSFB2xyTrRhxdNo6NulY wyIlRJSno9g5aqZItXv7kxDXZ4wLBApdlBDw/Vi6MfvWH8iSmEA2PrHAssji8FmB0XlRgVChd8Dsh N0Nq8Z8J/DzibWeDzbh4STxo+40fpd87ehrSQgzECKJkvSnwjeTmulNSxtqdhpLOfzg3hEs0lMwie T6+b1dbFNOC1pjQsnEVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhrTg-0004aa-Vn; Mon, 01 Jul 2019 08:15:57 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhrSs-0002oj-Kg for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2019 08:15:11 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x618ASXC004695; Mon, 1 Jul 2019 10:15:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=gFZXnm/IaqS/lZZLWx/8MO4ceDiguvcxpYNkcDkG8Ug=; b=b729Gy3D+8FM1VqOdqGZ64Zo98NHkQ/iPu3MYYVADy7BdKya/4oOW1yrH6Q7vio5v5tq njQx38cYogDzFpD5thOdNJwXYLq9MvQnWzpaIA1TFF2fYEGwrkiVtkN7tw2kl7xFUAMY SZ6XY/yngiI7mJwQ9M3wf9fs3gx9CINYYEOlCJGCakSQSbPPC6y0S4S4JppMkgzVdzNs xAHRyVniYa+xofUfd/4fS66X4yZG7bMuGdJ+IYcDuOfjlTFHUlZ1WC/hAGuEyF85nIbG rZQ/aFSIPx3XFzkxA7XU8o0y4V7AXtL0c1GpknYpHMYz9/lOZprOt1GTp4bfMS8gifrf xQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2tdxvhkefe-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Jul 2019 10:14:35 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 829AB46; Mon, 1 Jul 2019 08:14:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 506701C33; Mon, 1 Jul 2019 08:14:34 +0000 (GMT) Received: from localhost (10.75.127.51) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Jul 2019 10:14:33 +0200 From: Fabrice Gasnier To: , , , Subject: [PATCH v2 1/4] dt-bindings: regulator: add support for the stm32-booster Date: Mon, 1 Jul 2019 10:14:22 +0200 Message-ID: <1561968865-22037-2-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> References: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG6NODE1.st.com (10.75.127.16) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-01_05:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190701_011507_802995_ADE280FB X-CRM114-Status: GOOD ( 14.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Document the 3.3V booster regulator embedded in stm32h7 and stm32mp1 devices, that can be used to supply ADC analog input switches. It's controlled by using system configuration registers (SYSCFG). Introduce two compatibles as the booster regulator is controlled by: - a unique register/bit in STM32H7 - a set/clear register pair in STM32MP1 Signed-off-by: Fabrice Gasnier --- .../devicetree/bindings/regulator/st,stm32-booster.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/st,stm32-booster.txt diff --git a/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt new file mode 100644 index 0000000..479ad4c --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/st,stm32-booster.txt @@ -0,0 +1,18 @@ +STM32 BOOSTER - Booster for ADC analog input switches + +Some STM32 devices embed a 3.3V booster supplied by Vdda, that can be used +to supply ADC analog input switches. + +Required properties: +- compatible: Should be one of: + "st,stm32h7-booster" + "st,stm32mp1-booster" +- st,syscfg: Phandle to system configuration controller. +- vdda-supply: Phandle to the vdda input analog voltage. + +Example: + booster: regulator-booster { + compatible = "st,stm32mp1-booster"; + st,syscfg = <&syscfg>; + vdda-supply = <&vdda>; + }; From patchwork Mon Jul 1 08:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 11025237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9A7B6138B for ; Mon, 1 Jul 2019 08:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9856F284DA for ; Mon, 1 Jul 2019 08:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A2FE28514; Mon, 1 Jul 2019 08:14:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C02228414 for ; Mon, 1 Jul 2019 08:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CVQNKHZIa3DEEJQzjjBJdGk0wqcAnKa03YxBOJrRi2U=; b=dI1pYil7O5kms7 OoiLYw1oIJKNj/V2VzW09F1Xj9l7M3gtajApNGWiFrQYPP6kblmzNed1bD2rPu0qWqNdsDjokZLhT brahajTGfMzQJzP1lyYtrgkn26fh+XK9nc7rppThWZG1trQjMMGy88TWVfhGpWQ3FQRnfwc3KRax6 v9TUlmq6/7KkLUfj1dy6VDJxL/4jzqlrJXrZC52ViA9DdZeLphmuGRz5D9XToOH9NSA0QHGTRvdRB xEESR1mGkl3PFpFR5jW0ICFmJRGq5VHpzLgsElYmFC39Ozc2BkjhzE3Y690I32TfqBYPj9v6prgoG hPymX28PLLlvAFTQzmiw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhrSc-0002bw-Sh; Mon, 01 Jul 2019 08:14:50 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhrSX-0002Xr-BR for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2019 08:14:47 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x618CeOs016170; Mon, 1 Jul 2019 10:14:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=SA12HvxMBgmLlaje8uVlkPT05/Yq7cp0AhDC6a3uSfo=; b=e7y5o2QbMaYgEzp/6H3nVYqjHUoNaSuOr8vA9wJnJJGKlPjcyL7p3ya312pr030F4c0c WywiHhJlMvXuPmi5++pNF+USqFjiCP2lJx7tkJXrx3KpMn1l9lZh8q2Z3NzS+us9Vooq 3AzAR4yZCdwI+TFQ/1p02CkvDNGUB5mlmNZ+QXt9OHHa6OjAm7bI1+51BBYyHiZ0ygRZ 4zhx6HmdL2h+QZTsWjV12RjIu3w0wcBNJO/FlJnkaV5CsjAIx/0/98Hc7+YpX+ah9iz+ W1aAhGTkE86m21tu0TX1z1fZEhPyknlF/QZEVSAPmkE1Z0oOTd9B/wsbO/vFDjeOoKjt 3w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2tdwf0kn6j-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Jul 2019 10:14:35 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 31C6B3D; Mon, 1 Jul 2019 08:14:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0D728191D; Mon, 1 Jul 2019 08:14:35 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Jul 2019 10:14:34 +0200 From: Fabrice Gasnier To: , , , Subject: [PATCH v2 2/4] regulator: add support for the stm32-booster Date: Mon, 1 Jul 2019 10:14:23 +0200 Message-ID: <1561968865-22037-3-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> References: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG7NODE2.st.com (10.75.127.20) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-01_06:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190701_011445_866711_6FBA443C X-CRM114-Status: GOOD ( 20.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for the 3.3V booster regulator embedded in stm32h7 and stm32mp1 devices, that can be used to supply ADC analog input switches. This regulator is supplied by vdda. It's controlled by using SYSCFG: - STM32H7 has a unique register to set/clear the booster enable bit - STM32MP1 has separate set and clear registers to configure it. Signed-off-by: Fabrice Gasnier --- Changes in v2: - rebase on top of for-next branch --- drivers/regulator/Kconfig | 11 ++++ drivers/regulator/Makefile | 1 + drivers/regulator/stm32-booster.c | 132 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 drivers/regulator/stm32-booster.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 0e7d425..1e590ec 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -839,6 +839,17 @@ config REGULATOR_SLG51000 The SLG51000 is seven compact and customizable low dropout regulators. +config REGULATOR_STM32_BOOSTER + tristate "STMicroelectronics STM32 BOOSTER" + depends on ARCH_STM32 || COMPILE_TEST + help + This driver supports internal booster (3V3) embedded in some + STMicroelectronics STM32 chips. It can be used to supply ADC analog + input switches when vdda supply is below 2.7V. + + This driver can also be built as a module. If so, the module + will be called stm32-booster. + config REGULATOR_STM32_VREFBUF tristate "STMicroelectronics STM32 VREFBUF" depends on ARCH_STM32 || COMPILE_TEST diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index c15b0b6..eef73b5 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -105,6 +105,7 @@ obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o obj-$(CONFIG_REGULATOR_SLG51000) += slg51000-regulator.o +obj-$(CONFIG_REGULATOR_STM32_BOOSTER) += stm32-booster.o obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o diff --git a/drivers/regulator/stm32-booster.c b/drivers/regulator/stm32-booster.c new file mode 100644 index 0000000..2a89766 --- /dev/null +++ b/drivers/regulator/stm32-booster.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (C) STMicroelectronics 2019 +// Author(s): Fabrice Gasnier . + +#include +#include +#include +#include +#include +#include +#include + +/* STM32H7 SYSCFG register */ +#define STM32H7_SYSCFG_PMCR 0x04 +#define STM32H7_SYSCFG_BOOSTE_MASK BIT(8) + +/* STM32MP1 SYSCFG has set and clear registers */ +#define STM32MP1_SYSCFG_PMCSETR 0x04 +#define STM32MP1_SYSCFG_PMCCLRR 0x44 +#define STM32MP1_SYSCFG_EN_BOOSTER_MASK BIT(8) + +static const struct regulator_ops stm32h7_booster_ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = regulator_enable_regmap, + .disable = regulator_disable_regmap, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_desc stm32h7_booster_desc = { + .name = "booster", + .supply_name = "vdda", + .n_voltages = 1, + .type = REGULATOR_VOLTAGE, + .min_uV = 3300000, + .fixed_uV = 3300000, + .ramp_delay = 66000, /* up to 50us to stabilize */ + .ops = &stm32h7_booster_ops, + .enable_reg = STM32H7_SYSCFG_PMCR, + .enable_mask = STM32H7_SYSCFG_BOOSTE_MASK, + .owner = THIS_MODULE, +}; + +static int stm32mp1_booster_enable(struct regulator_dev *rdev) +{ + return regmap_write(rdev->regmap, STM32MP1_SYSCFG_PMCSETR, + STM32MP1_SYSCFG_EN_BOOSTER_MASK); +} + +static int stm32mp1_booster_disable(struct regulator_dev *rdev) +{ + return regmap_write(rdev->regmap, STM32MP1_SYSCFG_PMCCLRR, + STM32MP1_SYSCFG_EN_BOOSTER_MASK); +} + +static const struct regulator_ops stm32mp1_booster_ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = stm32mp1_booster_enable, + .disable = stm32mp1_booster_disable, + .is_enabled = regulator_is_enabled_regmap, +}; + +static const struct regulator_desc stm32mp1_booster_desc = { + .name = "booster", + .supply_name = "vdda", + .n_voltages = 1, + .type = REGULATOR_VOLTAGE, + .min_uV = 3300000, + .fixed_uV = 3300000, + .ramp_delay = 66000, + .ops = &stm32mp1_booster_ops, + .enable_reg = STM32MP1_SYSCFG_PMCSETR, + .enable_mask = STM32MP1_SYSCFG_EN_BOOSTER_MASK, + .owner = THIS_MODULE, +}; + +static int stm32_booster_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np = pdev->dev.of_node; + struct regulator_config config = { }; + const struct regulator_desc *desc; + struct regulator_dev *rdev; + struct regmap *regmap; + int ret; + + regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg"); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + desc = (const struct regulator_desc *) + of_match_device(dev->driver->of_match_table, dev)->data; + + config.regmap = regmap; + config.dev = dev; + config.of_node = np; + config.init_data = of_get_regulator_init_data(dev, np, desc); + + rdev = devm_regulator_register(dev, desc, &config); + if (IS_ERR(rdev)) { + ret = PTR_ERR(rdev); + dev_err(dev, "register failed with error %d\n", ret); + return ret; + } + + return 0; +} + +static const struct of_device_id stm32_booster_of_match[] = { + { + .compatible = "st,stm32h7-booster", + .data = (void *)&stm32h7_booster_desc + }, { + .compatible = "st,stm32mp1-booster", + .data = (void *)&stm32mp1_booster_desc + }, { + }, +}; +MODULE_DEVICE_TABLE(of, stm32_booster_of_match); + +static struct platform_driver stm32_booster_driver = { + .probe = stm32_booster_probe, + .driver = { + .name = "stm32-booster", + .of_match_table = of_match_ptr(stm32_booster_of_match), + }, +}; +module_platform_driver(stm32_booster_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Fabrice Gasnier "); +MODULE_DESCRIPTION("STMicroelectronics STM32 booster regulator driver"); +MODULE_ALIAS("platform:stm32-booster"); From patchwork Mon Jul 1 08:14:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 11025241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3154F13BD for ; Mon, 1 Jul 2019 08:15:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F2D8201B1 for ; Mon, 1 Jul 2019 08:15:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20B73204BE; Mon, 1 Jul 2019 08:15:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A51EB201B1 for ; Mon, 1 Jul 2019 08:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lRWSl4ozuOyYPpOQZ2+N8e+zgWd7hRDPqD50XhQhdWE=; b=ewEtTk9cn53X8O VZSL64A39pW5FIQ7/0N7DXqgImNBjKAWswYLfqpSjl2If2e4iiJM7rUmp/QZaQZxoFKikqsgt2zfW ELYrFxN/Q2Eb/OGYLpwTs++2KvQb0v6ot4XMo+HxrtmBeTZUk69bNlg6pHMtGDeWmAs6QCcE+KcJJ JGMiFVNX8YwbOX05eym4m3+f6SMu3tKmfASsFCU1hJqxLbbVShz4ztlFEn1w18B0C0akrtaRodz09 QrlIWhXF9q+WL92GrPJYvtqSyCnbYWFrGRclmlWk3h1uXaT3+ikCvRE/9fJIY+oyaVuIYqbrO6w65 Jy37Szifb1at8DzkTlIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhrTJ-0004KF-P0; Mon, 01 Jul 2019 08:15:33 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhrSs-00031U-Kh for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2019 08:15:10 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x618AURR004719; Mon, 1 Jul 2019 10:15:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=4HCnvTeET6w7JHg2LO1bt6ZsiU0ocB/xdZVHYiG9rFI=; b=GHW6645O6fXZFwxeACFbUizFjN2xzSQ/fT1WP22K35T2QBWXIxRswFIbY/Gicog7yd9+ MipX/Kz8DePJL5H40MejpIksdnXf1VxftXIgbNpJNwuuujLjuv/R2cPnSAIFvLD5XXDt PgRsTg4V6FOUkilsbNhyObODsNAk/zWROs4Iw4+gmmwLx7naRBdxmQy+t4MMZPaZkn+Y 8yYPEDrj8k9245W4SCXEsw0SQY7cNSRX24iQjYiJrSlv8+Kp7ZgXoTv+6O5aXzmdUBzb 1Dnt80cUK6MysfLVm0UJ2eGMJIlkAS4A67jx931w5OY9X+ZDYUZ3QHQUHQ5pmgmfNYhD Iw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2tdxvhkefh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Jul 2019 10:15:02 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DBAC134; Mon, 1 Jul 2019 08:14:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B47AA191D; Mon, 1 Jul 2019 08:14:35 +0000 (GMT) Received: from localhost (10.75.127.49) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Jul 2019 10:14:35 +0200 From: Fabrice Gasnier To: , , , Subject: [PATCH v2 3/4] ARM: multi_v7_defconfig: enable STM32 booster regulator Date: Mon, 1 Jul 2019 10:14:24 +0200 Message-ID: <1561968865-22037-4-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> References: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG6NODE3.st.com (10.75.127.18) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-01_05:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190701_011507_778540_7FEE4E6B X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This enables the driver for STM32 booster regulator found on stm32mp1. Signed-off-by: Fabrice Gasnier --- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 6b748f2..230e7e0 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -568,6 +568,7 @@ CONFIG_REGULATOR_RK808=y CONFIG_REGULATOR_RN5T618=y CONFIG_REGULATOR_S2MPS11=y CONFIG_REGULATOR_S5M8767=y +CONFIG_REGULATOR_STM32_BOOSTER=m CONFIG_REGULATOR_STM32_VREFBUF=m CONFIG_REGULATOR_STPMIC1=y CONFIG_REGULATOR_TI_ABB=y From patchwork Mon Jul 1 08:14:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 11025239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53FC4746 for ; Mon, 1 Jul 2019 08:15:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 524A428420 for ; Mon, 1 Jul 2019 08:15:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45FCF28514; Mon, 1 Jul 2019 08:15:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7150F28420 for ; Mon, 1 Jul 2019 08:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4el5kfEnP/TaCfIvX2Gvy+MdBTAUDtuqi15jr9Lrb4M=; b=orEHwI38xm9f6e sXzGlIl8/KY3bmLpn3P/FyOHuZDnlopy/vTDQmutcsahUL6UnrgY18j/Tia6fm0ujnF1CT7l2VPxd kTwiWnCxqoAJEt7C7OQdFjosgwO/nPRG8Gpm0RrSsRV7KS46r2zsY96RYKfEv9zki0UN2S/nwncLA NAFx/LRo7RbB83rajxXkSG3eYdQWe9wl7zfqKKOwJpZRc7G02bpPqycAeGin8abY1O+ZCiClnXNhU LuzXlCzj7yrJaVGXRTjUCBuI3jRd04ZBRhlKUIYCAyhEKFlN7fMe2ZhysmHuv1J9/XuoR4RRRH6xj B5eSn6r5ym/irtGCkqLw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hhrT3-0003j2-MY; Mon, 01 Jul 2019 08:15:17 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hhrSr-0002Yh-Ap for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2019 08:15:09 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x618CSaW000667; Mon, 1 Jul 2019 10:14:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=aYrirpoqz+aG/SQ1qsY5AmsZmle4+vE9RtqR8rZ9598=; b=wbZyeWZMH6xYzzqd5+MD4s9r5GEhFX6CQwoReQy2RJgamMa6lmh/+ywVJnPad1P2oVmV QLF+aa/JnO+RFMI9p/ZA8HKEFc2RFAF8JPm/JvzGez+slysnzB9C13y8IOf8oHMXd/D1 t7bTezEK/kZE9xy8krhoqzZcNN7or4ljCToecm8j3YJdVL4ERhcUsb37JQKSc4vxcAYa /w4gJQFU2ZCQcuAJWi+2KUMIpGOUKpIbeHeRWWwESfx3wLxvLaUHr+3Xl4jP58IXTJdZ qjWudvbYYOW9eZqsrXOcTx5QFOvYkPq41+kpxU+3gKDJ/U2TNRsRZ/uq8um1klb5+2WX wA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2tdwrukjmh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 01 Jul 2019 10:14:37 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CC18D3F; Mon, 1 Jul 2019 08:14:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 862B21C0E; Mon, 1 Jul 2019 08:14:36 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 1 Jul 2019 10:14:36 +0200 From: Fabrice Gasnier To: , , , Subject: [PATCH v2 4/4] ARM: dts: stm32: add booster for ADC analog switches on stm32mp157c Date: Mon, 1 Jul 2019 10:14:25 +0200 Message-ID: <1561968865-22037-5-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> References: <1561968865-22037-1-git-send-email-fabrice.gasnier@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG3NODE2.st.com (10.75.127.8) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-01_06:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190701_011506_842141_1F645DB5 X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, fabrice.gasnier@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Booster for ADC analog input switches can be used when Vdda is below 2.7V to get maximum ADC analog performances. Add booster for ADC analog switches on stm32mp157c. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index 2afeee6..2dd5162 100644 --- a/arch/arm/boot/dts/stm32mp157c.dtsi +++ b/arch/arm/boot/dts/stm32mp157c.dtsi @@ -109,6 +109,12 @@ }; }; + booster: regulator-booster { + compatible = "st,stm32mp1-booster"; + st,syscfg = <&syscfg>; + status = "disabled"; + }; + soc { compatible = "simple-bus"; #address-cells = <1>;