Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) ST-Ericsson SA 2010 |
| 3 | * |
| 4 | * License terms: GNU General Public License (GPL) version 2 |
| 5 | */ |
| 6 | |
| 7 | #include <linux/kernel.h> |
| 8 | #include <linux/init.h> |
Paul Gortmaker | 50af5ea | 2012-01-20 18:35:53 -0500 | [diff] [blame] | 9 | #include <linux/bug.h> |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 10 | #include <linux/string.h> |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 11 | #include <linux/pinctrl/machine.h> |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 12 | |
Bibek Basu | 4bc3a69 | 2011-02-15 10:46:59 +0100 | [diff] [blame] | 13 | #include <asm/mach-types.h> |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 14 | #include <plat/pincfg.h> |
Linus Walleij | 0f33286 | 2011-08-22 08:33:30 +0100 | [diff] [blame] | 15 | #include <plat/gpio-nomadik.h> |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 16 | |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 17 | #include <mach/hardware.h> |
| 18 | |
| 19 | #include "pins-db8500.h" |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 20 | #include "board-mop500.h" |
| 21 | |
| 22 | enum custom_pin_cfg_t { |
| 23 | PINS_FOR_DEFAULT, |
| 24 | PINS_FOR_U9500, |
| 25 | }; |
| 26 | |
| 27 | static enum custom_pin_cfg_t pinsfor; |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 28 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 29 | /* These simply sets bias for pins */ |
| 30 | #define BIAS(a,b) static unsigned long a[] = { b } |
Bibek Basu | 4bc3a69 | 2011-02-15 10:46:59 +0100 | [diff] [blame] | 31 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 32 | BIAS(pd, PIN_PULL_DOWN); |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 33 | BIAS(in_nopull, PIN_INPUT_NOPULL); |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 34 | BIAS(in_nopull_slpm_nowkup, PIN_INPUT_NOPULL|PIN_SLPM_WAKEUP_DISABLE); |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 35 | BIAS(in_pu, PIN_INPUT_PULLUP); |
| 36 | BIAS(in_pd, PIN_INPUT_PULLDOWN); |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 37 | BIAS(out_hi, PIN_OUTPUT_HIGH); |
| 38 | BIAS(out_lo, PIN_OUTPUT_LOW); |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 39 | BIAS(out_lo_slpm_nowkup, PIN_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE); |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 40 | /* These also force them into GPIO mode */ |
| 41 | BIAS(gpio_in_pu, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED); |
| 42 | BIAS(gpio_in_pd, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED); |
| 43 | BIAS(gpio_in_pu_slpm_gpio_nopull, PIN_INPUT_PULLUP|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL); |
| 44 | BIAS(gpio_in_pd_slpm_gpio_nopull, PIN_INPUT_PULLDOWN|PIN_GPIOMODE_ENABLED|PIN_SLPM_GPIO|PIN_SLPM_INPUT_NOPULL); |
| 45 | BIAS(gpio_out_hi, PIN_OUTPUT_HIGH|PIN_GPIOMODE_ENABLED); |
| 46 | BIAS(gpio_out_lo, PIN_OUTPUT_LOW|PIN_GPIOMODE_ENABLED); |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 47 | /* Sleep modes */ |
Patrice Chotard | 9cd9d65 | 2012-10-18 13:35:35 +0200 | [diff] [blame] | 48 | BIAS(slpm_in_nopull_wkup, PIN_SLEEPMODE_ENABLED| |
| 49 | PIN_SLPM_DIR_INPUT|PIN_SLPM_PULL_NONE|PIN_SLPM_WAKEUP_ENABLE); |
| 50 | BIAS(slpm_in_wkup_pdis, PIN_SLEEPMODE_ENABLED| |
| 51 | PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
| 52 | BIAS(slpm_wkup_pdis, PIN_SLEEPMODE_ENABLED| |
| 53 | PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
Patrice Chotard | 9cd9d65 | 2012-10-18 13:35:35 +0200 | [diff] [blame] | 54 | BIAS(slpm_out_lo_pdis, PIN_SLEEPMODE_ENABLED| |
| 55 | PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_DISABLE|PIN_SLPM_PDIS_DISABLED); |
| 56 | BIAS(slpm_out_lo_wkup, PIN_SLEEPMODE_ENABLED| |
| 57 | PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE); |
| 58 | BIAS(slpm_out_lo_wkup_pdis, PIN_SLEEPMODE_ENABLED| |
| 59 | PIN_SLPM_OUTPUT_LOW|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 60 | BIAS(slpm_out_hi_wkup_pdis, PIN_SLEEPMODE_ENABLED|PIN_SLPM_OUTPUT_HIGH| |
| 61 | PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
Patrice Chotard | 9cd9d65 | 2012-10-18 13:35:35 +0200 | [diff] [blame] | 62 | BIAS(slpm_in_nopull_wkup_pdis, PIN_SLEEPMODE_ENABLED| |
| 63 | PIN_SLPM_INPUT_NOPULL|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
| 64 | BIAS(slpm_in_pu_wkup_pdis_en, PIN_SLEEPMODE_ENABLED|PIN_SLPM_INPUT_PULLUP| |
| 65 | PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_ENABLED); |
Patrice Chotard | 184a695 | 2012-10-23 15:51:29 +0200 | [diff] [blame] | 66 | BIAS(slpm_out_wkup_pdis, PIN_SLEEPMODE_ENABLED| |
| 67 | PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 68 | BIAS(out_lo_wkup_pdis, PIN_SLPM_OUTPUT_LOW| |
| 69 | PIN_SLPM_WAKEUP_ENABLE|PIN_SLPM_PDIS_DISABLED); |
| 70 | BIAS(in_wkup_pdis_en, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE| |
| 71 | PIN_SLPM_PDIS_ENABLED); |
| 72 | BIAS(in_wkup_pdis, PIN_SLPM_DIR_INPUT|PIN_SLPM_WAKEUP_ENABLE| |
| 73 | PIN_SLPM_PDIS_DISABLED); |
Patrice Chotard | ad7f67c | 2012-10-25 15:30:32 +0200 | [diff] [blame] | 74 | BIAS(out_hi_wkup_pdis, PIN_SLPM_OUTPUT_HIGH|PIN_SLPM_WAKEUP_ENABLE| |
| 75 | PIN_SLPM_PDIS_DISABLED); |
| 76 | BIAS(out_wkup_pdis, PIN_SLPM_DIR_OUTPUT|PIN_SLPM_WAKEUP_ENABLE| |
| 77 | PIN_SLPM_PDIS_DISABLED); |
Bibek Basu | 4bc3a69 | 2011-02-15 10:46:59 +0100 | [diff] [blame] | 78 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 79 | /* We use these to define hog settings that are always done on boot */ |
| 80 | #define DB8500_MUX_HOG(group,func) \ |
| 81 | PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-db8500", group, func) |
| 82 | #define DB8500_PIN_HOG(pin,conf) \ |
| 83 | PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-db8500", pin, conf) |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 84 | #define DB8500_PIN_SLEEP(pin, conf, dev) \ |
| 85 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ |
| 86 | pin, conf) |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 87 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 88 | /* These are default states associated with device and changed runtime */ |
| 89 | #define DB8500_MUX(group,func,dev) \ |
| 90 | PIN_MAP_MUX_GROUP_DEFAULT(dev, "pinctrl-db8500", group, func) |
| 91 | #define DB8500_PIN(pin,conf,dev) \ |
| 92 | PIN_MAP_CONFIGS_PIN_DEFAULT(dev, "pinctrl-db8500", pin, conf) |
Patrice Chotard | d036809 | 2012-10-09 15:26:11 +0200 | [diff] [blame] | 93 | #define DB8500_PIN_IDLE(pin, conf, dev) \ |
| 94 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_IDLE, "pinctrl-db8500", \ |
| 95 | pin, conf) |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 96 | #define DB8500_PIN_SLEEP(pin, conf, dev) \ |
| 97 | PIN_MAP_CONFIGS_PIN(dev, PINCTRL_STATE_SLEEP, "pinctrl-db8500", \ |
| 98 | pin, conf) |
Jean-Nicolas Graux | 35c0c28 | 2012-10-19 17:39:07 +0200 | [diff] [blame^] | 99 | #define DB8500_MUX_STATE(group, func, dev, state) \ |
| 100 | PIN_MAP_MUX_GROUP(dev, state, "pinctrl-db8500", group, func) |
| 101 | #define DB8500_PIN_STATE(pin, conf, dev, state) \ |
| 102 | PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-db8500", pin, conf) |
Bibek Basu | 4bc3a69 | 2011-02-15 10:46:59 +0100 | [diff] [blame] | 103 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 104 | /* Pin control settings */ |
| 105 | static struct pinctrl_map __initdata mop500_family_pinmap[] = { |
| 106 | /* |
| 107 | * uMSP0, mux in 4 pins, regular placement of RX/TX |
| 108 | * explicitly set the pins to no pull |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 109 | */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 110 | DB8500_MUX_HOG("msp0txrx_a_1", "msp0"), |
| 111 | DB8500_MUX_HOG("msp0tfstck_a_1", "msp0"), |
| 112 | DB8500_PIN_HOG("GPIO12_AC4", in_nopull), /* TXD */ |
| 113 | DB8500_PIN_HOG("GPIO15_AC3", in_nopull), /* RXD */ |
| 114 | DB8500_PIN_HOG("GPIO13_AF3", in_nopull), /* TFS */ |
| 115 | DB8500_PIN_HOG("GPIO14_AE3", in_nopull), /* TCK */ |
| 116 | /* MSP2 for HDMI, pull down TXD, TCK, TFS */ |
| 117 | DB8500_MUX_HOG("msp2_a_1", "msp2"), |
| 118 | DB8500_PIN_HOG("GPIO193_AH27", in_pd), /* TXD */ |
| 119 | DB8500_PIN_HOG("GPIO194_AF27", in_pd), /* TCK */ |
| 120 | DB8500_PIN_HOG("GPIO195_AG28", in_pd), /* TFS */ |
| 121 | DB8500_PIN_HOG("GPIO196_AG26", out_lo), /* RXD */ |
| 122 | /* |
| 123 | * LCD, set TE0 (using LCD VSI0) and D14 (touch screen interrupt) to |
| 124 | * pull-up |
| 125 | * TODO: is this really correct? Snowball doesn't have a LCD. |
| 126 | */ |
| 127 | DB8500_MUX_HOG("lcdvsi0_a_1", "lcd"), |
| 128 | DB8500_PIN_HOG("GPIO68_E1", in_pu), |
| 129 | DB8500_PIN_HOG("GPIO84_C2", gpio_in_pu), |
| 130 | /* |
| 131 | * STMPE1601/tc35893 keypad IRQ GPIO 218 |
| 132 | * TODO: set for snowball and HREF really?? |
| 133 | */ |
| 134 | DB8500_PIN_HOG("GPIO218_AH11", gpio_in_pu), |
| 135 | /* |
| 136 | * UART0, we do not mux in u0 here. |
| 137 | * uart-0 pins gpio configuration should be kept intact to prevent |
| 138 | * a glitch in tx line when the tty dev is opened. Later these pins |
Patrice Chotard | ad7f67c | 2012-10-25 15:30:32 +0200 | [diff] [blame] | 139 | * are configured by uart driver |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 140 | */ |
| 141 | DB8500_PIN_HOG("GPIO0_AJ5", in_pu), /* CTS */ |
| 142 | DB8500_PIN_HOG("GPIO1_AJ3", out_hi), /* RTS */ |
| 143 | DB8500_PIN_HOG("GPIO2_AH4", in_pu), /* RXD */ |
| 144 | DB8500_PIN_HOG("GPIO3_AH3", out_hi), /* TXD */ |
| 145 | /* |
| 146 | * Mux in UART2 on altfunction C and set pull-ups. |
| 147 | * TODO: is this used on U8500 variants and Snowball really? |
| 148 | * The setting on GPIO31 conflicts with magnetometer use on hrefv60 |
| 149 | */ |
Patrice Chotard | ad7f67c | 2012-10-25 15:30:32 +0200 | [diff] [blame] | 150 | /* default state for UART2 */ |
| 151 | DB8500_MUX("u2ctsrts_c_1", "u2", "uart2"), |
| 152 | DB8500_PIN("GPIO31_V3", in_pu, "uart2"), /* CTS */ |
| 153 | DB8500_PIN("GPIO32_V2", out_hi, "uart2"), /* RTS */ |
| 154 | DB8500_MUX("u2rxtx_c_1", "u2", "uart2"), |
| 155 | DB8500_PIN("GPIO29_W2", in_pu, "uart2"), /* RXD */ |
| 156 | DB8500_PIN("GPIO30_W3", out_hi, "uart2"), /* TXD */ |
| 157 | /* Sleep state for UART2 */ |
| 158 | DB8500_PIN_SLEEP("GPIO31_V3", in_wkup_pdis, "uart2"), |
| 159 | DB8500_PIN_SLEEP("GPIO32_V2", out_hi_wkup_pdis, "uart2"), |
| 160 | DB8500_PIN_SLEEP("GPIO29_W2", in_wkup_pdis, "uart2"), |
| 161 | DB8500_PIN_SLEEP("GPIO30_W3", out_wkup_pdis, "uart2"), |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 162 | /* |
| 163 | * The following pin sets were known as "runtime pins" before being |
| 164 | * converted to the pinctrl model. Here we model them as "default" |
| 165 | * states. |
| 166 | */ |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 167 | /* Mux in UART0 after initialization */ |
| 168 | DB8500_MUX("u0_a_1", "u0", "uart0"), |
| 169 | DB8500_PIN("GPIO0_AJ5", in_pu, "uart0"), /* CTS */ |
| 170 | DB8500_PIN("GPIO1_AJ3", out_hi, "uart0"), /* RTS */ |
| 171 | DB8500_PIN("GPIO2_AH4", in_pu, "uart0"), /* RXD */ |
| 172 | DB8500_PIN("GPIO3_AH3", out_hi, "uart0"), /* TXD */ |
Patrice Chotard | 184a695 | 2012-10-23 15:51:29 +0200 | [diff] [blame] | 173 | /* Sleep state for UART0 */ |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 174 | DB8500_PIN_SLEEP("GPIO0_AJ5", slpm_in_wkup_pdis, "uart0"), |
| 175 | DB8500_PIN_SLEEP("GPIO1_AJ3", slpm_out_hi_wkup_pdis, "uart0"), |
| 176 | DB8500_PIN_SLEEP("GPIO2_AH4", slpm_in_wkup_pdis, "uart0"), |
| 177 | DB8500_PIN_SLEEP("GPIO3_AH3", slpm_out_wkup_pdis, "uart0"), |
Patrice Chotard | ad7f67c | 2012-10-25 15:30:32 +0200 | [diff] [blame] | 178 | /* Mux in UART1 after initialization */ |
| 179 | DB8500_MUX("u1rxtx_a_1", "u1", "uart1"), |
| 180 | DB8500_PIN("GPIO4_AH6", in_pu, "uart1"), /* RXD */ |
| 181 | DB8500_PIN("GPIO5_AG6", out_hi, "uart1"), /* TXD */ |
| 182 | /* Sleep state for UART1 */ |
| 183 | DB8500_PIN_SLEEP("GPIO4_AH6", slpm_in_wkup_pdis, "uart1"), |
| 184 | DB8500_PIN_SLEEP("GPIO5_AG6", slpm_out_wkup_pdis, "uart1"), |
Linus Walleij | 08d98fe | 2012-05-07 10:34:16 +0200 | [diff] [blame] | 185 | /* MSP1 for ALSA codec */ |
| 186 | DB8500_MUX("msp1txrx_a_1", "msp1", "ux500-msp-i2s.1"), |
| 187 | DB8500_MUX("msp1_a_1", "msp1", "ux500-msp-i2s.1"), |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 188 | DB8500_PIN("GPIO33_AF2", out_lo_slpm_nowkup, "ux500-msp-i2s.1"), |
| 189 | DB8500_PIN("GPIO34_AE1", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
| 190 | DB8500_PIN("GPIO35_AE2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
| 191 | DB8500_PIN("GPIO36_AG2", in_nopull_slpm_nowkup, "ux500-msp-i2s.1"), |
Linus Walleij | 08d98fe | 2012-05-07 10:34:16 +0200 | [diff] [blame] | 192 | /* MSP1 sleep state */ |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 193 | DB8500_PIN_SLEEP("GPIO33_AF2", slpm_out_lo_wkup, "ux500-msp-i2s.1"), |
| 194 | DB8500_PIN_SLEEP("GPIO34_AE1", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
| 195 | DB8500_PIN_SLEEP("GPIO35_AE2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
| 196 | DB8500_PIN_SLEEP("GPIO36_AG2", slpm_in_nopull_wkup, "ux500-msp-i2s.1"), |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 197 | /* Mux in LCD data lines 8 thru 11 and LCDA CLK for MCDE TVOUT */ |
| 198 | DB8500_MUX("lcd_d8_d11_a_1", "lcd", "mcde-tvout"), |
| 199 | DB8500_MUX("lcdaclk_b_1", "lcda", "mcde-tvout"), |
| 200 | /* Mux in LCD VSI1 and pull it up for MCDE HDMI output */ |
Patrice Chotard | 9728df9 | 2012-09-26 13:10:29 +0200 | [diff] [blame] | 201 | DB8500_MUX("lcdvsi1_a_1", "lcd", "0-0070"), |
| 202 | DB8500_PIN("GPIO69_E2", in_pu, "0-0070"), |
| 203 | /* LCD VSI1 sleep state */ |
| 204 | DB8500_PIN_SLEEP("GPIO69_E2", slpm_in_wkup_pdis, "0-0070"), |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 205 | /* Mux in i2c0 block, default state */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 206 | DB8500_MUX("i2c0_a_1", "i2c0", "nmk-i2c.0"), |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 207 | /* i2c0 sleep state */ |
| 208 | DB8500_PIN_SLEEP("GPIO147_C15", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SDA */ |
| 209 | DB8500_PIN_SLEEP("GPIO148_B16", slpm_in_nopull_wkup_pdis, "nmk-i2c.0"), /* SCL */ |
| 210 | /* Mux in i2c1 block, default state */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 211 | DB8500_MUX("i2c1_b_2", "i2c1", "nmk-i2c.1"), |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 212 | /* i2c1 sleep state */ |
| 213 | DB8500_PIN_SLEEP("GPIO16_AD3", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SDA */ |
| 214 | DB8500_PIN_SLEEP("GPIO17_AD4", slpm_in_nopull_wkup_pdis, "nmk-i2c.1"), /* SCL */ |
| 215 | /* Mux in i2c2 block, default state */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 216 | DB8500_MUX("i2c2_b_2", "i2c2", "nmk-i2c.2"), |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 217 | /* i2c2 sleep state */ |
| 218 | DB8500_PIN_SLEEP("GPIO10_AF5", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SDA */ |
| 219 | DB8500_PIN_SLEEP("GPIO11_AG4", slpm_in_nopull_wkup_pdis, "nmk-i2c.2"), /* SCL */ |
| 220 | /* Mux in i2c3 block, default state */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 221 | DB8500_MUX("i2c3_c_2", "i2c3", "nmk-i2c.3"), |
Patrice Chotard | 4401e29 | 2012-09-20 13:55:27 +0200 | [diff] [blame] | 222 | /* i2c3 sleep state */ |
| 223 | DB8500_PIN_SLEEP("GPIO229_AG7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SDA */ |
| 224 | DB8500_PIN_SLEEP("GPIO230_AF7", slpm_in_nopull_wkup_pdis, "nmk-i2c.3"), /* SCL */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 225 | /* Mux in SDI0 (here called MC0) used for removable MMC/SD/SDIO cards */ |
| 226 | DB8500_MUX("mc0_a_1", "mc0", "sdi0"), |
| 227 | DB8500_PIN("GPIO18_AC2", out_hi, "sdi0"), /* CMDDIR */ |
| 228 | DB8500_PIN("GPIO19_AC1", out_hi, "sdi0"), /* DAT0DIR */ |
| 229 | DB8500_PIN("GPIO20_AB4", out_hi, "sdi0"), /* DAT2DIR */ |
| 230 | DB8500_PIN("GPIO22_AA3", in_nopull, "sdi0"), /* FBCLK */ |
| 231 | DB8500_PIN("GPIO23_AA4", out_lo, "sdi0"), /* CLK */ |
| 232 | DB8500_PIN("GPIO24_AB2", in_pu, "sdi0"), /* CMD */ |
| 233 | DB8500_PIN("GPIO25_Y4", in_pu, "sdi0"), /* DAT0 */ |
| 234 | DB8500_PIN("GPIO26_Y2", in_pu, "sdi0"), /* DAT1 */ |
| 235 | DB8500_PIN("GPIO27_AA2", in_pu, "sdi0"), /* DAT2 */ |
| 236 | DB8500_PIN("GPIO28_AA1", in_pu, "sdi0"), /* DAT3 */ |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 237 | /* SDI0 sleep state */ |
| 238 | DB8500_PIN_SLEEP("GPIO18_AC2", slpm_out_hi_wkup_pdis, "sdi0"), |
| 239 | DB8500_PIN_SLEEP("GPIO19_AC1", slpm_out_hi_wkup_pdis, "sdi0"), |
| 240 | DB8500_PIN_SLEEP("GPIO20_AB4", slpm_out_hi_wkup_pdis, "sdi0"), |
| 241 | DB8500_PIN_SLEEP("GPIO22_AA3", slpm_in_wkup_pdis, "sdi0"), |
| 242 | DB8500_PIN_SLEEP("GPIO23_AA4", slpm_out_lo_wkup_pdis, "sdi0"), |
| 243 | DB8500_PIN_SLEEP("GPIO24_AB2", slpm_in_wkup_pdis, "sdi0"), |
| 244 | DB8500_PIN_SLEEP("GPIO25_Y4", slpm_in_wkup_pdis, "sdi0"), |
| 245 | DB8500_PIN_SLEEP("GPIO26_Y2", slpm_in_wkup_pdis, "sdi0"), |
| 246 | DB8500_PIN_SLEEP("GPIO27_AA2", slpm_in_wkup_pdis, "sdi0"), |
| 247 | DB8500_PIN_SLEEP("GPIO28_AA1", slpm_in_wkup_pdis, "sdi0"), |
| 248 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 249 | /* Mux in SDI1 (here called MC1) used for SDIO for CW1200 WLAN */ |
| 250 | DB8500_MUX("mc1_a_1", "mc1", "sdi1"), |
| 251 | DB8500_PIN("GPIO208_AH16", out_lo, "sdi1"), /* CLK */ |
| 252 | DB8500_PIN("GPIO209_AG15", in_nopull, "sdi1"), /* FBCLK */ |
| 253 | DB8500_PIN("GPIO210_AJ15", in_pu, "sdi1"), /* CMD */ |
| 254 | DB8500_PIN("GPIO211_AG14", in_pu, "sdi1"), /* DAT0 */ |
| 255 | DB8500_PIN("GPIO212_AF13", in_pu, "sdi1"), /* DAT1 */ |
| 256 | DB8500_PIN("GPIO213_AG13", in_pu, "sdi1"), /* DAT2 */ |
| 257 | DB8500_PIN("GPIO214_AH15", in_pu, "sdi1"), /* DAT3 */ |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 258 | /* SDI1 sleep state */ |
| 259 | DB8500_PIN_SLEEP("GPIO208_AH16", slpm_out_lo_wkup_pdis, "sdi1"), /* CLK */ |
| 260 | DB8500_PIN_SLEEP("GPIO209_AG15", slpm_in_wkup_pdis, "sdi1"), /* FBCLK */ |
| 261 | DB8500_PIN_SLEEP("GPIO210_AJ15", slpm_in_wkup_pdis, "sdi1"), /* CMD */ |
| 262 | DB8500_PIN_SLEEP("GPIO211_AG14", slpm_in_wkup_pdis, "sdi1"), /* DAT0 */ |
| 263 | DB8500_PIN_SLEEP("GPIO212_AF13", slpm_in_wkup_pdis, "sdi1"), /* DAT1 */ |
| 264 | DB8500_PIN_SLEEP("GPIO213_AG13", slpm_in_wkup_pdis, "sdi1"), /* DAT2 */ |
| 265 | DB8500_PIN_SLEEP("GPIO214_AH15", slpm_in_wkup_pdis, "sdi1"), /* DAT3 */ |
| 266 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 267 | /* Mux in SDI2 (here called MC2) used for for PoP eMMC */ |
| 268 | DB8500_MUX("mc2_a_1", "mc2", "sdi2"), |
| 269 | DB8500_PIN("GPIO128_A5", out_lo, "sdi2"), /* CLK */ |
| 270 | DB8500_PIN("GPIO129_B4", in_pu, "sdi2"), /* CMD */ |
| 271 | DB8500_PIN("GPIO130_C8", in_nopull, "sdi2"), /* FBCLK */ |
| 272 | DB8500_PIN("GPIO131_A12", in_pu, "sdi2"), /* DAT0 */ |
| 273 | DB8500_PIN("GPIO132_C10", in_pu, "sdi2"), /* DAT1 */ |
| 274 | DB8500_PIN("GPIO133_B10", in_pu, "sdi2"), /* DAT2 */ |
| 275 | DB8500_PIN("GPIO134_B9", in_pu, "sdi2"), /* DAT3 */ |
| 276 | DB8500_PIN("GPIO135_A9", in_pu, "sdi2"), /* DAT4 */ |
| 277 | DB8500_PIN("GPIO136_C7", in_pu, "sdi2"), /* DAT5 */ |
| 278 | DB8500_PIN("GPIO137_A7", in_pu, "sdi2"), /* DAT6 */ |
| 279 | DB8500_PIN("GPIO138_C5", in_pu, "sdi2"), /* DAT7 */ |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 280 | /* SDI2 sleep state */ |
| 281 | DB8500_PIN_SLEEP("GPIO128_A5", out_lo_wkup_pdis, "sdi2"), /* CLK */ |
| 282 | DB8500_PIN_SLEEP("GPIO129_B4", in_wkup_pdis_en, "sdi2"), /* CMD */ |
| 283 | DB8500_PIN_SLEEP("GPIO130_C8", in_wkup_pdis_en, "sdi2"), /* FBCLK */ |
| 284 | DB8500_PIN_SLEEP("GPIO131_A12", in_wkup_pdis, "sdi2"), /* DAT0 */ |
| 285 | DB8500_PIN_SLEEP("GPIO132_C10", in_wkup_pdis, "sdi2"), /* DAT1 */ |
| 286 | DB8500_PIN_SLEEP("GPIO133_B10", in_wkup_pdis, "sdi2"), /* DAT2 */ |
| 287 | DB8500_PIN_SLEEP("GPIO134_B9", in_wkup_pdis, "sdi2"), /* DAT3 */ |
| 288 | DB8500_PIN_SLEEP("GPIO135_A9", in_wkup_pdis, "sdi2"), /* DAT4 */ |
| 289 | DB8500_PIN_SLEEP("GPIO136_C7", in_wkup_pdis, "sdi2"), /* DAT5 */ |
| 290 | DB8500_PIN_SLEEP("GPIO137_A7", in_wkup_pdis, "sdi2"), /* DAT6 */ |
| 291 | DB8500_PIN_SLEEP("GPIO138_C5", in_wkup_pdis, "sdi2"), /* DAT7 */ |
| 292 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 293 | /* Mux in SDI4 (here called MC4) used for for PCB-mounted eMMC */ |
| 294 | DB8500_MUX("mc4_a_1", "mc4", "sdi4"), |
| 295 | DB8500_PIN("GPIO197_AH24", in_pu, "sdi4"), /* DAT3 */ |
| 296 | DB8500_PIN("GPIO198_AG25", in_pu, "sdi4"), /* DAT2 */ |
| 297 | DB8500_PIN("GPIO199_AH23", in_pu, "sdi4"), /* DAT1 */ |
| 298 | DB8500_PIN("GPIO200_AH26", in_pu, "sdi4"), /* DAT0 */ |
| 299 | DB8500_PIN("GPIO201_AF24", in_pu, "sdi4"), /* CMD */ |
| 300 | DB8500_PIN("GPIO202_AF25", in_nopull, "sdi4"), /* FBCLK */ |
| 301 | DB8500_PIN("GPIO203_AE23", out_lo, "sdi4"), /* CLK */ |
| 302 | DB8500_PIN("GPIO204_AF23", in_pu, "sdi4"), /* DAT7 */ |
| 303 | DB8500_PIN("GPIO205_AG23", in_pu, "sdi4"), /* DAT6 */ |
| 304 | DB8500_PIN("GPIO206_AG24", in_pu, "sdi4"), /* DAT5 */ |
| 305 | DB8500_PIN("GPIO207_AJ23", in_pu, "sdi4"), /* DAT4 */ |
Patrice Chotard | 28f88306 | 2012-10-18 14:26:24 +0200 | [diff] [blame] | 306 | /*SDI4 sleep state */ |
| 307 | DB8500_PIN_SLEEP("GPIO197_AH24", slpm_in_wkup_pdis, "sdi4"), /* DAT3 */ |
| 308 | DB8500_PIN_SLEEP("GPIO198_AG25", slpm_in_wkup_pdis, "sdi4"), /* DAT2 */ |
| 309 | DB8500_PIN_SLEEP("GPIO199_AH23", slpm_in_wkup_pdis, "sdi4"), /* DAT1 */ |
| 310 | DB8500_PIN_SLEEP("GPIO200_AH26", slpm_in_wkup_pdis, "sdi4"), /* DAT0 */ |
| 311 | DB8500_PIN_SLEEP("GPIO201_AF24", slpm_in_wkup_pdis, "sdi4"), /* CMD */ |
| 312 | DB8500_PIN_SLEEP("GPIO202_AF25", slpm_in_wkup_pdis, "sdi4"), /* FBCLK */ |
| 313 | DB8500_PIN_SLEEP("GPIO203_AE23", slpm_out_lo_wkup_pdis, "sdi4"), /* CLK */ |
| 314 | DB8500_PIN_SLEEP("GPIO204_AF23", slpm_in_wkup_pdis, "sdi4"), /* DAT7 */ |
| 315 | DB8500_PIN_SLEEP("GPIO205_AG23", slpm_in_wkup_pdis, "sdi4"), /* DAT6 */ |
| 316 | DB8500_PIN_SLEEP("GPIO206_AG24", slpm_in_wkup_pdis, "sdi4"), /* DAT5 */ |
| 317 | DB8500_PIN_SLEEP("GPIO207_AJ23", slpm_in_wkup_pdis, "sdi4"), /* DAT4 */ |
| 318 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 319 | /* Mux in USB pins, drive STP high */ |
| 320 | DB8500_MUX("usb_a_1", "usb", "musb-ux500.0"), |
| 321 | DB8500_PIN("GPIO257_AE29", out_hi, "musb-ux500.0"), /* STP */ |
| 322 | /* Mux in SPI2 pins on the "other C1" altfunction */ |
Patrice Chotard | 0fda8f0 | 2012-09-17 18:52:15 +0200 | [diff] [blame] | 323 | DB8500_MUX("spi2_oc1_2", "spi2", "spi2"), |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 324 | DB8500_PIN("GPIO216_AG12", gpio_out_hi, "spi2"), /* FRM */ |
| 325 | DB8500_PIN("GPIO218_AH11", in_pd, "spi2"), /* RXD */ |
| 326 | DB8500_PIN("GPIO215_AH13", out_lo, "spi2"), /* TXD */ |
| 327 | DB8500_PIN("GPIO217_AH12", out_lo, "spi2"), /* CLK */ |
Patrice Chotard | d036809 | 2012-10-09 15:26:11 +0200 | [diff] [blame] | 328 | /* SPI2 idle state */ |
| 329 | DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */ |
| 330 | DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */ |
| 331 | DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */ |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 332 | /* SPI2 sleep state */ |
Patrice Chotard | d036809 | 2012-10-09 15:26:11 +0200 | [diff] [blame] | 333 | DB8500_PIN_SLEEP("GPIO216_AG12", slpm_in_wkup_pdis, "spi2"), /* FRM */ |
Linus Walleij | 4c85472 | 2012-09-18 13:23:02 +0200 | [diff] [blame] | 334 | DB8500_PIN_SLEEP("GPIO218_AH11", slpm_in_wkup_pdis, "spi2"), /* RXD */ |
| 335 | DB8500_PIN_SLEEP("GPIO215_AH13", slpm_out_lo_wkup_pdis, "spi2"), /* TXD */ |
| 336 | DB8500_PIN_SLEEP("GPIO217_AH12", slpm_wkup_pdis, "spi2"), /* CLK */ |
Patrice Chotard | 9cd9d65 | 2012-10-18 13:35:35 +0200 | [diff] [blame] | 337 | |
| 338 | /* ske default state */ |
| 339 | DB8500_MUX("kp_a_2", "kp", "nmk-ske-keypad"), |
| 340 | DB8500_PIN("GPIO153_B17", in_pd, "nmk-ske-keypad"), /* I7 */ |
| 341 | DB8500_PIN("GPIO154_C16", in_pd, "nmk-ske-keypad"), /* I6 */ |
| 342 | DB8500_PIN("GPIO155_C19", in_pd, "nmk-ske-keypad"), /* I5 */ |
| 343 | DB8500_PIN("GPIO156_C17", in_pd, "nmk-ske-keypad"), /* I4 */ |
| 344 | DB8500_PIN("GPIO161_D21", in_pd, "nmk-ske-keypad"), /* I3 */ |
| 345 | DB8500_PIN("GPIO162_D20", in_pd, "nmk-ske-keypad"), /* I2 */ |
| 346 | DB8500_PIN("GPIO163_C20", in_pd, "nmk-ske-keypad"), /* I1 */ |
| 347 | DB8500_PIN("GPIO164_B21", in_pd, "nmk-ske-keypad"), /* I0 */ |
| 348 | DB8500_PIN("GPIO157_A18", out_lo, "nmk-ske-keypad"), /* O7 */ |
| 349 | DB8500_PIN("GPIO158_C18", out_lo, "nmk-ske-keypad"), /* O6 */ |
| 350 | DB8500_PIN("GPIO159_B19", out_lo, "nmk-ske-keypad"), /* O5 */ |
| 351 | DB8500_PIN("GPIO160_B20", out_lo, "nmk-ske-keypad"), /* O4 */ |
| 352 | DB8500_PIN("GPIO165_C21", out_lo, "nmk-ske-keypad"), /* O3 */ |
| 353 | DB8500_PIN("GPIO166_A22", out_lo, "nmk-ske-keypad"), /* O2 */ |
| 354 | DB8500_PIN("GPIO167_B24", out_lo, "nmk-ske-keypad"), /* O1 */ |
| 355 | DB8500_PIN("GPIO168_C22", out_lo, "nmk-ske-keypad"), /* O0 */ |
| 356 | /* ske sleep state */ |
| 357 | DB8500_PIN_SLEEP("GPIO153_B17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I7 */ |
| 358 | DB8500_PIN_SLEEP("GPIO154_C16", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I6 */ |
| 359 | DB8500_PIN_SLEEP("GPIO155_C19", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I5 */ |
| 360 | DB8500_PIN_SLEEP("GPIO156_C17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I4 */ |
| 361 | DB8500_PIN_SLEEP("GPIO161_D21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I3 */ |
| 362 | DB8500_PIN_SLEEP("GPIO162_D20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I2 */ |
| 363 | DB8500_PIN_SLEEP("GPIO163_C20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I1 */ |
| 364 | DB8500_PIN_SLEEP("GPIO164_B21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I0 */ |
| 365 | DB8500_PIN_SLEEP("GPIO157_A18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O7 */ |
| 366 | DB8500_PIN_SLEEP("GPIO158_C18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O6 */ |
| 367 | DB8500_PIN_SLEEP("GPIO159_B19", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O5 */ |
| 368 | DB8500_PIN_SLEEP("GPIO160_B20", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O4 */ |
| 369 | DB8500_PIN_SLEEP("GPIO165_C21", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O3 */ |
| 370 | DB8500_PIN_SLEEP("GPIO166_A22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O2 */ |
| 371 | DB8500_PIN_SLEEP("GPIO167_B24", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O1 */ |
| 372 | DB8500_PIN_SLEEP("GPIO168_C22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O0 */ |
Jean-Nicolas Graux | 35c0c28 | 2012-10-19 17:39:07 +0200 | [diff] [blame^] | 373 | |
| 374 | /* STM APE pins states */ |
| 375 | DB8500_MUX_STATE("stmape_c_1", "stmape", |
| 376 | "stm", "ape_mipi34"), |
| 377 | DB8500_PIN_STATE("GPIO70_G5", in_nopull, |
| 378 | "stm", "ape_mipi34"), /* clk */ |
| 379 | DB8500_PIN_STATE("GPIO71_G4", in_nopull, |
| 380 | "stm", "ape_mipi34"), /* dat3 */ |
| 381 | DB8500_PIN_STATE("GPIO72_H4", in_nopull, |
| 382 | "stm", "ape_mipi34"), /* dat2 */ |
| 383 | DB8500_PIN_STATE("GPIO73_H3", in_nopull, |
| 384 | "stm", "ape_mipi34"), /* dat1 */ |
| 385 | DB8500_PIN_STATE("GPIO74_J3", in_nopull, |
| 386 | "stm", "ape_mipi34"), /* dat0 */ |
| 387 | |
| 388 | DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis, |
| 389 | "stm", "ape_mipi34_sleep"), /* clk */ |
| 390 | DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis, |
| 391 | "stm", "ape_mipi34_sleep"), /* dat3 */ |
| 392 | DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis, |
| 393 | "stm", "ape_mipi34_sleep"), /* dat2 */ |
| 394 | DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis, |
| 395 | "stm", "ape_mipi34_sleep"), /* dat1 */ |
| 396 | DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis, |
| 397 | "stm", "ape_mipi34_sleep"), /* dat0 */ |
| 398 | |
| 399 | DB8500_MUX_STATE("stmape_oc1_1", "stmape", |
| 400 | "stm", "ape_microsd"), |
| 401 | DB8500_PIN_STATE("GPIO23_AA4", in_nopull, |
| 402 | "stm", "ape_microsd"), /* clk */ |
| 403 | DB8500_PIN_STATE("GPIO25_Y4", in_nopull, |
| 404 | "stm", "ape_microsd"), /* dat0 */ |
| 405 | DB8500_PIN_STATE("GPIO26_Y2", in_nopull, |
| 406 | "stm", "ape_microsd"), /* dat1 */ |
| 407 | DB8500_PIN_STATE("GPIO27_AA2", in_nopull, |
| 408 | "stm", "ape_microsd"), /* dat2 */ |
| 409 | DB8500_PIN_STATE("GPIO28_AA1", in_nopull, |
| 410 | "stm", "ape_microsd"), /* dat3 */ |
| 411 | |
| 412 | DB8500_PIN_STATE("GPIO23_AA4", slpm_out_lo_wkup_pdis, |
| 413 | "stm", "ape_microsd_sleep"), /* clk */ |
| 414 | DB8500_PIN_STATE("GPIO25_Y4", slpm_in_wkup_pdis, |
| 415 | "stm", "ape_microsd_sleep"), /* dat0 */ |
| 416 | DB8500_PIN_STATE("GPIO26_Y2", slpm_in_wkup_pdis, |
| 417 | "stm", "ape_microsd_sleep"), /* dat1 */ |
| 418 | DB8500_PIN_STATE("GPIO27_AA2", slpm_in_wkup_pdis, |
| 419 | "stm", "ape_microsd_sleep"), /* dat2 */ |
| 420 | DB8500_PIN_STATE("GPIO28_AA1", slpm_in_wkup_pdis, |
| 421 | "stm", "ape_microsd_sleep"), /* dat3 */ |
| 422 | |
| 423 | /* STM Modem pins states */ |
| 424 | DB8500_MUX_STATE("stmmod_oc3_2", "stmmod", |
| 425 | "stm", "mod_mipi34"), |
| 426 | DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod", |
| 427 | "stm", "mod_mipi34"), |
| 428 | DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod", |
| 429 | "stm", "mod_mipi34"), |
| 430 | DB8500_PIN_STATE("GPIO70_G5", in_nopull, |
| 431 | "stm", "mod_mipi34"), /* clk */ |
| 432 | DB8500_PIN_STATE("GPIO71_G4", in_nopull, |
| 433 | "stm", "mod_mipi34"), /* dat3 */ |
| 434 | DB8500_PIN_STATE("GPIO72_H4", in_nopull, |
| 435 | "stm", "mod_mipi34"), /* dat2 */ |
| 436 | DB8500_PIN_STATE("GPIO73_H3", in_nopull, |
| 437 | "stm", "mod_mipi34"), /* dat1 */ |
| 438 | DB8500_PIN_STATE("GPIO74_J3", in_nopull, |
| 439 | "stm", "mod_mipi34"), /* dat0 */ |
| 440 | DB8500_PIN_STATE("GPIO75_H2", in_pu, |
| 441 | "stm", "mod_mipi34"), /* uartmod rx */ |
| 442 | DB8500_PIN_STATE("GPIO76_J2", out_lo, |
| 443 | "stm", "mod_mipi34"), /* uartmod tx */ |
| 444 | |
| 445 | DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis, |
| 446 | "stm", "mod_mipi34_sleep"), /* clk */ |
| 447 | DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis, |
| 448 | "stm", "mod_mipi34_sleep"), /* dat3 */ |
| 449 | DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis, |
| 450 | "stm", "mod_mipi34_sleep"), /* dat2 */ |
| 451 | DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis, |
| 452 | "stm", "mod_mipi34_sleep"), /* dat1 */ |
| 453 | DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis, |
| 454 | "stm", "mod_mipi34_sleep"), /* dat0 */ |
| 455 | DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis, |
| 456 | "stm", "mod_mipi34_sleep"), /* uartmod rx */ |
| 457 | DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis, |
| 458 | "stm", "mod_mipi34_sleep"), /* uartmod tx */ |
| 459 | |
| 460 | DB8500_MUX_STATE("stmmod_b_1", "stmmod", |
| 461 | "stm", "mod_microsd"), |
| 462 | DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod", |
| 463 | "stm", "mod_microsd"), |
| 464 | DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod", |
| 465 | "stm", "mod_microsd"), |
| 466 | DB8500_PIN_STATE("GPIO23_AA4", in_nopull, |
| 467 | "stm", "mod_microsd"), /* clk */ |
| 468 | DB8500_PIN_STATE("GPIO25_Y4", in_nopull, |
| 469 | "stm", "mod_microsd"), /* dat0 */ |
| 470 | DB8500_PIN_STATE("GPIO26_Y2", in_nopull, |
| 471 | "stm", "mod_microsd"), /* dat1 */ |
| 472 | DB8500_PIN_STATE("GPIO27_AA2", in_nopull, |
| 473 | "stm", "mod_microsd"), /* dat2 */ |
| 474 | DB8500_PIN_STATE("GPIO28_AA1", in_nopull, |
| 475 | "stm", "mod_microsd"), /* dat3 */ |
| 476 | DB8500_PIN_STATE("GPIO75_H2", in_pu, |
| 477 | "stm", "mod_microsd"), /* uartmod rx */ |
| 478 | DB8500_PIN_STATE("GPIO76_J2", out_lo, |
| 479 | "stm", "mod_microsd"), /* uartmod tx */ |
| 480 | |
| 481 | DB8500_PIN_STATE("GPIO23_AA4", slpm_out_lo_wkup_pdis, |
| 482 | "stm", "mod_microsd_sleep"), /* clk */ |
| 483 | DB8500_PIN_STATE("GPIO25_Y4", slpm_in_wkup_pdis, |
| 484 | "stm", "mod_microsd_sleep"), /* dat0 */ |
| 485 | DB8500_PIN_STATE("GPIO26_Y2", slpm_in_wkup_pdis, |
| 486 | "stm", "mod_microsd_sleep"), /* dat1 */ |
| 487 | DB8500_PIN_STATE("GPIO27_AA2", slpm_in_wkup_pdis, |
| 488 | "stm", "mod_microsd_sleep"), /* dat2 */ |
| 489 | DB8500_PIN_STATE("GPIO28_AA1", slpm_in_wkup_pdis, |
| 490 | "stm", "mod_microsd_sleep"), /* dat3 */ |
| 491 | DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis, |
| 492 | "stm", "mod_microsd_sleep"), /* uartmod rx */ |
| 493 | DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis, |
| 494 | "stm", "mod_microsd_sleep"), /* uartmod tx */ |
| 495 | |
| 496 | /* STM dual Modem/APE pins state */ |
| 497 | DB8500_MUX_STATE("stmmod_oc3_2", "stmmod", |
| 498 | "stm", "mod_mipi34_ape_mipi60"), |
| 499 | DB8500_MUX_STATE("stmape_c_2", "stmape", |
| 500 | "stm", "mod_mipi34_ape_mipi60"), |
| 501 | DB8500_MUX_STATE("uartmodrx_oc3_1", "uartmod", |
| 502 | "stm", "mod_mipi34_ape_mipi60"), |
| 503 | DB8500_MUX_STATE("uartmodtx_oc3_1", "uartmod", |
| 504 | "stm", "mod_mipi34_ape_mipi60"), |
| 505 | DB8500_PIN_STATE("GPIO70_G5", in_nopull, |
| 506 | "stm", "mod_mipi34_ape_mipi60"), /* clk */ |
| 507 | DB8500_PIN_STATE("GPIO71_G4", in_nopull, |
| 508 | "stm", "mod_mipi34_ape_mipi60"), /* dat3 */ |
| 509 | DB8500_PIN_STATE("GPIO72_H4", in_nopull, |
| 510 | "stm", "mod_mipi34_ape_mipi60"), /* dat2 */ |
| 511 | DB8500_PIN_STATE("GPIO73_H3", in_nopull, |
| 512 | "stm", "mod_mipi34_ape_mipi60"), /* dat1 */ |
| 513 | DB8500_PIN_STATE("GPIO74_J3", in_nopull, |
| 514 | "stm", "mod_mipi34_ape_mipi60"), /* dat0 */ |
| 515 | DB8500_PIN_STATE("GPIO75_H2", in_pu, |
| 516 | "stm", "mod_mipi34_ape_mipi60"), /* uartmod rx */ |
| 517 | DB8500_PIN_STATE("GPIO76_J2", out_lo, |
| 518 | "stm", "mod_mipi34_ape_mipi60"), /* uartmod tx */ |
| 519 | DB8500_PIN_STATE("GPIO155_C19", in_nopull, |
| 520 | "stm", "mod_mipi34_ape_mipi60"), /* clk */ |
| 521 | DB8500_PIN_STATE("GPIO156_C17", in_nopull, |
| 522 | "stm", "mod_mipi34_ape_mipi60"), /* dat3 */ |
| 523 | DB8500_PIN_STATE("GPIO157_A18", in_nopull, |
| 524 | "stm", "mod_mipi34_ape_mipi60"), /* dat2 */ |
| 525 | DB8500_PIN_STATE("GPIO158_C18", in_nopull, |
| 526 | "stm", "mod_mipi34_ape_mipi60"), /* dat1 */ |
| 527 | DB8500_PIN_STATE("GPIO159_B19", in_nopull, |
| 528 | "stm", "mod_mipi34_ape_mipi60"), /* dat0 */ |
| 529 | |
| 530 | DB8500_PIN_STATE("GPIO70_G5", slpm_out_lo_pdis, |
| 531 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* clk */ |
| 532 | DB8500_PIN_STATE("GPIO71_G4", slpm_out_lo_pdis, |
| 533 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat3 */ |
| 534 | DB8500_PIN_STATE("GPIO72_H4", slpm_out_lo_pdis, |
| 535 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat2 */ |
| 536 | DB8500_PIN_STATE("GPIO73_H3", slpm_out_lo_pdis, |
| 537 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat1 */ |
| 538 | DB8500_PIN_STATE("GPIO74_J3", slpm_out_lo_pdis, |
| 539 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat0 */ |
| 540 | DB8500_PIN_STATE("GPIO75_H2", slpm_in_wkup_pdis, |
| 541 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* uartmod rx */ |
| 542 | DB8500_PIN_STATE("GPIO76_J2", slpm_out_lo_wkup_pdis, |
| 543 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* uartmod tx */ |
| 544 | DB8500_PIN_STATE("GPIO155_C19", slpm_in_wkup_pdis, |
| 545 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* clk */ |
| 546 | DB8500_PIN_STATE("GPIO156_C17", slpm_in_wkup_pdis, |
| 547 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat3 */ |
| 548 | DB8500_PIN_STATE("GPIO157_A18", slpm_in_wkup_pdis, |
| 549 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat2 */ |
| 550 | DB8500_PIN_STATE("GPIO158_C18", slpm_in_wkup_pdis, |
| 551 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat1 */ |
| 552 | DB8500_PIN_STATE("GPIO159_B19", slpm_in_wkup_pdis, |
| 553 | "stm", "mod_mipi34_ape_mipi60_sleep"), /* dat0 */ |
Robert Marklund | c41fac8 | 2011-06-21 09:39:13 +0200 | [diff] [blame] | 554 | }; |
| 555 | |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 556 | /* |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 557 | * These are specifically for the MOP500 and HREFP (pre-v60) version of the |
| 558 | * board, which utilized a TC35892 GPIO expander instead of using a lot of |
| 559 | * on-chip pins as the HREFv60 and later does. |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 560 | */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 561 | static struct pinctrl_map __initdata mop500_pinmap[] = { |
| 562 | /* Mux in SSP0, pull down RXD pin */ |
| 563 | DB8500_MUX_HOG("ssp0_a_1", "ssp0"), |
| 564 | DB8500_PIN_HOG("GPIO145_C13", pd), |
| 565 | /* |
| 566 | * XENON Flashgun on image processor GPIO (controlled from image |
| 567 | * processor firmware), mux in these image processor GPIO lines 0 |
| 568 | * (XENON_FLASH_ID) and 1 (XENON_READY) on altfunction C and pull up |
| 569 | * the pins. |
| 570 | */ |
| 571 | DB8500_MUX_HOG("ipgpio0_c_1", "ipgpio"), |
| 572 | DB8500_MUX_HOG("ipgpio1_c_1", "ipgpio"), |
| 573 | DB8500_PIN_HOG("GPIO6_AF6", in_pu), |
| 574 | DB8500_PIN_HOG("GPIO7_AG5", in_pu), |
| 575 | /* TC35892 IRQ, pull up the line, let the driver mux in the pin */ |
| 576 | DB8500_PIN_HOG("GPIO217_AH12", gpio_in_pu), |
| 577 | /* Mux in UART1 and set the pull-ups */ |
| 578 | DB8500_MUX_HOG("u1rxtx_a_1", "u1"), |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 579 | DB8500_PIN_HOG("GPIO4_AH6", in_pu), /* RXD */ |
| 580 | DB8500_PIN_HOG("GPIO5_AG6", out_hi), /* TXD */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 581 | /* |
| 582 | * Runtime stuff: make it possible to mux in the SKE keypad |
| 583 | * and bias the pins |
| 584 | */ |
Patrice Chotard | 9cd9d65 | 2012-10-18 13:35:35 +0200 | [diff] [blame] | 585 | /* ske default state */ |
| 586 | DB8500_MUX("kp_a_2", "kp", "nmk-ske-keypad"), |
| 587 | DB8500_PIN("GPIO153_B17", in_pu, "nmk-ske-keypad"), /* I7 */ |
| 588 | DB8500_PIN("GPIO154_C16", in_pu, "nmk-ske-keypad"), /* I6 */ |
| 589 | DB8500_PIN("GPIO155_C19", in_pu, "nmk-ske-keypad"), /* I5 */ |
| 590 | DB8500_PIN("GPIO156_C17", in_pu, "nmk-ske-keypad"), /* I4 */ |
| 591 | DB8500_PIN("GPIO161_D21", in_pu, "nmk-ske-keypad"), /* I3 */ |
| 592 | DB8500_PIN("GPIO162_D20", in_pu, "nmk-ske-keypad"), /* I2 */ |
| 593 | DB8500_PIN("GPIO163_C20", in_pu, "nmk-ske-keypad"), /* I1 */ |
| 594 | DB8500_PIN("GPIO164_B21", in_pu, "nmk-ske-keypad"), /* I0 */ |
| 595 | DB8500_PIN("GPIO157_A18", out_lo, "nmk-ske-keypad"), /* O7 */ |
| 596 | DB8500_PIN("GPIO158_C18", out_lo, "nmk-ske-keypad"), /* O6 */ |
| 597 | DB8500_PIN("GPIO159_B19", out_lo, "nmk-ske-keypad"), /* O5 */ |
| 598 | DB8500_PIN("GPIO160_B20", out_lo, "nmk-ske-keypad"), /* O4 */ |
| 599 | DB8500_PIN("GPIO165_C21", out_lo, "nmk-ske-keypad"), /* O3 */ |
| 600 | DB8500_PIN("GPIO166_A22", out_lo, "nmk-ske-keypad"), /* O2 */ |
| 601 | DB8500_PIN("GPIO167_B24", out_lo, "nmk-ske-keypad"), /* O1 */ |
| 602 | DB8500_PIN("GPIO168_C22", out_lo, "nmk-ske-keypad"), /* O0 */ |
| 603 | /* ske sleep state */ |
| 604 | DB8500_PIN_SLEEP("GPIO153_B17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I7 */ |
| 605 | DB8500_PIN_SLEEP("GPIO154_C16", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I6 */ |
| 606 | DB8500_PIN_SLEEP("GPIO155_C19", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I5 */ |
| 607 | DB8500_PIN_SLEEP("GPIO156_C17", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I4 */ |
| 608 | DB8500_PIN_SLEEP("GPIO161_D21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I3 */ |
| 609 | DB8500_PIN_SLEEP("GPIO162_D20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I2 */ |
| 610 | DB8500_PIN_SLEEP("GPIO163_C20", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I1 */ |
| 611 | DB8500_PIN_SLEEP("GPIO164_B21", slpm_in_pu_wkup_pdis_en, "nmk-ske-keypad"), /* I0 */ |
| 612 | DB8500_PIN_SLEEP("GPIO157_A18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O7 */ |
| 613 | DB8500_PIN_SLEEP("GPIO158_C18", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O6 */ |
| 614 | DB8500_PIN_SLEEP("GPIO159_B19", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O5 */ |
| 615 | DB8500_PIN_SLEEP("GPIO160_B20", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O4 */ |
| 616 | DB8500_PIN_SLEEP("GPIO165_C21", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O3 */ |
| 617 | DB8500_PIN_SLEEP("GPIO166_A22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O2 */ |
| 618 | DB8500_PIN_SLEEP("GPIO167_B24", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O1 */ |
| 619 | DB8500_PIN_SLEEP("GPIO168_C22", slpm_out_lo_pdis, "nmk-ske-keypad"), /* O0 */ |
| 620 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 621 | /* Mux in and drive the SDI0 DAT31DIR line high at runtime */ |
| 622 | DB8500_MUX("mc0dat31dir_a_1", "mc0", "sdi0"), |
| 623 | DB8500_PIN("GPIO21_AB3", out_hi, "sdi0"), |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 624 | }; |
| 625 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 626 | /* |
| 627 | * The HREFv60 series of platforms is using available pins on the DB8500 |
| 628 | * insteaf of the Toshiba I2C GPIO expander, reusing some pins like the SSP0 |
| 629 | * and SSP1 ports (previously connected to the AB8500) as generic GPIO lines. |
| 630 | */ |
| 631 | static struct pinctrl_map __initdata hrefv60_pinmap[] = { |
| 632 | /* Drive WLAN_ENA low */ |
| 633 | DB8500_PIN_HOG("GPIO85_D5", gpio_out_lo), /* WLAN_ENA */ |
| 634 | /* |
| 635 | * XENON Flashgun on image processor GPIO (controlled from image |
| 636 | * processor firmware), mux in these image processor GPIO lines 0 |
| 637 | * (XENON_FLASH_ID), 1 (XENON_READY) and there is an assistant |
| 638 | * LED on IP GPIO 4 (XENON_EN2) on altfunction C, that need bias |
| 639 | * from GPIO21 so pull up 0, 1 and drive 4 and GPIO21 low as output. |
| 640 | */ |
| 641 | DB8500_MUX_HOG("ipgpio0_c_1", "ipgpio"), |
| 642 | DB8500_MUX_HOG("ipgpio1_c_1", "ipgpio"), |
| 643 | DB8500_MUX_HOG("ipgpio4_c_1", "ipgpio"), |
| 644 | DB8500_PIN_HOG("GPIO6_AF6", in_pu), /* XENON_FLASH_ID */ |
| 645 | DB8500_PIN_HOG("GPIO7_AG5", in_pu), /* XENON_READY */ |
| 646 | DB8500_PIN_HOG("GPIO21_AB3", gpio_out_lo), /* XENON_EN1 */ |
| 647 | DB8500_PIN_HOG("GPIO64_F3", out_lo), /* XENON_EN2 */ |
| 648 | /* Magnetometer uses GPIO 31 and 32, pull these up/down respectively */ |
| 649 | DB8500_PIN_HOG("GPIO31_V3", gpio_in_pu), /* EN1 */ |
| 650 | DB8500_PIN_HOG("GPIO32_V2", gpio_in_pd), /* DRDY */ |
| 651 | /* |
| 652 | * Display Interface 1 uses GPIO 65 for RST (reset). |
| 653 | * Display Interface 2 uses GPIO 66 for RST (reset). |
| 654 | * Drive DISP1 reset high (not reset), driver DISP2 reset low (reset) |
| 655 | */ |
| 656 | DB8500_PIN_HOG("GPIO65_F1", gpio_out_hi), /* DISP1 NO RST */ |
| 657 | DB8500_PIN_HOG("GPIO66_G3", gpio_out_lo), /* DISP2 RST */ |
| 658 | /* |
| 659 | * Touch screen uses GPIO 143 for RST1, GPIO 146 for RST2 and |
| 660 | * GPIO 67 for interrupts. Pull-up the IRQ line and drive both |
| 661 | * reset signals low. |
| 662 | */ |
| 663 | DB8500_PIN_HOG("GPIO143_D12", gpio_out_lo), /* TOUCH_RST1 */ |
| 664 | DB8500_PIN_HOG("GPIO67_G2", gpio_in_pu), /* TOUCH_INT2 */ |
| 665 | DB8500_PIN_HOG("GPIO146_D13", gpio_out_lo), /* TOUCH_RST2 */ |
| 666 | /* |
| 667 | * Drive D19-D23 for the ETM PTM trace interface low, |
| 668 | * (presumably pins are unconnected therefore grounded here, |
| 669 | * the "other alt C1" setting enables these pins) |
| 670 | */ |
| 671 | DB8500_PIN_HOG("GPIO70_G5", gpio_out_lo), |
| 672 | DB8500_PIN_HOG("GPIO71_G4", gpio_out_lo), |
| 673 | DB8500_PIN_HOG("GPIO72_H4", gpio_out_lo), |
| 674 | DB8500_PIN_HOG("GPIO73_H3", gpio_out_lo), |
| 675 | DB8500_PIN_HOG("GPIO74_J3", gpio_out_lo), |
| 676 | /* NAHJ CTRL on GPIO 76 to low, CTRL_INV on GPIO216 to high */ |
| 677 | DB8500_PIN_HOG("GPIO76_J2", gpio_out_lo), /* CTRL */ |
| 678 | DB8500_PIN_HOG("GPIO216_AG12", gpio_out_hi), /* CTRL_INV */ |
| 679 | /* NFC ENA and RESET to low, pulldown IRQ line */ |
| 680 | DB8500_PIN_HOG("GPIO77_H1", gpio_out_lo), /* NFC_ENA */ |
| 681 | DB8500_PIN_HOG("GPIO144_B13", gpio_in_pd), /* NFC_IRQ */ |
| 682 | DB8500_PIN_HOG("GPIO142_C11", gpio_out_lo), /* NFC_RESET */ |
| 683 | /* |
| 684 | * SKE keyboard partly on alt A and partly on "Other alt C1" |
| 685 | * Driver KP_O1,2,3,6,7 low and pull up KP_I 0,2,3 for three |
| 686 | * rows of 6 keys, then pull up force sensing interrup and |
| 687 | * drive reset and force sensing WU low. |
| 688 | */ |
| 689 | DB8500_MUX_HOG("kp_a_1", "kp"), |
| 690 | DB8500_MUX_HOG("kp_oc1_1", "kp"), |
| 691 | DB8500_PIN_HOG("GPIO90_A3", out_lo), /* KP_O1 */ |
| 692 | DB8500_PIN_HOG("GPIO87_B3", out_lo), /* KP_O2 */ |
| 693 | DB8500_PIN_HOG("GPIO86_C6", out_lo), /* KP_O3 */ |
| 694 | DB8500_PIN_HOG("GPIO96_D8", out_lo), /* KP_O6 */ |
| 695 | DB8500_PIN_HOG("GPIO94_D7", out_lo), /* KP_O7 */ |
| 696 | DB8500_PIN_HOG("GPIO93_B7", in_pu), /* KP_I0 */ |
| 697 | DB8500_PIN_HOG("GPIO89_E6", in_pu), /* KP_I2 */ |
| 698 | DB8500_PIN_HOG("GPIO88_C4", in_pu), /* KP_I3 */ |
| 699 | DB8500_PIN_HOG("GPIO91_B6", gpio_in_pu), /* FORCE_SENSING_INT */ |
| 700 | DB8500_PIN_HOG("GPIO92_D6", gpio_out_lo), /* FORCE_SENSING_RST */ |
| 701 | DB8500_PIN_HOG("GPIO97_D9", gpio_out_lo), /* FORCE_SENSING_WU */ |
| 702 | /* DiPro Sensor interrupt */ |
| 703 | DB8500_PIN_HOG("GPIO139_C9", gpio_in_pu), /* DIPRO_INT */ |
| 704 | /* Audio Amplifier HF enable */ |
| 705 | DB8500_PIN_HOG("GPIO149_B14", gpio_out_hi), /* VAUDIO_HF_EN, enable MAX8968 */ |
| 706 | /* GBF interface, pull low to reset state */ |
| 707 | DB8500_PIN_HOG("GPIO171_D23", gpio_out_lo), /* GBF_ENA_RESET */ |
| 708 | /* MSP : HDTV INTERFACE GPIO line */ |
| 709 | DB8500_PIN_HOG("GPIO192_AJ27", gpio_in_pd), |
| 710 | /* Accelerometer interrupt lines */ |
| 711 | DB8500_PIN_HOG("GPIO82_C1", gpio_in_pu), /* ACC_INT1 */ |
| 712 | DB8500_PIN_HOG("GPIO83_D3", gpio_in_pu), /* ACC_INT2 */ |
| 713 | /* SD card detect GPIO pin */ |
| 714 | DB8500_PIN_HOG("GPIO95_E8", gpio_in_pu), |
| 715 | /* |
| 716 | * Runtime stuff |
| 717 | * Pull up/down of some sensor GPIO pins, for proximity, HAL sensor |
| 718 | * etc. |
| 719 | */ |
| 720 | DB8500_PIN("GPIO217_AH12", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"), |
| 721 | DB8500_PIN("GPIO145_C13", gpio_in_pd_slpm_gpio_nopull, "gpio-keys.0"), |
| 722 | DB8500_PIN("GPIO139_C9", gpio_in_pu_slpm_gpio_nopull, "gpio-keys.0"), |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 723 | }; |
| 724 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 725 | static struct pinctrl_map __initdata u9500_pinmap[] = { |
| 726 | /* Mux in UART1 (just RX/TX) and set the pull-ups */ |
| 727 | DB8500_MUX_HOG("u1rxtx_a_1", "u1"), |
| 728 | DB8500_PIN_HOG("GPIO4_AH6", in_pu), |
| 729 | DB8500_PIN_HOG("GPIO5_AG6", out_hi), |
| 730 | /* WLAN_IRQ line */ |
| 731 | DB8500_PIN_HOG("GPIO144_B13", gpio_in_pu), |
| 732 | /* HSI */ |
| 733 | DB8500_MUX_HOG("hsir_a_1", "hsi"), |
Patrice Chotard | 6fc84b841 | 2012-09-05 10:52:25 +0200 | [diff] [blame] | 734 | DB8500_MUX_HOG("hsit_a_2", "hsi"), |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 735 | DB8500_PIN_HOG("GPIO219_AG10", in_pd), /* RX FLA0 */ |
| 736 | DB8500_PIN_HOG("GPIO220_AH10", in_pd), /* RX DAT0 */ |
| 737 | DB8500_PIN_HOG("GPIO221_AJ11", out_lo), /* RX RDY0 */ |
| 738 | DB8500_PIN_HOG("GPIO222_AJ9", out_lo), /* TX FLA0 */ |
| 739 | DB8500_PIN_HOG("GPIO223_AH9", out_lo), /* TX DAT0 */ |
| 740 | DB8500_PIN_HOG("GPIO224_AG9", in_pd), /* TX RDY0 */ |
| 741 | DB8500_PIN_HOG("GPIO225_AG8", in_pd), /* CAWAKE0 */ |
Patrice Chotard | 6fc84b841 | 2012-09-05 10:52:25 +0200 | [diff] [blame] | 742 | DB8500_PIN_HOG("GPIO226_AF8", gpio_out_hi), /* ACWAKE0 */ |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 743 | }; |
| 744 | |
| 745 | static struct pinctrl_map __initdata u8500_pinmap[] = { |
| 746 | DB8500_PIN_HOG("GPIO226_AF8", gpio_out_lo), /* WLAN_PMU_EN */ |
| 747 | DB8500_PIN_HOG("GPIO4_AH6", gpio_in_pu), /* WLAN_IRQ */ |
| 748 | }; |
| 749 | |
| 750 | static struct pinctrl_map __initdata snowball_pinmap[] = { |
| 751 | /* Mux in SSP0 connected to AB8500, pull down RXD pin */ |
| 752 | DB8500_MUX_HOG("ssp0_a_1", "ssp0"), |
| 753 | DB8500_PIN_HOG("GPIO145_C13", pd), |
| 754 | /* Always drive the MC0 DAT31DIR line high on these boards */ |
| 755 | DB8500_PIN_HOG("GPIO21_AB3", out_hi), |
| 756 | /* Mux in "SM" which is used for the SMSC911x Ethernet adapter */ |
| 757 | DB8500_MUX_HOG("sm_b_1", "sm"), |
| 758 | /* Drive RSTn_LAN high */ |
| 759 | DB8500_PIN_HOG("GPIO141_C12", gpio_out_hi), |
| 760 | /* Accelerometer/Magnetometer */ |
| 761 | DB8500_PIN_HOG("GPIO163_C20", gpio_in_pu), /* ACCEL_IRQ1 */ |
| 762 | DB8500_PIN_HOG("GPIO164_B21", gpio_in_pu), /* ACCEL_IRQ2 */ |
| 763 | DB8500_PIN_HOG("GPIO165_C21", gpio_in_pu), /* MAG_DRDY */ |
| 764 | /* WLAN/GBF */ |
| 765 | DB8500_PIN_HOG("GPIO161_D21", gpio_out_lo), /* WLAN_PMU_EN */ |
| 766 | DB8500_PIN_HOG("GPIO171_D23", gpio_out_hi), /* GBF_ENA */ |
| 767 | DB8500_PIN_HOG("GPIO215_AH13", gpio_out_lo), /* WLAN_ENA */ |
| 768 | DB8500_PIN_HOG("GPIO216_AG12", gpio_in_pu), /* WLAN_IRQ */ |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 769 | }; |
| 770 | |
| 771 | /* |
| 772 | * passing "pinsfor=" in kernel cmdline allows for custom |
| 773 | * configuration of GPIOs on u8500 derived boards. |
| 774 | */ |
| 775 | static int __init early_pinsfor(char *p) |
| 776 | { |
| 777 | pinsfor = PINS_FOR_DEFAULT; |
| 778 | |
| 779 | if (strcmp(p, "u9500-21") == 0) |
| 780 | pinsfor = PINS_FOR_U9500; |
| 781 | |
| 782 | return 0; |
| 783 | } |
| 784 | early_param("pinsfor", early_pinsfor); |
| 785 | |
| 786 | int pins_for_u9500(void) |
| 787 | { |
| 788 | if (pinsfor == PINS_FOR_U9500) |
| 789 | return 1; |
| 790 | |
| 791 | return 0; |
| 792 | } |
| 793 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 794 | static void __init mop500_href_family_pinmaps_init(void) |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 795 | { |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 796 | switch (pinsfor) { |
| 797 | case PINS_FOR_U9500: |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 798 | pinctrl_register_mappings(u9500_pinmap, |
| 799 | ARRAY_SIZE(u9500_pinmap)); |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 800 | break; |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 801 | case PINS_FOR_DEFAULT: |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 802 | pinctrl_register_mappings(u8500_pinmap, |
| 803 | ARRAY_SIZE(u8500_pinmap)); |
Linus Walleij | 1baa574 | 2012-04-19 18:27:38 +0200 | [diff] [blame] | 804 | default: |
| 805 | break; |
| 806 | } |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 807 | } |
| 808 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 809 | void __init mop500_pinmaps_init(void) |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 810 | { |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 811 | pinctrl_register_mappings(mop500_family_pinmap, |
| 812 | ARRAY_SIZE(mop500_family_pinmap)); |
| 813 | pinctrl_register_mappings(mop500_pinmap, |
| 814 | ARRAY_SIZE(mop500_pinmap)); |
| 815 | mop500_href_family_pinmaps_init(); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 816 | } |
| 817 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 818 | void __init snowball_pinmaps_init(void) |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 819 | { |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 820 | pinctrl_register_mappings(mop500_family_pinmap, |
| 821 | ARRAY_SIZE(mop500_family_pinmap)); |
| 822 | pinctrl_register_mappings(snowball_pinmap, |
| 823 | ARRAY_SIZE(snowball_pinmap)); |
| 824 | pinctrl_register_mappings(u8500_pinmap, |
| 825 | ARRAY_SIZE(u8500_pinmap)); |
| 826 | } |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 827 | |
Linus Walleij | ed781d3 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 828 | void __init hrefv60_pinmaps_init(void) |
| 829 | { |
| 830 | pinctrl_register_mappings(mop500_family_pinmap, |
| 831 | ARRAY_SIZE(mop500_family_pinmap)); |
| 832 | pinctrl_register_mappings(hrefv60_pinmap, |
| 833 | ARRAY_SIZE(hrefv60_pinmap)); |
| 834 | mop500_href_family_pinmaps_init(); |
Rabin Vincent | fe05203 | 2011-02-11 17:07:21 -0700 | [diff] [blame] | 835 | } |