]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-osk.c
ARM: OMAP: Remove unused platform devices, v3
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-osk.c
index 3e766e49f7cc05faced8c31b01150a56e8fe1471..1a16ecb2ccc867489c2c3500721b8c00969672c2 100644 (file)
@@ -51,8 +51,6 @@
 #include <mach/mux.h>
 #include <mach/tc.h>
 #include <mach/common.h>
-#include <mach/mcbsp.h>
-#include <mach/omap-alsa.h>
 
 static struct mtd_partition osk_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
@@ -141,54 +139,18 @@ static struct platform_device osk5912_cf_device = {
        .resource       = osk5912_cf_resources,
 };
 
-#define DEFAULT_BITPERSAMPLE 16
-
-static struct omap_mcbsp_reg_cfg mcbsp_regs = {
-       .spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
-       .spcr1 = RINTM(3) | RRST,
-       .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
-           RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
-       .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
-       .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
-           XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
-       .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
-       .srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
-       .srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
-       /*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */
-       .pcr0 = CLKXP | CLKRP,  /* mcbsp: slave */
-};
-
-static struct omap_alsa_codec_config alsa_config = {
-       .name                   = "OSK AIC23",
-       .mcbsp_regs_alsa        = &mcbsp_regs,
-       .codec_configure_dev    = NULL, /* aic23_configure, */
-       .codec_set_samplerate   = NULL, /* aic23_set_samplerate, */
-       .codec_clock_setup      = NULL, /* aic23_clock_setup, */
-       .codec_clock_on         = NULL, /* aic23_clock_on, */
-       .codec_clock_off        = NULL, /* aic23_clock_off, */
-       .get_default_samplerate = NULL, /* aic23_get_default_samplerate, */
-};
-
-static struct platform_device osk5912_mcbsp1_device = {
-       .name   = "omap_alsa_mcbsp",
-       .id     = 1,
-       .dev = {
-               .platform_data  = &alsa_config,
-       },
-};
-
 static struct platform_device *osk5912_devices[] __initdata = {
        &osk5912_flash_device,
        &osk5912_smc91x_device,
        &osk5912_cf_device,
-       &osk5912_mcbsp1_device,
 };
 
 static struct gpio_led tps_leds[] = {
        /* NOTE:  D9 and D2 have hardware blink support.
         * Also, D9 requires non-battery power.
         */
-       { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9", },
+       { .gpio = OSK_TPS_GPIO_LED_D9, .name = "d9",
+                       .default_trigger = "ide-disk", },
        { .gpio = OSK_TPS_GPIO_LED_D2, .name = "d2", },
        { .gpio = OSK_TPS_GPIO_LED_D3, .name = "d3", .active_low = 1,
                        .default_trigger = "heartbeat", },
@@ -258,9 +220,10 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = {
                .platform_data  = &tps_board,
 
        },
+       {
+               I2C_BOARD_INFO("tlv320aic23", 0x1B),
+       },
        /* TODO when driver support is ready:
-        *  - aic23 audio chip at 0x1a
-        *  - on Mistral, 24c04 eeprom at 0x50
         *  - optionally on Mistral, ov9640 camera sensor at 0x30
         */
 };
@@ -288,7 +251,7 @@ static void __init osk_init_cf(void)
                return;
        }
        /* the CF I/O IRQ is really active-low */
-       set_irq_type(OMAP_GPIO_IRQ(62), IRQ_TYPE_EDGE_FALLING);
+       set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING);
 }
 
 static void __init osk_init_irq(void)
@@ -337,11 +300,28 @@ static struct omap_board_config_kernel osk_config[] __initdata = {
 #ifdef CONFIG_OMAP_OSK_MISTRAL
 
 #include <linux/input.h>
+#include <linux/i2c/at24.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 
 #include <mach/keypad.h>
 
+static struct at24_platform_data at24c04 = {
+       .byte_len       = SZ_4K / 8,
+       .page_size      = 16,
+};
+
+static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
+       {
+               /* NOTE:  powered from LCD supply */
+               I2C_BOARD_INFO("24c04", 0x50),
+               .platform_data  = &at24c04,
+       },
+       /* TODO when driver support is ready:
+        *  - optionally ov9640 camera sensor at 0x30
+        */
+};
+
 static const int osk_keymap[] = {
        /* KEY(col, row, code) */
        KEY(0, 0, KEY_F1),              /* SW4 */
@@ -483,23 +463,30 @@ static void __init osk_mistral_init(void)
        omap_cfg_reg(P20_1610_GPIO4);   /* PENIRQ */
        gpio_request(4, "ts_int");
        gpio_direction_input(4);
-       set_irq_type(OMAP_GPIO_IRQ(4), IRQ_TYPE_EDGE_FALLING);
+       set_irq_type(gpio_to_irq(4), IRQ_TYPE_EDGE_FALLING);
 
        spi_register_board_info(mistral_boardinfo,
                        ARRAY_SIZE(mistral_boardinfo));
 
-       /* the sideways button (SW1) is for use as a "wakeup" button */
+       /* the sideways button (SW1) is for use as a "wakeup" button
+        *
+        * NOTE:  The Mistral board has the wakeup button (SW1) wired
+        * to the LCD 3.3V rail, which is powered down during suspend.
+        * To allow this button to wake up the omap, work around this
+        * HW bug by rewiring SW1 to use the main 3.3V rail.
+        */
        omap_cfg_reg(N15_1610_MPUIO2);
        if (gpio_request(OMAP_MPUIO(2), "wakeup") == 0) {
                int ret = 0;
+               int irq = gpio_to_irq(OMAP_MPUIO(2));
 
                gpio_direction_input(OMAP_MPUIO(2));
-               set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQ_TYPE_EDGE_RISING);
+               set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
 #ifdef CONFIG_PM
                /* share the IRQ in case someone wants to use the
                 * button for more than wakeup from system sleep.
                 */
-               ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
+               ret = request_irq(irq,
                                &osk_mistral_wake_interrupt,
                                IRQF_SHARED, "mistral_wakeup",
                                &osk_mistral_wake_interrupt);
@@ -508,7 +495,7 @@ static void __init osk_mistral_init(void)
                        printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
                                ret);
                } else
-                       enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));
+                       enable_irq_wake(irq);
 #endif
        } else
                printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
@@ -520,6 +507,9 @@ static void __init osk_mistral_init(void)
        if (gpio_request(2, "lcd_pwr") == 0)
                gpio_direction_output(2, 1);
 
+       i2c_register_board_info(1, mistral_i2c_board_info,
+                       ARRAY_SIZE(mistral_i2c_board_info));
+
        platform_add_devices(mistral_devices, ARRAY_SIZE(mistral_devices));
 }
 #else