]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm:gpio:mxc add a bank_index entry in platdata
authorPeng Fan <Peng.Fan@freescale.com>
Tue, 10 Feb 2015 06:46:33 +0000 (14:46 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 19:13:33 +0000 (21:13 +0200)
Add a new entry in platdata structure and intialize
bank_index in mxc_plat array.
This new entry can avoid using `plat - mxc_plat` by using
`plat->bank_index`.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/gpio/mxc_gpio.c

index e8aca171a95e81b7fb3aa80586c19b7d5cf3cf84..02181ec8193a4ce81068adcfbf28d63aab999433 100644 (file)
@@ -280,6 +280,23 @@ static const struct dm_gpio_ops gpio_mxc_ops = {
        .get_function           = mxc_gpio_get_function,
 };
 
+static const struct mxc_gpio_plat mxc_plat[] = {
+       { 0, (struct gpio_regs *)GPIO1_BASE_ADDR },
+       { 1, (struct gpio_regs *)GPIO2_BASE_ADDR },
+       { 2, (struct gpio_regs *)GPIO3_BASE_ADDR },
+#if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX51) || \
+               defined(CONFIG_MX53) || defined(CONFIG_MX6)
+       { 3, (struct gpio_regs *)GPIO4_BASE_ADDR },
+#endif
+#if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6)
+       { 4, (struct gpio_regs *)GPIO5_BASE_ADDR },
+       { 5, (struct gpio_regs *)GPIO6_BASE_ADDR },
+#endif
+#if defined(CONFIG_MX53) || defined(CONFIG_MX6)
+       { 6, (struct gpio_regs *)GPIO7_BASE_ADDR },
+#endif
+};
+
 static int mxc_gpio_probe(struct udevice *dev)
 {
        struct mxc_bank_info *bank = dev_get_priv(dev);