From patchwork Wed Apr 17 15:17:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Moll X-Patchwork-Id: 2459751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 370E53FCA5 for ; Thu, 18 Apr 2013 11:17:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 35076E632B for ; Thu, 18 Apr 2013 04:17:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from service88.mimecast.com (service88.mimecast.com [195.130.217.12]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E2C1E66E2 for ; Wed, 17 Apr 2013 08:25:43 -0700 (PDT) Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 17 Apr 2013 16:18:18 +0100 Received: from hornet.Cambridge.Arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 17 Apr 2013 16:17:38 +0100 From: Pawel Moll To: linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [RFC 07/10] mfd: vexpress: Allow external drivers to parse site ids Date: Wed, 17 Apr 2013 16:17:19 +0100 Message-Id: <1366211842-21497-8-git-send-email-pawel.moll@arm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366211842-21497-1-git-send-email-pawel.moll@arm.com> References: <1366211842-21497-1-git-send-email-pawel.moll@arm.com> X-OriginalArrivalTime: 17 Apr 2013 15:17:38.0858 (UTC) FILETIME=[B29880A0:01CE3B7E] X-MC-Unique: 113041716181887301 X-Mailman-Approved-At: Thu, 18 Apr 2013 04:09:27 -0700 Cc: Russell King - ARM Linux , Laurent Pinchart , Pawel Moll X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org ... by providing a function translating the MASTER value into the currently valid site number and a _LAST constant providing all possible site id values. Signed-off-by: Pawel Moll --- drivers/mfd/vexpress-sysreg.c | 5 +++++ include/linux/vexpress.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index bf75e96..4158e26 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c @@ -81,6 +81,11 @@ void vexpress_flags_set(u32 data) writel(data, vexpress_sysreg_base + SYS_FLAGSSET); } +u32 vexpress_get_site(int site) +{ + return site == VEXPRESS_SITE_MASTER ? vexpress_master_site : site; +} + u32 vexpress_get_procid(int site) { if (site == VEXPRESS_SITE_MASTER) diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index 7581874..1ebbcf5 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h @@ -19,6 +19,7 @@ #define VEXPRESS_SITE_MB 0 #define VEXPRESS_SITE_DB1 1 #define VEXPRESS_SITE_DB2 2 +#define __VEXPRESS_SITE_LAST 3 #define VEXPRESS_SITE_MASTER 0xf #define VEXPRESS_CONFIG_STATUS_DONE 0 @@ -103,6 +104,7 @@ int vexpress_config_write(struct vexpress_config_func *func, int offset, /* Platform control */ +u32 vexpress_get_site(int site); u32 vexpress_get_procid(int site); u32 vexpress_get_hbi(int site); void *vexpress_get_24mhz_clock_base(void);