From patchwork Wed Mar 1 12:52:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olliver Schinagl X-Patchwork-Id: 734220 X-Patchwork-Delegate: jh80.chung@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vYFm83LpMz9s7j for ; Wed, 1 Mar 2017 23:55:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=schinagl.nl header.i=@schinagl.nl header.b="DGCuWrOm"; dkim-atps=neutral Received: by lists.denx.de (Postfix, from userid 105) id 392DCC21C9D; Wed, 1 Mar 2017 12:53:40 +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=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 5C24BC21C8A; Wed, 1 Mar 2017 12:52:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B98F9C21C3A; Wed, 1 Mar 2017 12:52:31 +0000 (UTC) Received: from 7of9.schinagl.nl (7of9.schinagl.nl [62.251.20.244]) by lists.denx.de (Postfix) with ESMTPS id 4C244C21C3F for ; Wed, 1 Mar 2017 12:52:31 +0000 (UTC) Received: from um-mbp-306.cloud.ultimaker.com (static-98-101-100-159.thenetworkfactory.nl [159.100.101.98]) by 7of9.schinagl.nl (Postfix) with ESMTPA id 568999D614; Wed, 1 Mar 2017 13:52:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=schinagl.nl; s=7of9; t=1488372750; bh=Z+1DHenxqnx5CFlPidYygNv2FZOhRw1kn3YGT3adD1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DGCuWrOmYOcMz6L+71iZiOhPQ1AV6GQlR/tf7THIXUT7pIs1DwYwuqkJxbT9YtT/U nkEH6Fre9nDVKk3VjjXtOeNqzHerGXeQ76HGBxTVPMKGaUudybsuo2huaF1QfzyP6m N1LBSriOioaT8g9D2EiEsn5OxRLfP1LpdmZRkKZo= From: Olliver Schinagl To: Hans de Goede , Iain Paton , Jaehoon Chung , Chen-Yu Tsai , Olliver Schinagl , Alexander Graf Date: Wed, 1 Mar 2017 13:52:20 +0100 Message-Id: <20170301125224.25994-5-oliver@schinagl.nl> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170301125224.25994-1-oliver@schinagl.nl> References: <20170301125224.25994-1-oliver@schinagl.nl> Cc: dev@linux-sunxi.org, u-boot@lists.denx.de, Maxime Ripard , Olliver Schinagl Subject: [U-Boot] [PATCH 4/8] power: axp209: Define the chip version mask 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Use a define for the chip version mask on the axp209. Signed-off-by: Olliver Schinagl --- drivers/power/axp209.c | 5 +---- include/axp209.h | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/power/axp209.c b/drivers/power/axp209.c index 731b75e50a..d496f675a1 100644 --- a/drivers/power/axp209.c +++ b/drivers/power/axp209.c @@ -154,10 +154,7 @@ int axp_init(void) if (rc) return rc; - /* Low 4 bits is chip version */ - ver &= 0x0f; - - if (ver != 0x1) + if ((ver & AXP209_CHIP_VERSION_MASK) != 0x1) return -1; /* Mask all interrupts */ diff --git a/include/axp209.h b/include/axp209.h index 7803300328..51d2e88dd2 100644 --- a/include/axp209.h +++ b/include/axp209.h @@ -26,6 +26,8 @@ enum axp209_reg { #define AXP209_POWER_STATUS_ON_BY_DC BIT(0) #define AXP209_POWER_STATUS_VBUS_USABLE BIT(4) +#define AXP209_CHIP_VERSION_MASK 0x0f + #define AXP209_OUTPUT_CTRL_EXTEN BIT(0) #define AXP209_OUTPUT_CTRL_DCDC3 BIT(1) #define AXP209_OUTPUT_CTRL_LDO2 BIT(2)