From patchwork Thu Jul 21 13:20:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 1659029 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=fMOEGFiD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LpYB358x5z9s1l for ; Thu, 21 Jul 2022 23:21:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3624384117; Thu, 21 Jul 2022 15:21:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com 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=collabora.com header.i=@collabora.com header.b="fMOEGFiD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C712184109; Thu, 21 Jul 2022 15:21:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (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 67D6E84100 for ; Thu, 21 Jul 2022 15:20:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=martyn.welch@collabora.com Received: from pan.home (unknown [IPv6:2a00:23c6:c30a:1501:427e:206e:3eb7:267d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: martyn) by madras.collabora.co.uk (Postfix) with ESMTPSA id D692C6601AA5; Thu, 21 Jul 2022 14:20:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1658409654; bh=DFu+Rr/EyVfkB3s54d3+1IKDAlhW/zZA5eC9T4W8+vA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fMOEGFiD3m6qcbCFY6QCTEnboawKHSrwLPdga2Q1VpxGUctycoNLvvqi6NuMf3/lG bwE4QU1pFSh/Khv5ry5qQkN3Vl8jOFmcSBA7BgUZGGrD5Y6AKbr1SnV6OTVNJn1mX7 rlIMoDxMQyGmnx+hs8Okn+lrduPBJbX2BsEN1q1ksVvD5dnoWactSVrM3k6/7RrjXw Arc9QBq9+vKiwBhbssLT5T6N3YMyZbDECrPrXClGDuIinKmF57Yf7kyMN8tSIWpwHS vE2309m4mi5IeJ/sWr62qrz5mf80OvW5mM4xsyRqKr0r4JOoNI7dozDpwoTBTwhR+R pEEjPbyRB9BiA== From: Martyn Welch To: Jaehoon Chung Cc: Martyn Welch , u-boot@lists.denx.de Subject: [PATCH 4/5] drivers: power: pmic: Add legacy support for rn5t567 PMIC Date: Thu, 21 Jul 2022 14:20:39 +0100 Message-Id: <20220721132041.2640418-4-martyn.welch@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220721132041.2640418-1-martyn.welch@collabora.com> References: <20220721132041.2640418-1-martyn.welch@collabora.com> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean The support added later in this series tweaks the PMIC voltages in the SPL, which doesn't support DM. Add legacy support to the rn5t567 PMIC driver to allow that to happen. Signed-off-by: Martyn Welch --- drivers/power/pmic/Makefile | 1 + drivers/power/pmic/pmic_rn5t567.c | 31 +++++++++++++++++++++++++++++++ include/power/rn5t567_pmic.h | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 drivers/power/pmic/pmic_rn5t567.c diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile index f73b326255..37c7584126 100644 --- a/drivers/power/pmic/Makefile +++ b/drivers/power/pmic/Makefile @@ -42,5 +42,6 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o obj-$(CONFIG_POWER_HI6553) += pmic_hi6553.o obj-$(CONFIG_POWER_MC34VR500) += pmic_mc34vr500.o +obj-$(CONFIG_POWER_RN5T567) += pmic_rn5t567.o obj-$(CONFIG_PMIC_TPS65941) += tps65941.o obj-$(CONFIG_PMIC_TPS65219) += tps65219.o diff --git a/drivers/power/pmic/pmic_rn5t567.c b/drivers/power/pmic/pmic_rn5t567.c new file mode 100644 index 0000000000..37156ef00c --- /dev/null +++ b/drivers/power/pmic/pmic_rn5t567.c @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019 NXP + */ + +#include +#include +#include +#include +#include + +static const char rn5t567_name[] = "RN5T567"; + +int power_rn5t567_init(unsigned char bus, unsigned char addr) +{ + struct pmic *p = pmic_alloc(); + + if (!p) { + printf("%s: POWER allocation error!\n", __func__); + return -ENOMEM; + } + + p->name = rn5t567_name; + p->interface = PMIC_I2C; + p->number_of_regs = RN5T567_NUM_OF_REGS; + p->hw.i2c.addr = addr; + p->hw.i2c.tx_num = 1; + p->bus = bus; + + return 0; +} diff --git a/include/power/rn5t567_pmic.h b/include/power/rn5t567_pmic.h index 93bc7cba5a..241847ea77 100644 --- a/include/power/rn5t567_pmic.h +++ b/include/power/rn5t567_pmic.h @@ -109,4 +109,6 @@ enum { RN5T567_NUM_OF_REGS = 0xBF, }; +int power_rn5t567_init(unsigned char bus, unsigned char addr); + #endif