Commit caa42d69 authored by Kyungmin Park's avatar Kyungmin Park Committed by Tony Lindgren

ARM: OMAP: Auto-detect Apollon Plus support

The Apollon Plus has more LEDs, SWs and so on.
Now it is configured by compile time, but it has different IDCODE revision 5.
so It can detect at runtime.
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent b0718f77
......@@ -94,16 +94,6 @@ config MACH_OMAP_APOLLON
bool "OMAP 2420 Apollon board"
depends on ARCH_OMAP2 && ARCH_OMAP2420
config MACH_OMAP_APOLLON_PLUS
bool "OMAP 2420 Apollon Plus board"
depends on ARCH_OMAP2 && ARCH_OMAP2420
select MACH_OMAP_APOLLON
help
It contains more LEDs, SWs, and so on
Note that it is only tested with version 1.1 and more
We have to test the version 1.0
config MACH_OMAP_2430SDP
bool "OMAP 2430 SDP board"
depends on ARCH_OMAP2 && ARCH_OMAP2430
......
......@@ -41,7 +41,6 @@ static struct gpio_keys_button apollon_gpio_keys_buttons[] = {
.gpio = SW_DOWN_GPIO58,
.desc = "down sw",
},
#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
[3] = {
.code = KEY_LEFT,
.gpio = SW_LEFT_GPIO95,
......@@ -57,7 +56,6 @@ static struct gpio_keys_button apollon_gpio_keys_buttons[] = {
.gpio = SW_ESC_GPIO97,
.desc = "esc sw",
},
#endif
};
static struct gpio_keys_platform_data apollon_gpio_keys = {
......@@ -81,14 +79,16 @@ static void __init apollon_sw_init(void)
omap_cfg_reg(AA12_242X_GPIO17);
/* Down SW - AA8 */
omap_cfg_reg(AA8_242X_GPIO58);
#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
/* Left SW - P18 */
omap_cfg_reg(P18_24XX_GPIO95);
/* Right SW - M18 */
omap_cfg_reg(M18_24XX_GPIO96);
/* Esc SW - L14 */
omap_cfg_reg(L14_24XX_GPIO97);
#endif
if (apollon_plus()) {
/* Left SW - P18 */
omap_cfg_reg(P18_24XX_GPIO95);
/* Right SW - M18 */
omap_cfg_reg(M18_24XX_GPIO96);
/* Esc SW - L14 */
omap_cfg_reg(L14_24XX_GPIO97);
} else
apollon_gpio_keys.nbuttons = 3;
}
static int __init omap_apollon_keys_init(void)
......
......@@ -227,7 +227,6 @@ static struct gpio_led apollon_led_config[] = {
.name = "d4",
.gpio = LED2_GPIO15,
},
#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
{
.name = "d5",
.gpio = LED3_GPIO92,
......@@ -236,7 +235,6 @@ static struct gpio_led apollon_led_config[] = {
.name = "d6",
.gpio = LED4_GPIO93,
},
#endif
};
static struct gpio_led_platform_data apollon_led_data = {
......@@ -384,12 +382,14 @@ static void __init apollon_led_init(void)
omap_cfg_reg(AA6_242X_GPIO14);
/* LED2 - AA4 */
omap_cfg_reg(AA4_242X_GPIO15);
#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
/* LED3 - M15 */
omap_cfg_reg(M15_24XX_GPIO92);
/* LED4 - P20 */
omap_cfg_reg(P20_24XX_GPIO93);
#endif
if (apollon_plus()) {
/* LED3 - M15 */
omap_cfg_reg(M15_24XX_GPIO92);
/* LED4 - P20 */
omap_cfg_reg(P20_24XX_GPIO93);
} else
apollon_led_data.num_leds = 3;
}
static void __init apollon_usb_init(void)
......
......@@ -31,6 +31,12 @@
extern void apollon_mmc_init(void);
static inline int apollon_plus(void)
{
/* The apollon plus has IDCODE revision 5 */
return system_rev & 0xc0;
}
/* Placeholder for APOLLON specific defines */
#define APOLLON_ETHR_GPIO_IRQ 74
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment