From patchwork Wed Jan 9 16:47:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 155086 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp917314jaa; Wed, 9 Jan 2019 08:51:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN7yfyulnjCdDcVY+RimsuS5afMO3a2kVdBaw9mZRy/rheYzMoGMrvxYvb635wCebDRLm8Fh X-Received: by 2002:a50:9106:: with SMTP id e6mr6344081eda.148.1547052661597; Wed, 09 Jan 2019 08:51:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547052661; cv=none; d=google.com; s=arc-20160816; b=Ebu66Ue4wkk3j8Du+V6cV9bqcQy1wVqypJ21jPvcCrePlhDJQCIo//BYpN89Xf4lJl NDHR3r+gYmV60flJU8IxiEpVDa43aT+GP5HuIxBN+GdXfSy7sBd/DsSiILcZCMGBGz2K B0mY4fzArg0f6gHpZ30uLpdqEH8mjrERw/3N/OLjpS7C+k+/JlQI6B0waYIGMrYpvcyY 8sOzLShXrrnsrjI0uPQ9ET4BPC5akH+UgrEvAzh0HtcQ4zI9O3pq+XM3aLO4q0o/kGIc X364Z9mtrOVzAZTC723YPvWxsCU43x9F3z0xsWM5x7lOJV4AxZp/IcpPCOBJJN6hETbI K+rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature; bh=daWq9xVXvOvStk4LUNjHMrfM8xtBtAhWN5S6Lsnps0U=; b=WixN5MKnzW7NhSfwhYh5AfaTa/eWu8Nf5urfgNkJfPdocGAiTI9aaSGuv4LJpX4LMk 8wusb9yMVpN7j6goDKaZmEI4wmRmsjqBuHUsO86QCJZ1ue6IglKiYMCas5eBCL2rn+DH 1WtUeN+fSto8vr6FXaiMqpOyDSewzVRb3xcxVbt0ixviTgaPlviEAXCTjm8iGvZMFUuU t1L4aYuiHkPLQDE+xqrh8RDgNslITpNgrNccjZksdR5jlgF6NRsg5RSlGjA9LxeQrC66 K+oR8ZZdrYBbbtZi5YG7URjPQBVyH8bM6EaUI55tdYouIGreNYralglBPHCQTE8BNmoS 1vTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bGaw77FW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id gr7-v6si627955ejb.241.2019.01.09.08.51.01; Wed, 09 Jan 2019 08:51:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bGaw77FW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 3093FC22009; Wed, 9 Jan 2019 16:50:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3921BC21FF4; Wed, 9 Jan 2019 16:48:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 838EBC22009; Wed, 9 Jan 2019 16:47:57 +0000 (UTC) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by lists.denx.de (Postfix) with ESMTPS id 1BCF0C21FC2 for ; Wed, 9 Jan 2019 16:47:53 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id y20so7840281edw.9 for ; Wed, 09 Jan 2019 08:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GdiSyuEjim5+vzDESRUhTEZSwbHbH+4ac/+7RxnoLhE=; b=bGaw77FW87eAFRLzaJ6g0gZTRKiBFjwE27u0ksIpN/VMxigoM8Ra+24h3eNtxZk6b9 /Pd5Jkk7OkrRClxXaMG2HUwd/I15Z0OXJDbW9kZ0Gb8ozznMintJxyNRwAQDwHnTp6wE zxUy/aM4nWGofvNZe0keIuMBvGWyPIDyI5Ol4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GdiSyuEjim5+vzDESRUhTEZSwbHbH+4ac/+7RxnoLhE=; b=OyvnUZ50geMiFRtbX3oe76V9eqdGjDg0tFccRdxx+ZaqKCg86CC1mQGsuTz3Aj7dM0 YhU/4HxxqL/GpXYY6s+qWrMsXMUOAeVxaxX9JZOd7eVwpJyG95DRen/iO8MLPDl4v5Mh tjNYstpJvedcgyxcYPJEE2A+P93VIkRy7gDt+3m5TqPH1XQLcLlM5Rao3kqwUPNpo/F5 if/KMnQ7/KVKiUD5weEFz6/UX8lcRzt9uB9QwVX5YWB36qOtYq4KhHXEQXGXxJ7vvZUq LJYylCZVpvfYUkLkqfPs35rXph9A0p0+oMQP52g3gmeGZReqfH7zLC/YTtw+jXDOCXmt gf9A== X-Gm-Message-State: AJcUukdtL5W39uEfIeoVvLuyOI/WBYVsP3tlydB/lJCWsi0NdcOTtKTJ 6K9SsrqKG/NZ9HBO5qoevxuGAoGtM9s= X-Received: by 2002:a17:906:1d01:: with SMTP id n1-v6mr5976465ejh.61.1547052472446; Wed, 09 Jan 2019 08:47:52 -0800 (PST) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id b14sm1081499edt.6.2019.01.09.08.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 08:47:51 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Wed, 9 Jan 2019 16:47:34 +0000 Message-Id: <20190109164734.22598-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190109164734.22598-1-bryan.odonoghue@linaro.org> References: <20190109164734.22598-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Cc: fabio.estevam@nxp.com Subject: [U-Boot] [PATCH v3 8/8] arm: imx7s-warp: Convert to DM PMIC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" This patch converts the warp7 and warp7_bl33 board ports over to using the DM PMIC model. Signed-off-by: Bryan O'Donoghue Reviewed-by: Peng Fan Cc: Peng Fan Cc: Fabio Estevam Cc: Stefano Babic --- board/warp7/warp7.c | 27 +++++++++++---------------- configs/warp7_bl33_defconfig | 6 ++++++ configs/warp7_defconfig | 6 ++++++ include/configs/warp7.h | 6 ------ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 19f0df4d09..6ebeb08e33 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -64,29 +64,24 @@ int board_early_init_f(void) return 0; } -#ifdef CONFIG_POWER -#define I2C_PMIC 0 -static struct pmic *pfuze; +#ifdef CONFIG_DM_PMIC int power_init_board(void) { - int ret; - unsigned int reg, rev_id; + struct udevice *dev; + int ret, dev_id, rev_id; - ret = power_pfuze3000_init(I2C_PMIC); - if (ret) + ret = pmic_get("pfuze3000", &dev); + if (ret == -ENODEV) + return 0; + if (ret != 0) return ret; - pfuze = pmic_get("PFUZE3000"); - ret = pmic_probe(pfuze); - if (ret) - return ret; - - pmic_reg_read(pfuze, PFUZE3000_DEVICEID, ®); - pmic_reg_read(pfuze, PFUZE3000_REVID, &rev_id); - printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", reg, rev_id); + dev_id = pmic_reg_read(dev, PFUZE3000_DEVICEID); + rev_id = pmic_reg_read(dev, PFUZE3000_REVID); + printf("PMIC: PFUZE3000 DEV_ID=0x%x REV_ID=0x%x\n", dev_id, rev_id); /* disable Low Power Mode during standby mode */ - pmic_reg_write(pfuze, PFUZE3000_LDOGCTL, 0x1); + pmic_clrsetbits(dev, PFUZE3000_LDOGCTL, 0, 1); return 0; } diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig index 2e80011cbc..7b40bfbd6d 100644 --- a/configs/warp7_bl33_defconfig +++ b/configs/warp7_bl33_defconfig @@ -45,3 +45,9 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_PFUZE100=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_PFUZE100=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 9f7dc73a11..d1c8e403a7 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -58,3 +58,9 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_IMX7=y CONFIG_DM_GPIO=y CONFIG_DM_I2C=y +CONFIG_DM_PMIC=y +CONFIG_DM_PMIC_PFUZE100=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_PFUZE100=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 41eb8d7e1d..043f2861b6 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -129,12 +129,6 @@ #define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000 -/* PMIC */ -#define CONFIG_POWER -#define CONFIG_POWER_I2C -#define CONFIG_POWER_PFUZE3000 -#define CONFIG_POWER_PFUZE3000_I2C_ADDR 0x08 - /* environment organization */ #define CONFIG_ENV_SIZE SZ_8K