Re: SERIO_USERDEV patch for 2.6

From: Dmitry Torokhov (dtor_core_at_ameritech.net)
Date: 05/30/04

  • Next message: Felipe Alfaro Solana: "Re: PROBLEM: kernel-2.6.7-rc1 ACPI and USB failures"
    To: linux-kernel@vger.kernel.org
    Date:	Sun, 30 May 2004 10:09:18 -0500
    
    

    On Sunday 30 May 2004 08:42 am, Vojtech Pavlik wrote:
    >
    > Anyway, looking at the patch, it's not bad, and it's quite close to what
    > I was considering to write. I'd like to keep it separate from the
    > serio.c file, although it's obvious it'll require to be linked to it
    > statically, because it needs hooks there - it cannot be a regular serio
    > driver.
    >

    Do we really have to have this stuff directly in serio? How about being able
    to mark some serio ports as working in raw mode (i8042.raw=0,1,1,0) and have
    separate (serio_raw?) module bind to such ports

    Warning - the patch below is not really tested and may not apply to Linus'
    tree.

    -- 
    Dmitry
    ===================================================================
    ChangeSet@1.1743.7.10, 2004-05-29 22:19:16-05:00, dtor_core@ameritech.net
      Input: i8042 - add kernel parameter to allow mark some of AUX ports
             as raw (SERIO_8042_RAW). This will cause psmouse module ignore
             these ports and will allow bytestream driver serve data to the
             userspace.
     Documentation/kernel-parameters.txt |    2 ++
     drivers/input/serio/i8042.c         |   15 +++++++++++++--
     include/linux/serio.h               |    1 +
     3 files changed, 16 insertions(+), 2 deletions(-)
    ===================================================================
    diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
    --- a/Documentation/kernel-parameters.txt	2004-05-30 10:08:34 -05:00
    +++ b/Documentation/kernel-parameters.txt	2004-05-30 10:08:34 -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-05-30 10:08:34 -05:00
    +++ b/drivers/input/serio/i8042.c	2004-05-30 10:08:34 -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");
    @@ -651,8 +656,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);
    @@ -936,6 +942,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;
    @@ -970,8 +978,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);
    diff -Nru a/include/linux/serio.h b/include/linux/serio.h
    --- a/include/linux/serio.h	2004-05-30 10:08:34 -05:00
    +++ b/include/linux/serio.h	2004-05-30 10:08:34 -05:00
    @@ -108,6 +108,7 @@
     #define SERIO_PC9800	0x04000000UL
     #define SERIO_PS_PSTHRU	0x05000000UL
     #define SERIO_8042_XL	0x06000000UL
    +#define SERIO_8042_RAW	0x07000000UL
     
     #define SERIO_PROTO	0xFFUL
     #define SERIO_MSC	0x01
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Felipe Alfaro Solana: "Re: PROBLEM: kernel-2.6.7-rc1 ACPI and USB failures"

    Relevant Pages

    • [PATCH] Add resume support to serio bus.
      ... This patch adds resume support to serio_bus based on serio reconnect ... framework so now not only i8042 ports will be re-initialized at resume. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Dont use a klist for drivers set-of-devices
      ... just a couple of comments about serio - I would not look at ... Presumably the gameport code is very similar to the serio code. ... you've had a chance to read through that patch, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Submitting patches for Kontron-boards with Freescale processors
      ... We would like to start now to submit all these board supports to the vanilla kernel. ... Should we try to provide a patch with all HW-features of the board supported, or would it be better to start with a minimalistic patch, and then add support for additional devices onboard time by time? ... I ask because for the 85xx and 83xx subarchitectures I'm trying to limit new board ports in arch/ppc as we try to transition to arch/powerpc. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: i8042 controller on Toshiba Satellite P10 notebook - patch
      ... Checking my logs it actually looks like usb-handoff did get 4 ports. ... With my patch, however, I only get: ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: SERIO_USERDEV patch for 2.6
      ... > work for all serio ports, not just i8042, etc, etc. ... PC-style AUX ports because of wide variety of connected devices. ... implement dynamic binding of serio drivers and ports, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)