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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 3D1E0C4338F for ; Sat, 21 Aug 2021 23:05:42 +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 25ACD61268 for ; Sat, 21 Aug 2021 23:05:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 25ACD61268 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org 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 40F7582DD7; Sun, 22 Aug 2021 01:05:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="PeiDq8EC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZhhEpKLc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 94286807FE; Sun, 22 Aug 2021 01:05:35 +0200 (CEST) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 28ADA82C7F for ; Sun, 22 Aug 2021 01:05:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 144B5580BF9; Sat, 21 Aug 2021 19:05:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 21 Aug 2021 19:05:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=IfVFJOl+jJm0+BSkXnRPZgd1Op Ej78Umwn/dLKIGYT0=; b=PeiDq8EC+i4bl13F6W0sRQY2Re9hEOXHaQJ6jcZYMN 8m00rafdXtkLe0q+FvWPC/mJVBt8uI2Kds5dUPmlE/eysnFQcpxnnY/scc8Zza9m j6TFz5xbO82jrESaKBk2J+NNfrba1HygyHH+KKBtI76veIwBuGw+W7w8sIstb6k6 qwQr9cvd3qrS+zeGUqP+wPYcdJKy2/KW0EjK5519E4lq3Q7EjyHdkzN5JxlsRXVM S0UmZEKLPATOyegnxYgIiEiSthi9SwMO9A7CYn0xdFRy7o10X54nyf8JbiVpkkmC loS3ojHOsWQsineDzAQog8l4v+XEEcaKDqQsvh00DTsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=IfVFJOl+jJm0+BSkX nRPZgd1OpEj78Umwn/dLKIGYT0=; b=ZhhEpKLc9O9XkB3o2hiCo91XOLlGfiVla j7LEdpuTw8Ro7yWiT9vPgcAKNOTWfCX55pzOlxE9YCuYppod00ks4IMA9ifZ2YDx de20Xpv41CcGbdTFM9iKOtkTwzY2jqNzkd/9f4qb45aHXwp1x7OaRzYcyD8JSB+i Q+ye+VnnBo/KDVeekFUT27fUS6rVbtESEC7fMfCY92BtOOmWgc01sN6Ufv2D+l3U cirvKFlo862BRS7HtQ0Eb79kD2AFe3c/wrJTbgkLXsLICkVMl1KDD+9CUhudOLYm jmGSS+Kp/6BI74npXADfp/+zKmvDDbzEamzJAkWJZY1m+X9dzCKJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtvddgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeethffhudfhueejhfeuffeihfefveetleekgeevjeeuleevteeljeeiudfh udetgeenucffohhmrghinhepohiilhgrsghsrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhlrghnugdr ohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Aug 2021 19:05:21 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Heiko Schocher , Jaehoon Chung , Samuel Holland , Anatolij Gustschin , Arnaud Ferraris , Bharat Gooty , Igor Opaniuk , Jernej Skrabec , Minkyu Kang , Rayagonda Kokatanur , Simon Glass , Stephan Gerhold , Tim Harvey , Tom Rini Subject: [PATCH 00/11] sunxi: Migrate to DM_I2C Date: Sat, 21 Aug 2021 18:05:08 -0500 Message-Id: <20210821230520.10051-1-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This series does the initial work to migrate sunxi boards to DM_I2C. First it takes care of the PMIC: - Patches 1-2 add DM_I2C versions of two drivers. - Patches 3-4 allow us to use DM_PMIC without DM_SPL. - Patch 5 then adds a DM_PMIC driver. - Patches 6-9 migrate the "pmic_bus" functions to use that DM_PMIC driver when possible. Then it takes care of the LCD panels: - Patch 10 converts those drivers to use DM_I2C. Finally, patch 11 switches all sunxi boards over to DM_I2C. 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. This series is on top of https://patchwork.ozlabs.org/project/uboot/list/?series=258648 which is on top of https://patchwork.ozlabs.org/project/uboot/list/?series=258482 I have build-tested each commit on all sunxi boards, and boot-tested the series on Pine H64 (H6) and Orange Pi Zero2 (H616). Samuel Holland (11): i2c: Add a DM_I2C wrapper for the sun6i_p2wi controller i2c: Add a DM_I2C wrapper for the sun8i_rsb controller power: pmic: Consistently depend on DM_PMIC power: pmic: Make the uclass optional in SPL power: pmic: Add a driver for X-Powers AXP PMICs sunxi: Select SUN8I_RSB more carefully sunxi: pmic_bus: Fix Kconfig dependencies 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 | 51 +++---------- arch/arm/mach-sunxi/pmic_bus.c | 109 ++++++++++++++-------------- 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 | 66 +++++++++++++++++ drivers/i2c/sun8i_rsb.c | 86 ++++++++++++++++++++++ drivers/power/pmic/Kconfig | 72 +++++++++--------- drivers/power/pmic/Makefile | 3 +- drivers/power/pmic/axp.c | 49 +++++++++++++ drivers/video/anx9804.c | 107 +++++++++++++-------------- drivers/video/anx9804.h | 5 +- drivers/video/sunxi/sunxi_display.c | 55 +++++++++----- include/axp_pmic.h | 12 +++ include/configs/sunxi-common.h | 17 ----- 18 files changed, 435 insertions(+), 269 deletions(-) create mode 100644 drivers/i2c/sun6i_p2wi.c create mode 100644 drivers/i2c/sun8i_rsb.c create mode 100644 drivers/power/pmic/axp.c -- 2.31.1