1 /* linux/arch/arm/mach-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 #include <linux/kernel.h>
14 #include <linux/types.h>
15 #include <linux/interrupt.h>
16 #include <linux/init.h>
17 #include <linux/module.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22 #include <asm/mach/irq.h>
24 #include <mach/hardware.h>
27 #include <mach/regs-gpio.h>
28 #include <mach/regs-dsc.h>
31 #include <plat/s3c2440.h>
33 int s3c2440_set_dsc(unsigned int pin
, unsigned int value
)
40 base
= (pin
& S3C2440_SELECT_DSC1
) ? S3C2440_DSC1
: S3C2440_DSC0
;
41 mask
= 3 << S3C2440_DSC_GETSHIFT(pin
);
43 local_irq_save(flags
);
45 val
= __raw_readl(base
);
48 __raw_writel(val
, base
);
50 local_irq_restore(flags
);
54 EXPORT_SYMBOL(s3c2440_set_dsc
);