26 #include <linux/kernel.h>
29 #include <linux/input.h>
33 #include <linux/i2c.h>
39 #include <linux/omapfb.h>
48 #include <mach/irqs.h>
54 #define OMAP_LCDC_CONTROL (0xfffec000 + 0x00)
55 #define OMAP_LCDC_STATUS (0xfffec000 + 0x10)
56 #define OMAP_DMA_LCD_CCR (0xfffee300 + 0xc2)
57 #define OMAP_DMA_LCD_CTRL (0xfffee300 + 0xc4)
58 #define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
59 #define OMAP_LCDC_STAT_DONE (1 << 0)
62 #define HTCHERALD_GPIO_POWER 139
63 #define HTCHERALD_GPIO_SLIDE 174
64 #define HTCHERALD_GIRQ_BTNS 141
67 #define HTCHERALD_GPIO_TS 76
131 #define HTCPLD_GPIO_START_OFFSET (OMAP_MAX_GPIO_LINES + 16)
132 #define HTCPLD_IRQ(chip, offset) (OMAP_IRQ_END + 8 * (chip) + (offset))
133 #define HTCPLD_BASE(chip, offset) \
134 (HTCPLD_GPIO_START_OFFSET + 8 * (chip) + (offset))
136 #define HTCPLD_GPIO_LED_DPAD HTCPLD_BASE(0, 0)
137 #define HTCPLD_GPIO_LED_KBD HTCPLD_BASE(1, 0)
138 #define HTCPLD_GPIO_LED_CAPS HTCPLD_BASE(1, 5)
139 #define HTCPLD_GPIO_LED_RED_FLASH HTCPLD_BASE(2, 1)
140 #define HTCPLD_GPIO_LED_RED_SOLID HTCPLD_BASE(2, 2)
141 #define HTCPLD_GPIO_LED_GREEN_FLASH HTCPLD_BASE(2, 3)
142 #define HTCPLD_GPIO_LED_GREEN_SOLID HTCPLD_BASE(2, 4)
143 #define HTCPLD_GPIO_LED_WIFI HTCPLD_BASE(2, 5)
144 #define HTCPLD_GPIO_LED_BT HTCPLD_BASE(2, 6)
145 #define HTCPLD_GPIO_LED_VIBRATE HTCPLD_BASE(3, 3)
146 #define HTCPLD_GPIO_LED_ALT HTCPLD_BASE(3, 4)
148 #define HTCPLD_GPIO_RIGHT_KBD HTCPLD_BASE(6, 7)
149 #define HTCPLD_GPIO_UP_KBD HTCPLD_BASE(6, 6)
150 #define HTCPLD_GPIO_LEFT_KBD HTCPLD_BASE(6, 5)
151 #define HTCPLD_GPIO_DOWN_KBD HTCPLD_BASE(6, 4)
153 #define HTCPLD_GPIO_RIGHT_DPAD HTCPLD_BASE(7, 7)
154 #define HTCPLD_GPIO_UP_DPAD HTCPLD_BASE(7, 6)
155 #define HTCPLD_GPIO_LEFT_DPAD HTCPLD_BASE(7, 5)
156 #define HTCPLD_GPIO_DOWN_DPAD HTCPLD_BASE(7, 4)
157 #define HTCPLD_GPIO_ENTER_DPAD HTCPLD_BASE(7, 3)
163 #define HTCPLD_GPIO_INT_RESET_HI HTCPLD_BASE(2, 7)
164 #define HTCPLD_GPIO_INT_RESET_LO HTCPLD_BASE(2, 0)
167 #define HTCPLD_IRQ_RIGHT_KBD HTCPLD_IRQ(0, 7)
168 #define HTCPLD_IRQ_UP_KBD HTCPLD_IRQ(0, 6)
169 #define HTCPLD_IRQ_LEFT_KBD HTCPLD_IRQ(0, 5)
170 #define HTCPLD_IRQ_DOWN_KBD HTCPLD_IRQ(0, 4)
173 #define HTCPLD_IRQ_RIGHT_DPAD HTCPLD_IRQ(1, 7)
174 #define HTCPLD_IRQ_UP_DPAD HTCPLD_IRQ(1, 6)
175 #define HTCPLD_IRQ_LEFT_DPAD HTCPLD_IRQ(1, 5)
176 #define HTCPLD_IRQ_DOWN_DPAD HTCPLD_IRQ(1, 4)
177 #define HTCPLD_IRQ_ENTER_DPAD HTCPLD_IRQ(1, 3)
181 static const unsigned int htc_herald_keymap[] = {
233 .keymap = htc_herald_keymap,
242 .keymap_data = &htc_herald_keymap_data,
245 static struct resource kp_resources[] = {
254 .name =
"omap-keypad",
257 .platform_data = &htcherald_kp_data,
260 .resource = kp_resources,
281 .buttons = herald_gpio_keys_table,
282 .nbuttons =
ARRAY_SIZE(herald_gpio_keys_table),
290 .platform_data = &herald_gpio_keys_data,
295 static struct gpio_led gpio_leds[] = {
318 .platform_data = &gpio_leds_data,
324 static struct resource htcpld_resources[] = {
370 .chip = htcpld_chips,
375 .name =
"i2c-htcpld",
377 .resource = htcpld_resources,
378 .num_resources =
ARRAY_SIZE(htcpld_resources),
380 .platform_data = &htcpld_pfdata,
395 .ctrl_name =
"internal",
399 .name =
"lcd_htcherald",
404 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
427 &herald_gpiokeys_device,
438 .pressure_max = 10000,
439 .pressure_min = 5000,
446 static struct spi_board_info __initdata htcherald_spi_board_info[] = {
448 .modalias =
"ads7846",
449 .platform_data = &htcherald_ts_platform_data,
450 .max_speed_hz = 2500000,
460 static void __init htcherald_lcd_init(
void)
463 unsigned int tries = 200;
468 reg &= ~OMAP_LCDC_CTRL_LCD_EN;
478 pr_err(
"Timeout waiting for end of frame -- LCD may not be available\n");
491 static void __init htcherald_map_io(
void)
499 htcherald_lcd_init();
504 static void __init htcherald_disable_watchdog(
void)
512 printk(
KERN_WARNING "OMAP850 Watchdog seems to be activated, disabling it for now.\n");
518 #define HTCHERALD_GPIO_USB_EN1 33
519 #define HTCHERALD_GPIO_USB_EN2 73
520 #define HTCHERALD_GPIO_USB_DM 35
521 #define HTCHERALD_GPIO_USB_DP 36
523 static void __init htcherald_usb_enable(
void)
525 unsigned int tries = 20;
526 unsigned int value = 0;
569 static void __init htcherald_init(
void)
578 htcherald_disable_watchdog();
580 htcherald_usb_enable();
589 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
590 htc_mmc_data[0] = &htc_mmc1_data;
591 omap1_init_mmc(htc_mmc_data, 1);
600 .atag_offset = 0x100,
601 .map_io = htcherald_map_io,
605 .init_machine = htcherald_init,