2005-09-15 07:06:01

by Dmitry Torokhov

[permalink] [raw]
Subject: [patch 00/28] RFC/RFT: Input - sysfs integration

[Argh, resending with subjects and proper CCs]

Hi,

The following set of patches deals with converting input subsystem
to the driver model and intergrate it with sysfs. This allows us
to remove custom-made input hotplug handler and finally have an
option of netlink-only hotplug notifier.

Some changes to the driver core were required. I decided that I did
not want to add an additional class to /sys/class directory; instead
class code was changed to allow nesting several classes. This way
we can have:

/sys/class/input/
|-- devices
| |-- input0
| |-- input1
| `-- input2
`-- interfaces
|-- event0
...
|-- mouse1
`-- ts0

and not clutter the top-level directory. Top-level classes define
individual subsystems, lower-level classes define individual parts.
In this particular case 'devices' directory contains class devices
corresponding to input_dev structures whereas 'interfaces' has
class devices produced by input interfaces (handlers), such as
evdev, mousedev, tsdev and joydev.

I believe that other subsystems, such as firewire, SCSI, USB and
I2C could also be moved to a hierarchy of classes to make /sys
tree more organized.

Although all this compatible with pre-udev hotplug scripts I was
advised that having sub-classes will require some changes to udev.

Class interface code was slightly changed to pass interface to
add/remove methods. This way subsystem can have a generic handler
and still call individual interfaces's methods if needed. There are
couple if I2O patches that deal with class interface code, these are
not directly related to this series, but required for compiling.
The maintainer acked them and will push with the rest of I2O
updates.

When registering class devices hotplug event is now sent before
adding interfaces, otherwise children's hotplug events would reach
userspace (udev) first.

The full sysfs input hierarchy on by laptop is the following:
[dtor@core ~]$ tree /sys/class/input/
/sys/class/input/
|-- devices
| |-- input0
| | |-- capabilities
| | | |-- abs
| | | |-- ev
| | | |-- ff
| | | |-- key
| | | |-- led
| | | |-- msc
| | | |-- rel
| | | |-- snd
| | | `-- sw
| | |-- device -> ../../../../devices/platform/i8042/serio1
| | |-- event0 -> ../../../../class/input/interfaces/event0
| | |-- id
| | | |-- bustype
| | | |-- product
| | | |-- vendor
| | | `-- version
| | |-- name
| | |-- phys
| | `-- uniq
| |-- input1
| | |-- capabilities
| | | |-- abs
| | | |-- ev
| | | |-- ff
| | | |-- key
| | | |-- led
| | | |-- msc
| | | |-- rel
| | | |-- snd
| | | `-- sw
| | |-- device -> ../../../../devices/platform/i8042/serio0
| | |-- event1 -> ../../../../class/input/interfaces/event1
| | |-- id
| | | |-- bustype
| | | |-- product
| | | |-- vendor
| | | `-- version
| | |-- mouse0 -> ../../../../class/input/interfaces/mouse0
| | |-- name
| | |-- phys
| | |-- ts0 -> ../../../../class/input/interfaces/ts0
| | `-- uniq
| `-- input2
| |-- capabilities
| | |-- abs
| | |-- ev
| | |-- ff
| | |-- key
| | |-- led
| | |-- msc
| | |-- rel
| | |-- snd
| | `-- sw
| |-- device -> ../../../../devices/platform/i8042/serio0/serio2
| |-- event2 -> ../../../../class/input/interfaces/event2
| |-- id
| | |-- bustype
| | |-- product
| | |-- vendor
| | `-- version
| |-- mouse1 -> ../../../../class/input/interfaces/mouse1
| |-- name
| |-- phys
| |-- ts1 -> ../../../../class/input/interfaces/ts1
| `-- uniq
`-- interfaces
|-- event0
| |-- dev
| `-- device -> ../../../../class/input/devices/input0
|-- event1
| |-- dev
| `-- device -> ../../../../class/input/devices/input1
|-- event2
| |-- dev
| `-- device -> ../../../../class/input/devices/input2
|-- mice
| `-- dev
|-- mouse0
| |-- dev
| `-- device -> ../../../../class/input/devices/input1
|-- mouse1
| |-- dev
| `-- device -> ../../../../class/input/devices/input2
|-- ts0
| |-- dev
| `-- device -> ../../../../class/input/devices/input1
`-- ts1
|-- dev
`-- device -> ../../../../class/input/devices/input2

Review/comments/testing will be appreciated.

Thank you.

--
Dmitry


2005-09-15 07:59:09

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [patch 00/28] RFC/RFT: Input - sysfs integration

Hi Dmitry,

> The following set of patches deals with converting input subsystem
> to the driver model and intergrate it with sysfs. This allows us
> to remove custom-made input hotplug handler and finally have an
> option of netlink-only hotplug notifier.

do you have a GIT tree with all that changes that I can simply pull in
for testing?

Regards

Marcel


2005-09-15 14:27:35

by Dmitry Torokhov

[permalink] [raw]
Subject: Re: [patch 00/28] RFC/RFT: Input - sysfs integration

On 9/15/05, Marcel Holtmann <[email protected]> wrote:
> Hi Dmitry,
>
> > The following set of patches deals with converting input subsystem
> > to the driver model and intergrate it with sysfs. This allows us
> > to remove custom-made input hotplug handler and finally have an
> > option of netlink-only hotplug notifier.
>
> do you have a GIT tree with all that changes that I can simply pull in
> for testing?
>

Not yet, but I think I will set one up if there is a general approval
of the direction of the series.

--
Dmitry