From patchwork Wed Jan 9 16:42:33 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: 155080 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp913730jaa; Wed, 9 Jan 2019 08:47:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FUEDTohQlGzHWWlU9pFw+CSEwpKJIQYc5YcQ+ES1b1sopeoRyH56H1SleG7wiCrC58mx9 X-Received: by 2002:a17:906:d0c6:: with SMTP id bq6-v6mr5592319ejb.99.1547052432230; Wed, 09 Jan 2019 08:47:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547052432; cv=none; d=google.com; s=arc-20160816; b=rVSkM92WUqleQkqN+eIf9ZEkAGIRNvFDxmRhsb5xKmSPdbkgBtDTwAmICqL694kXzh KlHZauck82p2yGp0fAbgIjo3LhpDbjeUU404qxOrYK5FobCBoDCy6+j5tAsh7xYxuZGK fsMgH9Rel5yua1Kwha/L9eZd4Q5ZIeXauGG5lxl8uKuR+SNq8JwvpUY6idAOTIT5jH5h e6JOUogal7aM4H7ltOSbQ8KN78hBRECurou02uuuQG2RIzoQ/elhdFmKVX9k2RKBWKxZ ZhF1B/8CaYACEmXdQlliTOyu5BzLwFzVM2OSw7rbmX1RMG/sV7L5hH0amSpQOmzlT6MU OfOg== 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=pPH+E37LUDtuDYrY5y5B239RVTPk5jMipqNsKwjcbzxGZkv913NsxMRBay0cgKLX6O T+tW6SXV4q0htKGXDkJItnsNImbiMBEuaLgV0mXBwKo4FfpRCPXzDp2XkWzjKTtCwMQx XbkiDWJkkEV1RXAIp8LhvdfwgE5OhYfPOyM8inT28vxUZo8PI83AiYzDcl8OrsMEhgqf l+VIJ4JHWdNpq0T/0QdYeOh9F4cI2i5uzcKX1KdkLEWKYFSDMpu2yWIFYeGXgcMzKFap vUU20QKLd4YJaSr2ZlvyPDz3AK+C2jJytfIs2DOxQfQLhSlCOyVh5Hd9eN8jVeZyEjYm Wl4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=My+iRaDT; 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 u9-v6si1521412ejh.47.2019.01.09.08.47.11; Wed, 09 Jan 2019 08:47:12 -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=My+iRaDT; 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 D0209C21FFB; Wed, 9 Jan 2019 16:44:55 +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 093A8C22016; Wed, 9 Jan 2019 16:43:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DA41BC21FA3; Wed, 9 Jan 2019 16:42:51 +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 2F4DDC21FC3 for ; Wed, 9 Jan 2019 16:42:48 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id f9so7821131eds.10 for ; Wed, 09 Jan 2019 08:42:48 -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=My+iRaDTSrkozGeZmz81UlM7FTUjeBfXSyvIMF0NIMyjwhiORxGXfIKWrq9GYbhHHr 3s3JxTEPed8W8TryoRP05/W8GOayd/p9TVL+ZstMbzyc1WUontXP/47irsioRzTJ0+R1 F5hnW1q58vEl4ItjpCsMUlss2FHnfompopa3Y= 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=r5OagtKnS7CBYi9T3QMOZCokh/pX+fNeJ17MiGmUQIe+SlYluTMIkr2hdeO7TiTeGL ndsERvUnIOjgF00t78NmCbilXE15Yrwf55nqibDYcGeiAQ7myYhJOkELMX8BWCaCDEq4 rRmo6O1QKRhtv4uMVlTXB6BU3JvaiRuEnYw4P+TMEBMSeYjC1C35tFh44gZHs5uI5Cg2 gUetRuK7EVHHfVzR33HNklAMljyX18pyixzx1udxSDWd30nbRaZ5/32aMhifBXbP2V9L U6/CRWNrMP6LA3AZppRjRBEqp1sLqEMnI/ebh3aHN/jDQ4Bz46533gxW5cJUEd1uspmL ab2g== X-Gm-Message-State: AJcUukc5BsW4rqG09pPUoFRIHgKisnhBrZsHXd5WOnHJDbDIsKrEzUk6 Fm6PvPJtttBoycnQZ5pdrnk5eCXTcI0= X-Received: by 2002:a17:906:a384:: with SMTP id k4-v6mr5911697ejz.243.1547052167465; Wed, 09 Jan 2019 08:42:47 -0800 (PST) Received: from event-horizon.net ([80.111.179.123]) by smtp.gmail.com with ESMTPSA id i24sm1081665edq.0.2019.01.09.08.42.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 08:42:46 -0800 (PST) From: Bryan O'Donoghue To: u-boot@lists.denx.de Date: Wed, 9 Jan 2019 16:42:33 +0000 Message-Id: <20190109164233.22297-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190109164233.22297-1-bryan.odonoghue@linaro.org> References: <20190109164233.22297-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Cc: fabio.estevam@nxp.com Subject: [U-Boot] [PATCH v2 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