ia64/xen-unstable

changeset 7035:43edce5b75d6

Remove file from sparse tree.
author kaf24@firebug.cl.cam.ac.uk
date Thu Sep 22 20:59:31 2005 +0100 (2005-09-22)
parents b6ee1d1cdc93
children 94c6fc048d8e
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/acpi/motherboard.c	Thu Sep 22 12:06:33 2005 -0600
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,178 +0,0 @@
     1.4 -/* 
     1.5 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1.6 - *  This program is free software; you can redistribute it and/or modify
     1.7 - *  it under the terms of the GNU General Public License as published by
     1.8 - *  the Free Software Foundation; either version 2 of the License, or (at
     1.9 - *  your option) any later version.
    1.10 - *
    1.11 - *  This program is distributed in the hope that it will be useful, but
    1.12 - *  WITHOUT ANY WARRANTY; without even the implied warranty of
    1.13 - *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.14 - *  General Public License for more details.
    1.15 - *
    1.16 - *  You should have received a copy of the GNU General Public License along
    1.17 - *  with this program; if not, write to the Free Software Foundation, Inc.,
    1.18 - *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
    1.19 - *
    1.20 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1.21 - */
    1.22 -
    1.23 -/* Purpose: Prevent PCMCIA cards from using motherboard resources. */
    1.24 -
    1.25 -#include <linux/kernel.h>
    1.26 -#include <linux/init.h>
    1.27 -#include <linux/types.h>
    1.28 -#include <linux/pci.h>
    1.29 -#include <linux/ioport.h>
    1.30 -#include <asm/io.h>
    1.31 -
    1.32 -#include <acpi/acpi_bus.h>
    1.33 -#include <acpi/acpi_drivers.h>
    1.34 -
    1.35 -#define _COMPONENT		ACPI_SYSTEM_COMPONENT
    1.36 -ACPI_MODULE_NAME		("acpi_motherboard")
    1.37 -
    1.38 -/* Dell use PNP0C01 instead of PNP0C02 */
    1.39 -#define ACPI_MB_HID1			"PNP0C01"
    1.40 -#define ACPI_MB_HID2			"PNP0C02"
    1.41 -
    1.42 -/**
    1.43 - * Doesn't care about legacy IO ports, only IO ports beyond 0x1000 are reserved
    1.44 - * Doesn't care about the failure of 'request_region', since other may reserve 
    1.45 - * the io ports as well
    1.46 - */
    1.47 -#define IS_RESERVED_ADDR(base, len) \
    1.48 -	(((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \
    1.49 -	&& ((base) + (len) > PCIBIOS_MIN_IO))
    1.50 -
    1.51 -/*
    1.52 - * Clearing the flag (IORESOURCE_BUSY) allows drivers to use
    1.53 - * the io ports if they really know they can use it, while
    1.54 - * still preventing hotplug PCI devices from using it. 
    1.55 - */
    1.56 -
    1.57 -static acpi_status
    1.58 -acpi_reserve_io_ranges (struct acpi_resource *res, void *data)
    1.59 -{
    1.60 -	struct resource *requested_res = NULL;
    1.61 -
    1.62 -	ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
    1.63 -
    1.64 -	if (res->id == ACPI_RSTYPE_IO) {
    1.65 -		struct acpi_resource_io *io_res = &res->data.io;
    1.66 -
    1.67 -		if (io_res->min_base_address != io_res->max_base_address)
    1.68 -			return_VALUE(AE_OK);
    1.69 -		if (IS_RESERVED_ADDR(io_res->min_base_address, io_res->range_length)) {
    1.70 -			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n",
    1.71 -				io_res->min_base_address, 
    1.72 -				io_res->min_base_address + io_res->range_length));
    1.73 -			requested_res = request_region(io_res->min_base_address, 
    1.74 -				io_res->range_length, "motherboard");
    1.75 -		}
    1.76 -	} else if (res->id == ACPI_RSTYPE_FIXED_IO) {
    1.77 -		struct acpi_resource_fixed_io *fixed_io_res = &res->data.fixed_io;
    1.78 -
    1.79 -		if (IS_RESERVED_ADDR(fixed_io_res->base_address, fixed_io_res->range_length)) {
    1.80 -			ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n",
    1.81 -				fixed_io_res->base_address, 
    1.82 -				fixed_io_res->base_address + fixed_io_res->range_length));
    1.83 -			requested_res = request_region(fixed_io_res->base_address, 
    1.84 -				fixed_io_res->range_length, "motherboard");
    1.85 -		}
    1.86 -	} else {
    1.87 -		/* Memory mapped IO? */
    1.88 -	}
    1.89 -
    1.90 -	if (requested_res)
    1.91 -		requested_res->flags &= ~IORESOURCE_BUSY;
    1.92 -	return_VALUE(AE_OK);
    1.93 -}
    1.94 -
    1.95 -static int acpi_motherboard_add (struct acpi_device *device)
    1.96 -{
    1.97 -	if (!device)
    1.98 -		return -EINVAL;
    1.99 -	acpi_walk_resources(device->handle, METHOD_NAME__CRS, 
   1.100 -		acpi_reserve_io_ranges, NULL);
   1.101 -
   1.102 -	return 0;
   1.103 -}
   1.104 -
   1.105 -static struct acpi_driver acpi_motherboard_driver1 = {
   1.106 -	.name =		"motherboard",
   1.107 -	.class =	"",
   1.108 -	.ids =		ACPI_MB_HID1,
   1.109 -	.ops =	{
   1.110 -		.add =		acpi_motherboard_add,
   1.111 -	},
   1.112 -};
   1.113 -
   1.114 -static struct acpi_driver acpi_motherboard_driver2 = {
   1.115 -	.name =		"motherboard",
   1.116 -	.class =	"",
   1.117 -	.ids =		ACPI_MB_HID2,
   1.118 -	.ops =	{
   1.119 -		.add =		acpi_motherboard_add,
   1.120 -	},
   1.121 -};
   1.122 -
   1.123 -static void __init
   1.124 -acpi_reserve_resources (void)
   1.125 -{
   1.126 -	if (!acpi_gbl_FADT) return;
   1.127 -	if (acpi_gbl_FADT->xpm1a_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
   1.128 -		request_region(acpi_gbl_FADT->xpm1a_evt_blk.address, 
   1.129 -			acpi_gbl_FADT->pm1_evt_len, "PM1a_EVT_BLK");
   1.130 -
   1.131 -	if (acpi_gbl_FADT->xpm1b_evt_blk.address && acpi_gbl_FADT->pm1_evt_len)
   1.132 -		request_region(acpi_gbl_FADT->xpm1b_evt_blk.address,
   1.133 -			acpi_gbl_FADT->pm1_evt_len, "PM1b_EVT_BLK");
   1.134 -
   1.135 -	if (acpi_gbl_FADT->xpm1a_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
   1.136 -		request_region(acpi_gbl_FADT->xpm1a_cnt_blk.address, 
   1.137 -			acpi_gbl_FADT->pm1_cnt_len, "PM1a_CNT_BLK");
   1.138 -
   1.139 -	if (acpi_gbl_FADT->xpm1b_cnt_blk.address && acpi_gbl_FADT->pm1_cnt_len)
   1.140 -		request_region(acpi_gbl_FADT->xpm1b_cnt_blk.address, 
   1.141 -			acpi_gbl_FADT->pm1_cnt_len, "PM1b_CNT_BLK");
   1.142 -
   1.143 -	if (acpi_gbl_FADT->xpm_tmr_blk.address && acpi_gbl_FADT->pm_tm_len == 4)
   1.144 -		request_region(acpi_gbl_FADT->xpm_tmr_blk.address,
   1.145 -			4, "PM_TMR");
   1.146 -
   1.147 -	if (acpi_gbl_FADT->xpm2_cnt_blk.address && acpi_gbl_FADT->pm2_cnt_len)
   1.148 -		request_region(acpi_gbl_FADT->xpm2_cnt_blk.address,
   1.149 -			acpi_gbl_FADT->pm2_cnt_len, "PM2_CNT_BLK");
   1.150 -
   1.151 -	/* Length of GPE blocks must be a non-negative multiple of 2 */
   1.152 -
   1.153 -	if (acpi_gbl_FADT->xgpe0_blk.address && acpi_gbl_FADT->gpe0_blk_len &&
   1.154 -			!(acpi_gbl_FADT->gpe0_blk_len & 0x1))
   1.155 -		request_region(acpi_gbl_FADT->xgpe0_blk.address,
   1.156 -			acpi_gbl_FADT->gpe0_blk_len, "GPE0_BLK");
   1.157 -
   1.158 -	if (acpi_gbl_FADT->xgpe1_blk.address && acpi_gbl_FADT->gpe1_blk_len &&
   1.159 -			!(acpi_gbl_FADT->gpe1_blk_len & 0x1))
   1.160 -		request_region(acpi_gbl_FADT->xgpe1_blk.address,
   1.161 -			acpi_gbl_FADT->gpe1_blk_len, "GPE1_BLK");
   1.162 -}
   1.163 -
   1.164 -static int __init acpi_motherboard_init(void)
   1.165 -{
   1.166 -	acpi_bus_register_driver(&acpi_motherboard_driver1);
   1.167 -	acpi_bus_register_driver(&acpi_motherboard_driver2);
   1.168 -	/* 
   1.169 -	 * Guarantee motherboard IO reservation first
   1.170 -	 * This module must run after scan.c
   1.171 -	 */
   1.172 -	if (!acpi_disabled)
   1.173 -		acpi_reserve_resources ();
   1.174 -	return 0;
   1.175 -}
   1.176 -
   1.177 -/**
   1.178 - * Reserve motherboard resources after PCI claim BARs,
   1.179 - * but before PCI assign resources for uninitialized PCI devices
   1.180 - */
   1.181 -fs_initcall(acpi_motherboard_init);