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: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
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
.gpio = SW_DOWN_GPIO58,
.desc = "down sw",
},
-#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
[3] = {
.code = KEY_LEFT,
.gpio = SW_LEFT_GPIO95,
.gpio = SW_ESC_GPIO97,
.desc = "esc sw",
},
-#endif
};
static struct gpio_keys_platform_data apollon_gpio_keys = {
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)
.name = "d4",
.gpio = LED2_GPIO15,
},
-#ifdef CONFIG_MACH_OMAP_APOLLON_PLUS
{
.name = "d5",
.gpio = LED3_GPIO92,
.name = "d6",
.gpio = LED4_GPIO93,
},
-#endif
};
static struct gpio_led_platform_data apollon_led_data = {
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)
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