1 /* 2 * Structures and registers for GPIO access in the Nomadik SoC 3 * 4 * Code ported from Nomadik GPIO driver in ST-Ericsson Linux kernel code. 5 * The purpose is that GPIO config found in kernel should work by simply 6 * copy-paste it to U-boot. 7 * 8 * Ported to U-boot by: 9 * Copyright (C) 2010 Joakim Axelsson <joakim.axelsson AT stericsson.com> 10 * Copyright (C) 2008 STMicroelectronics 11 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> 12 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> 13 * 14 * This program is free software; you can redistribute it and/or modify 15 * it under the terms of the GNU General Public License version 2 as 16 * published by the Free Software Foundation. 17 */ 18 19 #ifndef __DB8500_GPIO_H__ 20 #define __DB8500_GPIO_H__ 21 22 /* Alternate functions: function C is set in hw by setting both A and B */ 23 enum db8500_gpio_alt { 24 DB8500_GPIO_ALT_GPIO = 0, 25 DB8500_GPIO_ALT_A = 1, 26 DB8500_GPIO_ALT_B = 2, 27 DB8500_GPIO_ALT_C = (DB8500_GPIO_ALT_A | DB8500_GPIO_ALT_B) 28 }; 29 30 enum db8500_gpio_pull { 31 DB8500_GPIO_PULL_NONE, 32 DB8500_GPIO_PULL_UP, 33 DB8500_GPIO_PULL_DOWN 34 }; 35 36 void db8500_gpio_set_pull(unsigned gpio, enum db8500_gpio_pull pull); 37 void db8500_gpio_make_input(unsigned gpio); 38 int db8500_gpio_get_input(unsigned gpio); 39 void db8500_gpio_make_output(unsigned gpio, int val); 40 void db8500_gpio_set_output(unsigned gpio, int val); 41 42 #endif /* __DB8500_GPIO_H__ */ 43