Skip to contentSkip to conversation

udev: generalize the check in touchscreen rule

PATCH Applied Andrea Adami 2 participants 2 messages Mar 31, 2012 – Apr 2, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev: generalize the check in touchscreen rule

* The rule only works for devices reporting ts pressure
* and ignores the other touchscreens (happens e.g. on ipaq h1940).
* a0,1,*18 a = absolute axes (ABS_X 0x00 ABS_Y 0x01 ABS_PRESSURE 0x18)
* (see include/linux/input.h)
*
* Guidelines for touchscreen suggest only ABS_X and ABS_Y are mandatory
* (http://kernel.org/doc/Documentation/input/event-codes.txt)
*
* Side-effect of the patch is to remove a dependency on meta-oe
* but using older udev from oe-core.

---
 recipes-core/udev/udev/local.rules       |   34 ++++++++++++++++++++++++++++++
 recipes-core/udev/udev/touchscreen.rules |   21 ------------------
 recipes-core/udev/udev_164.bbappend      |    5 ++++
 recipes-core/udev/udev_173.bbappend      |    5 ----
 4 files changed, 39 insertions(+), 26 deletions(-)
 create mode 100644 recipes-core/udev/udev/local.rules
 delete mode 100644 recipes-core/udev/udev/touchscreen.rules
 create mode 100644 recipes-core/udev/udev_164.bbappend
 delete mode 100644 recipes-core/udev/udev_173.bbappend
recipes-core/udev/udev/local.rules new file +34 -0
new file mode 100644
index 0000000..49e8d28
@@ -0,0 +1,34 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
+# The first framebuffer is symlinked to /dev/fb                       
+KERNEL=="fb0", SYMLINK+="fb"
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+# Try and modprobe for drivers for new hardware
+ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
+
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*", SYMLINK+="input/touchscreen0"
recipes-core/udev/udev/touchscreen.rules deleted +0 -21
deleted file mode 100644
index b2307cf..0000000
@@ -1,21 +0,0 @@
-# There are a number of modifiers that are allowed to be used in some
-# of the different fields. They provide the following subsitutions:
-#
-# %n the "kernel number" of the device.
-#    For example, 'sda3' has a "kernel number" of '3'
-# %e the smallest number for that name which does not matches an existing node
-# %k the kernel name for the device
-# %M the kernel major number for the device
-# %m the kernel minor number for the device
-# %b the bus id for the device
-# %c the string returned by the PROGRAM
-# %s{filename} the content of a sysfs attribute
-# %% the '%' char itself
-#
-
-# Create a symlink to any touchscreen input device
-SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
-SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
-# This one is necessary for h1940
-SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*", SYMLINK+="input/touchscreen0"
-
recipes-core/udev/udev_164.bbappend new file +5 -0
new file mode 100644
index 0000000..4770c5b
@@ -0,0 +1,5 @@
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC = "1"
+
recipes-core/udev/udev_173.bbappend deleted +0 -5
deleted file mode 100644
index 4770c5b..0000000
@@ -1,5 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-PRINC = "1"
-
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 109 lines · On Sunday 01 April 2012 01:43:44 Andrea Adami wrote:

* The rule only works for devices reporting ts pressure
* and ignores the other touchscreens (happens e.g. on ipaq h1940).
* a0,1,*18 a = absolute axes (ABS_X 0x00 ABS_Y 0x01 ABS_PRESSURE 0x18)
* (see include/linux/input.h)
*
* Guidelines for touchscreen suggest only ABS_X and ABS_Y are mandatory
* (http://kernel.org/doc/Documentation/input/event-codes.txt)
*
* Side-effect of the patch is to remove a dependency on meta-oe
* but using older udev from oe-core.

---
 recipes-core/udev/udev/local.rules       |   34
++++++++++++++++++++++++++++++ recipes-core/udev/udev/touchscreen.rules |  
21 ------------------ recipes-core/udev/udev_164.bbappend      |    5 ++++
 recipes-core/udev/udev_173.bbappend      |    5 ----
 4 files changed, 39 insertions(+), 26 deletions(-)
 create mode 100644 recipes-core/udev/udev/local.rules
 delete mode 100644 recipes-core/udev/udev/touchscreen.rules
 create mode 100644 recipes-core/udev/udev_164.bbappend
 delete mode 100644 recipes-core/udev/udev_173.bbappend
(quoted diff) +0 -0

b/recipes-core/udev/udev/local.rules new file mode 100644 index 0000000..49e8d28

recipes-core/udev/udev/local.rules new file +6 -0
@@ -0,0 +1,34 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing

node +# %k the kernel name for the device

recipes-core/udev/udev/local.rules new file +24 -0
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
+# The first framebuffer is symlinked to /dev/fb
+KERNEL=="fb0", SYMLINK+="fb"
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+# Try and modprobe for drivers for new hardware
+ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*",

RUN+="/sbin/modprobe $env{MODALIAS}" +

recipes-core/udev/udev/local.rules new file +2 -0
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*",

ATTRS{modalias}=="input:*-e0*,3,*a0,1,*", SYMLINK+="input/touchscreen0"

(quoted diff) +0 -0

b/recipes-core/udev/udev/touchscreen.rules deleted file mode 100644 index b2307cf..0000000

recipes-core/udev/udev/touchscreen.rules deleted +0 -6
@@ -1,21 +0,0 @@
-# There are a number of modifiers that are allowed to be used in some
-# of the different fields. They provide the following subsitutions:
-#
-# %n the "kernel number" of the device.
-#    For example, 'sda3' has a "kernel number" of '3'
-# %e the smallest number for that name which does not matches an existing

node -# %k the kernel name for the device

recipes-core/udev/udev/touchscreen.rules deleted +0 -10
-# %M the kernel major number for the device
-# %m the kernel minor number for the device
-# %b the bus id for the device
-# %c the string returned by the PROGRAM
-# %s{filename} the content of a sysfs attribute
-# %% the '%' char itself
-#
-
-# Create a symlink to any touchscreen input device
-SUBSYSTEM=="input", KERNEL=="event[0-9]*",

ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" -SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" -# This one is necessary for h1940 -SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*", SYMLINK+="input/touchscreen0" -

(quoted diff) +0 -0

b/recipes-core/udev/udev_164.bbappend new file mode 100644 index 0000000..4770c5b

recipes-core/udev/udev_164.bbappend new file +5 -0
@@ -0,0 +1,5 @@
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC = "1"
+
(quoted diff) +0 -0

b/recipes-core/udev/udev_173.bbappend deleted file mode 100644 index 4770c5b..0000000

recipes-core/udev/udev_173.bbappend line 5

Quoted 5 lines
recipes-core/udev/udev_173.bbappend deleted +0 -5
@@ -1,5 +0,0 @@
-
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-
-PRINC = "1"
-

Merged to meta-handheld (with some rebasing), thanks.

FWIW I'd like to see this more generalised rule in OE-Core, but as we're in stabilisation at the moment I don't think now is the time. For the moment we can test it in meta-handheld.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre