[ARM] tegra: stingray: Add board revision identification
authorJames Wylder <james.wylder@motorola.com>
Mon, 7 Jun 2010 16:28:42 +0000 (11:28 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:03 +0000 (16:33 -0700)
Add function stingray_revision to return current board
revision.

Signed-off-by: James Wylder <james.wylder@motorola.com>
arch/arm/mach-tegra/board-stingray.c
arch/arm/mach-tegra/board-stingray.h

index dae71d8feb3cf879ffd90c952de7537928c47b44..52b3e74a5cac7d8a58e79c8e735decd296db0868 100644 (file)
@@ -283,6 +283,29 @@ static void __init stingray_power_off_init(void)
        }
 }
 
+static int stingray_board_revision = STINGRAY_REVISION_UNKNOWN;
+
+int stingray_revision(void)
+{
+       return stingray_board_revision;
+}
+
+static int __init stingray_revision_parse(char *options)
+{
+       if (!strcmp(options, "m1"))
+               stingray_board_revision = STINGRAY_REVISION_M1;
+       else if (!strcmp(options, "p0"))
+               stingray_board_revision = STINGRAY_REVISION_P0;
+       else if (!strcmp(options, "p1"))
+               stingray_board_revision = STINGRAY_REVISION_P1;
+       else if (!strcmp(options, "p2"))
+               stingray_board_revision = STINGRAY_REVISION_P2;
+
+       return 1;
+}
+
+__setup("hw_rev=", stingray_revision_parse);
+
 static void __init tegra_stingray_init(void)
 {
        struct clk *clk;
index 336f7ba40b971ad6a54f88f469fc7eeba4a3a746..466183778305c43b29cc114cdc4dcb2ef4828b27 100644 (file)
@@ -25,5 +25,14 @@ int stingray_wlan_init(void);
 int stingray_sensors_init(void);
 int stingray_touch_init(void);
 int stingray_spi_init(void);
+int stingray_revision(void);
+
+enum {
+       STINGRAY_REVISION_UNKNOWN,
+       STINGRAY_REVISION_M1,
+       STINGRAY_REVISION_P0,
+       STINGRAY_REVISION_P1,
+       STINGRAY_REVISION_P2,
+};
 
 #endif