diff options
author | Tony Lindgren <tony@atomide.com> | 2006-12-07 16:58:17 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2007-09-20 21:34:50 -0400 |
commit | a524626b113e36fc70cb456449444018e3045d5f (patch) | |
tree | 90307a026ae10a96d214d8822d363e2452df7d72 /arch/arm | |
parent | c79ed1940ca9a4af5e9c182ac51f28dadd32956d (diff) |
ARM: OMAP: Sync board specific files with linux-omap
This patch syncs omap board specific files with linux-omap tree.
Patch consists mostly of driver updates done in linux-omap
tree for drivers not yet in mainline kernel.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/board-ams-delta.c | 59 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 79 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-h3.c | 41 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-nokia770.c | 53 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-osk.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-palmte.c | 123 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-palmtt.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-voiceblue.c | 2 |
8 files changed, 203 insertions, 159 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index fa2da7490dbe..c73ca61e585e 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -34,20 +34,20 @@ static u8 ams_delta_latch1_reg; | |||
34 | static u16 ams_delta_latch2_reg; | 34 | static u16 ams_delta_latch2_reg; |
35 | 35 | ||
36 | static int ams_delta_keymap[] = { | 36 | static int ams_delta_keymap[] = { |
37 | KEY(0, 0, KEY_F1), /* Advert */ | 37 | KEY(0, 0, KEY_F1), /* Advert */ |
38 | 38 | ||
39 | KEY(3, 0, KEY_COFFEE), /* Games */ | 39 | KEY(3, 0, KEY_COFFEE), /* Games */ |
40 | KEY(2, 0, KEY_QUESTION), /* Directory */ | 40 | KEY(2, 0, KEY_QUESTION), /* Directory */ |
41 | KEY(3, 2, KEY_CONNECT), /* Internet */ | 41 | KEY(3, 2, KEY_CONNECT), /* Internet */ |
42 | KEY(2, 1, KEY_SHOP), /* Services */ | 42 | KEY(2, 1, KEY_SHOP), /* Services */ |
43 | KEY(1, 1, KEY_PHONE), /* VoiceMail */ | 43 | KEY(1, 1, KEY_PHONE), /* VoiceMail */ |
44 | 44 | ||
45 | KEY(1, 0, KEY_DELETE), /* Delete */ | 45 | KEY(1, 0, KEY_DELETE), /* Delete */ |
46 | KEY(2, 2, KEY_PLAY), /* Play */ | 46 | KEY(2, 2, KEY_PLAY), /* Play */ |
47 | KEY(0, 1, KEY_PAGEUP), /* Up */ | 47 | KEY(0, 1, KEY_PAGEUP), /* Up */ |
48 | KEY(3, 1, KEY_PAGEDOWN), /* Down */ | 48 | KEY(3, 1, KEY_PAGEDOWN), /* Down */ |
49 | KEY(0, 2, KEY_EMAIL), /* ReadEmail */ | 49 | KEY(0, 2, KEY_EMAIL), /* ReadEmail */ |
50 | KEY(1, 2, KEY_STOP), /* Stop */ | 50 | KEY(1, 2, KEY_STOP), /* Stop */ |
51 | 51 | ||
52 | /* Numeric keypad portion */ | 52 | /* Numeric keypad portion */ |
53 | KEY(7, 0, KEY_KP1), | 53 | KEY(7, 0, KEY_KP1), |
@@ -61,20 +61,20 @@ static int ams_delta_keymap[] = { | |||
61 | KEY(5, 2, KEY_KP9), | 61 | KEY(5, 2, KEY_KP9), |
62 | KEY(6, 3, KEY_KP0), | 62 | KEY(6, 3, KEY_KP0), |
63 | KEY(7, 3, KEY_KPASTERISK), | 63 | KEY(7, 3, KEY_KPASTERISK), |
64 | KEY(5, 3, KEY_KPDOT), /* # key */ | 64 | KEY(5, 3, KEY_KPDOT), /* # key */ |
65 | KEY(2, 7, KEY_NUMLOCK), /* Mute */ | 65 | KEY(2, 7, KEY_NUMLOCK), /* Mute */ |
66 | KEY(1, 7, KEY_KPMINUS), /* Recall */ | 66 | KEY(1, 7, KEY_KPMINUS), /* Recall */ |
67 | KEY(1, 6, KEY_KPPLUS), /* Redial */ | 67 | KEY(1, 6, KEY_KPPLUS), /* Redial */ |
68 | KEY(6, 7, KEY_KPSLASH), /* Handsfree */ | 68 | KEY(6, 7, KEY_KPSLASH), /* Handsfree */ |
69 | KEY(0, 6, KEY_ENTER), /* Video */ | 69 | KEY(0, 6, KEY_ENTER), /* Video */ |
70 | 70 | ||
71 | KEY(4, 7, KEY_CAMERA), /* Photo */ | 71 | KEY(4, 7, KEY_CAMERA), /* Photo */ |
72 | 72 | ||
73 | KEY(4, 0, KEY_F2), /* Home */ | 73 | KEY(4, 0, KEY_F2), /* Home */ |
74 | KEY(4, 1, KEY_F3), /* Office */ | 74 | KEY(4, 1, KEY_F3), /* Office */ |
75 | KEY(4, 2, KEY_F4), /* Mobile */ | 75 | KEY(4, 2, KEY_F4), /* Mobile */ |
76 | KEY(7, 7, KEY_F5), /* SMS */ | 76 | KEY(7, 7, KEY_F5), /* SMS */ |
77 | KEY(5, 7, KEY_F6), /* Email */ | 77 | KEY(5, 7, KEY_F6), /* Email */ |
78 | 78 | ||
79 | /* QWERTY portion of keypad */ | 79 | /* QWERTY portion of keypad */ |
80 | KEY(4, 3, KEY_Q), | 80 | KEY(4, 3, KEY_Q), |
@@ -107,7 +107,7 @@ static int ams_delta_keymap[] = { | |||
107 | KEY(3, 6, KEY_M), | 107 | KEY(3, 6, KEY_M), |
108 | KEY(2, 6, KEY_SPACE), | 108 | KEY(2, 6, KEY_SPACE), |
109 | 109 | ||
110 | KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */ | 110 | KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */ |
111 | KEY(3, 7, KEY_LEFTCTRL), /* Vol down */ | 111 | KEY(3, 7, KEY_LEFTCTRL), /* Vol down */ |
112 | 112 | ||
113 | 0 | 113 | 0 |
@@ -158,6 +158,10 @@ static struct map_desc ams_delta_io_desc[] __initdata = { | |||
158 | } | 158 | } |
159 | }; | 159 | }; |
160 | 160 | ||
161 | static struct omap_lcd_config ams_delta_lcd_config __initdata = { | ||
162 | .ctrl_name = "internal", | ||
163 | }; | ||
164 | |||
161 | static struct omap_uart_config ams_delta_uart_config __initdata = { | 165 | static struct omap_uart_config ams_delta_uart_config __initdata = { |
162 | .enabled_uarts = 1, | 166 | .enabled_uarts = 1, |
163 | }; | 167 | }; |
@@ -169,6 +173,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = { | |||
169 | }; | 173 | }; |
170 | 174 | ||
171 | static struct omap_board_config_kernel ams_delta_config[] = { | 175 | static struct omap_board_config_kernel ams_delta_config[] = { |
176 | { OMAP_TAG_LCD, &ams_delta_lcd_config }, | ||
172 | { OMAP_TAG_UART, &ams_delta_uart_config }, | 177 | { OMAP_TAG_UART, &ams_delta_uart_config }, |
173 | { OMAP_TAG_USB, &ams_delta_usb_config }, | 178 | { OMAP_TAG_USB, &ams_delta_usb_config }, |
174 | }; | 179 | }; |
@@ -199,6 +204,11 @@ static struct platform_device ams_delta_kp_device = { | |||
199 | .resource = ams_delta_kp_resources, | 204 | .resource = ams_delta_kp_resources, |
200 | }; | 205 | }; |
201 | 206 | ||
207 | static struct platform_device ams_delta_lcd_device = { | ||
208 | .name = "lcd_ams_delta", | ||
209 | .id = -1, | ||
210 | }; | ||
211 | |||
202 | static struct platform_device ams_delta_led_device = { | 212 | static struct platform_device ams_delta_led_device = { |
203 | .name = "ams-delta-led", | 213 | .name = "ams-delta-led", |
204 | .id = -1 | 214 | .id = -1 |
@@ -206,6 +216,7 @@ static struct platform_device ams_delta_led_device = { | |||
206 | 216 | ||
207 | static struct platform_device *ams_delta_devices[] __initdata = { | 217 | static struct platform_device *ams_delta_devices[] __initdata = { |
208 | &ams_delta_kp_device, | 218 | &ams_delta_kp_device, |
219 | &ams_delta_lcd_device, | ||
209 | &ams_delta_led_device, | 220 | &ams_delta_led_device, |
210 | }; | 221 | }; |
211 | 222 | ||
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 48c8c9195dc3..d901dcbe8066 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -139,6 +139,66 @@ static struct platform_device h2_nor_device = { | |||
139 | .resource = &h2_nor_resource, | 139 | .resource = &h2_nor_resource, |
140 | }; | 140 | }; |
141 | 141 | ||
142 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
143 | |||
144 | static struct mtd_partition h2_nand_partitions[] = { | ||
145 | #if 0 | ||
146 | /* REVISIT: enable these partitions if you make NAND BOOT | ||
147 | * work on your H2 (rev C or newer); published versions of | ||
148 | * x-load only support P2 and H3. | ||
149 | */ | ||
150 | { | ||
151 | .name = "xloader", | ||
152 | .offset = 0, | ||
153 | .size = 64 * 1024, | ||
154 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
155 | }, | ||
156 | { | ||
157 | .name = "bootloader", | ||
158 | .offset = MTDPART_OFS_APPEND, | ||
159 | .size = 256 * 1024, | ||
160 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
161 | }, | ||
162 | { | ||
163 | .name = "params", | ||
164 | .offset = MTDPART_OFS_APPEND, | ||
165 | .size = 192 * 1024, | ||
166 | }, | ||
167 | { | ||
168 | .name = "kernel", | ||
169 | .offset = MTDPART_OFS_APPEND, | ||
170 | .size = 2 * SZ_1M, | ||
171 | }, | ||
172 | #endif | ||
173 | { | ||
174 | .name = "filesystem", | ||
175 | .size = MTDPART_SIZ_FULL, | ||
176 | .offset = MTDPART_OFS_APPEND, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | ||
181 | static struct nand_platform_data h2_nand_data = { | ||
182 | .options = NAND_SAMSUNG_LP_OPTIONS, | ||
183 | .parts = h2_nand_partitions, | ||
184 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), | ||
185 | }; | ||
186 | |||
187 | static struct resource h2_nand_resource = { | ||
188 | .flags = IORESOURCE_MEM, | ||
189 | }; | ||
190 | |||
191 | static struct platform_device h2_nand_device = { | ||
192 | .name = "omapnand", | ||
193 | .id = 0, | ||
194 | .dev = { | ||
195 | .platform_data = &h2_nand_data, | ||
196 | }, | ||
197 | .num_resources = 1, | ||
198 | .resource = &h2_nand_resource, | ||
199 | }; | ||
200 | #endif | ||
201 | |||
142 | static struct resource h2_smc91x_resources[] = { | 202 | static struct resource h2_smc91x_resources[] = { |
143 | [0] = { | 203 | [0] = { |
144 | .start = OMAP1610_ETHR_START, /* Physical */ | 204 | .start = OMAP1610_ETHR_START, /* Physical */ |
@@ -218,11 +278,15 @@ static struct resource h2_irda_resources[] = { | |||
218 | .flags = IORESOURCE_IRQ, | 278 | .flags = IORESOURCE_IRQ, |
219 | }, | 279 | }, |
220 | }; | 280 | }; |
281 | |||
282 | static u64 irda_dmamask = 0xffffffff; | ||
283 | |||
221 | static struct platform_device h2_irda_device = { | 284 | static struct platform_device h2_irda_device = { |
222 | .name = "omapirda", | 285 | .name = "omapirda", |
223 | .id = 0, | 286 | .id = 0, |
224 | .dev = { | 287 | .dev = { |
225 | .platform_data = &h2_irda_data, | 288 | .platform_data = &h2_irda_data, |
289 | .dma_mask = &irda_dmamask, | ||
226 | }, | 290 | }, |
227 | .num_resources = ARRAY_SIZE(h2_irda_resources), | 291 | .num_resources = ARRAY_SIZE(h2_irda_resources), |
228 | .resource = h2_irda_resources, | 292 | .resource = h2_irda_resources, |
@@ -270,6 +334,7 @@ static struct platform_device h2_mcbsp1_device = { | |||
270 | 334 | ||
271 | static struct platform_device *h2_devices[] __initdata = { | 335 | static struct platform_device *h2_devices[] __initdata = { |
272 | &h2_nor_device, | 336 | &h2_nor_device, |
337 | //&h2_nand_device, | ||
273 | &h2_smc91x_device, | 338 | &h2_smc91x_device, |
274 | &h2_irda_device, | 339 | &h2_irda_device, |
275 | &h2_kp_device, | 340 | &h2_kp_device, |
@@ -333,6 +398,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = { | |||
333 | { OMAP_TAG_LCD, &h2_lcd_config }, | 398 | { OMAP_TAG_LCD, &h2_lcd_config }, |
334 | }; | 399 | }; |
335 | 400 | ||
401 | #define H2_NAND_RB_GPIO_PIN 62 | ||
402 | |||
403 | static int h2_nand_dev_ready(struct nand_platform_data *data) | ||
404 | { | ||
405 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | ||
406 | } | ||
407 | |||
336 | static void __init h2_init(void) | 408 | static void __init h2_init(void) |
337 | { | 409 | { |
338 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped | 410 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped |
@@ -347,6 +419,13 @@ static void __init h2_init(void) | |||
347 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); | 419 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); |
348 | h2_nor_resource.end += SZ_32M - 1; | 420 | h2_nor_resource.end += SZ_32M - 1; |
349 | 421 | ||
422 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
423 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | ||
424 | h2_nand_resource.end += SZ_4K - 1; | ||
425 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | ||
426 | h2_nand_data.dev_ready = h2_nand_dev_ready; | ||
427 | #endif | ||
428 | |||
350 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 429 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
351 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 430 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
352 | 431 | ||
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 79d4ef4c54d4..4167f3480974 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <asm/arch/keypad.h> | 44 | #include <asm/arch/keypad.h> |
45 | #include <asm/arch/dma.h> | 45 | #include <asm/arch/dma.h> |
46 | #include <asm/arch/common.h> | 46 | #include <asm/arch/common.h> |
47 | #include <asm/arch/mcbsp.h> | ||
48 | #include <asm/arch/omap-alsa.h> | ||
47 | 49 | ||
48 | extern int omap_gpio_init(void); | 50 | extern int omap_gpio_init(void); |
49 | 51 | ||
@@ -351,11 +353,14 @@ static struct resource h3_irda_resources[] = { | |||
351 | }, | 353 | }, |
352 | }; | 354 | }; |
353 | 355 | ||
356 | static u64 irda_dmamask = 0xffffffff; | ||
357 | |||
354 | static struct platform_device h3_irda_device = { | 358 | static struct platform_device h3_irda_device = { |
355 | .name = "omapirda", | 359 | .name = "omapirda", |
356 | .id = 0, | 360 | .id = 0, |
357 | .dev = { | 361 | .dev = { |
358 | .platform_data = &h3_irda_data, | 362 | .platform_data = &h3_irda_data, |
363 | .dma_mask = &irda_dmamask, | ||
359 | }, | 364 | }, |
360 | .num_resources = ARRAY_SIZE(h3_irda_resources), | 365 | .num_resources = ARRAY_SIZE(h3_irda_resources), |
361 | .resource = h3_irda_resources, | 366 | .resource = h3_irda_resources, |
@@ -366,6 +371,41 @@ static struct platform_device h3_lcd_device = { | |||
366 | .id = -1, | 371 | .id = -1, |
367 | }; | 372 | }; |
368 | 373 | ||
374 | static struct omap_mcbsp_reg_cfg mcbsp_regs = { | ||
375 | .spcr2 = FREE | FRST | GRST | XRST | XINTM(3), | ||
376 | .spcr1 = RINTM(3) | RRST, | ||
377 | .rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) | | ||
378 | RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(1), | ||
379 | .rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16), | ||
380 | .xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) | | ||
381 | XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(1) | XFIG, | ||
382 | .xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16), | ||
383 | .srgr1 = FWID(15), | ||
384 | .srgr2 = GSYNC | CLKSP | FSGM | FPER(31), | ||
385 | |||
386 | .pcr0 = CLKRM | SCLKME | FSXP | FSRP | CLKXP | CLKRP, | ||
387 | //.pcr0 = CLKXP | CLKRP, /* mcbsp: slave */ | ||
388 | }; | ||
389 | |||
390 | static struct omap_alsa_codec_config alsa_config = { | ||
391 | .name = "H3 TSC2101", | ||
392 | .mcbsp_regs_alsa = &mcbsp_regs, | ||
393 | .codec_configure_dev = NULL, // tsc2101_configure, | ||
394 | .codec_set_samplerate = NULL, // tsc2101_set_samplerate, | ||
395 | .codec_clock_setup = NULL, // tsc2101_clock_setup, | ||
396 | .codec_clock_on = NULL, // tsc2101_clock_on, | ||
397 | .codec_clock_off = NULL, // tsc2101_clock_off, | ||
398 | .get_default_samplerate = NULL, // tsc2101_get_default_samplerate, | ||
399 | }; | ||
400 | |||
401 | static struct platform_device h3_mcbsp1_device = { | ||
402 | .name = "omap_alsa_mcbsp", | ||
403 | .id = 1, | ||
404 | .dev = { | ||
405 | .platform_data = &alsa_config, | ||
406 | }, | ||
407 | }; | ||
408 | |||
369 | static struct platform_device *devices[] __initdata = { | 409 | static struct platform_device *devices[] __initdata = { |
370 | &nor_device, | 410 | &nor_device, |
371 | &nand_device, | 411 | &nand_device, |
@@ -374,6 +414,7 @@ static struct platform_device *devices[] __initdata = { | |||
374 | &h3_irda_device, | 414 | &h3_irda_device, |
375 | &h3_kp_device, | 415 | &h3_kp_device, |
376 | &h3_lcd_device, | 416 | &h3_lcd_device, |
417 | &h3_mcbsp1_device, | ||
377 | }; | 418 | }; |
378 | 419 | ||
379 | static struct omap_usb_config h3_usb_config __initdata = { | 420 | static struct omap_usb_config h3_usb_config __initdata = { |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 70014f751bc4..8ea0cef8bdb1 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include <asm/arch/aic23.h> | 34 | #include <asm/arch/aic23.h> |
35 | #include <asm/arch/gpio.h> | 35 | #include <asm/arch/gpio.h> |
36 | 36 | ||
37 | #include "../plat-omap/dsp/dsp_common.h" | ||
38 | |||
37 | static void __init omap_nokia770_init_irq(void) | 39 | static void __init omap_nokia770_init_irq(void) |
38 | { | 40 | { |
39 | /* On Nokia 770, the SleepX signal is masked with an | 41 | /* On Nokia 770, the SleepX signal is masked with an |
@@ -91,7 +93,7 @@ static struct platform_device nokia770_kp_device = { | |||
91 | }; | 93 | }; |
92 | 94 | ||
93 | static struct platform_device *nokia770_devices[] __initdata = { | 95 | static struct platform_device *nokia770_devices[] __initdata = { |
94 | &nokia770_kp_device, | 96 | &nokia770_kp_device, |
95 | }; | 97 | }; |
96 | 98 | ||
97 | static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { | 99 | static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { |
@@ -105,7 +107,7 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = | |||
105 | 107 | ||
106 | static struct spi_board_info nokia770_spi_board_info[] __initdata = { | 108 | static struct spi_board_info nokia770_spi_board_info[] __initdata = { |
107 | [0] = { | 109 | [0] = { |
108 | .modalias = "lcd_mipid", | 110 | .modalias = "lcd_mipid", |
109 | .bus_num = 2, | 111 | .bus_num = 2, |
110 | .chip_select = 3, | 112 | .chip_select = 3, |
111 | .max_speed_hz = 12000000, | 113 | .max_speed_hz = 12000000, |
@@ -153,6 +155,7 @@ static struct omap_board_config_kernel nokia770_config[] = { | |||
153 | { OMAP_TAG_MMC, &nokia770_mmc_config }, | 155 | { OMAP_TAG_MMC, &nokia770_mmc_config }, |
154 | }; | 156 | }; |
155 | 157 | ||
158 | #if defined(CONFIG_OMAP_DSP) | ||
156 | /* | 159 | /* |
157 | * audio power control | 160 | * audio power control |
158 | */ | 161 | */ |
@@ -183,7 +186,7 @@ static void nokia770_audio_pwr_up(void) | |||
183 | clk_enable(dspxor_ck); | 186 | clk_enable(dspxor_ck); |
184 | 187 | ||
185 | /* Turn on codec */ | 188 | /* Turn on codec */ |
186 | tlv320aic23_power_up(); | 189 | aic23_power_up(); |
187 | 190 | ||
188 | if (omap_get_gpio_datain(HEADPHONE_GPIO)) | 191 | if (omap_get_gpio_datain(HEADPHONE_GPIO)) |
189 | /* HP not connected, turn on amplifier */ | 192 | /* HP not connected, turn on amplifier */ |
@@ -197,7 +200,7 @@ static void codec_delayed_power_down(struct work_struct *work) | |||
197 | { | 200 | { |
198 | down(&audio_pwr_sem); | 201 | down(&audio_pwr_sem); |
199 | if (audio_pwr_state == -1) | 202 | if (audio_pwr_state == -1) |
200 | tlv320aic23_power_down(); | 203 | aic23_power_down(); |
201 | clk_disable(dspxor_ck); | 204 | clk_disable(dspxor_ck); |
202 | up(&audio_pwr_sem); | 205 | up(&audio_pwr_sem); |
203 | } | 206 | } |
@@ -213,7 +216,8 @@ static void nokia770_audio_pwr_down(void) | |||
213 | schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ | 216 | schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ |
214 | } | 217 | } |
215 | 218 | ||
216 | void nokia770_audio_pwr_up_request(int stage) | 219 | static int |
220 | nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage) | ||
217 | { | 221 | { |
218 | down(&audio_pwr_sem); | 222 | down(&audio_pwr_sem); |
219 | if (audio_pwr_state == -1) | 223 | if (audio_pwr_state == -1) |
@@ -221,9 +225,11 @@ void nokia770_audio_pwr_up_request(int stage) | |||
221 | /* force audio_pwr_state = 0, even if it was 1. */ | 225 | /* force audio_pwr_state = 0, even if it was 1. */ |
222 | audio_pwr_state = 0; | 226 | audio_pwr_state = 0; |
223 | up(&audio_pwr_sem); | 227 | up(&audio_pwr_sem); |
228 | return 0; | ||
224 | } | 229 | } |
225 | 230 | ||
226 | void nokia770_audio_pwr_down_request(int stage) | 231 | static int |
232 | nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) | ||
227 | { | 233 | { |
228 | down(&audio_pwr_sem); | 234 | down(&audio_pwr_sem); |
229 | switch (stage) { | 235 | switch (stage) { |
@@ -239,7 +245,38 @@ void nokia770_audio_pwr_down_request(int stage) | |||
239 | break; | 245 | break; |
240 | } | 246 | } |
241 | up(&audio_pwr_sem); | 247 | up(&audio_pwr_sem); |
248 | return 0; | ||
249 | } | ||
250 | |||
251 | static struct dsp_kfunc_device nokia770_audio_device = { | ||
252 | .name = "audio", | ||
253 | .type = DSP_KFUNC_DEV_TYPE_AUDIO, | ||
254 | .enable = nokia770_audio_pwr_up_request, | ||
255 | .disable = nokia770_audio_pwr_down_request, | ||
256 | }; | ||
257 | |||
258 | static __init int omap_dsp_init(void) | ||
259 | { | ||
260 | int ret; | ||
261 | |||
262 | dspxor_ck = clk_get(0, "dspxor_ck"); | ||
263 | if (IS_ERR(dspxor_ck)) { | ||
264 | printk(KERN_ERR "couldn't acquire dspxor_ck\n"); | ||
265 | return PTR_ERR(dspxor_ck); | ||
266 | } | ||
267 | |||
268 | ret = dsp_kfunc_device_register(&nokia770_audio_device); | ||
269 | if (ret) { | ||
270 | printk(KERN_ERR | ||
271 | "KFUNC device registration faild: %s\n", | ||
272 | nokia770_audio_device.name); | ||
273 | goto out; | ||
274 | } | ||
275 | return 0; | ||
276 | out: | ||
277 | return ret; | ||
242 | } | 278 | } |
279 | #endif /* CONFIG_OMAP_DSP */ | ||
243 | 280 | ||
244 | static void __init omap_nokia770_init(void) | 281 | static void __init omap_nokia770_init(void) |
245 | { | 282 | { |
@@ -251,9 +288,7 @@ static void __init omap_nokia770_init(void) | |||
251 | omap_board_config = nokia770_config; | 288 | omap_board_config = nokia770_config; |
252 | omap_board_config_size = ARRAY_SIZE(nokia770_config); | 289 | omap_board_config_size = ARRAY_SIZE(nokia770_config); |
253 | omap_serial_init(); | 290 | omap_serial_init(); |
254 | omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request; | 291 | omap_dsp_init(); |
255 | omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request; | ||
256 | dspxor_ck = clk_get(0, "dspxor_ck"); | ||
257 | } | 292 | } |
258 | 293 | ||
259 | static void __init omap_nokia770_map_io(void) | 294 | static void __init omap_nokia770_map_io(void) |
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index 2bfa08870664..83f6e09bf079 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/interrupt.h> | ||
32 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
33 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
34 | 35 | ||
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index 9af031ad63b8..2f9d00a00135 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c | |||
@@ -321,116 +321,6 @@ static struct tsc2102_config palmte_tsc2102_config = { | |||
321 | .alsa_config = &palmte_alsa_config, | 321 | .alsa_config = &palmte_alsa_config, |
322 | }; | 322 | }; |
323 | 323 | ||
324 | static struct omap_mcbsp_reg_cfg palmte_mcbsp1_regs = { | ||
325 | .spcr2 = FRST | GRST | XRST | XINTM(3), | ||
326 | .xcr2 = XDATDLY(1) | XFIG, | ||
327 | .xcr1 = XWDLEN1(OMAP_MCBSP_WORD_32), | ||
328 | .pcr0 = SCLKME | FSXP | CLKXP, | ||
329 | }; | ||
330 | |||
331 | static struct omap_alsa_codec_config palmte_alsa_config = { | ||
332 | .name = "TSC2102 audio", | ||
333 | .mcbsp_regs_alsa = &palmte_mcbsp1_regs, | ||
334 | .codec_configure_dev = NULL, /* tsc2102_configure, */ | ||
335 | .codec_set_samplerate = NULL, /* tsc2102_set_samplerate, */ | ||
336 | .codec_clock_setup = NULL, /* tsc2102_clock_setup, */ | ||
337 | .codec_clock_on = NULL, /* tsc2102_clock_on, */ | ||
338 | .codec_clock_off = NULL, /* tsc2102_clock_off, */ | ||
339 | .get_default_samplerate = NULL, /* tsc2102_get_default_samplerate, */ | ||
340 | }; | ||
341 | |||
342 | #ifdef CONFIG_APM | ||
343 | /* | ||
344 | * Values measured in 10 minute intervals averaged over 10 samples. | ||
345 | * May differ slightly from device to device but should be accurate | ||
346 | * enough to give basic idea of battery life left and trigger | ||
347 | * potential alerts. | ||
348 | */ | ||
349 | static const int palmte_battery_sample[] = { | ||
350 | 2194, 2157, 2138, 2120, | ||
351 | 2104, 2089, 2075, 2061, | ||
352 | 2048, 2038, 2026, 2016, | ||
353 | 2008, 1998, 1989, 1980, | ||
354 | 1970, 1958, 1945, 1928, | ||
355 | 1910, 1888, 1860, 1827, | ||
356 | 1791, 1751, 1709, 1656, | ||
357 | }; | ||
358 | |||
359 | #define INTERVAL 10 | ||
360 | #define BATTERY_HIGH_TRESHOLD 66 | ||
361 | #define BATTERY_LOW_TRESHOLD 33 | ||
362 | |||
363 | static void palmte_get_power_status(struct apm_power_info *info, int *battery) | ||
364 | { | ||
365 | int charging, batt, hi, lo, mid; | ||
366 | |||
367 | charging = !omap_get_gpio_datain(PALMTE_DC_GPIO); | ||
368 | batt = battery[0]; | ||
369 | if (charging) | ||
370 | batt -= 60; | ||
371 | |||
372 | hi = ARRAY_SIZE(palmte_battery_sample); | ||
373 | lo = 0; | ||
374 | |||
375 | info->battery_flag = 0; | ||
376 | info->units = APM_UNITS_MINS; | ||
377 | |||
378 | if (batt > palmte_battery_sample[lo]) { | ||
379 | info->battery_life = 100; | ||
380 | info->time = INTERVAL * ARRAY_SIZE(palmte_battery_sample); | ||
381 | } else if (batt <= palmte_battery_sample[hi - 1]) { | ||
382 | info->battery_life = 0; | ||
383 | info->time = 0; | ||
384 | } else { | ||
385 | while (hi > lo + 1) { | ||
386 | mid = (hi + lo) >> 2; | ||
387 | if (batt <= palmte_battery_sample[mid]) | ||
388 | lo = mid; | ||
389 | else | ||
390 | hi = mid; | ||
391 | } | ||
392 | |||
393 | mid = palmte_battery_sample[lo] - palmte_battery_sample[hi]; | ||
394 | hi = palmte_battery_sample[lo] - batt; | ||
395 | info->battery_life = 100 - (100 * lo + 100 * hi / mid) / | ||
396 | ARRAY_SIZE(palmte_battery_sample); | ||
397 | info->time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) - | ||
398 | lo) - INTERVAL * hi / mid; | ||
399 | } | ||
400 | |||
401 | if (charging) { | ||
402 | info->ac_line_status = APM_AC_ONLINE; | ||
403 | info->battery_status = APM_BATTERY_STATUS_CHARGING; | ||
404 | info->battery_flag |= APM_BATTERY_FLAG_CHARGING; | ||
405 | } else { | ||
406 | info->ac_line_status = APM_AC_OFFLINE; | ||
407 | if (info->battery_life > BATTERY_HIGH_TRESHOLD) | ||
408 | info->battery_status = APM_BATTERY_STATUS_HIGH; | ||
409 | else if (info->battery_life > BATTERY_LOW_TRESHOLD) | ||
410 | info->battery_status = APM_BATTERY_STATUS_LOW; | ||
411 | else | ||
412 | info->battery_status = APM_BATTERY_STATUS_CRITICAL; | ||
413 | } | ||
414 | |||
415 | if (info->battery_life > BATTERY_HIGH_TRESHOLD) | ||
416 | info->battery_flag |= APM_BATTERY_FLAG_HIGH; | ||
417 | else if (info->battery_life > BATTERY_LOW_TRESHOLD) | ||
418 | info->battery_flag |= APM_BATTERY_FLAG_LOW; | ||
419 | else | ||
420 | info->battery_flag |= APM_BATTERY_FLAG_CRITICAL; | ||
421 | } | ||
422 | #else | ||
423 | #define palmte_get_power_status NULL | ||
424 | #endif | ||
425 | |||
426 | static struct tsc2102_config palmte_tsc2102_config = { | ||
427 | .use_internal = 0, | ||
428 | .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP, | ||
429 | .temp_at25c = { 2200, 2615 }, | ||
430 | .apm_report = palmte_get_power_status, | ||
431 | .alsa_config = &palmte_alsa_config, | ||
432 | }; | ||
433 | |||
434 | static struct omap_board_config_kernel palmte_config[] = { | 324 | static struct omap_board_config_kernel palmte_config[] = { |
435 | { OMAP_TAG_USB, &palmte_usb_config }, | 325 | { OMAP_TAG_USB, &palmte_usb_config }, |
436 | { OMAP_TAG_MMC, &palmte_mmc_config }, | 326 | { OMAP_TAG_MMC, &palmte_mmc_config }, |
@@ -449,17 +339,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = { | |||
449 | }, | 339 | }, |
450 | }; | 340 | }; |
451 | 341 | ||
452 | static struct spi_board_info palmte_spi_info[] __initdata = { | ||
453 | { | ||
454 | .modalias = "tsc2102", | ||
455 | .bus_num = 2, /* uWire (officially) */ | ||
456 | .chip_select = 0, /* As opposed to 3 */ | ||
457 | .irq = OMAP_GPIO_IRQ(PALMTE_PINTDAV_GPIO), | ||
458 | .platform_data = &palmte_tsc2102_config, | ||
459 | .max_speed_hz = 8000000, | ||
460 | }, | ||
461 | }; | ||
462 | |||
463 | /* Periodically check for changes on important input pins */ | 342 | /* Periodically check for changes on important input pins */ |
464 | struct timer_list palmte_pin_timer; | 343 | struct timer_list palmte_pin_timer; |
465 | int prev_power, prev_headphones; | 344 | int prev_power, prev_headphones; |
@@ -539,8 +418,6 @@ static void __init omap_palmte_init(void) | |||
539 | 418 | ||
540 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); | 419 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); |
541 | 420 | ||
542 | spi_register_board_info(palmte_spi_info, ARRAY_SIZE(palmte_spi_info)); | ||
543 | |||
544 | omap_serial_init(); | 421 | omap_serial_init(); |
545 | palmte_gpio_setup(); | 422 | palmte_gpio_setup(); |
546 | } | 423 | } |
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 3c9a41a3d820..e47010fec275 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c | |||
@@ -314,8 +314,8 @@ static struct omap_uart_config palmtt_uart_config __initdata = { | |||
314 | }; | 314 | }; |
315 | 315 | ||
316 | static struct omap_board_config_kernel palmtt_config[] = { | 316 | static struct omap_board_config_kernel palmtt_config[] = { |
317 | { OMAP_TAG_USB, &palmtt_usb_config }, | 317 | { OMAP_TAG_USB, &palmtt_usb_config }, |
318 | { OMAP_TAG_LCD, &palmtt_lcd_config }, | 318 | { OMAP_TAG_LCD, &palmtt_lcd_config }, |
319 | { OMAP_TAG_UART, &palmtt_uart_config }, | 319 | { OMAP_TAG_UART, &palmtt_uart_config }, |
320 | }; | 320 | }; |
321 | 321 | ||
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 447a586eb334..214dd19889ac 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -235,7 +235,7 @@ static struct notifier_block panic_block = { | |||
235 | static int __init voiceblue_setup(void) | 235 | static int __init voiceblue_setup(void) |
236 | { | 236 | { |
237 | /* Setup panic notifier */ | 237 | /* Setup panic notifier */ |
238 | notifier_chain_register(&panic_notifier_list, &panic_block); | 238 | atomic_notifier_chain_register(&panic_notifier_list, &panic_block); |
239 | 239 | ||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |