aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/Kconfig2
-rw-r--r--arch/arm/mach-omap1/Makefile2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c69
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c3
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c3
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c321
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c3
-rw-r--r--arch/arm/mach-omap1/devices.c96
-rw-r--r--arch/arm/mach-omap1/include/mach/camera.h11
-rw-r--r--arch/arm/mach-omap1/pm_bus.c98
10 files changed, 594 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 3b02d3b944af..5f6496375404 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -128,7 +128,7 @@ config MACH_OMAP_PALMTT
128 help 128 help
129 Support for the Palm Tungsten|T PDA. To boot the kernel, you'll 129 Support for the Palm Tungsten|T PDA. To boot the kernel, you'll
130 need a PalmOS compatible bootloader (Garux); check out 130 need a PalmOS compatible bootloader (Garux); check out
131 http://www.hackndev.com/palm/tt/ for more information. 131 http://garux.sourceforge.net/ for more information.
132 Say Y here if you have this PDA model, say N otherwise. 132 Say Y here if you have this PDA model, say N otherwise.
133 133
134config MACH_SX1 134config MACH_SX1
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index facfaeb1ae5c..9a304d854e33 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_OMAP_MPU_TIMER) += time.o
12obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o 12obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o
13 13
14# Power Management 14# Power Management
15obj-$(CONFIG_PM) += pm.o sleep.o 15obj-$(CONFIG_PM) += pm.o sleep.o pm_bus.o
16 16
17# DSP 17# DSP
18obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 18obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 73c86392fcd3..1d4163b9f0b7 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -16,9 +16,12 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/input.h> 17#include <linux/input.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/leds.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/serial_8250.h> 21#include <linux/serial_8250.h>
21 22
23#include <media/soc_camera.h>
24
22#include <asm/serial.h> 25#include <asm/serial.h>
23#include <mach/hardware.h> 26#include <mach/hardware.h>
24#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -32,6 +35,7 @@
32#include <plat/usb.h> 35#include <plat/usb.h>
33#include <plat/board.h> 36#include <plat/board.h>
34#include <plat/common.h> 37#include <plat/common.h>
38#include <mach/camera.h>
35 39
36#include <mach/ams-delta-fiq.h> 40#include <mach/ams-delta-fiq.h>
37 41
@@ -213,10 +217,56 @@ static struct platform_device ams_delta_led_device = {
213 .id = -1 217 .id = -1
214}; 218};
215 219
220static struct i2c_board_info ams_delta_camera_board_info[] = {
221 {
222 I2C_BOARD_INFO("ov6650", 0x60),
223 },
224};
225
226#ifdef CONFIG_LEDS_TRIGGERS
227DEFINE_LED_TRIGGER(ams_delta_camera_led_trigger);
228
229static int ams_delta_camera_power(struct device *dev, int power)
230{
231 /*
232 * turn on camera LED
233 */
234 if (power)
235 led_trigger_event(ams_delta_camera_led_trigger, LED_FULL);
236 else
237 led_trigger_event(ams_delta_camera_led_trigger, LED_OFF);
238 return 0;
239}
240#else
241#define ams_delta_camera_power NULL
242#endif
243
244static struct soc_camera_link __initdata ams_delta_iclink = {
245 .bus_id = 0, /* OMAP1 SoC camera bus */
246 .i2c_adapter_id = 1,
247 .board_info = &ams_delta_camera_board_info[0],
248 .module_name = "ov6650",
249 .power = ams_delta_camera_power,
250};
251
252static struct platform_device ams_delta_camera_device = {
253 .name = "soc-camera-pdrv",
254 .id = 0,
255 .dev = {
256 .platform_data = &ams_delta_iclink,
257 },
258};
259
260static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
261 .camexclk_khz = 12000, /* default 12MHz clock, no extra DPLL */
262 .lclk_khz_max = 1334, /* results in 5fps CIF, 10fps QCIF */
263};
264
216static struct platform_device *ams_delta_devices[] __initdata = { 265static struct platform_device *ams_delta_devices[] __initdata = {
217 &ams_delta_kp_device, 266 &ams_delta_kp_device,
218 &ams_delta_lcd_device, 267 &ams_delta_lcd_device,
219 &ams_delta_led_device, 268 &ams_delta_led_device,
269 &ams_delta_camera_device,
220}; 270};
221 271
222static void __init ams_delta_init(void) 272static void __init ams_delta_init(void)
@@ -225,6 +275,20 @@ static void __init ams_delta_init(void)
225 omap_cfg_reg(UART1_TX); 275 omap_cfg_reg(UART1_TX);
226 omap_cfg_reg(UART1_RTS); 276 omap_cfg_reg(UART1_RTS);
227 277
278 /* parallel camera interface */
279 omap_cfg_reg(H19_1610_CAM_EXCLK);
280 omap_cfg_reg(J15_1610_CAM_LCLK);
281 omap_cfg_reg(L18_1610_CAM_VS);
282 omap_cfg_reg(L15_1610_CAM_HS);
283 omap_cfg_reg(L19_1610_CAM_D0);
284 omap_cfg_reg(K14_1610_CAM_D1);
285 omap_cfg_reg(K15_1610_CAM_D2);
286 omap_cfg_reg(K19_1610_CAM_D3);
287 omap_cfg_reg(K18_1610_CAM_D4);
288 omap_cfg_reg(J14_1610_CAM_D5);
289 omap_cfg_reg(J19_1610_CAM_D6);
290 omap_cfg_reg(J18_1610_CAM_D7);
291
228 iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); 292 iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
229 293
230 omap_board_config = ams_delta_config; 294 omap_board_config = ams_delta_config;
@@ -236,6 +300,11 @@ static void __init ams_delta_init(void)
236 ams_delta_latch2_write(~0, 0); 300 ams_delta_latch2_write(~0, 0);
237 301
238 omap1_usb_init(&ams_delta_usb_config); 302 omap1_usb_init(&ams_delta_usb_config);
303 omap1_set_camera_info(&ams_delta_camera_platform_data);
304#ifdef CONFIG_LEDS_TRIGGERS
305 led_trigger_register_simple("ams_delta_camera",
306 &ams_delta_camera_led_trigger);
307#endif
239 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 308 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
240 309
241#ifdef CONFIG_AMS_DELTA_FIQ 310#ifdef CONFIG_AMS_DELTA_FIQ
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index b30c4990744d..f2fc43d8382b 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -58,8 +58,7 @@ static struct omap_mmc_platform_data mmc1_data = {
58 .dma_mask = 0xffffffff, 58 .dma_mask = 0xffffffff,
59 .slots[0] = { 59 .slots[0] = {
60 .set_power = mmc_set_power, 60 .set_power = mmc_set_power,
61 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 61 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
62 MMC_VDD_32_33 | MMC_VDD_33_34,
63 .name = "mmcblk", 62 .name = "mmcblk",
64 }, 63 },
65}; 64};
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index 54b0f063e263..2098525e7cc5 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -40,8 +40,7 @@ static struct omap_mmc_platform_data mmc1_data = {
40 .dma_mask = 0xffffffff, 40 .dma_mask = 0xffffffff,
41 .slots[0] = { 41 .slots[0] = {
42 .set_power = mmc_set_power, 42 .set_power = mmc_set_power,
43 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 43 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
44 MMC_VDD_32_33 | MMC_VDD_33_34,
45 .name = "mmcblk", 44 .name = "mmcblk",
46 }, 45 },
47}; 46};
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 86afb2952225..071af3e47789 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -30,6 +30,13 @@
30#include <linux/input.h> 30#include <linux/input.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/gpio_keys.h>
34#include <linux/i2c.h>
35#include <linux/i2c-gpio.h>
36#include <linux/htcpld.h>
37#include <linux/leds.h>
38#include <linux/spi/spi.h>
39#include <linux/spi/ads7846.h>
33 40
34#include <asm/mach-types.h> 41#include <asm/mach-types.h>
35#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
@@ -39,6 +46,7 @@
39#include <plat/board.h> 46#include <plat/board.h>
40#include <plat/keypad.h> 47#include <plat/keypad.h>
41#include <plat/usb.h> 48#include <plat/usb.h>
49#include <plat/mmc.h>
42 50
43#include <mach/irqs.h> 51#include <mach/irqs.h>
44 52
@@ -52,13 +60,123 @@
52#define OMAP_LCDC_CTRL_LCD_EN (1 << 0) 60#define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
53#define OMAP_LCDC_STAT_DONE (1 << 0) 61#define OMAP_LCDC_STAT_DONE (1 << 0)
54 62
55static struct omap_lcd_config htcherald_lcd_config __initdata = { 63/* GPIO definitions for the power button and keyboard slide switch */
56 .ctrl_name = "internal", 64#define HTCHERALD_GPIO_POWER 139
57}; 65#define HTCHERALD_GPIO_SLIDE 174
66#define HTCHERALD_GIRQ_BTNS 141
58 67
59static struct omap_board_config_kernel htcherald_config[] __initdata = { 68/* GPIO definitions for the touchscreen */
60 { OMAP_TAG_LCD, &htcherald_lcd_config }, 69#define HTCHERALD_GPIO_TS 76
61}; 70
71/* HTCPLD definitions */
72
73/*
74 * CPLD Logic
75 *
76 * Chip 3 - 0x03
77 *
78 * Function 7 6 5 4 3 2 1 0
79 * ------------------------------------
80 * DPAD light x x x x x x x 1
81 * SoundDev x x x x 1 x x x
82 * Screen white 1 x x x x x x x
83 * MMC power on x x x x x 1 x x
84 * Happy times (n) 0 x x x x 1 x x
85 *
86 * Chip 4 - 0x04
87 *
88 * Function 7 6 5 4 3 2 1 0
89 * ------------------------------------
90 * Keyboard light x x x x x x x 1
91 * LCD Bright (4) x x x x x 1 1 x
92 * LCD Bright (3) x x x x x 0 1 x
93 * LCD Bright (2) x x x x x 1 0 x
94 * LCD Bright (1) x x x x x 0 0 x
95 * LCD Off x x x x 0 x x x
96 * LCD image (fb) 1 x x x x x x x
97 * LCD image (white) 0 x x x x x x x
98 * Caps lock LED x x 1 x x x x x
99 *
100 * Chip 5 - 0x05
101 *
102 * Function 7 6 5 4 3 2 1 0
103 * ------------------------------------
104 * Red (solid) x x x x x 1 x x
105 * Red (flash) x x x x x x 1 x
106 * Green (GSM flash) x x x x 1 x x x
107 * Green (GSM solid) x x x 1 x x x x
108 * Green (wifi flash) x x 1 x x x x x
109 * Blue (bt flash) x 1 x x x x x x
110 * DPAD Int Enable 1 x x x x x x 0
111 *
112 * (Combinations of the above can be made for different colors.)
113 * The direction pad interrupt enable must be set each time the
114 * interrupt is handled.
115 *
116 * Chip 6 - 0x06
117 *
118 * Function 7 6 5 4 3 2 1 0
119 * ------------------------------------
120 * Vibrator x x x x 1 x x x
121 * Alt LED x x x 1 x x x x
122 * Screen white 1 x x x x x x x
123 * Screen white x x 1 x x x x x
124 * Screen white x 0 x x x x x x
125 * Enable kbd dpad x x x x x x 0 x
126 * Happy Times 0 1 0 x x x 0 x
127 */
128
129/*
130 * HTCPLD GPIO lines start 16 after OMAP_MAX_GPIO_LINES to account
131 * for the 16 MPUIO lines.
132 */
133#define HTCPLD_GPIO_START_OFFSET (OMAP_MAX_GPIO_LINES + 16)
134#define HTCPLD_IRQ(chip, offset) (OMAP_IRQ_END + 8 * (chip) + (offset))
135#define HTCPLD_BASE(chip, offset) \
136 (HTCPLD_GPIO_START_OFFSET + 8 * (chip) + (offset))
137
138#define HTCPLD_GPIO_LED_DPAD HTCPLD_BASE(0, 0)
139#define HTCPLD_GPIO_LED_KBD HTCPLD_BASE(1, 0)
140#define HTCPLD_GPIO_LED_CAPS HTCPLD_BASE(1, 5)
141#define HTCPLD_GPIO_LED_RED_FLASH HTCPLD_BASE(2, 1)
142#define HTCPLD_GPIO_LED_RED_SOLID HTCPLD_BASE(2, 2)
143#define HTCPLD_GPIO_LED_GREEN_FLASH HTCPLD_BASE(2, 3)
144#define HTCPLD_GPIO_LED_GREEN_SOLID HTCPLD_BASE(2, 4)
145#define HTCPLD_GPIO_LED_WIFI HTCPLD_BASE(2, 5)
146#define HTCPLD_GPIO_LED_BT HTCPLD_BASE(2, 6)
147#define HTCPLD_GPIO_LED_VIBRATE HTCPLD_BASE(3, 3)
148#define HTCPLD_GPIO_LED_ALT HTCPLD_BASE(3, 4)
149
150#define HTCPLD_GPIO_RIGHT_KBD HTCPLD_BASE(6, 7)
151#define HTCPLD_GPIO_UP_KBD HTCPLD_BASE(6, 6)
152#define HTCPLD_GPIO_LEFT_KBD HTCPLD_BASE(6, 5)
153#define HTCPLD_GPIO_DOWN_KBD HTCPLD_BASE(6, 4)
154
155#define HTCPLD_GPIO_RIGHT_DPAD HTCPLD_BASE(7, 7)
156#define HTCPLD_GPIO_UP_DPAD HTCPLD_BASE(7, 6)
157#define HTCPLD_GPIO_LEFT_DPAD HTCPLD_BASE(7, 5)
158#define HTCPLD_GPIO_DOWN_DPAD HTCPLD_BASE(7, 4)
159#define HTCPLD_GPIO_ENTER_DPAD HTCPLD_BASE(7, 3)
160
161/*
162 * The htcpld chip requires a gpio write to a specific line
163 * to re-enable interrupts after one has occurred.
164 */
165#define HTCPLD_GPIO_INT_RESET_HI HTCPLD_BASE(2, 7)
166#define HTCPLD_GPIO_INT_RESET_LO HTCPLD_BASE(2, 0)
167
168/* Chip 5 */
169#define HTCPLD_IRQ_RIGHT_KBD HTCPLD_IRQ(0, 7)
170#define HTCPLD_IRQ_UP_KBD HTCPLD_IRQ(0, 6)
171#define HTCPLD_IRQ_LEFT_KBD HTCPLD_IRQ(0, 5)
172#define HTCPLD_IRQ_DOWN_KBD HTCPLD_IRQ(0, 4)
173
174/* Chip 6 */
175#define HTCPLD_IRQ_RIGHT_DPAD HTCPLD_IRQ(1, 7)
176#define HTCPLD_IRQ_UP_DPAD HTCPLD_IRQ(1, 6)
177#define HTCPLD_IRQ_LEFT_DPAD HTCPLD_IRQ(1, 5)
178#define HTCPLD_IRQ_DOWN_DPAD HTCPLD_IRQ(1, 4)
179#define HTCPLD_IRQ_ENTER_DPAD HTCPLD_IRQ(1, 3)
62 180
63/* Keyboard definition */ 181/* Keyboard definition */
64 182
@@ -140,6 +258,129 @@ static struct platform_device kp_device = {
140 .resource = kp_resources, 258 .resource = kp_resources,
141}; 259};
142 260
261/* GPIO buttons for keyboard slide and power button */
262static struct gpio_keys_button herald_gpio_keys_table[] = {
263 {BTN_0, HTCHERALD_GPIO_POWER, 1, "POWER", EV_KEY, 1, 20},
264 {SW_LID, HTCHERALD_GPIO_SLIDE, 0, "SLIDE", EV_SW, 1, 20},
265
266 {KEY_LEFT, HTCPLD_GPIO_LEFT_KBD, 1, "LEFT", EV_KEY, 1, 20},
267 {KEY_RIGHT, HTCPLD_GPIO_RIGHT_KBD, 1, "RIGHT", EV_KEY, 1, 20},
268 {KEY_UP, HTCPLD_GPIO_UP_KBD, 1, "UP", EV_KEY, 1, 20},
269 {KEY_DOWN, HTCPLD_GPIO_DOWN_KBD, 1, "DOWN", EV_KEY, 1, 20},
270
271 {KEY_LEFT, HTCPLD_GPIO_LEFT_DPAD, 1, "DLEFT", EV_KEY, 1, 20},
272 {KEY_RIGHT, HTCPLD_GPIO_RIGHT_DPAD, 1, "DRIGHT", EV_KEY, 1, 20},
273 {KEY_UP, HTCPLD_GPIO_UP_DPAD, 1, "DUP", EV_KEY, 1, 20},
274 {KEY_DOWN, HTCPLD_GPIO_DOWN_DPAD, 1, "DDOWN", EV_KEY, 1, 20},
275 {KEY_ENTER, HTCPLD_GPIO_ENTER_DPAD, 1, "DENTER", EV_KEY, 1, 20},
276};
277
278static struct gpio_keys_platform_data herald_gpio_keys_data = {
279 .buttons = herald_gpio_keys_table,
280 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table),
281 .rep = 1,
282};
283
284static struct platform_device herald_gpiokeys_device = {
285 .name = "gpio-keys",
286 .id = -1,
287 .dev = {
288 .platform_data = &herald_gpio_keys_data,
289 },
290};
291
292/* LEDs for the Herald. These connect to the HTCPLD GPIO device. */
293static struct gpio_led gpio_leds[] = {
294 {"dpad", NULL, HTCPLD_GPIO_LED_DPAD, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
295 {"kbd", NULL, HTCPLD_GPIO_LED_KBD, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
296 {"vibrate", NULL, HTCPLD_GPIO_LED_VIBRATE, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
297 {"green_solid", NULL, HTCPLD_GPIO_LED_GREEN_SOLID, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
298 {"green_flash", NULL, HTCPLD_GPIO_LED_GREEN_FLASH, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
299 {"red_solid", "mmc0", HTCPLD_GPIO_LED_RED_SOLID, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
300 {"red_flash", NULL, HTCPLD_GPIO_LED_RED_FLASH, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
301 {"wifi", NULL, HTCPLD_GPIO_LED_WIFI, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
302 {"bt", NULL, HTCPLD_GPIO_LED_BT, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
303 {"caps", NULL, HTCPLD_GPIO_LED_CAPS, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
304 {"alt", NULL, HTCPLD_GPIO_LED_ALT, 0, 0, LEDS_GPIO_DEFSTATE_OFF},
305};
306
307static struct gpio_led_platform_data gpio_leds_data = {
308 .leds = gpio_leds,
309 .num_leds = ARRAY_SIZE(gpio_leds),
310};
311
312static struct platform_device gpio_leds_device = {
313 .name = "leds-gpio",
314 .id = 0,
315 .dev = {
316 .platform_data = &gpio_leds_data,
317 },
318};
319
320/* HTC PLD chips */
321
322static struct resource htcpld_resources[] = {
323 [0] = {
324 .start = OMAP_GPIO_IRQ(HTCHERALD_GIRQ_BTNS),
325 .end = OMAP_GPIO_IRQ(HTCHERALD_GIRQ_BTNS),
326 .flags = IORESOURCE_IRQ,
327 },
328};
329
330struct htcpld_chip_platform_data htcpld_chips[] = {
331 [0] = {
332 .addr = 0x03,
333 .reset = 0x04,
334 .num_gpios = 8,
335 .gpio_out_base = HTCPLD_BASE(0, 0),
336 .gpio_in_base = HTCPLD_BASE(4, 0),
337 },
338 [1] = {
339 .addr = 0x04,
340 .reset = 0x8e,
341 .num_gpios = 8,
342 .gpio_out_base = HTCPLD_BASE(1, 0),
343 .gpio_in_base = HTCPLD_BASE(5, 0),
344 },
345 [2] = {
346 .addr = 0x05,
347 .reset = 0x80,
348 .num_gpios = 8,
349 .gpio_out_base = HTCPLD_BASE(2, 0),
350 .gpio_in_base = HTCPLD_BASE(6, 0),
351 .irq_base = HTCPLD_IRQ(0, 0),
352 .num_irqs = 8,
353 },
354 [3] = {
355 .addr = 0x06,
356 .reset = 0x40,
357 .num_gpios = 8,
358 .gpio_out_base = HTCPLD_BASE(3, 0),
359 .gpio_in_base = HTCPLD_BASE(7, 0),
360 .irq_base = HTCPLD_IRQ(1, 0),
361 .num_irqs = 8,
362 },
363};
364
365struct htcpld_core_platform_data htcpld_pfdata = {
366 .int_reset_gpio_hi = HTCPLD_GPIO_INT_RESET_HI,
367 .int_reset_gpio_lo = HTCPLD_GPIO_INT_RESET_LO,
368 .i2c_adapter_id = 1,
369
370 .chip = htcpld_chips,
371 .num_chip = ARRAY_SIZE(htcpld_chips),
372};
373
374static struct platform_device htcpld_device = {
375 .name = "i2c-htcpld",
376 .id = -1,
377 .resource = htcpld_resources,
378 .num_resources = ARRAY_SIZE(htcpld_resources),
379 .dev = {
380 .platform_data = &htcpld_pfdata,
381 },
382};
383
143/* USB Device */ 384/* USB Device */
144static struct omap_usb_config htcherald_usb_config __initdata = { 385static struct omap_usb_config htcherald_usb_config __initdata = {
145 .otg = 0, 386 .otg = 0,
@@ -150,14 +391,71 @@ static struct omap_usb_config htcherald_usb_config __initdata = {
150}; 391};
151 392
152/* LCD Device resources */ 393/* LCD Device resources */
394static struct omap_lcd_config htcherald_lcd_config __initdata = {
395 .ctrl_name = "internal",
396};
397
398static struct omap_board_config_kernel htcherald_config[] __initdata = {
399 { OMAP_TAG_LCD, &htcherald_lcd_config },
400};
401
153static struct platform_device lcd_device = { 402static struct platform_device lcd_device = {
154 .name = "lcd_htcherald", 403 .name = "lcd_htcherald",
155 .id = -1, 404 .id = -1,
156}; 405};
157 406
407/* MMC Card */
408#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
409static struct omap_mmc_platform_data htc_mmc1_data = {
410 .nr_slots = 1,
411 .switch_slot = NULL,
412 .slots[0] = {
413 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
414 .name = "mmcblk",
415 .nomux = 1,
416 .wires = 4,
417 .switch_pin = -1,
418 },
419};
420
421static struct omap_mmc_platform_data *htc_mmc_data[1];
422#endif
423
424
425/* Platform devices for the Herald */
158static struct platform_device *devices[] __initdata = { 426static struct platform_device *devices[] __initdata = {
159 &kp_device, 427 &kp_device,
160 &lcd_device, 428 &lcd_device,
429 &htcpld_device,
430 &gpio_leds_device,
431 &herald_gpiokeys_device,
432};
433
434/*
435 * Touchscreen
436 */
437static const struct ads7846_platform_data htcherald_ts_platform_data = {
438 .model = 7846,
439 .keep_vref_on = 1,
440 .x_plate_ohms = 496,
441 .gpio_pendown = HTCHERALD_GPIO_TS,
442 .pressure_max = 100000,
443 .pressure_min = 5000,
444 .x_min = 528,
445 .x_max = 3760,
446 .y_min = 624,
447 .y_max = 3760,
448};
449
450static struct spi_board_info __initdata htcherald_spi_board_info[] = {
451 {
452 .modalias = "ads7846",
453 .platform_data = &htcherald_ts_platform_data,
454 .irq = OMAP_GPIO_IRQ(HTCHERALD_GPIO_TS),
455 .max_speed_hz = 2500000,
456 .bus_num = 2,
457 .chip_select = 1,
458 }
161}; 459};
162 460
163/* 461/*
@@ -278,6 +576,7 @@ static void __init htcherald_init(void)
278{ 576{
279 printk(KERN_INFO "HTC Herald init.\n"); 577 printk(KERN_INFO "HTC Herald init.\n");
280 578
579 /* Do board initialization before we register all the devices */
281 omap_gpio_init(); 580 omap_gpio_init();
282 581
283 omap_board_config = htcherald_config; 582 omap_board_config = htcherald_config;
@@ -288,6 +587,16 @@ static void __init htcherald_init(void)
288 587
289 htcherald_usb_enable(); 588 htcherald_usb_enable();
290 omap1_usb_init(&htcherald_usb_config); 589 omap1_usb_init(&htcherald_usb_config);
590
591 spi_register_board_info(htcherald_spi_board_info,
592 ARRAY_SIZE(htcherald_spi_board_info));
593
594 omap_register_i2c_bus(1, 100, NULL, 0);
595
596#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
597 htc_mmc_data[0] = &htc_mmc1_data;
598 omap1_init_mmc(htc_mmc_data, 1);
599#endif
291} 600}
292 601
293static void __init htcherald_init_irq(void) 602static void __init htcherald_init_irq(void)
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 5b33ae8141bc..e8ddd86e3fda 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -44,8 +44,7 @@ static struct omap_mmc_platform_data mmc1_data = {
44 .nr_slots = 1, 44 .nr_slots = 1,
45 .slots[0] = { 45 .slots[0] = {
46 .set_power = mmc_set_power, 46 .set_power = mmc_set_power,
47 .ocr_mask = MMC_VDD_28_29 | MMC_VDD_30_31 | 47 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
48 MMC_VDD_32_33 | MMC_VDD_33_34,
49 .name = "mmcblk", 48 .name = "mmcblk",
50 }, 49 },
51}; 50};
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index aa0725608fb1..ea0d80a89da7 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -9,6 +9,7 @@
9 * (at your option) any later version. 9 * (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/dma-mapping.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/init.h> 15#include <linux/init.h>
@@ -25,6 +26,7 @@
25#include <mach/gpio.h> 26#include <mach/gpio.h>
26#include <plat/mmc.h> 27#include <plat/mmc.h>
27#include <plat/omap7xx.h> 28#include <plat/omap7xx.h>
29#include <plat/mcbsp.h>
28 30
29/*-------------------------------------------------------------------------*/ 31/*-------------------------------------------------------------------------*/
30 32
@@ -191,10 +193,76 @@ static inline void omap_init_spi100k(void)
191} 193}
192#endif 194#endif
193 195
196
197#define OMAP1_CAMERA_BASE 0xfffb6800
198#define OMAP1_CAMERA_IOSIZE 0x1c
199
200static struct resource omap1_camera_resources[] = {
201 [0] = {
202 .start = OMAP1_CAMERA_BASE,
203 .end = OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1,
204 .flags = IORESOURCE_MEM,
205 },
206 [1] = {
207 .start = INT_CAMERA,
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32);
213
214static struct platform_device omap1_camera_device = {
215 .name = "omap1-camera",
216 .id = 0, /* This is used to put cameras on this interface */
217 .dev = {
218 .dma_mask = &omap1_camera_dma_mask,
219 .coherent_dma_mask = DMA_BIT_MASK(32),
220 },
221 .num_resources = ARRAY_SIZE(omap1_camera_resources),
222 .resource = omap1_camera_resources,
223};
224
225void __init omap1_camera_init(void *info)
226{
227 struct platform_device *dev = &omap1_camera_device;
228 int ret;
229
230 dev->dev.platform_data = info;
231
232 ret = platform_device_register(dev);
233 if (ret)
234 dev_err(&dev->dev, "unable to register device: %d\n", ret);
235}
236
237
194/*-------------------------------------------------------------------------*/ 238/*-------------------------------------------------------------------------*/
195 239
196static inline void omap_init_sti(void) {} 240static inline void omap_init_sti(void) {}
197 241
242#if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
243
244static struct platform_device omap_pcm = {
245 .name = "omap-pcm-audio",
246 .id = -1,
247};
248
249OMAP_MCBSP_PLATFORM_DEVICE(1);
250OMAP_MCBSP_PLATFORM_DEVICE(2);
251OMAP_MCBSP_PLATFORM_DEVICE(3);
252
253static void omap_init_audio(void)
254{
255 platform_device_register(&omap_mcbsp1);
256 platform_device_register(&omap_mcbsp2);
257 if (!cpu_is_omap7xx())
258 platform_device_register(&omap_mcbsp3);
259 platform_device_register(&omap_pcm);
260}
261
262#else
263static inline void omap_init_audio(void) {}
264#endif
265
198/*-------------------------------------------------------------------------*/ 266/*-------------------------------------------------------------------------*/
199 267
200/* 268/*
@@ -227,8 +295,36 @@ static int __init omap1_init_devices(void)
227 omap_init_rtc(); 295 omap_init_rtc();
228 omap_init_spi100k(); 296 omap_init_spi100k();
229 omap_init_sti(); 297 omap_init_sti();
298 omap_init_audio();
230 299
231 return 0; 300 return 0;
232} 301}
233arch_initcall(omap1_init_devices); 302arch_initcall(omap1_init_devices);
234 303
304#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
305
306static struct resource wdt_resources[] = {
307 {
308 .start = 0xfffeb000,
309 .end = 0xfffeb07F,
310 .flags = IORESOURCE_MEM,
311 },
312};
313
314static struct platform_device omap_wdt_device = {
315 .name = "omap_wdt",
316 .id = -1,
317 .num_resources = ARRAY_SIZE(wdt_resources),
318 .resource = wdt_resources,
319};
320
321static int __init omap_init_wdt(void)
322{
323 if (!cpu_is_omap16xx())
324 return;
325
326 platform_device_register(&omap_wdt_device);
327 return 0;
328}
329subsys_initcall(omap_init_wdt);
330#endif
diff --git a/arch/arm/mach-omap1/include/mach/camera.h b/arch/arm/mach-omap1/include/mach/camera.h
new file mode 100644
index 000000000000..fd54b452eb22
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/camera.h
@@ -0,0 +1,11 @@
1#ifndef __ASM_ARCH_CAMERA_H_
2#define __ASM_ARCH_CAMERA_H_
3
4void omap1_camera_init(void *);
5
6static inline void omap1_set_camera_info(struct omap1_cam_platform_data *info)
7{
8 omap1_camera_init(info);
9}
10
11#endif /* __ASM_ARCH_CAMERA_H_ */
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
new file mode 100644
index 000000000000..8b66392be745
--- /dev/null
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -0,0 +1,98 @@
1/*
2 * Runtime PM support code for OMAP1
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/pm_runtime.h>
16#include <linux/platform_device.h>
17#include <linux/mutex.h>
18#include <linux/clk.h>
19#include <linux/err.h>
20
21#include <plat/omap_device.h>
22#include <plat/omap-pm.h>
23
24#ifdef CONFIG_PM_RUNTIME
25static int omap1_pm_runtime_suspend(struct device *dev)
26{
27 struct clk *iclk, *fclk;
28 int ret = 0;
29
30 dev_dbg(dev, "%s\n", __func__);
31
32 ret = pm_generic_runtime_suspend(dev);
33
34 fclk = clk_get(dev, "fck");
35 if (!IS_ERR(fclk)) {
36 clk_disable(fclk);
37 clk_put(fclk);
38 }
39
40 iclk = clk_get(dev, "ick");
41 if (!IS_ERR(iclk)) {
42 clk_disable(iclk);
43 clk_put(iclk);
44 }
45
46 return 0;
47};
48
49static int omap1_pm_runtime_resume(struct device *dev)
50{
51 int ret = 0;
52 struct clk *iclk, *fclk;
53
54 dev_dbg(dev, "%s\n", __func__);
55
56 iclk = clk_get(dev, "ick");
57 if (!IS_ERR(iclk)) {
58 clk_enable(iclk);
59 clk_put(iclk);
60 }
61
62 fclk = clk_get(dev, "fck");
63 if (!IS_ERR(fclk)) {
64 clk_enable(fclk);
65 clk_put(fclk);
66 }
67
68 return pm_generic_runtime_resume(dev);
69};
70
71static int __init omap1_pm_runtime_init(void)
72{
73 const struct dev_pm_ops *pm;
74 struct dev_pm_ops *omap_pm;
75
76 pm = platform_bus_get_pm_ops();
77 if (!pm) {
78 pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
79 __func__);
80 return -ENODEV;
81 }
82
83 omap_pm = kmemdup(pm, sizeof(struct dev_pm_ops), GFP_KERNEL);
84 if (!omap_pm) {
85 pr_err("%s: unable to alloc memory for new dev_pm_ops\n",
86 __func__);
87 return -ENOMEM;
88 }
89
90 omap_pm->runtime_suspend = omap1_pm_runtime_suspend;
91 omap_pm->runtime_resume = omap1_pm_runtime_resume;
92
93 platform_bus_set_pm_ops(omap_pm);
94
95 return 0;
96}
97core_initcall(omap1_pm_runtime_init);
98#endif /* CONFIG_PM_RUNTIME */