]> Pileus Git - ~andy/linux/blobdiff - arch/arm/mach-mx5/board-mx51_efikasb.c
Merge commit 'v3.1-rc1' into imx-fixes
[~andy/linux] / arch / arm / mach-mx5 / board-mx51_efikasb.c
index 4b2e522de0f86b4ad3905b8a0d76112b7ef04e99..8a9bca22beb530cb67eb637060e6ed5d60a9a223 100644 (file)
@@ -132,7 +132,7 @@ static void __init mx51_efikasb_usb(void)
                mxc_register_device(&mxc_usbh2_device, &usbh2_config);
 }
 
-static struct gpio_led mx51_efikasb_leds[] = {
+static const struct gpio_led mx51_efikasb_leds[] __initconst = {
        {
                .name = "efikasb:green",
                .default_trigger = "default-on",
@@ -146,40 +146,34 @@ static struct gpio_led mx51_efikasb_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data mx51_efikasb_leds_data = {
+static const struct gpio_led_platform_data
+               mx51_efikasb_leds_data __initconst = {
        .leds = mx51_efikasb_leds,
        .num_leds = ARRAY_SIZE(mx51_efikasb_leds),
 };
 
-static struct platform_device mx51_efikasb_leds_device = {
-       .name = "leds-gpio",
-       .id = -1,
-       .dev = {
-               .platform_data = &mx51_efikasb_leds_data,
-       },
-};
-
 static struct gpio_keys_button mx51_efikasb_keys[] = {
        {
                .code = KEY_POWER,
                .gpio = EFIKASB_PWRKEY,
-               .type = EV_PWR,
+               .type = EV_KEY,
                .desc = "Power Button",
                .wakeup = 1,
-               .debounce_interval = 10, /* ms */
+               .active_low = 1,
        },
        {
                .code = SW_LID,
                .gpio = EFIKASB_LID,
                .type = EV_SW,
                .desc = "Lid Switch",
+               .active_low = 1,
        },
        {
-               /* SW_RFKILLALL vs KEY_RFKILL ? */
-               .code = SW_RFKILL_ALL,
+               .code = KEY_RFKILL,
                .gpio = EFIKASB_RFKILL,
-               .type = EV_SW,
+               .type = EV_KEY,
                .desc = "rfkill",
+               .active_low = 1,
        },
 };
 
@@ -231,8 +225,8 @@ static void __init mx51_efikasb_board_id(void)
        gpio_request(EFIKASB_PCBID1, "pcb id1");
        gpio_direction_input(EFIKASB_PCBID1);
 
-       id = gpio_get_value(EFIKASB_PCBID0);
-       id |= gpio_get_value(EFIKASB_PCBID1) << 1;
+       id = gpio_get_value(EFIKASB_PCBID0) ? 1 : 0;
+       id |= (gpio_get_value(EFIKASB_PCBID1) ? 1 : 0) << 1;
 
        switch (id) {
        default:
@@ -258,9 +252,8 @@ static void __init efikasb_board_init(void)
        mx51_efikasb_usb();
        imx51_add_sdhci_esdhc_imx(1, NULL);
 
-       platform_device_register(&mx51_efikasb_leds_device);
+       gpio_led_register_device(-1, &mx51_efikasb_leds_data);
        imx_add_gpio_keys(&mx51_efikasb_keys_data);
-
 }
 
 static void __init mx51_efikasb_timer_init(void)