summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0054-Workaround-for-boards-with-mistaken-ASCII-interpreta.patch
blob: 028fe816ef322206e1f40ef5e9b5a43e2b371d7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From bf49a3539e82539d8d347f7d88626c308662ed62 Mon Sep 17 00:00:00 2001
From: Bas Laarhoven <sjml@xs4all.nl>
Date: Mon, 14 May 2012 14:36:23 +0200
Subject: [PATCH 54/56] Workaround for boards with (mistaken) ASCII
 interpretation for the numpins field.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/board-am335xevm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index d6a607a..0a1738a 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -2488,6 +2488,12 @@ static void bone_io_config_from_cape_eeprom( void)
 	u16* pmuxdata;
 	char status[ NR_ITEMS( cape_config.muxdata) + 1];
 
+	// Workaround for capes that have encoded this as ASCII
+	if (cnt > 256) {
+		pr_info( "BeagleBone cape: workaround for bad 'numpins' setting\n");
+		cnt = (cape_config.numpins & 255) - '0';
+		cnt = 10 * cnt + ((cape_config.numpins >> 8) & 255) - '0';
+	}
 	pr_info( "BeagleBone cape: configuring %2d out of %2d signals:\n",
 		 cnt, NR_ITEMS( cape_config.muxdata));
 	RULER( NR_ITEMS( cape_config.muxdata));
-- 
1.7.7.6