rk29: add board_boot_mode API

This commit is contained in:
黄涛
2011-01-22 16:13:03 +08:00
parent 28c4147c01
commit 4807018478
2 changed files with 35 additions and 0 deletions

View File

@@ -23,6 +23,7 @@
#include <mach/rk29_iomap.h>
#include <mach/rk29-dma-pl330.h>
#include <mach/rk29_camera.h> /* ddl@rock-chips.com : camera support */
#include <mach/board.h>
#include "devices.h"
#ifdef CONFIG_ADC_RK29
static struct resource rk29_adc_resource[] = {
@@ -718,3 +719,29 @@ struct platform_device rk29_device_usb20_host = {
};
#endif
static int boot_mode;
static int __init boot_mode_init(char *s)
{
if (!strcmp(s, "normal"))
boot_mode = BOOT_MODE_NORMAL;
else if (!strcmp(s, "factory2"))
boot_mode = BOOT_MODE_FACTORY2;
else if (!strcmp(s, "recovery"))
boot_mode = BOOT_MODE_RECOVERY;
else if (!strcmp(s, "charge"))
boot_mode = BOOT_MODE_CHARGE;
else if (!strcmp(s, "power_test"))
boot_mode = BOOT_MODE_POWER_TEST;
else if (!strcmp(s, "offmode_charging"))
boot_mode = BOOT_MODE_OFFMODE_CHARGING;
return 1;
}
__setup("androidboot.mode=", boot_mode_init);
int board_boot_mode(void)
{
return boot_mode;
}
EXPORT_SYMBOL(board_boot_mode);

View File

@@ -169,4 +169,12 @@ struct akm8975_platform_data {
void __init rk29_map_common_io(void);
void __init rk29_clock_init(void);
#define BOOT_MODE_NORMAL 0
#define BOOT_MODE_FACTORY2 1
#define BOOT_MODE_RECOVERY 2
#define BOOT_MODE_CHARGE 3
#define BOOT_MODE_POWER_TEST 4
#define BOOT_MODE_OFFMODE_CHARGING 5
int board_boot_mode(void);
#endif