From 307a253778d0918a8e0f10c2ea9a350450e37677 Mon Sep 17 00:00:00 2001 From: Joakim Axelsson Date: Wed, 20 Oct 2010 14:11:49 +0200 Subject: db8500: New GPIO driver and config, from Linux kernel Copied the GPIO configurator written for the Linux kernel. The Nomadik db8500 GPIO driver. Purpose is to be able to just cut-n-paste the GPIO config from Linux to U-boot. Also at the same time remove the obsolete and old gpio_alt_funcenable/disable methods. Now all is configured using a table in u8500.c. Now drivers doesn't have to worry about setting up the GPIO pins. Actually no driver today uses GPIO pins directly, only via hardware blocks within db8500. Functions are still added to be able to interact directly with a GPIO pin. This also cleaned up a lot of driver by not having to bit manipulate GPIO registers them self. The new driver is called db8500_gpio and placed in driver/gpio/. Functions are in include/db8500_gpio.h: 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); And for the configurator in include/db8500_pincfg.h: void db8500_gpio_config_pins(pin_cfg_t *cfgs, size_t num); All in all the final binary size has decreased. This is only done for db8500 nomadik GPIO. The code for gpio expanders has not been touched. All references to Nomadik has been removed in this driver. Only db8500 is left. ST-Ericsson ID: None Signed-off-by: Joakim Axelsson Change-Id: I90aa1d46c813ffb5a777c3492b5751f5054f71cf Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/9904 Reviewed-by: QATOOLS Reviewed-by: Michael BRANDT --- include/configs/u8500.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/configs/u8500.h') diff --git a/include/configs/u8500.h b/include/configs/u8500.h index 7a0284c0b..0bca0dcf6 100644 --- a/include/configs/u8500.h +++ b/include/configs/u8500.h @@ -309,6 +309,7 @@ /* * U8500 GPIO register base for 9 banks */ +#define CONFIG_DB8500_GPIO #define CFG_GPIO_0_BASE 0x8012E000 #define CFG_GPIO_1_BASE 0x8012E080 #define CFG_GPIO_2_BASE 0x8000E000 -- cgit v1.2.3