From d21f7ac4857899ef5bf721dc02a48f5404b870d9 Mon Sep 17 00:00:00 2001
From: Bernie Innocenti <bernie@codewiz.org>
Date: Mon, 1 Feb 2010 15:51:05 -0300
Subject: [PATCH 2/3] olpc: convenience funcs to check for XO-1 / XO-1.5
Organization: Sugar Labs Foundation

For the time being, we assume that anything beyond BOARD_XO_1_5_Ax
is an XO-1.5. This will have to be reworked when new models appear.
---
 arch/x86/include/asm/olpc.h |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/olpc.h b/arch/x86/include/asm/olpc.h
index 05c4598..635b54e 100644
--- a/arch/x86/include/asm/olpc.h
+++ b/arch/x86/include/asm/olpc.h
@@ -57,9 +57,20 @@ static inline uint32_t olpc_board_pre(uint8_t id)
 	return id << 4;
 }
 
-static inline int machine_is_olpc(void)
+static inline bool olpc_board_is_xo1(void)
+{
+	return (olpc_platform_info.boardrev >= olpc_board_pre(BOARD_XO_1_B1)
+			&& olpc_platform_info.boardrev <= olpc_board(BOARD_XO_1_C2));
+}
+
+static inline bool olpc_board_is_xo1_5(void)
+{
+	return (olpc_platform_info.boardrev >= olpc_board_pre(BOARD_XO_1_5_Ax));
+}
+
+static inline bool machine_is_olpc(void)
 {
-	return (olpc_platform_info.flags & OLPC_F_PRESENT) ? 1 : 0;
+	return olpc_platform_info.flags & OLPC_F_PRESENT;
 }
 
 /*
-- 
1.6.6.1

