public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrey Panin <pazke@orbita1.ru>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] PnP BIOS support for i82365.c
Date: Tue, 4 Sep 2001 18:01:45 +0400	[thread overview]
Message-ID: <20010904180145.A10608@orbita1.ru> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 318 bytes --]

Hello all,

attached patch adds PnP BIOS support in i82365 PCMCIA driver.
I hope it will be usefull for people with strange hardware configurations.

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.asc

[-- Attachment #1.2: patch-i82365-PNPBIOS --]
[-- Type: text/plain, Size: 2650 bytes --]

diff -urN -X /usr/dontdiff /linux.vanilla/drivers/pcmcia/i82365.c /linux/drivers/pcmcia/i82365.c
--- /linux.vanilla/drivers/pcmcia/i82365.c	Sun Sep  2 23:42:50 2001
+++ /linux/drivers/pcmcia/i82365.c	Mon Sep  3 00:28:16 2001
@@ -58,6 +58,7 @@
 #include <pcmcia/cs.h>
 
 #include <linux/isapnp.h>
+#include <linux/pnp_bios.h>
 
 /* ISA-bus controllers */
 #include "i82365.h"
@@ -821,33 +822,53 @@
 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
 #define I82365_ISAPNP
 #endif
+#ifdef CONFIG_PNPBIOS
+#define I82365_PNPBIOS
+#endif
+#if defined(I82365_ISAPNP) || defined(I82365_PNPBIOS)
+#define I82365_PNP
+#endif
 
-#ifdef I82365_ISAPNP
+#ifdef I82365_PNP
 static struct isapnp_device_id id_table[] __initdata = {
 	{ 	ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'),
-		ISAPNP_FUNCTION(0x0e00), (unsigned long) "Intel 82365-Compatible" },
+		ISAPNP_FUNCTION(0x0e00), (unsigned long) "PNP0e00" },
 	{ 	ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'),
-		ISAPNP_FUNCTION(0x0e01), (unsigned long) "Cirrus Logic CL-PD6720" },
+		ISAPNP_FUNCTION(0x0e01), (unsigned long) "PNP0e01" },
 	{ 	ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'),
-		ISAPNP_FUNCTION(0x0e02), (unsigned long) "VLSI VL82C146" },
+		ISAPNP_FUNCTION(0x0e02), (unsigned long) "PNP0e02" },
 	{	0 }
 };
 MODULE_DEVICE_TABLE(isapnp, id_table);
 
 static struct pci_dev *i82365_pnpdev;
+
+static struct pci_dev *pnp_find_dev(struct isapnp_device_id *id)
+{
+	struct pci_dev *dev = NULL;
+#ifdef I82365_ISAPNP
+	if ((dev = isapnp_find_dev(NULL, id->vendor, id->function, NULL)))
+		return dev;
+#endif
+#ifdef I82365_PNPBIOS
+	if ((dev = pnpbios_find_device((char *)id->driver_data, NULL)))
+		return dev;
+#endif
+	return dev;
+}
 #endif
 
 static void __init isa_probe(void)
 {
     int i, j, sock, k, ns, id;
     ioaddr_t port;
-#ifdef I82365_ISAPNP
+#ifdef I82365_PNP
     struct isapnp_device_id *devid;
     struct pci_dev *dev;
 
     for (devid = id_table; devid->vendor; devid++) {
-	if ((dev = isapnp_find_dev(NULL, devid->vendor, devid->function, NULL))) {
-	    printk("ISAPNP ");
+	if ((dev = pnp_find_dev(devid))) {
+	    printk("PNP ");
 
 	    if (dev->prepare && dev->prepare(dev) < 0) {
 		printk("prepare failed\n");
@@ -1652,7 +1673,7 @@
 	i365_set(i, I365_CSCINT, 0);
 	release_region(socket[i].ioaddr, 2);
     }
-#if defined(CONFIG_ISA) && defined(I82365_ISAPNP)
+#if defined(CONFIG_ISA) && defined(I82365_PNP)
     if (i82365_pnpdev && i82365_pnpdev->deactivate)
 		i82365_pnpdev->deactivate(i82365_pnpdev);
 #endif

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

                 reply	other threads:[~2001-09-04 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010904180145.A10608@orbita1.ru \
    --to=pazke@orbita1.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox