diff options
| -rw-r--r-- | drivers/gpio/gpio-tegra186.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c index 3ed3e00ac..4c5d718b6 100644 --- a/drivers/gpio/gpio-tegra186.c +++ b/drivers/gpio/gpio-tegra186.c | |||
| @@ -123,6 +123,11 @@ static int tegra186_gpio_map[MAX_GPIO_CONTROLLERS][MAX_GPIO_PORTS] = { | |||
| 123 | {31, 18, 20, 30, 21, 22, 26, 25},/* AON gpio cntrlr */ | 123 | {31, 18, 20, 30, 21, 22, 26, 25},/* AON gpio cntrlr */ |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | static u32 tegra186_gpio_port_pin_count[MAX_PORTS] = { | ||
| 127 | 7, 7, 7, 6, 8, 6, 6, 7, 8, 8, 1, 8, 6, 7, 4, 7, | ||
| 128 | 6, 6, 5, 4, 6, 8, 8, 8, 7, 4, 8, 2, 4, 0, 3, 5, | ||
| 129 | }; | ||
| 130 | |||
| 126 | static u32 address_map[32][2]; | 131 | static u32 address_map[32][2]; |
| 127 | static u32 tegra_gpio_bank_count; | 132 | static u32 tegra_gpio_bank_count; |
| 128 | static struct tegra_gpio_controller | 133 | static struct tegra_gpio_controller |
| @@ -199,6 +204,9 @@ static inline bool is_gpio_accessible(u32 offset) | |||
| 199 | if (controller == -1) | 204 | if (controller == -1) |
| 200 | return false; | 205 | return false; |
| 201 | 206 | ||
| 207 | if (pin >= tegra186_gpio_port_pin_count[port]) | ||
| 208 | return false; | ||
| 209 | |||
| 202 | for (i = 0; i < MAX_GPIO_CONTROLLERS; i++) { | 210 | for (i = 0; i < MAX_GPIO_CONTROLLERS; i++) { |
| 203 | for (j = 0; j < MAX_GPIO_PORTS; j++) { | 211 | for (j = 0; j < MAX_GPIO_PORTS; j++) { |
| 204 | if (tegra186_gpio_map[i][j] == port) { | 212 | if (tegra186_gpio_map[i][j] == port) { |
