diff options
-rw-r--r-- | arch/arm/mach-s3c2410/mach-h1940.c | 29 | ||||
-rw-r--r-- | include/asm-arm/arch-s3c2410/h1940-latch.h | 64 |
2 files changed, 91 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 1c316f14ed94..646a3a5d33a5 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c | |||
@@ -46,10 +46,11 @@ | |||
46 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
47 | #include <asm/mach-types.h> | 47 | #include <asm/mach-types.h> |
48 | 48 | ||
49 | //#include <asm/debug-ll.h> | 49 | |
50 | #include <asm/arch/regs-serial.h> | 50 | #include <asm/arch/regs-serial.h> |
51 | #include <asm/arch/regs-lcd.h> | 51 | #include <asm/arch/regs-lcd.h> |
52 | 52 | ||
53 | #include <asm/arch/h1940-latch.h> | ||
53 | #include <asm/arch/fb.h> | 54 | #include <asm/arch/fb.h> |
54 | 55 | ||
55 | #include <linux/serial_core.h> | 56 | #include <linux/serial_core.h> |
@@ -59,7 +60,12 @@ | |||
59 | #include "cpu.h" | 60 | #include "cpu.h" |
60 | 61 | ||
61 | static struct map_desc h1940_iodesc[] __initdata = { | 62 | static struct map_desc h1940_iodesc[] __initdata = { |
62 | /* nothing here yet */ | 63 | [0] = { |
64 | .virtual = (unsigned long)H1940_LATCH, | ||
65 | .pfn = __phys_to_pfn(H1940_PA_LATCH), | ||
66 | .length = SZ_16K, | ||
67 | .type = MT_DEVICE | ||
68 | }, | ||
63 | }; | 69 | }; |
64 | 70 | ||
65 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK | 71 | #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK |
@@ -92,6 +98,25 @@ static struct s3c2410_uartcfg h1940_uartcfgs[] = { | |||
92 | } | 98 | } |
93 | }; | 99 | }; |
94 | 100 | ||
101 | /* Board control latch control */ | ||
102 | |||
103 | static unsigned int latch_state = H1940_LATCH_DEFAULT; | ||
104 | |||
105 | void h1940_latch_control(unsigned int clear, unsigned int set) | ||
106 | { | ||
107 | unsigned long flags; | ||
108 | |||
109 | local_irq_save(flags); | ||
110 | |||
111 | latch_state &= ~clear; | ||
112 | latch_state |= set; | ||
113 | |||
114 | __raw_writel(latch_state, H1940_LATCH); | ||
115 | |||
116 | local_irq_restore(flags); | ||
117 | } | ||
118 | |||
119 | EXPORT_SYMBOL_GPL(h1940_latch_control); | ||
95 | 120 | ||
96 | 121 | ||
97 | /** | 122 | /** |
diff --git a/include/asm-arm/arch-s3c2410/h1940-latch.h b/include/asm-arm/arch-s3c2410/h1940-latch.h new file mode 100644 index 000000000000..c5802411f43d --- /dev/null +++ b/include/asm-arm/arch-s3c2410/h1940-latch.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/h1940-latch.h | ||
2 | * | ||
3 | * (c) 2005 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * iPAQ H1940 series - latch definitions | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARCH_H1940_LATCH_H | ||
15 | #define __ASM_ARCH_H1940_LATCH_H | ||
16 | |||
17 | |||
18 | #ifndef __ASSEMBLY__ | ||
19 | #define H1940_LATCH ((void __iomem *)0xF8000000) | ||
20 | #else | ||
21 | #define H1940_LATCH 0xF8000000 | ||
22 | #endif | ||
23 | |||
24 | #define H1940_PA_LATCH (S3C2410_CS2) | ||
25 | |||
26 | /* SD layer latch */ | ||
27 | |||
28 | #define H1940_LATCH_SDQ1 (1<<16) | ||
29 | #define H1940_LATCH_LCD_P1 (1<<17) | ||
30 | #define H1940_LATCH_LCD_P2 (1<<18) | ||
31 | #define H1940_LATCH_LCD_P3 (1<<19) | ||
32 | #define H1940_LATCH_MAX1698_nSHUTDOWN (1<<20) /* LCD backlight */ | ||
33 | #define H1940_LATCH_LED_RED (1<<21) | ||
34 | #define H1940_LATCH_SDQ7 (1<<22) | ||
35 | #define H1940_LATCH_USB_DP (1<<23) | ||
36 | |||
37 | /* CPU layer latch */ | ||
38 | |||
39 | #define H1940_LATCH_UDA_POWER (1<<24) | ||
40 | #define H1940_LATCH_AUDIO_POWER (1<<25) | ||
41 | #define H1940_LATCH_SM803_ENABLE (1<<26) | ||
42 | #define H1940_LATCH_LCD_P4 (1<<27) | ||
43 | #define H1940_LATCH_CPUQ5 (1<<28) /* untraced */ | ||
44 | #define H1940_LATCH_BLUETOOTH_POWER (1<<29) /* active high */ | ||
45 | #define H1940_LATCH_LED_GREEN (1<<30) | ||
46 | #define H1940_LATCH_LED_FLASH (1<<31) | ||
47 | |||
48 | /* default settings */ | ||
49 | |||
50 | #define H1940_LATCH_DEFAULT \ | ||
51 | H1940_LATCH_LCD_P4 | \ | ||
52 | H1940_LATCH_SM803_ENABLE | \ | ||
53 | H1940_LATCH_SDQ1 | \ | ||
54 | H1940_LATCH_LCD_P1 | \ | ||
55 | H1940_LATCH_LCD_P2 | \ | ||
56 | H1940_LATCH_LCD_P3 | \ | ||
57 | H1940_LATCH_MAX1698_nSHUTDOWN | \ | ||
58 | H1940_LATCH_CPUQ5 | ||
59 | |||
60 | /* control functions */ | ||
61 | |||
62 | extern void h1940_latch_control(unsigned int clear, unsigned int set); | ||
63 | |||
64 | #endif /* __ASM_ARCH_H1940_LATCH_H */ | ||