diff options
| author | dmitry pervushin <dpervushin@nvidia.com> | 2016-08-02 10:34:20 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-14 10:45:35 -0400 |
| commit | 02ad284eea8714df30ae5c9af61955cb25cd2f2c (patch) | |
| tree | 5abc15d78febd4e543a7d492948c9f9e027c60b0 | |
| parent | 5b2320f1c37d6a7885c78e5ef1a2c1702ad083da (diff) | |
tegra: gpio: remove unneeded locks
Instead of disabling interrupts on startup, mask out interrupts for accessible gpios
Bug 200222365
Change-Id: Ia61f69c2de8094f4f9fe93f1b028969900df7743
Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Reviewed-on: http://git-master/r/1195993
(cherry picked from commit 4d96b29c6fbc3ac5740c5a3789bc860aafd38651)
Reviewed-on: http://git-master/r/1219825
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
| -rw-r--r-- | drivers/gpio/gpio-tegra186.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c index 1f4114f1f..3ed3e00ac 100644 --- a/drivers/gpio/gpio-tegra186.c +++ b/drivers/gpio/gpio-tegra186.c | |||
| @@ -91,7 +91,6 @@ | |||
| 91 | struct tegra_gpio_controller { | 91 | struct tegra_gpio_controller { |
| 92 | int controller; | 92 | int controller; |
| 93 | int irq; | 93 | int irq; |
| 94 | spinlock_t lvl_lock[4]; | ||
| 95 | u32 cnf[MAX_PORTS * MAX_PINS_PER_PORT]; | 94 | u32 cnf[MAX_PORTS * MAX_PINS_PER_PORT]; |
| 96 | u32 dbc[MAX_PORTS * MAX_PINS_PER_PORT]; | 95 | u32 dbc[MAX_PORTS * MAX_PINS_PER_PORT]; |
| 97 | u32 out_ctrl[MAX_PORTS * MAX_PINS_PER_PORT]; | 96 | u32 out_ctrl[MAX_PORTS * MAX_PINS_PER_PORT]; |
| @@ -197,10 +196,8 @@ static inline bool is_gpio_accessible(u32 offset) | |||
| 197 | u32 i, j; | 196 | u32 i, j; |
| 198 | bool found = false; | 197 | bool found = false; |
| 199 | 198 | ||
| 200 | if (controller == -1) { | 199 | if (controller == -1) |
| 201 | pr_err("Invalid gpio number %d\n", offset); | ||
| 202 | return false; | 200 | return false; |
| 203 | } | ||
| 204 | 201 | ||
| 205 | for (i = 0; i < MAX_GPIO_CONTROLLERS; i++) { | 202 | for (i = 0; i < MAX_GPIO_CONTROLLERS; i++) { |
| 206 | for (j = 0; j < MAX_GPIO_PORTS; j++) { | 203 | for (j = 0; j < MAX_GPIO_PORTS; j++) { |
| @@ -535,10 +532,9 @@ static int tegra_gpio_probe(struct platform_device *pdev) | |||
| 535 | struct resource *res; | 532 | struct resource *res; |
| 536 | struct tegra_gpio_controller *tg_cont; | 533 | struct tegra_gpio_controller *tg_cont; |
| 537 | void __iomem *base; | 534 | void __iomem *base; |
| 538 | u32 i, j; | 535 | u32 i; |
| 539 | int gpio; | 536 | int gpio; |
| 540 | int ret; | 537 | int ret; |
| 541 | unsigned long flags; | ||
| 542 | 538 | ||
| 543 | read_gpio_mapping_data(pdev); | 539 | read_gpio_mapping_data(pdev); |
| 544 | 540 | ||
| @@ -624,6 +620,10 @@ static int tegra_gpio_probe(struct platform_device *pdev) | |||
| 624 | for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) { | 620 | for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) { |
| 625 | int irq = irq_create_mapping(irq_domain, gpio); | 621 | int irq = irq_create_mapping(irq_domain, gpio); |
| 626 | 622 | ||
| 623 | if (is_gpio_accessible(gpio)) | ||
| 624 | /* mask interrupts for this GPIO */ | ||
| 625 | tegra_gpio_update(gpio, GPIO_ENB_CONFIG_REG, GPIO_INT_FUNC_BIT, 0); | ||
| 626 | |||
| 627 | tg_cont = &tegra_gpio_controllers[controller_index(gpio)]; | 627 | tg_cont = &tegra_gpio_controllers[controller_index(gpio)]; |
| 628 | 628 | ||
| 629 | irq_set_chip_data(irq, tg_cont); | 629 | irq_set_chip_data(irq, tg_cont); |
| @@ -642,17 +642,13 @@ static int tegra_gpio_probe(struct platform_device *pdev) | |||
| 642 | irq_domain_remove(irq_domain); | 642 | irq_domain_remove(irq_domain); |
| 643 | return ret; | 643 | return ret; |
| 644 | } | 644 | } |
| 645 | local_irq_save(flags); | 645 | |
| 646 | for (i = 0; i < tegra_gpio_bank_count; i++) { | 646 | for (i = 0; i < tegra_gpio_bank_count; i++) { |
| 647 | tg_cont = &tegra_gpio_controllers[i]; | 647 | tg_cont = &tegra_gpio_controllers[i]; |
| 648 | |||
| 649 | for (j = 0; j < 4; j++) | ||
| 650 | spin_lock_init(&tg_cont->lvl_lock[j]); | ||
| 651 | |||
| 652 | irq_set_chained_handler_and_data(tg_cont->irq, | 648 | irq_set_chained_handler_and_data(tg_cont->irq, |
| 653 | tegra_gpio_irq_handler, tg_cont); | 649 | tegra_gpio_irq_handler, tg_cont); |
| 654 | } | 650 | } |
| 655 | local_irq_restore(flags); | 651 | |
| 656 | return 0; | 652 | return 0; |
| 657 | } | 653 | } |
| 658 | 654 | ||
