]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
PNP: define PNP-specific IORESOURCE_IO_* flags alongside IRQ, DMA, MEM
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Fri, 27 Jun 2008 22:57:03 +0000 (16:57 -0600)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 16 Jul 2008 21:27:06 +0000 (23:27 +0200)
PNP previously defined PNP_PORT_FLAG_16BITADDR and PNP_PORT_FLAG_FIXED
in a private header file, but put those flags in struct resource.flags
fields.  Better to make them IORESOURCE_IO_* flags like the existing
IRQ, DMA, and MEM flags.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/pnp/interface.c
drivers/pnp/isapnp/core.c
drivers/pnp/pnpacpi/rsparser.c
drivers/pnp/pnpbios/rsparser.c
include/linux/ioport.h
include/linux/pnp.h

index 239923a300cd8ebb6a93a34a4ae3b945b916a97a..c172b6de6b71af59c924872fc70d5b38f3310e0a 100644 (file)
@@ -57,7 +57,7 @@ static void pnp_print_port(pnp_info_buffer_t * buffer, char *space,
                   "%sport 0x%x-0x%x, align 0x%x, size 0x%x, %i-bit address decoding\n",
                   space, port->min, port->max,
                   port->align ? (port->align - 1) : 0, port->size,
-                  port->flags & PNP_PORT_FLAG_16BITADDR ? 16 : 10);
+                  port->flags & IORESOURCE_IO_16BIT_ADDR ? 16 : 10);
 }
 
 static void pnp_print_irq(pnp_info_buffer_t * buffer, char *space,
index ca4457ec403bd7060315298ba9455c142c5c2681..c5b92526963bf2159d06e0e249e6726989caefd0 100644 (file)
@@ -486,7 +486,7 @@ static void __init isapnp_parse_port_resource(struct pnp_dev *dev,
        port->max = (tmp[4] << 8) | tmp[3];
        port->align = tmp[5];
        port->size = tmp[6];
-       port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0;
+       port->flags = tmp[0] ? IORESOURCE_IO_16BIT_ADDR : 0;
        pnp_register_port_resource(dev, option, port);
 }
 
@@ -507,7 +507,7 @@ static void __init isapnp_parse_fixed_port_resource(struct pnp_dev *dev,
        port->min = port->max = (tmp[1] << 8) | tmp[0];
        port->size = tmp[2];
        port->align = 0;
-       port->flags = PNP_PORT_FLAG_FIXED;
+       port->flags = IORESOURCE_IO_FIXED;
        pnp_register_port_resource(dev, option, port);
 }
 
index 595252b65205b5cfc2d0ebc763120c78f641007e..46069e64a6b2ffd0a81d96559ed176283a905c30 100644 (file)
@@ -180,7 +180,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_dev *dev, u64 start,
        u64 end = start + len - 1;
 
        if (io_decode == ACPI_DECODE_16)
-               flags |= PNP_PORT_FLAG_16BITADDR;
+               flags |= IORESOURCE_IO_16BIT_ADDR;
        if (len == 0 || end >= 0x10003)
                flags |= IORESOURCE_DISABLED;
 
@@ -485,7 +485,7 @@ static __init void pnpacpi_parse_port_option(struct pnp_dev *dev,
        port->align = io->alignment;
        port->size = io->address_length;
        port->flags = ACPI_DECODE_16 == io->io_decode ?
-           PNP_PORT_FLAG_16BITADDR : 0;
+           IORESOURCE_IO_16BIT_ADDR : 0;
        pnp_register_port_resource(dev, option, port);
 }
 
@@ -503,7 +503,7 @@ static __init void pnpacpi_parse_fixed_port_option(struct pnp_dev *dev,
        port->min = port->max = io->address;
        port->size = io->address_length;
        port->align = 0;
-       port->flags = PNP_PORT_FLAG_FIXED;
+       port->flags = IORESOURCE_IO_FIXED;
        pnp_register_port_resource(dev, option, port);
 }
 
@@ -609,7 +609,7 @@ static __init void pnpacpi_parse_address_option(struct pnp_dev *dev,
                port->min = port->max = p->minimum;
                port->size = p->address_length;
                port->align = 0;
-               port->flags = PNP_PORT_FLAG_FIXED;
+               port->flags = IORESOURCE_IO_FIXED;
                pnp_register_port_resource(dev, option, port);
        }
 }
@@ -946,7 +946,7 @@ static void pnpacpi_encode_io(struct pnp_dev *dev,
 
        if (pnp_resource_enabled(p)) {
                /* Note: pnp_assign_port copies pnp_port->flags into p->flags */
-               io->io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR) ?
+               io->io_decode = (p->flags & IORESOURCE_IO_16BIT_ADDR) ?
                    ACPI_DECODE_16 : ACPI_DECODE_10;
                io->minimum = p->start;
                io->maximum = p->end;
index 01f0c3dd1b08ef259bc554c7ff2acb661e1b7e47..489fec3b7974e6be0146da97311ea73c59ac5cf8 100644 (file)
@@ -310,7 +310,7 @@ static __init void pnpbios_parse_port_option(struct pnp_dev *dev,
        port->max = (p[5] << 8) | p[4];
        port->align = p[6];
        port->size = p[7];
-       port->flags = p[1] ? PNP_PORT_FLAG_16BITADDR : 0;
+       port->flags = p[1] ? IORESOURCE_IO_16BIT_ADDR : 0;
        pnp_register_port_resource(dev, option, port);
 }
 
@@ -326,7 +326,7 @@ static __init void pnpbios_parse_fixed_port_option(struct pnp_dev *dev,
        port->min = port->max = (p[2] << 8) | p[1];
        port->size = p[3];
        port->align = 0;
-       port->flags = PNP_PORT_FLAG_FIXED;
+       port->flags = IORESOURCE_IO_FIXED;
        pnp_register_port_resource(dev, option, port);
 }
 
index c6801bffe76d335af9e8ac2db0fe68a07d3e9823..39db059ffb8b3c342210e544b4f76b4d5a33690e 100644 (file)
@@ -88,6 +88,10 @@ struct resource_list {
 #define IORESOURCE_MEM_SHADOWABLE      (1<<5)  /* dup: IORESOURCE_SHADOWABLE */
 #define IORESOURCE_MEM_EXPANSIONROM    (1<<6)
 
+/* PnP I/O specific bits (IORESOURCE_BITS) */
+#define IORESOURCE_IO_16BIT_ADDR       (1<<0)
+#define IORESOURCE_IO_FIXED            (1<<1)
+
 /* PCI ROM control bits (IORESOURCE_BITS) */
 #define IORESOURCE_ROM_ENABLE          (1<<0)  /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
 #define IORESOURCE_ROM_SHADOW          (1<<1)  /* ROM is copy at C000:0 */
index e033e1b14c275368fe0854475426a1b244601999..e1454dabde10b304cc391c156dae89062319c6bf 100644 (file)
@@ -182,9 +182,6 @@ static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar)
 }
 
 
-#define PNP_PORT_FLAG_16BITADDR        (1<<0)
-#define PNP_PORT_FLAG_FIXED    (1<<1)
-
 struct pnp_port {
        unsigned short min;     /* min base number */
        unsigned short max;     /* max base number */