diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2010-05-18 06:23:36 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:15:02 -0400 |
commit | 838c6d499b780c42fccbbdfecc0f5dcc471d0ef3 (patch) | |
tree | 8dbbe6ad6f940c390ea62c273470480ebdde2d63 /arch/arm/plat-s5pc1xx | |
parent | 14b8a0f92b309ff452a8c339abd9a096d00b210f (diff) |
ARM: SAMSUNG: move driver strength gpio configuration helper to common dir
Driver strength parameter can be changed not only on S5PC100 but also
on S5PV210/S5PC110 platforms, so move the helper functions to the common
plat-samsung directory.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s5pc1xx')
-rw-r--r-- | arch/arm/plat-s5pc1xx/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/plat-s5pc1xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-s5pc1xx/gpio-config.c | 62 | ||||
-rw-r--r-- | arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h | 32 | ||||
-rw-r--r-- | arch/arm/plat-s5pc1xx/setup-fb-24bpp.c | 1 |
5 files changed, 1 insertions, 97 deletions
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig index c7ccdf22eefa..79d3be721dde 100644 --- a/arch/arm/plat-s5pc1xx/Kconfig +++ b/arch/arm/plat-s5pc1xx/Kconfig | |||
@@ -16,9 +16,9 @@ config PLAT_S5PC1XX | |||
16 | select SAMSUNG_IRQ_VIC_TIMER | 16 | select SAMSUNG_IRQ_VIC_TIMER |
17 | select S3C_GPIO_TRACK | 17 | select S3C_GPIO_TRACK |
18 | select S3C_GPIO_PULL_UPDOWN | 18 | select S3C_GPIO_PULL_UPDOWN |
19 | select S5P_GPIO_DRVSTR | ||
19 | select S3C_GPIO_CFG_S3C24XX | 20 | select S3C_GPIO_CFG_S3C24XX |
20 | select S3C_GPIO_CFG_S3C64XX | 21 | select S3C_GPIO_CFG_S3C64XX |
21 | select S5P_GPIO_CFG_S5PC1XX | ||
22 | help | 22 | help |
23 | Base platform code for any Samsung S5PC1XX device | 23 | Base platform code for any Samsung S5PC1XX device |
24 | 24 | ||
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile index 278f26806089..66a8f3eb7071 100644 --- a/arch/arm/plat-s5pc1xx/Makefile +++ b/arch/arm/plat-s5pc1xx/Makefile | |||
@@ -24,7 +24,6 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o | |||
24 | 24 | ||
25 | # Device setup | 25 | # Device setup |
26 | 26 | ||
27 | obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o | ||
28 | obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o | 27 | obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o |
29 | obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o | 28 | obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o |
30 | obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o | 29 | obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o |
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c b/arch/arm/plat-s5pc1xx/gpio-config.c deleted file mode 100644 index a4f67e80a150..000000000000 --- a/arch/arm/plat-s5pc1xx/gpio-config.c +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* linux/arch/arm/plat-s5pc1xx/gpio-config.c | ||
2 | * | ||
3 | * Copyright 2009 Samsung Electronics | ||
4 | * | ||
5 | * S5PC1XX GPIO Configuration. | ||
6 | * | ||
7 | * Based on plat-s3c64xx/gpio-config.c | ||
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 | #include <linux/kernel.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <plat/gpio-core.h> | ||
20 | #include <plat/gpio-cfg-s5pc1xx.h> | ||
21 | |||
22 | s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off) | ||
23 | { | ||
24 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); | ||
25 | void __iomem *reg; | ||
26 | int shift = off * 2; | ||
27 | u32 drvstr; | ||
28 | |||
29 | if (!chip) | ||
30 | return -EINVAL; | ||
31 | |||
32 | reg = chip->base + 0x0C; | ||
33 | |||
34 | drvstr = __raw_readl(reg); | ||
35 | drvstr = 0xffff & (0x3 << shift); | ||
36 | drvstr = drvstr >> shift; | ||
37 | |||
38 | return (__force s5p_gpio_drvstr_t)drvstr; | ||
39 | } | ||
40 | EXPORT_SYMBOL(s5p_gpio_get_drvstr); | ||
41 | |||
42 | int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off, | ||
43 | s5p_gpio_drvstr_t drvstr) | ||
44 | { | ||
45 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); | ||
46 | void __iomem *reg; | ||
47 | int shift = off * 2; | ||
48 | u32 tmp; | ||
49 | |||
50 | if (!chip) | ||
51 | return -EINVAL; | ||
52 | |||
53 | reg = chip->base + 0x0C; | ||
54 | |||
55 | tmp = __raw_readl(reg); | ||
56 | tmp |= drvstr << shift; | ||
57 | |||
58 | __raw_writel(tmp, reg); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | EXPORT_SYMBOL(s5p_gpio_set_drvstr); | ||
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h deleted file mode 100644 index 72ad59f61efc..000000000000 --- a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h | ||
2 | * | ||
3 | * Copyright 2009 Samsung Electronic | ||
4 | * | ||
5 | * S5PC1XX Platform - GPIO pin configuration | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | /* This file contains the necessary definitions to get the basic gpio | ||
13 | * pin configuration done such as setting a pin to input or output or | ||
14 | * changing the pull-{up,down} configurations. | ||
15 | */ | ||
16 | |||
17 | #ifndef __GPIO_CFG_S5PC1XX_H | ||
18 | #define __GPIO_CFG_S5PC1XX_H __FILE__ | ||
19 | |||
20 | typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; | ||
21 | |||
22 | #define S5P_GPIO_DRVSTR_LV1 0x00 | ||
23 | #define S5P_GPIO_DRVSTR_LV2 0x01 | ||
24 | #define S5P_GPIO_DRVSTR_LV3 0x10 | ||
25 | #define S5P_GPIO_DRVSTR_LV4 0x11 | ||
26 | |||
27 | extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off); | ||
28 | |||
29 | extern int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off, | ||
30 | s5p_gpio_drvstr_t drvstr); | ||
31 | |||
32 | #endif /* __GPIO_CFG_S5PC1XX_H */ | ||
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c index 1a63768a9a2e..b02c36fb10d1 100644 --- a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +++ b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <mach/map.h> | 19 | #include <mach/map.h> |
20 | #include <plat/fb.h> | 20 | #include <plat/fb.h> |
21 | #include <plat/gpio-cfg.h> | 21 | #include <plat/gpio-cfg.h> |
22 | #include <plat/gpio-cfg-s5pc1xx.h> | ||
23 | 22 | ||
24 | #define DISR_OFFSET 0x7008 | 23 | #define DISR_OFFSET 0x7008 |
25 | 24 | ||