1 /* linux/arch/arm/mach-s3c2410/s3c2440-dsc.c
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * Samsung S3C2440 Drive Strength Control support
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.
13 * 29-Aug-2004 BJD Start of drive-strength control
14 * 09-Nov-2004 BJD Added symbol export
15 * 11-Jan-2005 BJD Include fix
18 #include <linux/kernel.h>
19 #include <linux/types.h>
20 #include <linux/interrupt.h>
21 #include <linux/init.h>
22 #include <linux/module.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/irq.h>
28 #include <asm/hardware.h>
32 #include <asm/arch/regs-gpio.h>
33 #include <asm/arch/regs-dsc.h>
38 int s3c2440_set_dsc(unsigned int pin, unsigned int value)
45 base = (pin & S3C2440_SELECT_DSC1) ? S3C2440_DSC1 : S3C2440_DSC0;
46 mask = 3 << S3C2440_DSC_GETSHIFT(pin);
48 local_irq_save(flags);
50 val = __raw_readl(base);
53 __raw_writel(val, base);
55 local_irq_restore(flags);
59 EXPORT_SYMBOL(s3c2440_set_dsc);