aboutsummaryrefslogtreecommitdiff
path: root/include/db8500_gpio.h
diff options
context:
space:
mode:
authorPer Forlin <per.forlin@linaro.org>2012-01-16 22:31:46 -0700
committerJohn Rigby <john.rigby@linaro.org>2012-04-25 07:54:07 -0600
commit6c2c97ff988701fa5d2d7dee89cb3d246f5c7432 (patch)
tree45f87b87dbcd04ae905a605753b47b5ac2dd6785 /include/db8500_gpio.h
parentf77f298b98b8c3bc551433ed7d89c164104bd705 (diff)
downloadu-boot-linaro-stable-6c2c97ff988701fa5d2d7dee89cb3d246f5c7432.tar.gz
snowball: igloo copy port of gpio driver support
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Diffstat (limited to 'include/db8500_gpio.h')
-rw-r--r--include/db8500_gpio.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/db8500_gpio.h b/include/db8500_gpio.h
new file mode 100644
index 000000000..67d7e4d56
--- /dev/null
+++ b/include/db8500_gpio.h
@@ -0,0 +1,43 @@
+/*
+ * Structures and registers for GPIO access in the Nomadik SoC
+ *
+ * Code ported from Nomadik GPIO driver in ST-Ericsson Linux kernel code.
+ * The purpose is that GPIO config found in kernel should work by simply
+ * copy-paste it to U-boot.
+ *
+ * Ported to U-boot by:
+ * Copyright (C) 2010 Joakim Axelsson <joakim.axelsson AT stericsson.com>
+ * Copyright (C) 2008 STMicroelectronics
+ * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
+ * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
+ *
+ * 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.
+ */
+
+#ifndef __DB8500_GPIO_H__
+#define __DB8500_GPIO_H__
+
+/* Alternate functions: function C is set in hw by setting both A and B */
+enum db8500_gpio_alt {
+ DB8500_GPIO_ALT_GPIO = 0,
+ DB8500_GPIO_ALT_A = 1,
+ DB8500_GPIO_ALT_B = 2,
+ DB8500_GPIO_ALT_C = (DB8500_GPIO_ALT_A | DB8500_GPIO_ALT_B)
+};
+
+enum db8500_gpio_pull {
+ DB8500_GPIO_PULL_NONE,
+ DB8500_GPIO_PULL_UP,
+ DB8500_GPIO_PULL_DOWN
+};
+
+void db8500_gpio_set_pull(unsigned gpio, enum db8500_gpio_pull pull);
+void db8500_gpio_make_input(unsigned gpio);
+int db8500_gpio_get_input(unsigned gpio);
+void db8500_gpio_make_output(unsigned gpio, int val);
+void db8500_gpio_set_output(unsigned gpio, int val);
+
+#endif /* __DB8500_GPIO_H__ */
+