diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-04 15:18:36 +0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-04 15:18:36 +0400 |
commit | db3c94a7edc6b29f8d52ba5884dec6a15feeadad (patch) | |
tree | ac9207a44cecafb9104ca4e1f46aecb9fe01383d /arch/arm/mach-s3c2412 | |
parent | c9477f38cba225870862fd9e08868ae3d4abdfe0 (diff) | |
parent | 568f0e278c6dd33dc11bd19c4ad781d1f8d86800 (diff) | |
download | linux-db3c94a7edc6b29f8d52ba5884dec6a15feeadad.tar.xz |
Merge branch 'next-samsung-devel' into next-samsung-devel-2
Conflicts:
arch/arm/mach-exynos4/clock.c
arch/arm/mach-s3c2412/gpio.c
arch/arm/mach-s5p64x0/dma.c
arch/arm/mach-s5p64x0/gpiolib.c
Diffstat (limited to 'arch/arm/mach-s3c2412')
-rw-r--r-- | arch/arm/mach-s3c2412/dma.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2412/gpio.c | 62 |
2 files changed, 64 insertions, 2 deletions
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c index c61e3261615d..d2a7d5ef3e67 100644 --- a/arch/arm/mach-s3c2412/dma.c +++ b/arch/arm/mach-s3c2412/dma.c @@ -130,11 +130,11 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = { static void s3c2412_dma_direction(struct s3c2410_dma_chan *chan, struct s3c24xx_dma_map *map, - enum s3c2410_dmasrc dir) + enum dma_data_direction dir) { unsigned long chsel; - if (dir == S3C2410_DMASRC_HW) + if (dir == DMA_FROM_DEVICE) chsel = map->channels_rx[0]; else chsel = map->channels[0]; diff --git a/arch/arm/mach-s3c2412/gpio.c b/arch/arm/mach-s3c2412/gpio.c new file mode 100644 index 000000000000..4526f6ba31a8 --- /dev/null +++ b/arch/arm/mach-s3c2412/gpio.c @@ -0,0 +1,62 @@ +/* linux/arch/arm/mach-s3c2412/gpio.c + * + * Copyright (c) 2007 Simtec Electronics + * Ben Dooks <ben@simtec.co.uk> + * + * http://armlinux.simtec.co.uk/. + * + * S3C2412/S3C2413 specific GPIO support + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/module.h> +#include <linux/interrupt.h> +#include <linux/gpio.h> + +#include <asm/mach/arch.h> +#include <asm/mach/map.h> + +#include <mach/regs-gpio.h> +#include <mach/hardware.h> + +#include <plat/gpio-core.h> + +int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state) +{ + struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin); + unsigned long offs = pin - chip->chip.base; + unsigned long flags; + unsigned long slpcon; + + offs *= 2; + + if (pin < S3C2410_GPB(0)) + return -EINVAL; + + if (pin >= S3C2410_GPF(0) && + pin <= S3C2410_GPG(16)) + return -EINVAL; + + if (pin > S3C2410_GPH(16)) + return -EINVAL; + + local_irq_save(flags); + + slpcon = __raw_readl(chip->base + 0x0C); + + slpcon &= ~(3 << offs); + slpcon |= state << offs; + + __raw_writel(slpcon, chip->base + 0x0C); + + local_irq_restore(flags); + + return 0; +} + +EXPORT_SYMBOL(s3c2412_gpio_set_sleepcfg); |