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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F185C433EF for ; Tue, 12 Oct 2021 11:24:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id CE34460F11 for ; Tue, 12 Oct 2021 11:24:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CE34460F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D1ACC83721; Tue, 12 Oct 2021 13:24:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com 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 7F058832E6; Tue, 12 Oct 2021 13:24:36 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id CB7E4832E6 for ; Tue, 12 Oct 2021 13:24:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 012A41FB; Tue, 12 Oct 2021 04:24:32 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E38423F694; Tue, 12 Oct 2021 04:24:29 -0700 (PDT) Date: Tue, 12 Oct 2021 12:24:27 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , Jaehoon Chung , Heiko Schocher , Anatolij Gustschin , Arnaud Ferraris , Bharat Gooty , Igor Opaniuk , Jernej Skrabec , Minkyu Kang , Rayagonda Kokatanur , Simon Glass , Stephan Gerhold , Tim Harvey , Tom Rini Subject: Re: [PATCH v2 00/12] sunxi: Migrate to DM_I2C Message-ID: <20211012122427.474dab8a@donnerap.cambridge.arm.com> In-Reply-To: <20211008051725.29401-1-samuel@sholland.org> References: <20211008051725.29401-1-samuel@sholland.org> Organization: ARM X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.103.2 at phobos.denx.de X-Virus-Status: Clean On Fri, 8 Oct 2021 00:17:13 -0500 Samuel Holland wrote: Hi Samuel, > This series does the initial work to migrate sunxi boards to DM_I2C. > Version 1 of this series bitrotted quite a bit, so there is some > reorganization in version 2. > > First it takes care of the PMIC: > - Patches 1-2 clean up the PMIC Kconfig, though they are not strictly > necessary after 7abf178b, and are independent from the other patches. > - Patch 3 then adds a DM_PMIC driver. > - Patches 4-6 prepare to move the P2WI/RSB bus drivers to drivers/i2c. > - Patches 7-8 move and add DM_I2C versions of those two drivers. > - Patches 9-10 migrate the "pmic_bus" functions to use the DM_I2C bus > and DM_PMIC driver when possible. > Then it takes care of the LCD panels: > - Patch 11 converts those drivers to use DM_I2C. > Finally, patch 12 switches all sunxi boards over to DM_I2C. > > I have build-tested each commit on all sunxi boards. I am fine with this, and this removes the deprecation warnings for many older boards, so I applied it to sunxi/master and will send a PR for this. This looks like it has the potential to break boards, but I guess we will never find out without applying it and waiting for bug reports. Thanks! Andre > > There is some remaining work to clean up uses of pmic_bus in U-Boot > proper and replace them with DM_PMIC functions: > - drivers/gpio/axp_gpio.c - I have a series for this. > - do_poweroff() in drivers/gpio/axp???.c - I have a series for this. > - axp_get_sid() in drivers/power/axp221.c - Not sure what to do here. > - axp_set_eldo() in drivers/video/sunxi/sunxi_display.c - This will > need a DM_REGULATOR driver. > > Changes in v2: > - Rebase to pick up 7abf178b ("power: Tidy up #undef of CONFIG_DM_PMIC") > - Rebase to pick up 7abf178b ("power: Tidy up #undef of CONFIG_DM_PMIC") > - Replace axp_pmic_bind() with `.bind = dm_scan_fdt_dev` > - New patch to account for I2C Kconfig changes > - Renamed Kconfig symbol to SYS_I2C_SUN6I_P2WI > - Moved entire P2WI driver source to drivers/i2c > - Renamed Kconfig symbol to SYS_I2C_SUN8I_RSB > - Moved entire RSB driver source to drivers/i2c > - Update IS_ENABLEDs in pmic_bus.c to match chages to previous patches > > Samuel Holland (12): > power: pmic: Consistently depend on DM_PMIC > power: pmic: Consistently depend on SPL_DM_PMIC > power: pmic: Add a driver for X-Powers AXP PMICs > sunxi: Only initialize legacy I2C when enabled > sunxi: Select SUN8I_RSB more carefully > sunxi: pmic_bus: Fix Kconfig dependencies > i2c: Add a DM_I2C driver for the sun6i P2WI controller > i2c: Add a DM_I2C driver for the sun8i RSB controller > sunxi: pmic_bus: Clean up preprocessor conditions > sunxi: pmic_bus: Use the DM PMIC interface when possible > sunxi: video: Convert panel I2C to use DM_I2C > sunxi: Enable DM_I2C for all sunxi boards > > arch/arm/Kconfig | 1 + > arch/arm/mach-sunxi/Kconfig | 59 ++---- > arch/arm/mach-sunxi/Makefile | 2 - > arch/arm/mach-sunxi/board.c | 2 +- > arch/arm/mach-sunxi/p2wi.c | 117 ------------ > arch/arm/mach-sunxi/pmic_bus.c | 109 +++++------ > arch/arm/mach-sunxi/rsb.c | 175 ----------------- > board/sunxi/board.c | 44 +---- > configs/Colombus_defconfig | 6 - > configs/UTOO_P66_defconfig | 3 - > drivers/i2c/Kconfig | 16 ++ > drivers/i2c/Makefile | 2 + > drivers/i2c/sun6i_p2wi.c | 220 ++++++++++++++++++++++ > drivers/i2c/sun8i_rsb.c | 281 ++++++++++++++++++++++++++++ > drivers/power/pmic/Kconfig | 69 ++++--- > drivers/power/pmic/Makefile | 1 + > drivers/power/pmic/axp.c | 38 ++++ > drivers/video/anx9804.c | 103 +++++----- > drivers/video/anx9804.h | 5 +- > drivers/video/sunxi/sunxi_display.c | 55 ++++-- > include/axp_pmic.h | 12 ++ > include/configs/sunxi-common.h | 17 -- > 22 files changed, 773 insertions(+), 564 deletions(-) > delete mode 100644 arch/arm/mach-sunxi/p2wi.c > delete mode 100644 arch/arm/mach-sunxi/rsb.c > create mode 100644 drivers/i2c/sun6i_p2wi.c > create mode 100644 drivers/i2c/sun8i_rsb.c > create mode 100644 drivers/power/pmic/axp.c >