Messages in this thread Patch in this message | | | Date | Sun, 21 Mar 1999 23:54:14 -0800 (PST) | From | Tigran Aivazian <> | Subject | [patch] io/irq are CONFIG_ options in mcd (mitsumi single-speed CDROM) |
| |
Dear Linus,
This patch gets rid of '#define I_WAS_THERE' approach whereby users (including the clueless ones) have to edit the drivers/cdrom/mcd.h to set io base address and irq number for their CDROM unless they want to see a compilation warning telling that something maybe wrong.
It makes the code overall smaller and configuration more "user-friendly".
So, I am going to go through any other places that require "user source editing" and turn them into CONFIG_ options (if reasonable), unless you (or many other people) tell me not to do it.
Also, how about a separate section "Kernel Tuning" where all defaults used in /proc/sys can be adjusted + some new onesI have in mind, e.g. the modprobe_path length (defaults to 256 but one needs to edit two places to change it)? If nobody objects perhaps I shall do this as well?
Regards, Tigran.
PS.I can see only one objection to this patch saying "but when I configure sound subsystem it does not let me set io/irq if I choose M (module)...." Those who say this are advised to read carefully drivers/sound/* files and see the way it is done there - that should answer their objection. Also, look in ftape driver and see that it *is* a good idea to be able to specify default io/irq for a module (unless one has a rich infrastructure like the sound one).
diff -ur linux/Documentation/Configure.help linux-2.2.3-mcd/Documentation/Configure.help --- linux/Documentation/Configure.help Sun Mar 21 20:52:50 1999 +++ linux-2.2.3-mcd/Documentation/Configure.help Sun Mar 21 21:35:07 1999 @@ -6503,9 +6503,6 @@ (PhotoCDs). There is a new driver (next question) which can do this. If you want that one, say N here. - If the driver doesn't work out of the box, you might want to have a - look at drivers/cdrom/mcd.h. - If you say Y here, you should also say Y or M to "ISO 9660 CDROM filesystem support" below, because that's the filesystem used on CDROMs. @@ -6514,6 +6511,20 @@ inserted in and removed from the running kernel whenever you want). The module will be called mcd.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. + +IRQ channel for Mitsumi CD-ROM +CONFIG_MCD_IRQ + This allows you to specify default value of interrupt number used by + the driver. This setting can be overriden at boot time by passing "mcd=" + parameter to the kernel or module load time (if you compiled this as a + module). + +I/O base address for Mitsumi CD-ROM +CONFIG_MCD_BASE + This allows you to specify default value of I/O base address used by + the driver. This setting can be overriden at boot time by passing "mcd=" + parameter to the kernel or module load time (if you compiled this as a + module). Mitsumi [XA/MultiSession] support CONFIG_MCDX diff -ur linux/drivers/cdrom/Config.in linux-2.2.3-mcd/drivers/cdrom/Config.in --- linux/drivers/cdrom/Config.in Sun Dec 28 20:05:45 1997 +++ linux-2.2.3-mcd/drivers/cdrom/Config.in Sun Mar 21 21:49:22 1999 @@ -14,6 +14,10 @@ fi fi tristate 'Mitsumi (standard) [no XA/Multisession] CDROM support' CONFIG_MCD +if [ "$CONFIG_MCD" != "n" ]; then + int 'MCD IRQ' CONFIG_MCD_IRQ 11 + hex 'MCD I/O base' CONFIG_MCD_BASE 300 +fi tristate 'Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX tristate 'Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206 diff -ur linux/drivers/cdrom/mcd.c linux-2.2.3-mcd/drivers/cdrom/mcd.c --- linux/drivers/cdrom/mcd.c Wed Nov 4 20:09:43 1998 +++ linux-2.2.3-mcd/drivers/cdrom/mcd.c Sun Mar 21 21:05:44 1999 @@ -67,6 +67,7 @@ a CD. November 1997 -- ported to the Uniform CD-ROM driver by Erik Andersen. + March 1999 -- made io base and irq CONFIG_ options (Tigran Aivazian). */ #include <linux/module.h> @@ -83,6 +84,7 @@ #include <linux/string.h> #include <linux/delay.h> #include <linux/init.h> +#include <linux/config.h> /* #define REALLY_SLOW_IO */ #include <asm/system.h> @@ -155,8 +157,8 @@ int mitsumi_bug_93_wait = 0; #endif /* WORK_AROUND_MITSUMI_BUG_93 */ -static short mcd_port = MCD_BASE_ADDR; /* used as "mcd" by "insmod" */ -static int mcd_irq = MCD_INTR_NR; /* must directly follow mcd_port */ +static short mcd_port = CONFIG_MCD_BASE; /* used as "mcd" by "insmod" */ +static int mcd_irq = CONFIG_MCD_IRQ; /* must directly follow mcd_port */ MODULE_PARM(mcd, "1-2i"); static int McdTimeout, McdTries; diff -ur linux/drivers/cdrom/mcd.h linux-2.2.3-mcd/drivers/cdrom/mcd.h --- linux/drivers/cdrom/mcd.h Tue Dec 2 19:41:44 1997 +++ linux-2.2.3-mcd/drivers/cdrom/mcd.h Sun Mar 21 21:49:04 1999 @@ -21,20 +21,6 @@ * */ -/* *** change this to set the I/O port address */ -#define MCD_BASE_ADDR 0x300 - -/* *** change this to set the interrupt number */ -#define MCD_INTR_NR 11 - -/* *** make the following line uncommented, if you're sure, - * *** all configuration is done */ - -/* #define I_WAS_HERE */ - - - - /* Increase this if you get lots of timeouts */ #define MCD_STATUS_DELAY 1000 @@ -121,8 +107,3 @@ struct msf trackTime; struct msf diskTime; }; - -#ifndef I_WAS_HERE -#warning You have not edited mcd.h -#warning Perhaps irq and i/o settings are wrong. -#endif
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |