aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/bfin_gpio.c
diff options
context:
space:
mode:
authorMike Frysinger <michael.frysinger@analog.com>2007-12-24 03:54:48 -0500
committerBryan Wu <bryan.wu@analog.com>2007-12-24 03:54:48 -0500
commit1545a1111a02b5aafe6f141e133a6269c5741285 (patch)
treef018c4b0c074c3e9ed72d887d74948a88165a9c5 /arch/blackfin/kernel/bfin_gpio.c
parent54a1668ce53fe701f1d36651b591ced388e97275 (diff)
[Blackfin] arch: add support for BF523/BF524/BF526
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/kernel/bfin_gpio.c')
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index ce85d4bf34ca..ea13d2a22d69 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -83,6 +83,7 @@
83#include <linux/delay.h> 83#include <linux/delay.h>
84#include <linux/module.h> 84#include <linux/module.h>
85#include <linux/err.h> 85#include <linux/err.h>
86#include <linux/proc_fs.h>
86#include <asm/blackfin.h> 87#include <asm/blackfin.h>
87#include <asm/gpio.h> 88#include <asm/gpio.h>
88#include <asm/portmux.h> 89#include <asm/portmux.h>
@@ -1194,3 +1195,36 @@ void bfin_gpio_reset_spi0_ssel1(void)
1194} 1195}
1195 1196
1196#endif /*BF548_FAMILY */ 1197#endif /*BF548_FAMILY */
1198
1199#if defined(CONFIG_PROC_FS)
1200static int gpio_proc_read(char *buf, char **start, off_t offset,
1201 int len, int *unused_i, void *unused_v)
1202{
1203 int c, outlen = 0;
1204
1205 for (c = 0; c < MAX_RESOURCES; c++) {
1206 if (!check_gpio(c) && (reserved_gpio_map[gpio_bank(c)] & gpio_bit(c)))
1207 len = sprintf(buf, "GPIO_%d: %s \tGPIO %s\n", c,
1208 get_label(c), get_gpio_dir(c) ? "OUTPUT" : "INPUT");
1209 else if (reserved_peri_map[gpio_bank(c)] & gpio_bit(c))
1210 len = sprintf(buf, "GPIO_%d: %s \tPeripheral\n", c, get_label(c));
1211 else
1212 continue;
1213 buf += len;
1214 outlen += len;
1215 }
1216 return outlen;
1217}
1218
1219static __init int gpio_register_proc(void)
1220{
1221 struct proc_dir_entry *proc_gpio;
1222
1223 proc_gpio = create_proc_entry("gpio", S_IRUGO, NULL);
1224 if (proc_gpio)
1225 proc_gpio->read_proc = gpio_proc_read;
1226 return proc_gpio != NULL;
1227}
1228
1229__initcall(gpio_register_proc);
1230#endif