aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2440/dsc.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-02-11 12:31:01 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-02-11 12:36:09 -0500
commita21765a70ec06be175d3997320a83fa66fcc8955 (patch)
tree24bdbf437a9bd5b7c1af05898f5aa25dccf67fe9 /arch/arm/mach-s3c2440/dsc.c
parentd19494b187b20e363f9b434b9ceab4159ac88324 (diff)
[ARM] 4157/2: S3C24XX: move arch/arch/mach-s3c2410 into cpu components
The following patch and script moves the arch/arm/mach-s3c2410 directory into arch/arm/plat-s3c24xx for the generic core code and inti arch/arm/mach-s3c{cpu} for the cpu/machine support files Include directory include/asm-arm/plat-s3c24xx is added for the core include files. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2440/dsc.c')
-rw-r--r--arch/arm/mach-s3c2440/dsc.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2440/dsc.c b/arch/arm/mach-s3c2440/dsc.c
new file mode 100644
index 000000000000..2995ff5681bb
--- /dev/null
+++ b/arch/arm/mach-s3c2440/dsc.c
@@ -0,0 +1,54 @@
1/* linux/arch/arm/mach-s3c2440/dsc.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2440 Drive Strength Control support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/init.h>
17#include <linux/module.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21#include <asm/mach/irq.h>
22
23#include <asm/hardware.h>
24#include <asm/io.h>
25#include <asm/irq.h>
26
27#include <asm/arch/regs-gpio.h>
28#include <asm/arch/regs-dsc.h>
29
30#include <asm/plat-s3c24xx/cpu.h>
31#include <asm/plat-s3c24xx/s3c2440.h>
32
33int s3c2440_set_dsc(unsigned int pin, unsigned int value)
34{
35 void __iomem *base;
36 unsigned long val;
37 unsigned long flags;
38 unsigned long mask;
39
40 base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
41 mask = 3 << S3C2440_DSC_GETSHIFT(pin);
42
43 local_irq_save(flags);
44
45 val = __raw_readl(base);
46 val &= ~mask;
47 val |= value & mask;
48 __raw_writel(val, base);
49
50 local_irq_restore(flags);
51 return 0;
52}
53
54EXPORT_SYMBOL(s3c2440_set_dsc);