lpc_ich.c (55692af5eb587f7592d6c2713e1e0eeaab0f6c31) lpc_ich.c (4f600ada70beeb1dfe08e11e871bf31015aa0a3d)
1/*
2 * lpc_ich.c - LPC interface for Intel ICH
3 *
4 * LPC bridge function of the Intel ICH contains many other
5 * functional units, such as Interrupt controllers, Timers,
6 * Power Management, System Management, GPIO, RTC, and LPC
7 * Configuration Registers.
8 *

--- 669 unchanged lines hidden (view full) ---

678
679static void __devinit lpc_ich_finalize_cell(struct mfd_cell *cell,
680 const struct pci_device_id *id)
681{
682 cell->platform_data = &lpc_chipset_info[id->driver_data];
683 cell->pdata_size = sizeof(struct lpc_ich_info);
684}
685
1/*
2 * lpc_ich.c - LPC interface for Intel ICH
3 *
4 * LPC bridge function of the Intel ICH contains many other
5 * functional units, such as Interrupt controllers, Timers,
6 * Power Management, System Management, GPIO, RTC, and LPC
7 * Configuration Registers.
8 *

--- 669 unchanged lines hidden (view full) ---

678
679static void __devinit lpc_ich_finalize_cell(struct mfd_cell *cell,
680 const struct pci_device_id *id)
681{
682 cell->platform_data = &lpc_chipset_info[id->driver_data];
683 cell->pdata_size = sizeof(struct lpc_ich_info);
684}
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,
687 const struct pci_device_id *id)
688{
689 u32 base_addr_cfg;
690 u32 base_addr;
691 int ret;
692 bool acpi_conflict = false;
693 struct resource *res;

--- 41 unchanged lines hidden (view full) ---

735 case ICH_V10CORP_GPIO:
736 res->end = res->start + 128 - 1;
737 break;
738 default:
739 res->end = res->start + 64 - 1;
740 break;
741 }
742
710static int __devinit lpc_ich_init_gpio(struct pci_dev *dev,
711 const struct pci_device_id *id)
712{
713 u32 base_addr_cfg;
714 u32 base_addr;
715 int ret;
716 bool acpi_conflict = false;
717 struct resource *res;

--- 41 unchanged lines hidden (view full) ---

759 case ICH_V10CORP_GPIO:
760 res->end = res->start + 128 - 1;
761 break;
762 default:
763 res->end = res->start + 64 - 1;
764 break;
765 }
766
743 ret = acpi_check_resource_conflict(res);
744 if (ret) {
767 ret = lpc_ich_check_conflict_gpio(res);
768 if (ret < 0) {
745 /* this isn't necessarily fatal for the GPIO */
746 acpi_conflict = true;
747 goto gpio_done;
748 }
769 /* this isn't necessarily fatal for the GPIO */
770 acpi_conflict = true;
771 goto gpio_done;
772 }
773 lpc_chipset_info[id->driver_data].use_gpio = ret;
749 lpc_ich_enable_gpio_space(dev);
750
751 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id);
752 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO],
753 1, NULL, 0, NULL);
754
755gpio_done:
756 if (acpi_conflict)

--- 114 unchanged lines hidden ---
774 lpc_ich_enable_gpio_space(dev);
775
776 lpc_ich_finalize_cell(&lpc_ich_cells[LPC_GPIO], id);
777 ret = mfd_add_devices(&dev->dev, -1, &lpc_ich_cells[LPC_GPIO],
778 1, NULL, 0, NULL);
779
780gpio_done:
781 if (acpi_conflict)

--- 114 unchanged lines hidden ---