]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap1/board-h2.c
Cleanup patch to sync with mainline kernel
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-h2.c
index 4161e873f5a8352150e45383f290a269d3ec1f26..7eded8e1b917759f06d48a997c021d651b69df14 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/arch/tc.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/usb.h>
+#include <asm/arch/keypad.h>
 #include <asm/arch/common.h>
+#include <asm/arch/mcbsp.h>
+#include <asm/arch/omap-alsa.h>
 
 extern int omap_gpio_init(void);
 
+static int h2_keymap[] = {
+       KEY(0, 0, KEY_LEFT),
+       KEY(0, 1, KEY_RIGHT),
+       KEY(0, 2, KEY_3),
+       KEY(0, 3, KEY_F10),
+       KEY(0, 4, KEY_F5),
+       KEY(0, 5, KEY_9),
+       KEY(1, 0, KEY_DOWN),
+       KEY(1, 1, KEY_UP),
+       KEY(1, 2, KEY_2),
+       KEY(1, 3, KEY_F9),
+       KEY(1, 4, KEY_F7),
+       KEY(1, 5, KEY_0),
+       KEY(2, 0, KEY_ENTER),
+       KEY(2, 1, KEY_6),
+       KEY(2, 2, KEY_1),
+       KEY(2, 3, KEY_F2),
+       KEY(2, 4, KEY_F6),
+       KEY(2, 5, KEY_HOME),
+       KEY(3, 0, KEY_8),
+       KEY(3, 1, KEY_5),
+       KEY(3, 2, KEY_F12),
+       KEY(3, 3, KEY_F3),
+       KEY(3, 4, KEY_F8),
+       KEY(3, 5, KEY_END),
+       KEY(4, 0, KEY_7),
+       KEY(4, 1, KEY_4),
+       KEY(4, 2, KEY_F11),
+       KEY(4, 3, KEY_F1),
+       KEY(4, 4, KEY_F4),
+       KEY(4, 5, KEY_ESC),
+       KEY(5, 0, KEY_F13),
+       KEY(5, 1, KEY_F14),
+       KEY(5, 2, KEY_F15),
+       KEY(5, 3, KEY_F16),
+       KEY(5, 4, KEY_SLEEP),
+       0
+};
+
 static struct mtd_partition h2_nor_partitions[] = {
        /* bootloader (U-Boot, etc) in first sector */
        {
@@ -172,8 +215,34 @@ static struct platform_device h2_smc91x_device = {
        .resource       = h2_smc91x_resources,
 };
 
+static struct resource h2_kp_resources[] = {
+       [0] = {
+               .start  = INT_KEYBOARD,
+               .end    = INT_KEYBOARD,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct omap_kp_platform_data h2_kp_data = {
+       .rows   = 8,
+       .cols   = 8,
+       .keymap = h2_keymap,
+       .rep    = 1,
+};
+
+static struct platform_device h2_kp_device = {
+       .name           = "omap-keypad",
+       .id             = -1,
+       .dev            = {
+               .platform_data = &h2_kp_data,
+       },
+       .num_resources  = ARRAY_SIZE(h2_kp_resources),
+       .resource       = h2_kp_resources,
+};
+
 #define H2_IRDA_FIRSEL_GPIO_PIN        17
 
+#if defined(CONFIG_OMAP_IR) || defined(CONFIG_OMAP_IR_MODULE)
 static int h2_transceiver_mode(struct device *dev, int state)
 {
        if (state & IR_SIRMODE)
@@ -183,9 +252,16 @@ static int h2_transceiver_mode(struct device *dev, int state)
 
        return 0;
 }
+#endif
 
 static struct omap_irda_config h2_irda_data = {
        .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
+       .rx_channel             = OMAP_DMA_UART3_RX,
+       .tx_channel             = OMAP_DMA_UART3_TX,
+       .dest_start             = UART3_THR,
+       .src_start              = UART3_RHR,
+       .tx_trigger             = 0,
+       .rx_trigger             = 0,
 };
 
 static struct resource h2_irda_resources[] = {
@@ -205,11 +281,54 @@ static struct platform_device h2_irda_device = {
        .resource       = h2_irda_resources,
 };
 
+static struct platform_device h2_lcd_device = {
+       .name           = "lcd_h2",
+       .id             = -1,
+};
+
+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(1),
+       .rcr1  = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
+       .xcr2  = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
+                XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG,
+       .xcr1  = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
+       .srgr1 = FWID(15),
+       .srgr2 = GSYNC | CLKSP | FSGM | FPER(31),
+
+       .pcr0  = CLKXM | CLKRM | FSXP | FSRP | CLKXP | CLKRP,
+       //.pcr0 = CLKXP | CLKRP,        /* mcbsp: slave */
+};
+
+static struct omap_alsa_codec_config alsa_config = {
+       .name                   = "H2 TSC2101",
+       .mcbsp_regs_alsa        = &mcbsp_regs,
+       .codec_configure_dev    = NULL, // tsc2101_configure,
+       .codec_set_samplerate   = NULL, // tsc2101_set_samplerate,
+       .codec_clock_setup      = NULL, // tsc2101_clock_setup,
+       .codec_clock_on         = NULL, // tsc2101_clock_on,
+       .codec_clock_off        = NULL, // tsc2101_clock_off,
+       .get_default_samplerate = NULL, // tsc2101_get_default_samplerate,
+};
+
+static struct platform_device h2_mcbsp1_device = {
+       .name   = "omap_alsa_mcbsp",
+       .id     = 1,
+       .dev = {
+               .platform_data  = &alsa_config,
+       },
+};
+
 static struct platform_device *h2_devices[] __initdata = {
        &h2_nor_device,
        &h2_nand_device,
        &h2_smc91x_device,
        &h2_irda_device,
+       &h2_kp_device,
+       &h2_lcd_device,
+       &h2_mcbsp1_device,
 };
 
 static void __init h2_init_smc91x(void)
@@ -258,7 +377,6 @@ static struct omap_uart_config h2_uart_config __initdata = {
 };
 
 static struct omap_lcd_config h2_lcd_config __initdata = {
-       .panel_name     = "h2",
        .ctrl_name      = "internal",
 };