aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/lpc_ich.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/lpc_ich.c')
-rw-r--r--drivers/mfd/lpc_ich.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 092ad4b44b6d..d142622a3fb0 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -683,6 +683,30 @@ static void __devinit lpc_ich_finalize_cell(struct mfd_cell *cell,
683 cell->pdata_size = sizeof(struct lpc_ich_info); 683 cell->pdata_size = sizeof(struct lpc_ich_info);
684} 684}
685 685
686/*
687 * We don't check for resource conflict globally. There are 2 or 3 independent
688 * GPIO groups and it's enough to have access to one of these to instantiate
689 * the device.
690 */
691static int __devinit lpc_ich_check_conflict_gpio(struct resource *res)
692{
693 int ret;
694 u8 use_gpio = 0;
695
696 if (resource_size(res) >= 0x50 &&
697 !acpi_check_region(res->start + 0x40, 0x10, "LPC ICH GPIO3"))
698 use_gpio |= 1 << 2;
699
700 if (!acpi_check_region(res->start + 0x30, 0x10, "LPC ICH GPIO2"))
701 use_gpio |= 1 << 1;
702
703 ret = acpi_check_region(res->start + 0x00, 0x30, "LPC ICH GPIO1");
704 if (!ret)
705 use_gpio |= 1 << 0;
706
707 return use_gpio ? use_gpio : ret;
708}
709
686static int __devinit lpc_ich_init_gpio(struct pci_dev *dev, 710static int __devinit lpc_ich_init_gpio(struct pci_dev *dev,
687 const struct pci_device_id *id) 711 const struct pci_device_id *id)
688{ 712{
@@ -740,12 +764,13 @@ gpe0_done:
740 break; 764 break;
741 } 765 }
742 766
743 ret = acpi_check_resource_conflict(res); 767 ret = lpc_ich_check_conflict_gpio(res);
744 if (ret) { 768 if (ret < 0) {
745 /* this isn't necessarily fatal for the GPIO */ 769 /* this isn't necessarily fatal for the GPIO */
746 acpi_conflict = true; 770 acpi_conflict = true;
747 goto gpio_done; 771 goto gpio_done;
748 } 772 }
773 lpc_chipset_info[id->driver_data].use_gpio = ret;
749 lpc_ich_enable_gpio_space(dev); 774 lpc_ich_enable_gpio_space(dev);
750 775
751 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id); 776 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id);