[ARM] 3326/1: H1940 - Control latches

Patch from Ben Dooks

Define the bits for the two board control latches
that control various items on the H1940 iPAQ.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Ben Dooks and committed by
Russell King
e1981680 b514d319

+91 -2
+27 -2
arch/arm/mach-s3c2410/mach-h1940.c
··· 46 46 #include <asm/irq.h> 47 47 #include <asm/mach-types.h> 48 48 49 - //#include <asm/debug-ll.h> 49 + 50 50 #include <asm/arch/regs-serial.h> 51 51 #include <asm/arch/regs-lcd.h> 52 52 53 + #include <asm/arch/h1940-latch.h> 53 54 #include <asm/arch/fb.h> 54 55 55 56 #include <linux/serial_core.h> ··· 60 59 #include "cpu.h" 61 60 62 61 static struct map_desc h1940_iodesc[] __initdata = { 63 - /* nothing here yet */ 62 + [0] = { 63 + .virtual = (unsigned long)H1940_LATCH, 64 + .pfn = __phys_to_pfn(H1940_PA_LATCH), 65 + .length = SZ_16K, 66 + .type = MT_DEVICE 67 + }, 64 68 }; 65 69 66 70 #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK ··· 98 92 } 99 93 }; 100 94 95 + /* Board control latch control */ 96 + 97 + static unsigned int latch_state = H1940_LATCH_DEFAULT; 98 + 99 + void h1940_latch_control(unsigned int clear, unsigned int set) 100 + { 101 + unsigned long flags; 102 + 103 + local_irq_save(flags); 104 + 105 + latch_state &= ~clear; 106 + latch_state |= set; 107 + 108 + __raw_writel(latch_state, H1940_LATCH); 109 + 110 + local_irq_restore(flags); 111 + } 112 + 113 + EXPORT_SYMBOL_GPL(h1940_latch_control); 101 114 102 115 103 116 /**
+64
include/asm-arm/arch-s3c2410/h1940-latch.h
··· 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 */