From patchwork Tue Jul 2 02:31:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1125820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=nxp.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45d83W2816z9s3Z for ; Tue, 2 Jul 2019 12:54:47 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DD451C21C93; Tue, 2 Jul 2019 02:50:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D3249C21E39; Tue, 2 Jul 2019 02:42:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 57C92C21E62; Tue, 2 Jul 2019 02:41:50 +0000 (UTC) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lists.denx.de (Postfix) with ESMTPS id 44601C21E60 for ; Tue, 2 Jul 2019 02:41:45 +0000 (UTC) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 17E16200ADC; Tue, 2 Jul 2019 04:41:45 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2C7F8200AD4; Tue, 2 Jul 2019 04:41:41 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7EA6E4030F; Tue, 2 Jul 2019 10:41:36 +0800 (SGT) From: peng.fan@nxp.com To: sbabic@denx.de, festevam@gmail.com, uboot-imx@nxp.com Date: Tue, 2 Jul 2019 10:31:59 +0800 Message-Id: <20190702023206.48995-46-peng.fan@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190702023206.48995-1-peng.fan@nxp.com> References: <20190702023206.48995-1-peng.fan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 45/52] power: pmic: add SPL_DM_PMIC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Peng Fan Introduce SPL_DM_PMIC for SPL Signed-off-by: Peng Fan --- drivers/power/pmic/Kconfig | 12 ++++++++++++ drivers/power/pmic/Makefile | 2 +- include/power/pmic.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig index 450935fdc1..efcad22587 100644 --- a/drivers/power/pmic/Kconfig +++ b/drivers/power/pmic/Kconfig @@ -10,6 +10,18 @@ config DM_PMIC - 'drivers/power/pmic/pmic-uclass.c' - 'include/power/pmic.h' +config SPL_DM_PMIC + bool "Enable Driver Model for PMIC drivers in SPL (UCLASS_PMIC)" + depends on SPL_DM + ---help--- + This config enables the driver-model PMIC support. + UCLASS_PMIC - designed to provide an I/O interface for PMIC devices. + For the multi-function PMIC devices, this can be used as parent I/O + device for each IC's interface. Then, each children uses its parent + for read/write. For detailed description, please refer to the files: + - 'drivers/power/pmic/pmic-uclass.c' + - 'include/power/pmic.h' + config PMIC_CHILDREN bool "Allow child devices for PMICs" depends on DM_PMIC diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile index 888dbb2857..e60eed8ec8 100644 --- a/drivers/power/pmic/Makefile +++ b/drivers/power/pmic/Makefile @@ -3,7 +3,7 @@ # Copyright (C) 2012 Samsung Electronics # Lukasz Majewski -obj-$(CONFIG_DM_PMIC) += pmic-uclass.o +obj-$(CONFIG_$(SPL_)DM_PMIC) += pmic-uclass.o obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o obj-$(CONFIG_DM_PMIC_MAX8998) += max8998.o diff --git a/include/power/pmic.h b/include/power/pmic.h index be9de6b4de..a228e9484f 100644 --- a/include/power/pmic.h +++ b/include/power/pmic.h @@ -84,7 +84,7 @@ struct pmic { }; #endif /* CONFIG_POWER */ -#ifdef CONFIG_DM_PMIC +#if CONFIG_IS_ENABLED(DM_PMIC) /** * U-Boot PMIC Framework * =====================