Skip to content

RFC/RFT: Input - sysfs integration

Dmitry Torokhov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 of 28 patches 27 repliesIn review

26 of 28 patches are in this archive. The cover letter announces 28.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/28I2O: remove class interfacedrivers/message/i2o/device.c+122 -1332 replies
2/28I2O: remove i2o_device_classdrivers/message/i2o/core.h drivers/message/i2o/device.c drivers/message/i2o/driver.c +2 more+17 -721 reply
3/28Driver core: allow nesting classesdrivers/base/class.c include/linux/device.h+8 -10 replies
4/28Driver core: make parent class define subsystemdrivers/base/class.c+12 -20 replies
5/28Driver core: pass interface to class intreface methodsdrivers/base/class.c drivers/pcmcia/ds.c drivers/pcmcia/rsrc_nonstatic.c +3 more+22 -160 replies
6/28Driver core: send hotplug event before adding class interfacesdrivers/base/class.c+2 -10 replies
7/28Input: kill devfs referencesdrivers/input/evdev.c drivers/input/input.c drivers/input/joydev.c +2 more+1 -300 replies
8/28Input: prepare to sysfs integrationdrivers/input/input.c include/linux/input.h+95 -68 replies
9/28Input: convert net/bluetooth to dynamic input_dev allocationnet/bluetooth/hidp/core.c+8 -510 replies
10/28Input: convert drivers/macintosh to dynamic input_dev allocationdrivers/macintosh/adbhid.c drivers/macintosh/mac_hid.c+139 -1250 replies
11/28Input: convert konicawc to dynamic input_dev allocationdrivers/usb/media/konicawc.c+61 -280 replies
12/28Input: convert onetouch to dynamic input_dev allocationdrivers/usb/storage/onetouch.c+53 -520 replies
13/28drivers/input/mouse: convert to dynamic input_dev allocationdrivers/input/mouse/alps.c drivers/input/mouse/alps.h drivers/input/mouse/amimouse.c +12 more+370 -3680 replies
14/28drivers/input/keyboard: convert to dynamic input_dev allocationdrivers/input/keyboard/amikbd.c drivers/input/keyboard/atkbd.c drivers/input/keyboard/corgikbd.c +6 more+450 -4320 replies
15/28drivers/input/touchscreen: convert to dynamic input_dev allocationdrivers/input/touchscreen/corgi_ts.c drivers/input/touchscreen/elo.c drivers/input/touchscreen/gunze.c +4 more+285 -3140 replies
17/28Input: convert ucb1x00-ts to dynamic input_dev allocationdrivers/mfd/ucb1x00-ts.c+25 -200 replies
18/28Input: convert sound/ppc/beep to dynamic input_dev allocationsound/ppc/beep.c+38 -300 replies
19/28Input: convert sonypi to dynamic input_dev allocationdrivers/char/sonypi.c+53 -390 replies
20/28Input: convert driver/input/misc to dynamic input_dev allocationdrivers/input/misc/m68kspkr.c drivers/input/misc/pcspkr.c drivers/input/misc/sparcspkr.c+59 -600 replies
22/28drivers/media: convert to dynamic input_dev allocationdrivers/media/common/ir-common.c drivers/media/dvb/cinergyT2/cinergyT2.c drivers/media/dvb/dvb-usb/dvb-usb-remote.c +10 more+268 -1920 replies
23/28Input: show sysfs path in /proc/bus/input/devicesdrivers/input/input.c+6 -00 replies
24/28Input: export input_dev data via sysfs attributesdrivers/input/input.c+134 -230 replies
25/28input core: implement class hierachydrivers/input/evdev.c drivers/input/input.c drivers/input/joydev.c +3 more+188 -1160 replies
26/28input core: remove custom-made hotplug handlerdrivers/input/input.c+110 -1450 replies
27/28Input: convert input handlers to class interfacesdrivers/input/input.c include/linux/input.h+232 -2310 replies
28/28Input: convert to seq_filedrivers/input/input.c+150 -890 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [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