public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Waugh <twaugh@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] 2.4.3: VIA SIO parport parameters
Date: Fri, 30 Mar 2001 12:16:52 +0100	[thread overview]
Message-ID: <20010330121652.I10553@redhat.com> (raw)

Currently the VIA SuperIO chip's parallel port support uses IRQs
regardless of whether the user says not to.  This patch addresses
that.  Please let me know if there are problems with it.

Thanks,
Tim.
*/

2001-03-30  Tim Waugh  <twaugh@redhat.com>

	* drivers/parport/parport_pc.c: Make Via SuperIO chipsets behave
	like everything else with respect to irq= and dma= parameters.
	* drivers/parport/ChangeLog: Updated.

--- linux/drivers/parport/parport_pc.c.viaparam	Fri Mar 30 12:02:12 2001
+++ linux/drivers/parport/parport_pc.c	Fri Mar 30 12:02:12 2001
@@ -2180,7 +2180,8 @@
 
 
 /* Via support maintained by Jeff Garzik <jgarzik@mandrakesoft.com> */
-static int __devinit sio_via_686a_probe (struct pci_dev *pdev)
+static int __devinit sio_via_686a_probe (struct pci_dev *pdev, int autoirq,
+					 int autodma)
 {
 	u8 tmp;
 	int dma, irq;
@@ -2260,6 +2261,14 @@
 	if (!have_eppecp)
 		dma = PARPORT_DMA_NONE;
 
+	/* Let the user (or defaults) steer us away from interrupts and DMA */
+	if (autoirq != PARPORT_IRQ_AUTO) {
+		irq = PARPORT_IRQ_NONE;
+		dma = PARPORT_DMA_NONE;
+	}
+	if (autodma != PARPORT_DMA_AUTO)
+		dma = PARPORT_DMA_NONE;
+
 	/* finally, do the probe with values obtained */
 	if (parport_pc_probe_port (port1, port2, irq, dma, NULL)) {
 		printk (KERN_INFO
@@ -2285,7 +2294,7 @@
 
 /* each element directly indexed from enum list, above */
 static struct parport_pc_superio {
-	int (*probe) (struct pci_dev *pdev);
+	int (*probe) (struct pci_dev *pdev, int autoirq, int autodma);
 } parport_pc_superio_info[] __devinitdata = {
 	{ sio_via_686a_probe, },
 };
@@ -2542,7 +2551,7 @@
 	probe:		parport_pc_pci_probe,
 };
 
-static int __init parport_pc_init_superio (void)
+static int __init parport_pc_init_superio (int autoirq, int autodma)
 {
 #ifdef CONFIG_PCI
 	const struct pci_device_id *id;
@@ -2553,7 +2562,8 @@
 		if (id == NULL || id->driver_data >= last_sio)
 			continue;
 
-		return parport_pc_superio_info[id->driver_data].probe (pdev);
+		return parport_pc_superio_info[id->driver_data].probe
+			(pdev, autoirq, autodma);
 	}
 #endif /* CONFIG_PCI */
 
@@ -2596,7 +2606,7 @@
 #endif
 
 	/* Onboard SuperIO chipsets that show themselves on the PCI bus. */
-	count += parport_pc_init_superio ();
+	count += parport_pc_init_superio (autoirq, autodma);
 
 	/* ISA ports and whatever (see asm/parport.h). */
 	count += parport_pc_find_nonpci_ports (autoirq, autodma);
--- linux/drivers/parport/ChangeLog.viaparam	Fri Mar 30 12:02:12 2001
+++ linux/drivers/parport/ChangeLog	Fri Mar 30 12:02:12 2001
@@ -0,0 +1,10 @@
+2001-03-30  Tim Waugh  <twaugh@redhat.com>
+
+	* parport_pc.c (sio_via_686a_probe): Take autoirq and autodma
+	parameters in order to conform to how the rest of the driver
+	works.
+	(parport_pc_init_superio): Take autoirq and autodma parameters and
+	pass them on to sio_via_686a_probe.
+	(parport_pc_find_ports): Pass autoirq and autodma to
+	parport_pc_init_superio.
+

                 reply	other threads:[~2001-03-30 11:17 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=20010330121652.I10553@redhat.com \
    --to=twaugh@redhat.com \
    --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