From patchwork Fri Jan 29 19:51:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 373445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EA7AC433E0 for ; Fri, 29 Jan 2021 19:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA2F861477 for ; Fri, 29 Jan 2021 19:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbhA2Tyc (ORCPT ); Fri, 29 Jan 2021 14:54:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:58686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233119AbhA2Tx2 (ORCPT ); Fri, 29 Jan 2021 14:53:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7155564E1B; Fri, 29 Jan 2021 19:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611949925; bh=yTxTCIPY/70pSfJAZeNKARTKVE/csJaWC4cyadiMy/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9GfiqbA5Nu/pN2MSOWD7ckzh12pf4LafiG1q9pwc3yqp/LMNlB9YIyjsNLh4Sz3J 4pTEyIH5XUEEZ+M4CDULJ6CmcDhtJj4JsAoOTLlabP9w7WjAmssTNSmiLW8VxaUen9 J2RQOgf7e/6TYpCdCMNJNmM33oVd6VXtPpQM3AnUqwsJEl/4T7Dwet1+Pk4jcvQrTc 691sUi1fOoKRn88bFIri0hU0jhr0tJ8/ymuyahd1ByswgM6aTmJsjvr58kgxF7kFVA YxNFqH5CxZZq5ppJyYJzAA9W58EOMDgtFBV6eZFNk2ju4dH3PxlUl5TOwI+IeVp9E/ Gf4Mo1gG0RW9g== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1l5ZoJ-007Wk0-8K; Fri, 29 Jan 2021 20:52:03 +0100 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman , Mark Brown , Lee Jones Cc: Mauro Carvalho Chehab , Christophe JAILLET , Colin Ian King , Dan Carpenter , David Gow , Juan Antonio Aldea-Armenteros , Mayulong , Rob Herring , Stephen Boyd , YueHaibing , devel@driverdev.osuosl.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 11/14] spmi: hisi-spmi-controller: move driver from staging Date: Fri, 29 Jan 2021 20:51:57 +0100 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Hisilicon 6421v600 SPMI driver is ready for mainstream. So, move it from staging. Signed-off-by: Mauro Carvalho Chehab Acked-by: Stephen Boyd --- .../spmi}/hisilicon,hisi-spmi-controller.yaml | 0 MAINTAINERS | 7 +++++++ drivers/spmi/Kconfig | 9 +++++++++ drivers/spmi/Makefile | 1 + .../{staging/hikey9xx => spmi}/hisi-spmi-controller.c | 0 drivers/staging/hikey9xx/Kconfig | 11 ----------- drivers/staging/hikey9xx/Makefile | 1 - 7 files changed, 17 insertions(+), 12 deletions(-) rename {drivers/staging/hikey9xx => Documentation/devicetree/bindings/spmi}/hisilicon,hisi-spmi-controller.yaml (100%) rename drivers/{staging/hikey9xx => spmi}/hisi-spmi-controller.c (100%) diff --git a/drivers/staging/hikey9xx/hisilicon,hisi-spmi-controller.yaml b/Documentation/devicetree/bindings/spmi/hisilicon,hisi-spmi-controller.yaml similarity index 100% rename from drivers/staging/hikey9xx/hisilicon,hisi-spmi-controller.yaml rename to Documentation/devicetree/bindings/spmi/hisilicon,hisi-spmi-controller.yaml diff --git a/MAINTAINERS b/MAINTAINERS index fb49e654a1db..406c2340f221 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8078,6 +8078,13 @@ F: drivers/crypto/hisilicon/sec2/sec_crypto.c F: drivers/crypto/hisilicon/sec2/sec_crypto.h F: drivers/crypto/hisilicon/sec2/sec_main.c +HISILICON SPMI CONTROLLER DRIVER FOR HIKEY 970 +M: Mauro Carvalho Chehab +L: linux-kernel@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/spmi/hisilicon,hisi-spmi-controller.yaml +F: drivers/spmi/hisi-spmi-controller.c + HISILICON STAGING DRIVERS FOR HIKEY 960/970 M: Mauro Carvalho Chehab L: devel@driverdev.osuosl.org diff --git a/drivers/spmi/Kconfig b/drivers/spmi/Kconfig index a53bad541f1a..2874b6c26028 100644 --- a/drivers/spmi/Kconfig +++ b/drivers/spmi/Kconfig @@ -11,6 +11,15 @@ menuconfig SPMI if SPMI +config SPMI_HISI3670 + tristate "Hisilicon 3670 SPMI Controller" + select IRQ_DOMAIN_HIERARCHY + depends on HAS_IOMEM + help + If you say yes to this option, support will be included for the + built-in SPMI PMIC Arbiter interface on Hisilicon 3670 + processors. + config SPMI_MSM_PMIC_ARB tristate "Qualcomm MSM SPMI Controller (PMIC Arbiter)" select IRQ_DOMAIN_HIERARCHY diff --git a/drivers/spmi/Makefile b/drivers/spmi/Makefile index 55a94cadeffe..6e092e6f290c 100644 --- a/drivers/spmi/Makefile +++ b/drivers/spmi/Makefile @@ -4,4 +4,5 @@ # obj-$(CONFIG_SPMI) += spmi.o +obj-$(CONFIG_SPMI_HISI3670) += hisi-spmi-controller.o obj-$(CONFIG_SPMI_MSM_PMIC_ARB) += spmi-pmic-arb.o diff --git a/drivers/staging/hikey9xx/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c similarity index 100% rename from drivers/staging/hikey9xx/hisi-spmi-controller.c rename to drivers/spmi/hisi-spmi-controller.c diff --git a/drivers/staging/hikey9xx/Kconfig b/drivers/staging/hikey9xx/Kconfig index 88bdf5655d20..49ce28ff55b2 100644 --- a/drivers/staging/hikey9xx/Kconfig +++ b/drivers/staging/hikey9xx/Kconfig @@ -1,16 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -# to be placed at drivers/spmi -config SPMI_HISI3670 - tristate "Hisilicon 3670 SPMI Controller" - select IRQ_DOMAIN_HIERARCHY - depends on HAS_IOMEM - depends on SPMI - help - If you say yes to this option, support will be included for the - built-in SPMI PMIC Arbiter interface on Hisilicon 3670 - processors. - # to be placed at drivers/mfd config MFD_HI6421_SPMI tristate "HiSilicon Hi6421v600 SPMI PMU/Codec IC" diff --git a/drivers/staging/hikey9xx/Makefile b/drivers/staging/hikey9xx/Makefile index 9371dcc3d35b..347880fd378f 100644 --- a/drivers/staging/hikey9xx/Makefile +++ b/drivers/staging/hikey9xx/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 -obj-$(CONFIG_SPMI_HISI3670) += hisi-spmi-controller.o obj-$(CONFIG_MFD_HI6421_SPMI) += hi6421-spmi-pmic.o obj-$(CONFIG_REGULATOR_HI6421V600) += hi6421v600-regulator.o From patchwork Fri Jan 29 19:52:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 373444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D420CC433E6 for ; Fri, 29 Jan 2021 19:55:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98CDC61477 for ; Fri, 29 Jan 2021 19:55:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbhA2Ty6 (ORCPT ); Fri, 29 Jan 2021 14:54:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:58698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233122AbhA2Tx3 (ORCPT ); Fri, 29 Jan 2021 14:53:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BF6A64E19; Fri, 29 Jan 2021 19:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611949925; bh=zLl/LXT9nD9oiff3TtR2evITRFPN8gyWpZ86jRIchpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XnxcbmlJjf145jvC7z/VDn/moQyH8N2Is7cwMYUAD+AukwUYMhOm9D7D4EMrvZmAI A1EJzXreeafarejH6zDDPWWnJPo0mx2wRP5qnpPFw0sCpz/tKTlB7UC1NuMAnrZx8n yR0cH3RiWLbNNYqfg0SCmpH48ZlxOxaayCRHxNDEbfm3yP2jgdFseo2jStzoz8nlfu wsI1qBeYCGIxwPN5QMY6fefL2nicV2qXIOQxJuCbbq4RaSNy/b/s/U8tNS9rrNObun zLcovJnR7LsNesO4FJtY8tAopASoorA7SbfMsH+RKL8nUbe6tUTesZ5HaNkLyPjg+3 Wge6l7kIs3d5A== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1l5ZoJ-007Wk8-B7; Fri, 29 Jan 2021 20:52:03 +0100 From: Mauro Carvalho Chehab To: Greg Kroah-Hartman , Mark Brown , Lee Jones Cc: Mauro Carvalho Chehab , Rob Herring , Wei Xu , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 14/14] dts: hisilicon: add support for the PMIC found on Hikey 970 Date: Fri, 29 Jan 2021 20:52:00 +0100 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add a device tree for the HiSilicon 6421v600 SPMI PMIC, used on HiKey970 board. As we now have support for it, change the fixed regulators used by the SD I/O to use the proper LDO supplies. Signed-off-by: Mauro Carvalho Chehab --- .../boot/dts/hisilicon/hi3670-hikey970.dts | 22 +---- .../boot/dts/hisilicon/hikey970-pmic.dtsi | 87 +++++++++++++++++++ 2 files changed, 90 insertions(+), 19 deletions(-) create mode 100644 arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi diff --git a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts index 7f9f9886c349..5e6d7b329771 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3670-hikey970.dts @@ -12,6 +12,7 @@ #include "hi3670.dtsi" #include "hikey970-pinctrl.dtsi" +#include "hikey970-pmic.dtsi" / { model = "HiKey970"; @@ -39,23 +40,6 @@ memory@0 { reg = <0x0 0x0 0x0 0x0>; }; - sd_1v8: regulator-1v8 { - compatible = "regulator-fixed"; - regulator-name = "fixed-1.8V"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-always-on; - }; - - sd_3v3: regulator-3v3 { - compatible = "regulator-fixed"; - regulator-name = "fixed-3.3V"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-boot-on; - regulator-always-on; - }; - wlan_en: wlan-en-1-8v { compatible = "regulator-fixed"; regulator-name = "wlan-en-regulator"; @@ -402,8 +386,8 @@ &dwmmc1 { pinctrl-0 = <&sd_pmx_func &sd_clk_cfg_func &sd_cfg_func>; - vmmc-supply = <&sd_3v3>; - vqmmc-supply = <&sd_1v8>; + vmmc-supply = <&ldo16>; + vqmmc-supply = <&ldo9>; status = "okay"; }; diff --git a/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi b/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi new file mode 100644 index 000000000000..8cf45b962fea --- /dev/null +++ b/arch/arm64/boot/dts/hisilicon/hikey970-pmic.dtsi @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * dts file for Hi6421v600 SPMI PMIC used at the HiKey970 Development Board + * + * Copyright (C) 2020, Huawei Tech. Co., Ltd. + */ + +#include + +/ { + spmi: spmi@fff24000 { + compatible = "hisilicon,kirin970-spmi-controller"; + #address-cells = <2>; + #size-cells = <0>; + status = "okay"; + reg = <0x0 0xfff24000 0x0 0x1000>; + spmi-channel = <2>; + + pmic: pmic@0 { + compatible = "hisilicon,hi6421-spmi"; + reg = <0 SPMI_USID>; + + #interrupt-cells = <2>; + interrupt-controller; + gpios = <&gpio28 0 0>; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + ldo3: LDO3 { + regulator-name = "ldo3"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2000000>; + regulator-boot-on; + }; + + ldo4: LDO4 { /* 40 PIN */ + regulator-name = "ldo4"; + regulator-min-microvolt = <1725000>; + regulator-max-microvolt = <1900000>; + regulator-boot-on; + }; + + ldo9: LDO9 { /* SDCARD I/O */ + regulator-name = "ldo9"; + regulator-min-microvolt = <1750000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + ldo15: LDO15 { /* UFS */ + regulator-name = "ldo15"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + }; + + ldo16: LDO16 { /* SD */ + regulator-name = "ldo16"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + }; + + ldo17: LDO17 { + regulator-name = "ldo17"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <3300000>; + }; + + ldo33: LDO33 { /* PEX8606 */ + regulator-name = "ldo33"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + ldo34: LDO34 { /* GPS AUX IN VDD */ + regulator-name = "ldo34"; + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <3300000>; + }; + }; + }; + }; +};