Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 09BCDC0015E for ; Sun, 16 Jul 2023 00:36:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A83086237; Sun, 16 Jul 2023 02:36:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mx5.nisiq.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 1D6188623A; Sun, 16 Jul 2023 02:36:38 +0200 (CEST) Received: from isp-msaf2.u-netsurf.ne.jp (isp-msaf2.u-netsurf.ne.jp [202.233.11.27]) by phobos.denx.de (Postfix) with ESMTP id 47EBA8622E for ; Sun, 16 Jul 2023 02:36:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=mx5.nisiq.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=uaa@mx5.nisiq.net Received: from framboise.uaa.org.uk.uaa.org.uk (unknown [116.65.140.46]) by isp-msaf2.u-netsurf.ne.jp (Postfix) with ESMTPA id D7F851BF22; Sun, 16 Jul 2023 09:36:33 +0900 (JST) Date: Sun, 16 Jul 2023 09:36:32 +0900 Message-ID: <871qh8d75b.wl-uaa@mx5.nisiq.net> From: SASANO Takayoshi To: Simon Glass Cc: uaa@mx5.nisiq.net, u-boot@lists.denx.de, SASANO Takayoshi Subject: Re: [PATCH] add axp313a support In-Reply-To: References: <87r0p8g7gh.wl-uaa@mx5.nisiq.net> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-unknown-openbsd) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Hello, On Sun, 16 Jul 2023 08:40:36 +0900, Simon Glass wrote: > > Hi, > > On Sat, 15 Jul 2023 at 16:01, SASANO Takayoshi wrote: > > > > > > Here is the diff of AXP313A PMIC driver. > > (No board configuration is included) > > > > Signed-off-by: SASANO Takayoshi > > --- > > > > arch/arm/mach-sunxi/pmic_bus.c | 4 +- > > board/sunxi/board.c | 9 +- > > drivers/power/Kconfig | 16 ++- > > drivers/power/Makefile | 1 + > > drivers/power/axp313a.c | 171 +++++++++++++++++++++++++++++++++ > > drivers/power/pmic/axp.c | 1 + > > include/axp313a.h | 31 ++++++ > > include/axp_pmic.h | 2 + > > 8 files changed, 226 insertions(+), 9 deletions(-) > > create mode 100644 drivers/power/axp313a.c > > create mode 100644 include/axp313a.h > > > > Please can you write this to use driver model? There is a pmic uclass. This is controller-specific driver for power/pmic/axp.c. axp.c (axp_pmic) belongs to UCLASS_PMIC. -- U_BOOT_DRIVER(axp_pmic) = { .name = "axp_pmic", .id = UCLASS_PMIC, .of_match = axp_pmic_ids, .bind = axp_pmic_bind, .ops = &axp_pmic_ops, }; -- > > diff --git a/board/sunxi/board.c b/board/sunxi/board.c > > index f321cd58a6..9b0069cd52 100644 > > --- a/board/sunxi/board.c > > +++ b/board/sunxi/board.c > > @@ -584,6 +584,7 @@ void sunxi_board_init(void) > > > > #if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || \ > > defined CONFIG_AXP221_POWER || defined CONFIG_AXP305_POWER || \ > > + defined CONFIG_AXP313A_POWER || \ > > defined CONFIG_AXP809_POWER || defined CONFIG_AXP818_POWER > > power_failed = axp_init(); > > > > @@ -605,7 +606,8 @@ void sunxi_board_init(void) > > power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); > > power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); > > #endif > > -#if !defined(CONFIG_AXP209_POWER) && !defined(CONFIG_AXP818_POWER) > > +#if !defined(CONFIG_AXP209_POWER) && !defined(CONFIG_AXP818_POWER) && \ > > + !defined(CONFIG_AXP313A_POWER) > > power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT); > > #endif > > #if defined CONFIG_AXP221_POWER || defined CONFIG_AXP809_POWER || \ > > @@ -617,10 +619,11 @@ void sunxi_board_init(void) > > defined CONFIG_AXP818_POWER > > power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT); > > #endif > > -#if !defined(CONFIG_AXP305_POWER) > > +#if !defined(CONFIG_AXP305_POWER) && !defined(CONFIG_AXP313A_POWER) > > power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT); > > #endif > > -#if !defined(CONFIG_AXP152_POWER) && !defined(CONFIG_AXP305_POWER) > > +#if !defined(CONFIG_AXP152_POWER) && !defined(CONFIG_AXP305_POWER) && \ > > + !defined(CONFIG_AXP313A_POWER) > > power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT); > > #endif > > OMG that is a mess. It looks like sunxi needs some conversion. I think so. We have to rewrite what regulator output (dcdcX, aldoX, etc..) is supported (not by controller name), but is it necessary before adding AXP313A code? Best regards, -- SASANO Takayoshi (JG1UAA)