Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
pyra-config-udev: update rules
· 0cc6cccb
aTc
authored
Jan 03, 2020
0cc6cccb
Update changelog for 0.24 release
· 9ab87431
aTc
authored
Jan 03, 2020
9ab87431
Show whitespace changes
Inline
Side-by-side
debian/changelog
View file @
9ab87431
pyra-config (0.24) unstable; urgency=medium
[ aTc ]
* Update changelog for 0.20 release
* pyra-config-udev: update rules
-- Pyra Dev <pyra-dev@pyra-handheld.com> Fri, 03 Jan 2020 02:40:46 +0100
pyra-config (0.23) unstable; urgency=medium
[ aTc ]
...
...
udev/charging.rules
View file @
9ab87431
...
...
@@ -14,16 +14,21 @@
# and we need a helper script.
#
# provide stable name to access the id pin of the USB connector and the max_current setting for the usb charger
# /dev/usb_id should link to e.g. /sys/devices/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:twl4030-usb/id
# 1. provide stable name to access the id pin of the USB connector and the max_current setting for the usb charger
# /dev/usb_id -> /sys/devices/platform/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:twl4030-usb/id
# /dev/usb_max_current -> /sys/devices/platform/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:bci/power_supply/twl4030_usb/input_current_limit
# to find patters use e.g. udevadm info -a -p /sys/devices/platform/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:bci/power_supply/twl4030_usb
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="*twl4030-usb", DRIVER=="twl4030_usb", RUN+="/bin/ln -s /sys%p/id /dev/usb_id"
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/device/max_current /dev/usb_max_current"
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="bq24297", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/device/id /dev/usb_id"
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="bq24297", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/device/max_current /dev/usb_max_current"
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/input_current_limit /dev/usb_max_current"
# default to 500 mA right after boot (independently what the ID pin says)
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", ATTR{
device/max
_current}="500000"
#
2.
default to 500 mA right after boot (independently what the ID pin says)
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", ATTR{
input
_current
_limit
}="500000"
# charger has been plugged in (or removed): run external script
ACTION=="change", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", RUN+="/etc/udev/rules.d/charging.sh"
# 3. this is preparation for the Pyra but neither tested nor complete nor working
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="bq24297", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/id /dev/usb_id"
ACTION=="add", SUBSYSTEM=="power_supply", KERNEL=="bq24297", ATTR{type}=="USB", RUN+="/bin/ln -s /sys%p/input_current_limit /dev/usb_max_current"
# 4. charger has been plugged in (or removed): run external script
# this script reads the id pin value and make a decision for the current setting of /dev/usb_max_current
ACTION=="change", SUBSYSTEM=="power_supply", KERNEL=="twl4030_usb", ATTR{type}=="USB", RUN+="/lib/udev/rules.d/charging.sh"
udev/charging.sh
View file @
9ab87431
#!/bin/bash
# detect Openmoko wall charger and increase input current limit
case
$(
cat
/dev/usb_id 2>/dev/null
)
in
"floating"
)
echo
"500000"
>
/dev/usb_max_current
;;
...
...
udev/input.rules
View file @
9ab87431
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,15,*f50,51*", SYMLINK="input/rumble" # rumble/vibra force feedback
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen" # touchscreen
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,3,*a0,1,2,*", SYMLINK+="input/accel" # main accelerometer
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*a0,1,2,*", SYMLINK+="input/accel2" # optional second
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k74,*", SYMLINK+="input/power" # twl4030/6030 power button
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kA9,*", SYMLINK+="input/aux" # user/aus button (if available)
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kF0,*", SYMLINK+="input/incoming" # 3G/4G incoming call/message event
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k77,*", SYMLINK+="input/keyboard" # tca8418 keyboard
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k1D0,*", SYMLINK+="input/keyboard" # twl4030 keyboard
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k7e,*", SYMLINK+="input/keyboard2" # gpio buttons (OpenPandora, Pyra)
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,5,*w[24678D]*", SYMLINK+="input/jack" # headset jack plug/unplug
# make stable /dev/input file names for Letux devices
# to find the patterns to match against, use e.g. udevadm info -a -p /sys/class/input/event5
# and cat /sys/devices/platform/68000000.ocp/48072000.i2c/i2c-1/1-0048/input/input5/modalias
# rumble/vibra force feedback
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,15,*f50,51*", SYMLINK="input/rumble"
# touchscreen
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k14A,*", SYMLINK+="input/touchscreen"
# main accelerometer
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,3,*a0,1,2,*", SYMLINK+="input/accel"
# optional second
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*a0,1,2,*", SYMLINK+="input/accel2"
# twl4030/6030 power button
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k74,*", SYMLINK+="input/power"
# user/aus button (if available)
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kA9,*", SYMLINK+="input/aux"
# 3G/4G incoming call/message event
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*kF0,*", SYMLINK+="input/incoming"
# tca8418 keyboard
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k77,*", SYMLINK+="input/keyboard"
# twl4030 keyboard
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k1D0,*", SYMLINK+="input/keyboard"
# gpio buttons (OpenPandora, Pyra)
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0,1,*k7e,*", SYMLINK+="input/keyboard2"
# check with /sys/devices/platform/*/input/input*/modalias if they are unique
# headset jack plug/unplug
# SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,5,*w[24678D]*", SYMLINK+="input/jack"
# external GPS antenna plug/unplug
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,5,*w[24678D]*", SYMLINK+="input/antenna-detect"
udev/pyra-keyboard-backlight.rules
0 → 100644
View file @
9ab87431
SUBSYSTEM=="backlight", KERNELS=="keyboard-backlight", ENV{ID_BACKLIGHT_CLAMP}="0"