From patchwork Fri Jan 18 17:40:14 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: 156034 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3525575jaa; Fri, 18 Jan 2019 09:45:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN7TXIKj31YK6tEcd1qUViBG+PMHGZHijpIZKQ9jI1C86hu4BGSdtPMM5a5/zCzSMpr3nvBi X-Received: by 2002:a17:906:6085:: with SMTP id t5-v6mr15566096ejj.47.1547833523925; Fri, 18 Jan 2019 09:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547833523; cv=none; d=google.com; s=arc-20160816; b=lDsPv/CK1x2D0/WlAJjoEtbg9v0GihaJS7ym5jQMj5n/rHrBfdnjl118Vra/5cscuv RiG/X955lWNmfbgbth4ovT0NtQIZ60bv15Vje8tgYMSp1Ow6WPeKllRCg3KGQrwgTz2k QbbPI9iU3uj6haDYhJuRq56VRp1O1oWwoHzjZXF4vaNwnd7di7h/oRwiSsl2n93TcQY+ sMdncAu3EeaYrN4PegGQ5xDobHDF0i8plJgiw7qBozchUmgssOHQ2LR+FiPl0NGGwlf+ mk3Q1pxHddpzvAd6rp66XxCx1ThG2VqBW5KR5cPwj6WqRPhhgZgipoy20Q+0UbkcDwOC MiXg== 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=a6ZHKEbSoBl3+9ADyeWuoxp7secjjEInYehv7dnX9hY+zcc6wlDCQei/ppUNQ1BCFy pIWReG0A2vIcbxYQeXnTq6REwVwira053frFyGQ0Et5IQF+iCxV7D014yhbQn+Y6FFER AK/moTUqLDLki3KAOkRKpE7c8nMCMkgbeOY8pTLpcof8Jpr/k0Gnh3fEBoj4c+zmzGpx 1MjxDDQlzXF9icjTU3mEa06H1PbGuB6y/MSCEZiDLD7bCmtyY1MxzbwlJuMjJF6AeJzp nVjsgunQwgI8VA4DZv1Y8Nu9MOHT/08QwQWmUcwgXxC+c4m3uAYYqE5rpoLRcYF0GRCv mzQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=bRec+KNB; 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 q19-v6si1887329ejk.294.2019.01.18.09.45.23; Fri, 18 Jan 2019 09:45:23 -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=bRec+KNB; 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 777BEC2213D; Fri, 18 Jan 2019 17:43:02 +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 A0419C22135; Fri, 18 Jan 2019 17:40:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E82CBC21EA1; Fri, 18 Jan 2019 17:40:31 +0000 (UTC) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by lists.denx.de (Postfix) with ESMTPS id F1EF4C22129 for ; Fri, 18 Jan 2019 17:40:27 +0000 (UTC) Received: by mail-ed1-f66.google.com with SMTP id y20so11746587edw.9 for ; Fri, 18 Jan 2019 09:40:27 -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=bRec+KNBFI1L34J6hTNWCNUfgkIpFu/wzFPOY5RDcdB+ihLLtITf9RI6vBr23w6Xps +SZI1WKZXdvf7Kq09gXSlvVze3nGw57k5URAjq2w3YJiR8vdS2B5EDpaHRDvoTUnfd7i hVxSPwinDJ89PSkd9tO24etC115VvFInLxASE= 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=aojYNwEyO7c3pX8UpDjtmPb4qDCvBN2nAnl97ZX8e2ESaKgpU3+UzXPlShcZrkgFJg V6V8Tka57a+7//TmvIfGphfA5GM9LIMhMW8YJRiASelmRdyuoBJT1l0XsuenoQfpadvd 4YmRbgzWIjEcFVq6DD/9Uz2NUGdhIckG4xMacT6Y2X8cyKZxKc8RRPaNiEzbUfmE5ROT V9u/snxOphoLidhikfb8TnqU1z6Sna2JYw7R+uM3uG7gq8eqNfK5ui0Ne0W79a3/+M+q SPgvyVZzaVx99R7nR0qLWkMlom0Dn15LTswJAbR9vPsM7aKXTaeIUJOWe0Qd9cDibSbl Co8Q== X-Gm-Message-State: AJcUuketgkmODvHHGokKg1IwpW1hWGPZwtaISClODigVW08oqSoXHjlb +Jc/bK8op812YkhD7vHNaIIOt2Fjmt8= X-Received: by 2002:a50:8fe4:: with SMTP id y91mr16488899edy.231.1547833227345; Fri, 18 Jan 2019 09:40:27 -0800 (PST) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id l20-v6sm4026339eja.18.2019.01.18.09.40.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 09:40:26 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Fri, 18 Jan 2019 17:40:14 +0000 Message-Id: <20190118174014.17860-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118174014.17860-1-bryan.odonoghue@linaro.org> References: <20190118174014.17860-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Cc: fabio.estevam@nxp.com Subject: [U-Boot] [RESEND] [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