aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/gpio.h
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2008-12-25 04:17:09 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-01-27 00:49:09 -0500
commit18801be7f805b891876a6676ec7fac2e1acdec13 (patch)
tree71b4366a89ac25980dc16bc1b33fbc6943f1155c /arch/sh/include/asm/gpio.h
parent5376071069ec8a7e6a8112beab16fc24f5139475 (diff)
sh: make gpio_get/set_value() O(1)
This patch modifies the table based SuperH gpio implementation to make use of direct table lookups. With this change the functions gpio_get_value() and gpio_set_value() are O(1). Tested on Migo-R using bitbanging mmc. Performance is improved from 11 KBytes/s to 26 Kbytes/s. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/gpio.h')
-rw-r--r--arch/sh/include/asm/gpio.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h
index 90673658eb14..942fefa61c7e 100644
--- a/arch/sh/include/asm/gpio.h
+++ b/arch/sh/include/asm/gpio.h
@@ -20,7 +20,7 @@
20#endif 20#endif
21 21
22typedef unsigned short pinmux_enum_t; 22typedef unsigned short pinmux_enum_t;
23typedef unsigned char pinmux_flag_t; 23typedef unsigned short pinmux_flag_t;
24 24
25#define PINMUX_TYPE_NONE 0 25#define PINMUX_TYPE_NONE 0
26#define PINMUX_TYPE_FUNCTION 1 26#define PINMUX_TYPE_FUNCTION 1
@@ -34,6 +34,11 @@ typedef unsigned char pinmux_flag_t;
34#define PINMUX_FLAG_WANT_PULLUP (1 << 3) 34#define PINMUX_FLAG_WANT_PULLUP (1 << 3)
35#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4) 35#define PINMUX_FLAG_WANT_PULLDOWN (1 << 4)
36 36
37#define PINMUX_FLAG_DBIT_SHIFT 5
38#define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT)
39#define PINMUX_FLAG_DREG_SHIFT 10
40#define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT)
41
37struct pinmux_gpio { 42struct pinmux_gpio {
38 pinmux_enum_t enum_id; 43 pinmux_enum_t enum_id;
39 pinmux_flag_t flags; 44 pinmux_flag_t flags;