From 27f7fd89723cfb096790b4d4db9f3c96df3ae934 Mon Sep 17 00:00:00 2001 From: tytung Date: Tue, 8 Mar 2011 00:12:31 +0800 Subject: [PATCH] cLK: off_mode_charging just prevents the kernel from BUG() if off mode charging and panel is off ( and not detectable ) By cedesmith. http://forum.xda-developers.com/showpost.php?p=10837322&postcount=2 --- arch/arm/mach-msm/board-htcleo-panel.c | 12 ++++++++++-- arch/arm/mach-msm/devices_htc.c | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-msm/board-htcleo-panel.c b/arch/arm/mach-msm/board-htcleo-panel.c index a7a701da..1b986112 100644 --- a/arch/arm/mach-msm/board-htcleo-panel.c +++ b/arch/arm/mach-msm/board-htcleo-panel.c @@ -861,9 +861,17 @@ static void detect_panel_type(void) } else { - printk(" UNKNOWN, stop system now\n"); htcleo_panel_type = PANELTYPE_UNKNOWN; - BUG(); + extern int board_mfg_mode(void); + if(board_mfg_mode()==5) + { + printk(" offmode charging, panel is off\n"); + } + else + { + printk(" UNKNOWN, stop system now\n"); + BUG(); + } } } diff --git a/arch/arm/mach-msm/devices_htc.c b/arch/arm/mach-msm/devices_htc.c index e5f65e72..6839c0d2 100644 --- a/arch/arm/mach-msm/devices_htc.c +++ b/arch/arm/mach-msm/devices_htc.c @@ -457,6 +457,10 @@ int __init board_mfg_mode_init(char *s) mfg_mode = 2; else if (!strcmp(s, "charge")) mfg_mode = 3; + else if (!strcmp(s, "power_test")) + mfg_mode = 4; + else if (!strcmp(s, "offmode_charging")) + mfg_mode = 5; return 1; }