From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephane Chauveau Date: Fri, 05 Oct 2001 15:51:29 +0000 Subject: Re: hotplug, input and XFree86 Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Humm... Stupid mailer :-) Here is the complete mail: Hi, is there a project to handle hotpluging of X11 input devices? For example, I have a Wacom USB tablet. Hotplug works well except that the input subsystem is not yet integrated so I have to guess which input device number is use by the tablet. Even with a proper input subsystem, the X server will have to be stopped and restarted when a new device is plugged in :-( A first approach could be to change XFree86 but I have the feeling that I could take months or years. So I propose to develop a generic 'input' driver for XFree86. This input driver will only understand a subset of the kernel-input events corresponding more or less to the native X11 events (motions in n-dimensions, n-buttons press/release and key press/release). Those events will not be provided directly by the kernel drivers by a daemon started before the X server. The daemon will be responsible for - Creating one or more devices (daemon device) for each physical device that could be plugged in the system Those file devices can be opened by the XFree86 generic 'input' driver even if the physical device is yet not plugged in. - respond to hotplug requests by mapping those demon daemon devices to the kernel input devices. - translate kernel input events to XFree86 input events and redirect them to the appropriate daemon device. Example: For my wacom, the daemon would load a wacom.o driver and create 3 devices. /dev/daemon-input/wacom-stylus /dev/daemon-input/wacom-eraser /dev/daemon-input/wacom-mouse consider that the wacom is plugged in /dev/input/event0. the daemon driver has to interpret the wacom specific event ABS_PRESSURE, BTN_TOOL_STYLUS, BTN_TOOL_ERASER, ABS_TILTX, and map them to more standard event. In the XFree wacom driver, the pressure is on the Z axis so all ABS_PRESSURE events will be transformed into ABS_Z events. The BTN_TOOL_??? events will be used to select the output device to use. >From an XFree point of view, all devices have to be configured in the XF86Config file. Example: for the wacom stylus Section "InputDevice" Identifier "gstylus" Driver "generic-input" Option "Device" "/dev/daemon-input/wacom-stylus" # my wacom supports only 3 dimensions: X, Y and Pressure Option "Dimensions" "3" Option "Mode0" "absolute" Option "Max0" "10206" Option "Mode1" "absolute" Option "Max1" "7422" Option "Mode2" "absolute" Option "Max2" "511" # and 3 buttons Option "Buttons" "3" EndSection _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel