public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] allow i8042 register location override
@ 2004-09-02 17:56 Dmitry Torokhov
  2004-09-02 21:29 ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Torokhov @ 2004-09-02 17:56 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Alessandro Rubini, linux-kernel, Andrew Morton, Vojtech Pavlik

Bjorn Helgass wrote:
> Allow the default i8042 register locations to be changed at run-time.
> This is a prelude to adding discovery via the ACPI namespace.
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 

> 
> +static unsigned long i8042_command_reg = I8042_COMMAND_REG;
> +static unsigned long i8042_status_reg = I8042_STATUS_REG;
> +static unsigned long i8042_data_reg = I8042_DATA_REG;
> +

Hi Bjorn,

This will not work as these macros are not constants, see i8042-*io.h
and i8042_platform_init(). What you need to do is add ACPI hooks to
i8042_platform_init for i386/ia64/etc.

--
Dmitry


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] allow i8042 register location override
@ 2004-09-02 16:09 Bjorn Helgaas
  0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2004-09-02 16:09 UTC (permalink / raw)
  To: Vojtech Pavlik, Andrew Morton; +Cc: Alessandro Rubini, linux-kernel

Allow the default i8042 register locations to be changed at run-time.
This is a prelude to adding discovery via the ACPI namespace.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

diff -u -ur 2.6.9-rc1-mm2/drivers/input/serio/i8042-io.h 2.6.9-rc1-mm2-kbd1/drivers/input/serio/i8042-io.h
--- 2.6.9-rc1-mm2/drivers/input/serio/i8042-io.h	2004-09-02 09:49:05.000000000 -0600
+++ 2.6.9-rc1-mm2-kbd1/drivers/input/serio/i8042-io.h	2004-09-02 09:50:26.000000000 -0600
@@ -36,32 +36,36 @@
 #endif
 
 /*
- * Register numbers.
+ * Register numbers (may be overridden)
  */
 
 #define I8042_COMMAND_REG	0x64	
 #define I8042_STATUS_REG	0x64	
 #define I8042_DATA_REG		0x60
 
+extern unsigned long i8042_command_reg;
+extern unsigned long i8042_status_reg;
+extern unsigned long i8042_data_reg;
+
 static inline int i8042_read_data(void)
 {
-	return inb(I8042_DATA_REG);
+	return inb(i8042_data_reg);
 }
 
 static inline int i8042_read_status(void)
 {
-	return inb(I8042_STATUS_REG);
+	return inb(i8042_status_reg);
 }
 
 static inline void i8042_write_data(int val)
 {
-	outb(val, I8042_DATA_REG);
+	outb(val, i8042_data_reg);
 	return;
 }
 
 static inline void i8042_write_command(int val)
 {
-	outb(val, I8042_COMMAND_REG);
+	outb(val, i8042_command_reg);
 	return;
 }
 
diff -u -ur 2.6.9-rc1-mm2/drivers/input/serio/i8042.c 2.6.9-rc1-mm2-kbd1/drivers/input/serio/i8042.c
--- 2.6.9-rc1-mm2/drivers/input/serio/i8042.c	2004-09-02 09:49:05.000000000 -0600
+++ 2.6.9-rc1-mm2-kbd1/drivers/input/serio/i8042.c	2004-09-02 09:49:50.000000000 -0600
@@ -106,6 +106,10 @@
 static struct timer_list i8042_timer;
 static struct platform_device *i8042_platform_device;
 
+static unsigned long i8042_command_reg = I8042_COMMAND_REG;
+static unsigned long i8042_status_reg = I8042_STATUS_REG;
+static unsigned long i8042_data_reg = I8042_DATA_REG;
+
 /*
  * Shared IRQ's require a device pointer, but this driver doesn't support
  * multiple devices
@@ -650,10 +654,7 @@
 	}
 
 	printk(KERN_INFO "serio: i8042 %s port at %#lx,%#lx irq %d\n",
-	       values->name,
-	       (unsigned long) I8042_DATA_REG,
-	       (unsigned long) I8042_COMMAND_REG,
-	       values->irq);
+	       values->name, i8042_data_reg, i8042_command_reg, values->irq);
 
 	serio_register_port(port);
 

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

end of thread, other threads:[~2004-09-06 19:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-02 17:56 [PATCH] allow i8042 register location override Dmitry Torokhov
2004-09-02 21:29 ` Bjorn Helgaas
2004-09-03  6:57   ` Dmitry Torokhov
2004-09-03 15:41     ` Bjorn Helgaas
2004-09-06 12:22       ` Vojtech Pavlik
2004-09-06 18:28         ` Dmitry Torokhov
2004-09-06 19:58           ` Vojtech Pavlik
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02 16:09 Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox