mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] Re: pc_keyb.c #define kbd_controller_present()
@ 2002-12-09 21:29 Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2002-12-09 21:29 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Nat Ersoz, linux-kernel

You should only need this:

+#ifndef CONFIG_PSKEYBOARD
+#define kbd_controller_present()       0
+#endif

I think the following hunk should be superfluous:

+#ifdef CONFIG_PSKEYBOARD
 #define kbd_read_input() inb(KBD_DATA_REG)
 #define kbd_read_status() inb(KBD_STATUS_REG)
 #define kbd_write_output(val) outb(val, KBD_DATA_REG)
 #define kbd_write_command(val) outb(val, KBD_CNTL_REG)
+#else
+#define kbd_read_input()       0
+#define kbd_read_status()      0
+#define kbd_write_output(val)
+#define kbd_write_command(val)
+#endif

Or is there some case where pc_keyb will use kbd_read_input() and
friends even if kbd_controller_present() is false?

We have the equivalent of the first hunk in asm-ia64/keyboard.h, and
the kbd_controller_present() hook should be used consistently to
avoid breakage.  For example, if you include the second hunk, and
pc_keyb.c changes to use kbd_read_input() even when kbd_controller_present()
is false, i386 might still work but ia64 would break.

Bjorn


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Re: pc_keyb.c #define kbd_controller_present()
       [not found] <1039019244.25141.34.camel@ersoz.et.myrio.com>
@ 2002-12-04 20:54 ` Randy.Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy.Dunlap @ 2002-12-04 20:54 UTC (permalink / raw)
  To: Nat Ersoz; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1278 bytes --]


Hi,

Nat Ersoz wrote a couple of weeks back about systems that he has
without PS/2 (or AT) keyboards attached, and he mentioned a possible
solution.  I have done a minimal implementation of that solution
for 2.4.20.  Nat has tested it on a system with an IR keyboard and is
ready to ship it.  :)  I have tested it on a system with a USB
keyboard.  Both of these systems have a PS/2 keyboard controller
on them but no PS/2 keyboard attached.

I know that 2.5 has a different solution for this, but this is
now available for 2.4 for anyone who needs it.
This introduces CONFIG_PSKEYBOARD for i386, which defaults to Yes/ON,
so you'll need to disablel this option to use/test it, and it's
marked Experimental, so you'll need to enable Experimental also.

This eliminates some keyboard timeouts and messages such as:
| keyboard: Timeout - AT keyboard not present?(ed)
| keyboard: Timeout - AT keyboard not present?(f4)
| "pc_keyb: controller jammed 0xFF"
and it makes booting faster on systems that were experiencing
such keyboard timeouts.

Comments?

--
~Randy


On 4 Dec 2002, Nat Ersoz wrote:

| That worked for me.  Thanks for taking the initiative on this! I used it
| to patch both the 2.4.19 and 2.4.20 kernels without errors.  This looks
| good to me.  Ship it!
|
| Nat



[-- Attachment #2: Type: TEXT/PLAIN, Size: 2258 bytes --]

--- ./include/asm-i386/keyboard.h%KBC	Mon Dec  2 12:15:08 2002
+++ ./include/asm-i386/keyboard.h	Tue Dec  3 16:18:56 2002
@@ -13,12 +13,17 @@
 
 #ifdef __KERNEL__
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
 #include <linux/kd.h>
 #include <linux/pm.h>
 #include <asm/io.h>
 
+#ifndef CONFIG_PSKEYBOARD
+#define kbd_controller_present()	0
+#endif
+
 #define KEYBOARD_IRQ			1
 #define DISABLE_KBD_DURING_INTERRUPTS	0
 
@@ -49,10 +54,17 @@
                                              "keyboard", NULL)
 
 /* How to access the keyboard macros on this platform.  */
+#ifdef CONFIG_PSKEYBOARD
 #define kbd_read_input() inb(KBD_DATA_REG)
 #define kbd_read_status() inb(KBD_STATUS_REG)
 #define kbd_write_output(val) outb(val, KBD_DATA_REG)
 #define kbd_write_command(val) outb(val, KBD_CNTL_REG)
+#else
+#define kbd_read_input()	0
+#define kbd_read_status()	0
+#define kbd_write_output(val)
+#define kbd_write_command(val)
+#endif
 
 /* Some stoneage hardware needs delays after some operations.  */
 #define kbd_pause() do { } while(0)
--- ./drivers/char/Config.in%KBC	Thu Nov 28 15:53:12 2002
+++ ./drivers/char/Config.in	Tue Dec  3 14:30:01 2002
@@ -155,6 +155,8 @@
 
 source drivers/i2c/Config.in
 
+bool 'PS/2 keyboard support (Off = EXPERIMENTAL)' CONFIG_PSKEYBOARD $CONFIG_EXPERIMENTAL
+
 mainmenu_option next_comment
 comment 'Mice'
 tristate 'Bus Mouse Support' CONFIG_BUSMOUSE
--- ./arch/i386/defconfig%KBC	Thu Nov 28 15:53:09 2002
+++ ./arch/i386/defconfig	Tue Dec  3 14:37:50 2002
@@ -559,6 +559,8 @@
 #
 # CONFIG_I2C is not set
 
+CONFIG_PSKEYBOARD=y
+
 #
 # Mice
 #
--- ./Documentation/Configure.help%KBC	Thu Nov 28 15:53:08 2002
+++ ./Documentation/Configure.help	Tue Dec  3 14:36:37 2002
@@ -17679,6 +17679,12 @@
   it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-proc.o.
 
+PS/2 keyboard support
+CONFIG_PSKEYBOARD
+  PS/2 keyboard support is optional and can be omitted on some systems,
+  for example, some IA32 systems which use IrDA keyboards.
+  If unsure, say Y.
+
 Bus Mouse Support
 CONFIG_BUSMOUSE
   Say Y here if your machine has a bus mouse as opposed to a serial

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-09 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-09 21:29 [PATCH] Re: pc_keyb.c #define kbd_controller_present() Bjorn Helgaas
     [not found] <1039019244.25141.34.camel@ersoz.et.myrio.com>
2002-12-04 20:54 ` Randy.Dunlap

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®