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: 18040 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1USU8Q-0007Tl-26; Wed, 17 Apr 2013 17:18:58 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1USU8P-00021M-EE; Wed, 17 Apr 2013 17:18:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948Ab3DQPSz (ORCPT + 1 other); Wed, 17 Apr 2013 11:18:55 -0400 Received: from service87.mimecast.com ([91.220.42.44]:45916 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445Ab3DQPSy (ORCPT ); Wed, 17 Apr 2013 11:18:54 -0400 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 Cc: Laurent Pinchart , Linus Walleij , Russell King - ARM Linux , Pawel Moll 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 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.4.17.151220 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_XOAT 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_RCPTS_TO_X5 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' ... 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);