public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC/RFT] Raw access to serio ports (2/2)
       [not found] <200406020216.36568.dtor_core@ameritech.net>
@ 2004-06-02  7:17 ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2004-06-02  7:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Giuseppe Bilotta, Sau Dan Lee, Vojtech Pavlik,
	Tuukka Toivonen


===================================================================


ChangeSet@1.1841, 2004-06-02 02:00:12-05:00, dtor_core@ameritech.net
  Input: add i8042.raw option to mark AUX ports as raw so they can be
         bound to rawdev device.
  
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 Documentation/kernel-parameters.txt |    2 ++
 drivers/input/serio/i8042.c         |   15 +++++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)


===================================================================



diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
--- a/Documentation/kernel-parameters.txt	2004-06-02 02:15:49 -05:00
+++ b/Documentation/kernel-parameters.txt	2004-06-02 02:15:49 -05:00
@@ -464,6 +464,8 @@
 	i8042.noaux	[HW] Don't check for auxiliary (== mouse) port
 	i8042.nomux	[HW] Don't check presence of an active multiplexing
 			     controller
+	i8042.raw	[HW] Specifies which AUX ports should be marked as raw
+			Format: <aux1>,<aux2>,<aux3>,<aux4>
 	i8042.reset	[HW] Reset the controller during init and cleanup
 	i8042.unlock	[HW] Unlock (ignore) the keylock
 
diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	2004-06-02 02:15:49 -05:00
+++ b/drivers/input/serio/i8042.c	2004-06-02 02:15:49 -05:00
@@ -52,6 +52,11 @@
 module_param_named(dumbkbd, i8042_dumbkbd, bool, 0);
 MODULE_PARM_DESC(dumbkbd, "Pretend that controller can only read data from keyboard");
 
+static unsigned int i8042_aux_raw[4];
+static unsigned int i8042_aux_raw_nargs;
+module_param_array_named(raw, i8042_aux_raw, bool, i8042_aux_raw_nargs, 0);
+MODULE_PARM_DESC(raw, "Specifies which AUX ports should be marked as RAW");
+
 __obsolete_setup("i8042_noaux");
 __obsolete_setup("i8042_nomux");
 __obsolete_setup("i8042_unlock");
@@ -652,8 +657,9 @@
 		return -1;
 	}
 
-	printk(KERN_INFO "serio: i8042 %s port at %#lx,%#lx irq %d\n",
+	printk(KERN_INFO "serio: i8042 %s port%s at %#lx,%#lx irq %d\n",
 	       values->name,
+	       port->type == SERIO_8042_RAW ? " (raw)" : "",
 	       (unsigned long) I8042_DATA_REG,
 	       (unsigned long) I8042_COMMAND_REG,
 	       values->irq);
@@ -940,6 +946,8 @@
 	sprintf(i8042_mux_names[index], "i8042 Aux-%d Port", index);
 	sprintf(i8042_mux_phys[index], I8042_MUX_PHYS_DESC, index + 1);
 	sprintf(i8042_mux_short[index], "AUX%d", index);
+	if (i8042_aux_raw[index])
+		port->type = SERIO_8042_RAW;
 	port->name = i8042_mux_names[index];
 	port->phys = i8042_mux_phys[index];
 	port->driver = values;
@@ -974,8 +982,11 @@
 				i8042_init_mux_values(i8042_mux_values + i, i8042_mux_port + i, i);
 				i8042_port_register(i8042_mux_values + i, i8042_mux_port + i);
 			}
-		else
+		else {
+			if (i8042_aux_raw[0])
+				i8042_aux_port.type = SERIO_8042_RAW;
 			i8042_port_register(&i8042_aux_values, &i8042_aux_port);
+		}
 	}
 
 	i8042_port_register(&i8042_kbd_values, &i8042_kbd_port);

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

* Re: [RFC/RFT] Raw access to serio ports (2/2)
@ 2004-06-02  9:49 Sau Dan Lee
  2004-06-02 12:33 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Sau Dan Lee @ 2004-06-02  9:49 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-kernel

>>>>> "Dmitry" == Dmitry Torokhov <dtor_core@ameritech.net> writes:

    Dmitry> +static unsigned int i8042_aux_raw[4];

So,  only AUX ports  can be  directly accessed?   No direct  access to
keyboard port?  Why?

The  SERIO_USERDEV  patch  does  allow  direct access  to  the  PC  AT
keyboard, and it did help me  locate the SysRq problem that I reported
in  other postings.   i.e.  it IS  useful  to be  able  to access  the
keyboard port directly.


    Dmitry> The driver will happily co-exist with psmouse and atkbd
    Dmitry> loaded as they ignore SERIO_8042_RAW ports, so it is
    Dmitry> possible to have one AUX port in raw mode and other in
    Dmitry> standard 2.6 mode.

1) there is no RAW access to the keyboard port;

2) I   hate  this   black  magic,   in  which   the   input  "devices"
   (i.e. drivers)  kidnap the serio  ports they like according  to the
   port  type SERIO_8042_RAW, etc.   That's a  kind of  hardcoding the
   binding between ports and drivers.


Isn't it better to leave the AUX ports as SERIO_8042, and let the user
dynamically change  this port<-->driver binding?  Then,  we don't even
need  that ugly  "i8042.raw" boot  parameter or  i8042_aux_raw option.
The  user can  decide  which  ports are  connected  to your  serio_raw
driver, and which ports are  connected to psmouse.ko.  That would also
allow multiple drivers driving the ports of the same type.  



-- 
Sau Dan LEE                     李守敦(Big5)                    ~{@nJX6X~}(HZ) 

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee


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

* Re: [RFC/RFT] Raw access to serio ports (2/2)
  2004-06-02  9:49 Sau Dan Lee
@ 2004-06-02 12:33 ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2004-06-02 12:33 UTC (permalink / raw)
  To: Sau Dan Lee; +Cc: linux-kernel

On Wednesday 02 June 2004 04:49 am, Sau Dan Lee wrote:
> >>>>> "Dmitry" == Dmitry Torokhov <dtor_core@ameritech.net> writes:
> 
>     Dmitry> +static unsigned int i8042_aux_raw[4];
> 
> So,  only AUX ports  can be  directly accessed?   No direct  access to
> keyboard port?  Why?
>

Keyboards are to be handled in-kernel, at least for now. If there really
a need we can enable grabbing keyboard as well, no big deal.
 
> The  SERIO_USERDEV  patch  does  allow  direct access  to  the  PC  AT
> keyboard, and it did help me  locate the SysRq problem that I reported
> in  other postings.   i.e.  it IS  useful  to be  able  to access  the
> keyboard port directly.
> 

Vojtech has a patch for that - now raw (really raw) codes are reported via
EV_MSC/MSC_RAW event.

> 
>     Dmitry> The driver will happily co-exist with psmouse and atkbd
>     Dmitry> loaded as they ignore SERIO_8042_RAW ports, so it is
>     Dmitry> possible to have one AUX port in raw mode and other in
>     Dmitry> standard 2.6 mode.
> 
> 1) there is no RAW access to the keyboard port;
> 
> 2) I   hate  this   black  magic,   in  which   the   input  "devices"
>    (i.e. drivers)  kidnap the serio  ports they like according  to the
>    port  type SERIO_8042_RAW, etc.   That's a  kind of  hardcoding the
>    binding between ports and drivers.

We do have some hardcoding so atkbd does not try to grab a serio linked
to a serial port and sermouse does not try grabbing keyboard port, etc..
There is nothing new.

> 
> 
> Isn't it better to leave the AUX ports as SERIO_8042, and let the user
> dynamically change  this port<-->driver binding?  Then,  we don't even
> need  that ugly  "i8042.raw" boot  parameter or  i8042_aux_raw option.
> The  user can  decide  which  ports are  connected  to your  serio_raw
> driver, and which ports are  connected to psmouse.ko.  That would also
> allow multiple drivers driving the ports of the same type.  
>

Yes, that's the perfect solution, but I believe we need sysfs for that
and at least I started working on it, but it takes time. In the meantime
i8042.raw should alleviate most of the user's troubles with their input
devices no longer working.

-- 
Dmitry

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

end of thread, other threads:[~2004-06-02 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200406020216.36568.dtor_core@ameritech.net>
2004-06-02  7:17 ` [RFC/RFT] Raw access to serio ports (2/2) Dmitry Torokhov
2004-06-02  9:49 Sau Dan Lee
2004-06-02 12:33 ` Dmitry Torokhov

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