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 B7577C433F5 for ; Fri, 8 Oct 2021 05:18:59 +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 E4DF860FC2 for ; Fri, 8 Oct 2021 05:18:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E4DF860FC2 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 CC72C83572; Fri, 8 Oct 2021 07:18:17 +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="gOyqh0l8"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="HgIjDaMs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 15C058358B; Fri, 8 Oct 2021 07:18:05 +0200 (CEST) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) (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 1190B83375 for ; Fri, 8 Oct 2021 07:17:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=samuel@sholland.org Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id B2CD2580D20; Fri, 8 Oct 2021 01:17:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 08 Oct 2021 01:17:30 -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=b6k+1UcxxhJliCRj6fbpySQjBJ xBV2erdq4KMt0u7AY=; b=gOyqh0l8C3LX/kTEZBj14V7cZlnQVwbRbQvF7HkFSK XrGexvIEnp0p17CGpb5PxRxhO3voDStxHa0EDDHjOyHT9ZUl0by+7ybFfJYViu4o kSzoUR9sPc/3ujPoYeDPcXMNSfqBpY8xb7wVBBdFFJkWUpTLBa3BGPadsm5VGEsD pck4BinNpT/T8opvBbS9P5axGGB9w0EaHav+qOsIZS1U9MC8c9Kk99I3NENvs5wn FWSxKgvRRBvvMmLuVzSRqoYl9VdIPebf7XMWN76FJjSi7rAQGX0tTyr42kZHo5Pp NojXuz7wOpJ5wxbEcFQpXyDB0TAoZvmr7ApgCvTlJYCw== 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=fm1; bh=b6k+1UcxxhJliCRj6 fbpySQjBJxBV2erdq4KMt0u7AY=; b=HgIjDaMsFmO8CutCj7EiA26SjLld6rHXM p5jXE7qq83Hpgm4nG7gMBSSIDGmZ+dG1EHjGdjtY6eariUwTqomgryjdKWzH21MA SfiLIkRAoWou4WumuWq6zvopEJl7AQzKE0AIdh7Pgy8negRiChmAk7Z6TnCmo5CD zsRKUiooLAIM/VhBd2GLTDM4li+Gavoz7KOo441sB5c5/vmKdu5nfgpK5ILpLUYY XCN08KsK3AxDRhXDbpZri1Mk8S7So6zcLepDeqCdsffAuFVOVwvAhbyLED42KP/Y KKaCOxt61/+huw/dCLhLNPAPe87f9s6LyRALub4C1k1EK+ScsueoA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelledgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeeiteekhfehuddugfeltddufeejjeefgeevheekueffhffhjeekheeiffdt vedtveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Oct 2021 01:17:26 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Jaehoon Chung , Heiko Schocher , 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 v2 00/12] sunxi: Migrate to DM_I2C Date: Fri, 8 Oct 2021 00:17:13 -0500 Message-Id: <20211008051725.29401-1-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 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. 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. 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 -- 2.32.0