mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] runtime selection of CONFIG_PARIDE_EPATC8
Date: Mon, 31 May 2004 13:57:54 +0200	[thread overview]
Message-ID: <20040531115754.GA16245@lst.de> (raw)

drivers/block/paride/epat.c support two slightly different protocol
variants.  Currently it's compile-time selected by CONFIG_PARIDE_EPATC8,
but this patch adds a epatc8 module option to allow runtime selection.
CONFIG_PARIDE_EPATC8 stays for now but I'd like to kill it int 2.7.

The basic patch is from the Debian kernel package (Author unknown) but
I reworked it a bit.


--- 1.7/drivers/block/paride/epat.c	2002-11-15 03:03:17 +01:00
+++ edited/drivers/block/paride/epat.c	2004-05-31 13:16:02 +02:00
@@ -31,6 +31,12 @@
 #define j44(a,b)		(((a>>4)&0x0f)+(b&0xf0))
 #define j53(a,b)		(((a>>3)&0x1f)+((b<<4)&0xe0))
 
+static int epatc8;
+
+module_param(epatc8, int, 0);
+MODULE_PARM_DESC(epatc8, "support for the Shuttle EP1284 chip, "
+	"used in any recent Imation SuperDisk (LS-120) drive.");
+
 /* cont =  0   IDE register file
    cont =  1   IDE control registers
    cont =  2   internal EPAT registers
@@ -209,15 +215,18 @@
 {       pi->saved_r0 = r0();
         pi->saved_r2 = r2();
 
-#ifdef CONFIG_PARIDE_EPATC8
  	/* Initialize the chip */
-        CPP(0);CPP(0x40);CPP(0xe0);              
-        w0(0);w2(1);w2(4);
-        WR(0x8,0x12);WR(0xc,0x14);WR(0x12,0x10);
-        WR(0xe,0xf);WR(0xf,4);
-     /* WR(0xe,0xa);WR(0xf,4); */
-        WR(0xe,0xd);WR(0xf,0);
-     /* CPP(0x30); */
+	CPP(0);
+
+	if (epatc8) {
+		CPP(0x40);CPP(0xe0);              
+		w0(0);w2(1);w2(4);
+		WR(0x8,0x12);WR(0xc,0x14);WR(0x12,0x10);
+		WR(0xe,0xf);WR(0xf,4);
+		/* WR(0xe,0xa);WR(0xf,4); */
+		WR(0xe,0xd);WR(0xf,0);
+		/* CPP(0x30); */
+	}
 
         /* Connect to the chip */
 	CPP(0xe0);
@@ -227,15 +236,10 @@
           /* Request EPP */
           w0(0x40);w2(6);w2(7);w2(4);w2(0xc);w2(4);
         }
-#else
- 	CPP(0); CPP(0xe0);
-	w0(0); w2(1); w2(4);
-	if (pi->mode >= 3) {
-		w0(0); w2(1); w2(4); w2(0xc);
-		w0(0x40); w2(6); w2(7); w2(4); w2(0xc); w2(4);
+
+	if (!epatc8) {
+		WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
 	}
-	WR(8,0x10); WR(0xc,0x14); WR(0xa,0x38); WR(0x12,0x10);
-#endif
 }
 
 static void epat_disconnect (PIA *pi)
@@ -320,6 +324,9 @@
 
 static int __init epat_init(void)
 {
+#ifdef CONFIG_PARIDE_EPATC8
+	epatc8 = 1;
+#endif
 	return pi_register(&epat)-1;
 }
 

                 reply	other threads:[~2004-05-31 11:58 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=20040531115754.GA16245@lst.de \
    --to=hch@lst.de \
    --cc=akpm@osdl.org \
    --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

all inboxes | Powered by JetHome®