Revision: 5958
Author: pebender
Date: Wed Dec 16 14:40:19 2009
Log: - Added the udev property lircudevd_remote to lircudevd for setting  
the remote name.
- Added key map files to system/lircudevd.
- Added udev scripts and rules to system/lircudevd.


http://code.google.com/p/minimyth/source/detail?r=5958

Added:
  /trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_05a4_9881.keymap
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_0766_0204.keymap
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_147a_e02d.keymap
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/Makefile.am
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/bdremoteng.keymap
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/default.keymap
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/mcekbd.keymap
  /trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/Makefile.am
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/lircd_helper.in
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/rules.d
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/rules.d/98-lircd.rules.disabled.in
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/rules.d/98-lircudevd.rules.disabled.in
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/wakeup_enable.in
Modified:
  /trunk/gar-minimyth/script/system/lircudevd/Makefile
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/Makefile.am
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/configure.ac
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/man/lircudevd.8.in
   
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/src/input.c

=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_05a4_9881.keymap
        
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,49 @@
+ KEY_HOMEPAGE        = KEY_WWW           # WWW
+ KEY_SLEEP           = KEY_POWER         # Sleep
+ ctrl+shift+KEY_T    = KEY_VCR           # My TV
+ ctrl+KEY_M          = KEY_MP3           # My Music
+ ctrl+KEY_I          = KEY_MEDIA         # My Pictures
+ ctrl+KEY_E          = KEY_VIDEO         # My Videos
+ ctrl+KEY_O          = KEY_VCR2          # Record TV
+ ctrl+KEY_G          = KEY_PROGRAM       # Guide
+ ctrl+KEY_T          = KEY_TV            # Live TV
+ ctrl+shift+KEY_M    = KEY_DVD           # DVD Menu
+ KEY_PLAYPAUSE       = KEY_PLAYPAUSE     # Play (also used for Pause)
+#KEY_PLAYPAUSE       = KEY_PLAYPAUSE     # Pause (also used for Play)
+ ctrl+shift+KEY_B    = KEY_REWIND        # Reverse
+ ctrl+shift+KEY_F    = KEY_FORWARD       # Forward
+ KEY_PREVIOUSSONG    = KEY_PREVIOUS      # Pre-track
+ KEY_NEXTSONG        = KEY_NEXT          # Next track
+ KEY_STOPCD          = KEY_STOP          # Stop
+ ctrl+KEY_R          = KEY_RECORD        # Record
+ KEY_BACKSPACE       = KEY_BACK          # Back
+ BTN_RIGHT           = KEY_INFO          # Information (also used for  
Mouse Right)
+ KEY_UP              = KEY_UP            # Direction Up
+ KEY_DOWN            = KEY_DOWN          # Direction Down
+ KEY_LEFT            = KEY_LEFT          # Direction Left
+ KEY_RIGHT           = KEY_RIGHT         # Direction Right
+ KEY_ENTER           = KEY_ENTER         # Direction OK (also used for  
Enter)
+ BTN_MOUSE           = BTN_LEFT          # Mouse Left
+#BTN_RIGHT           = KEY_INFO          # Mouse Right (also used for  
Information)
+ KEY_VOLUMEUP        = KEY_VOLUMEUP      # Volume Up
+ KEY_VOLUMEDOWN      = KEY_VOLUMEDOWN    # Volume Down
+ KEY_PAGEDOWN        = KEY_CHANNELDOWN   # Channel Up
+ KEY_PAGEUP          = KEY_CHANNELUP     # Channel Down
+ KEY_MUTE            = KEY_MUTE          # Mute
+ alt+meta+KEY_ENTER  = KEY_MENU          # Start Key
+ alt+KEY_F4          = KEY_CLOSE         # Close
+ KEY_ESC             = KEY_CLEAR         # Clear
+#KEY_ENTER           = KEY_ENTER         # Enter (also used for Direction  
OK)
+ numlock+KEY_KP0     = KEY_0             # 0
+ numlock+KEY_KP1     = KEY_1             # 1
+ numlock+KEY_KP2     = KEY_2             # 2
+ numlock+KEY_KP3     = KEY_3             # 3
+ numlock+KEY_KP4     = KEY_4             # 4
+ numlock+KEY_KP5     = KEY_5             # 5
+ numlock+KEY_KP6     = KEY_6             # 6
+ numlock+KEY_KP7     = KEY_7             # 7
+ numlock+KEY_KP8     = KEY_8             # 8
+ numlock+KEY_KP9     = KEY_9             # 9
+ KEY_KPASTERISK      = KEY_ZOOM          # *
+ numlock+alt+KEY_KP3 = KEY_TEXT          # #
+ numlock+alt+KEY_KP5 = NULL              # Sent as part #, and we ignore it
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_0766_0204.keymap
        
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,46 @@
+ KEY_1            = KEY_1           # 1
+ KEY_2            = KEY_2           # 2
+ KEY_3            = KEY_3           # 3
+ KEY_4            = KEY_4           # 4
+ KEY_5            = KEY_5           # 5
+ KEY_6            = KEY_6           # 6
+ KEY_7            = KEY_7           # 7
+ KEY_8            = KEY_8           # 8
+ KEY_9            = KEY_9           # 9
+ KEY_0            = KEY_0           # 0
+ KEY_UP           = KEY_UP          # Up Arrow
+ KEY_DOWN         = KEY_DOWN        # Down Arrow
+ KEY_LEFT         = KEY_LEFT        # Left Arrow
+ KEY_RIGHT        = KEY_RIGHT       # Right Arrow
+ KEY_ENTER        = KEY_ENTER       # Enter & Ok
+ KEY_DELETE       = KEY_CLEAR       # Clear
+ KEY_HOME         = KEY_HOME        # Home
+ KEY_SLEEP        = KEY_POWER       # Power
+ KEY_DVD          = KEY_DVD         # DVD/VCD
+ KEY_MP3          = KEY_MP3         # Music
+ KEY_MEDIA        = KEY_MEDIA       # Pictures
+ KEY_VIDEO        = KEY_VIDEO       # Videos
+ KEY_TV           = KEY_TV          # Live TV
+ KEY_RECORD       = KEY_RECORD      # Record
+ KEY_RADIO        = KEY_RADIO       # Radio
+ KEY_AUDIO        = KEY_AUDIO       # SAP
+ KEY_TEXT         = KEY_TEXT        # Teletext/CC
+ KEY_LAST         = KEY_LAST        # Last CH
+ KEY_SUBTITLE     = KEY_SUBTITLE    # Subtitle
+ KEY_LANGUAGE     = KEY_LANGUAGE    # Language
+ KEY_ANGLE        = KEY_ANGLE       # Angle
+ KEY_BACK         = KEY_BACK        # BACK
+ KEY_PROPS        = KEY_INFO        # Info/EPG
+ KEY_MENU         = KEY_MENU        # DVD Menu
+ KEY_VOLUMEDOWN   = KEY_VOLUMEDOWN  # Vol -
+ KEY_VOLUMEUP     = KEY_VOLUMEUP    # Vol +
+ KEY_MUTE         = KEY_MUTE        # Mute
+ KEY_CHANNELUP    = KEY_CHANNELUP   # CH/PG up
+ KEY_CHANNELDOWN  = KEY_CHANNELDOWN # CH/PG down
+ KEY_PLAY         = KEY_PLAY        # Play
+ KEY_REWIND       = KEY_REWIND      # Rev
+ KEY_PAUSE        = KEY_PAUSE       # Pause
+ KEY_FASTFORWARD  = KEY_FASTFORWARD # Fwd
+ KEY_PREVIOUSSONG = KEY_PREVIOUS    # Prev
+ KEY_STOPCD       = KEY_STOP        # Stop
+ KEY_NEXTSONG     = KEY_NEXT        # Next
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/03_147a_e02d.keymap
        
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,30 @@
+ KEY_1     = KEY_1
+ KEY_2     = KEY_2
+ KEY_3     = KEY_3
+ KEY_4     = KEY_4
+ KEY_5     = KEY_5
+ KEY_6     = KEY_6
+ KEY_7     = KEY_7
+ KEY_8     = KEY_8
+ KEY_9     = KEY_9
+ KEY_0     = KEY_0
+ KEY_M     = KEY_MUTE
+ KEY_R     = KEY_VOLUMEDOWN # -/-- key
+ KEY_S     = KEY_VOLUMEUP   # A/B key
+ KEY_F5    = KEY_RECORD     # KEY_RED
+ KEY_F6    = KEY_PREVIOUS   # KEY_GREEN
+ KEY_F7    = KEY_NEXT       # KEY_YELLOW
+ KEY_F8    = KEY_BLUE
+ KEY_ENTER = KEY_ENTER
+ KEY_UP    = KEY_UP
+ KEY_DOWN  = KEY_DOWN
+ KEY_LEFT  = KEY_LEFT
+ KEY_RIGHT = KEY_RIGHT
+ KEY_E     = KEY_PROGRAM
+ KEY_F     = KEY_EXIT
+ KEY_I     = KEY_INFO
+ KEY_F9    = KEY_TV
+ KEY_F2    = KEY_MENU
+ KEY_T     = KEY_TEXT
+ KEY_P     = KEY_PAUSE
+ KEY_V     = KEY_ZOOM       # EXT
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/Makefile.am
        
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,9 @@
+keymapdir = $(KEYMAP_DIR)
+
+dist_keymap_DATA = \
+       03_05a4_9881.keymap \
+       03_0766_0204.keymap \
+       03_147a_e02d.keymap \
+       bdremoteng.keymap \
+       default.keymap \
+       mcekbd.keymap
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/bdremoteng.keymap
  
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,7 @@
+BTN_A     = KEY_F1
+BTN_B     = KEY_F2
+BTN_C     = KEY_F3
+BTN_X     = KEY_F4
+BNT_Y     = KEY_F5
+BTN_Z     = KEY_F6
+BTN_START = KEY_ENTER
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/default.keymap
     
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,22 @@
+KEY_BACKSPACE  = KEY_BACK
+KEY_KP1        = KEY_1
+KEY_KP2        = KEY_2
+KEY_KP3        = KEY_3
+KEY_KP4        = KEY_4
+KEY_KP5        = KEY_5
+KEY_KP6        = KEY_6
+KEY_KP7        = KEY_7
+KEY_KP8        = KEY_8
+KEY_KP9        = KEY_9
+KEY_KP0        = KEY_0
+KEY_KPASTERISK = KEY_NUMERIC_STAR
+KEY_NUMERIC_1  = KEY_1
+KEY_NUMERIC_2  = KEY_2
+KEY_NUMERIC_3  = KEY_3
+KEY_NUMERIC_4  = KEY_4
+KEY_NUMERIC_5  = KEY_5
+KEY_NUMERIC_6  = KEY_6
+KEY_NUMERIC_7  = KEY_7
+KEY_NUMERIC_8  = KEY_8
+KEY_NUMERIC_9  = KEY_9
+KEY_NUMERIC_0  = KEY_0
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/etc/mcekbd.keymap
      
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,45 @@
+KEY_UP             = KEY_UP
+KEY_DOWN           = KEY_DOWN
+KEY_LEFT           = KEY_LEFT
+KEY_RIGHT          = KEY_RIGHT
+KEY_ENTER          = KEY_ENTER
+KEY_PAGEDOWN       = KEY_PAGEDOWN
+KEY_PAGEUP         = KEY_PAGEUP
+alt+meta+KEY_ENTER = KEY_MENU
+KEY_BACKSPACE      = KEY_BACK
+KEY_1              = KEY_1
+KEY_2              = KEY_2
+KEY_3              = KEY_3
+KEY_4              = KEY_4
+KEY_5              = KEY_5
+KEY_6              = KEY_6
+KEY_7              = KEY_7
+KEY_8              = KEY_8
+KEY_9              = KEY_9
+KEY_0              = KEY_0
+KEY_EQUAL          = KEY_CHANNELUP
+ctrl+KEY_EQUAL     = KEY_CHANNELUP
+KEY_MINUS          = KEY_CHANNELDOWN
+ctrl+KEY_MINUS     = KEY_CHANNELDOWN
+ctrl+shift+KEY_T   = KEY_TV
+ctrl+KEY_M         = KEY_MP3
+ctrl+KEY_E         = KEY_VIDEO
+ctrl+KEY_I         = KEY_MEDIA
+ctrl+KEY_G         = KEY_PROGRAM
+ctrl+KEY_R         = KEY_RECORD
+ctrl+KEY_D         = KEY_MENU
+ctrl+shift+KEY_M   = KEY_DVD
+ctrl+KEY_O         = KEY_VCR
+ctrl+KEY_A         = KEY_RADIO
+ctrl+KEY_U         = KEY_SUBTITLE
+ctrl+KEY_P         = KEY_PAUSE
+ctrl+shift+KEY_P   = KEY_PLAY
+ctrl+shift+KEY_S   = KEY_STOP
+ctrl+KEY_B         = KEY_PREVIOUS
+ctrl+KEY_F         = KEY_NEXT
+ctrl+shift+KEY_B   = KEY_REWIND
+ctrl+shift+KEY_F   = KEY_FORWARD
+KEY_F8             = KEY_MUTE
+KEY_F9             = KEY_VOLUMEDOWN
+KEY_F10            = KEY_VOLUMEUP
+ctrl+shift+KEY_C   = KEY_TEXT
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/Makefile.am
       
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,5 @@
+udevbindir   = $(UDEV_DIR)
+udevrulesdir = $(UDEV_DIR)/rules.d
+
+udevbin_SCRIPTS = lircd_helper wakeup_enable
+udevrules_DATA  = rules.d/98-lircd.rules.disabled  
rules.d/98-lircudevd.rules.disabled
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/lircd_helper.in
   
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,67 @@
+#!/bin/sh
+################################################################################
+# lircd_helper
+#
+# This script can be used by udev to start or stop lircd when a remote  
control
+# device is added or removed.
+#
+# lircd_helper configures lircd to output using a uinput event device so  
that
+# lircudevd can aggregate the outputs into a single lircd socket.
+#
+# lircd_helper configures lircd to use an lircd socket name that is derived
+# from the device name. In addition, lircd_helper creates symbolic links  
to this
+# lircd socket that are derived from the device symbolic links. You can  
use this
+# socket and the symbolic link to this socket when using commands such as  
irsend.
+#
+# lircd_helper understands two lircd_helper specific device properites set
+# using ENV{} and passed as environment variables:
+#   lircd_driver:
+#     Used to tell lircd_helper the name of the lircd driver.
+#   lircd_conf:
+#     Used to tell lircd_helper the path to the lircd.conf file to use.
+################################################################################
+
+case "${ACTION}" in
+    add)
+        if test "x${lircd_driver}" = "x" ; then
+            exit 1;
+        fi
+        if test "x${lircd_conf}" = "x" ; then
+            exit 1;
+        fi
+        if test ! -e '@localstatedir@/run/lirc' ; then
+            mkdir -p '@localstatedir@/run/lirc'
+        fi
+        devname_instance=`echo ${DEVNAME} | sed -e 's/\/\+/~/g'  
-e 's/^~dev~//'`
+        if test !  
-e "@localstatedir@/run/lirc/lircd-${devname_instance}.pid" ; then
+            daemon='@sbindir@/lircd'
+            daemon="${daemon} --uinput"
+            daemon="${daemon} --device=${DEVNAME}"
+            daemon="${daemon} --driver=${lircd_driver}"
+            daemon="${daemon}  
--outp...@localstatedir@/run/lirc/lircd-${devname_instance}"
+            daemon="${daemon}  
--pidfi...@localstatedir@/run/lirc/lircd-${devname_instance}.pid"
+            daemon="${daemon} ${lircd_conf}"
+            ${daemon}
+            for devlink in ${DEVLINKS} ; do
+                devlink_instance=`echo ${devlink} | /bin/sed  
-e 's/\/\+/~/g' -e 's/^~dev~//'`
+                rm -f "@localstatedir@/run/lirc/lircd-${devlink_instance}"
+                ln  
-s "lircd-${devname_instance}" 
"@localstatedir@/run/lirc/lircd-${devlink_instance}"
+            done
+        fi
+        ;;
+    remove)
+        instance=`echo $DEVNAME | sed -e 's/\/\+/~/g' -e 's/^~dev~//'`
+        if test -e "@localstatedir@/run/lirc/lircd-${instance}.pid" ; then
+            pid=`cat @localstate@/run/lirc/lircd-${instance}.pid`
+            if test ! "x${pid}" = "x" ; then
+                kill ${pid}
+            fi
+            for devlink in ${DEVLINKS} ; do
+                devlink_instance=`echo ${devlink} | sed -e 's/\/\+/~/g'  
-e 's/^~dev~//'`
+                rm -f "@localstatedir@/run/lirc/lircd-${devlink_instance}"
+            done
+        fi
+        ;;
+esac
+
+exit 0
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/rules.d/98-lircd.rules.disabled.in
        
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,44 @@
+################################################################################
+# An example udev rules file for lircd.
+################################################################################
+
+# lircd_helper only does something for "add" and "remove" actions.
+ACTION!="add|remove", GOTO="end"
+
+KERNEL=="hiddev[0-9]*", SUBSYSTEM=="usb",  SUBSYSTEMS=="usb", GOTO="begin"
+KERNEL=="lirc[0-9]*",   SUBSYSTEM=="lirc", SUBSYSTEMS=="i2c", GOTO="begin"
+KERNEL=="lirc[0-9]*",   SUBSYSTEM=="lirc", SUBSYSTEMS=="usb", GOTO="begin"
+GOTO="end"
+LABEL="begin"
+
+#-------------------------------------------------------------------------------
+# Ask lircd_helper to lirc devices.
+#-------------------------------------------------------------------------------
+SUBSYSTEM=="lirc", \
+  ENV{lircd_driver}="default", \
+  ENV{lircd_conf}="@sysconfdir@/lirc/lircd.conf"
+
+#-------------------------------------------------------------------------------
+# Ask lircd_helper to handle USB devices that do not show up as lirc  
devices
+# and are supported by lircd. Remote controls that are USB HID devices  
that show
+# up as event devices are not included as as they are handled by lircudevd.
+#-------------------------------------------------------------------------------
+SUBSYSTEMS=="usb", GOTO="begin-usb"
+SUBSYSTEMS=="usb", GOTO="begin-usb"
+GOTO="end-usb"
+LABEL="begin-usb"
+
+ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
+
+ENV{ID_VENDOR}=="0fe9", ENV{ID_MODEL}=="9010", \
+  ENV{lircd_driver}="dvico", \
+  ENV{lircd_conf}="@sysconfdir@/lirc/lircd.conf"
+
+# Enable wake-on-usb for the USB remotes.
+ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", RUN+="wakeup_enable"
+
+LABEL="end-usb"
+
+ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", RUN+="lircd_helper"
+
+LABEL="end"
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/rules.d/98-lircudevd.rules.disabled.in
    
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,82 @@
+################################################################################
+# An example udev rules file for lircudevd.
+#
+# This rules file does not start lircudevd. Many applications only check  
for the
+# the lircd socket at application lauch. Therefore, it is better to start
+# lircudevd in an init script so that lircudevd creates the lircd socket  
before
+# any applications that use LIRC launch.
+################################################################################
+
+# lircudevd only does something for "add" and "remove" actions.
+ACTION!="add|remove", GOTO="end"
+
+# lircudevd only does something "input" subsystem devices.
+SUBSYSTEM!="input", GOTO="end"
+
+# lircudevd can only handle event devices.
+KERNEL!="event[0-9]*", GOTO="end"
+
+# lircudevd ignores devices created by lircudevd.
+ATTRS{name}=="lircudevd", GOTO="end"
+
+#-------------------------------------------------------------------------------
+# Ask lircudevd to handle input event devices created by lircd. For this to
+# work, lircd must be configured to output Linux input events and must be
+# configured to output key names that conform to the LIRC namespace  
derived from
+# the Linux key/button event names. This rule assumes that lircd performs  
all
+# key mappings, so the rule does not provide a value  
for "lircudevd_keymap". For
+# more information on lircd, see <http://www.lirc.org/>.
+#-------------------------------------------------------------------------------
+ATTRS{name}=="lircd", \
+  ENV{lircudevd_enable}="true" \
+  ENV{lircudevd_keymap}="default.keymap"
+
+#-------------------------------------------------------------------------------
+# Ask lircudevd to handle input event devices created by bdremoteng. For  
this to
+# work, bdremoteng must be configured to output Linux input events and must
+# be configured to output key names that conform to LIRC namespace derived
+# from the Linux key/button event names. For more information on  
bdremoteng,
+# see <http://code.google.com/p/bdremote-ng/>.
+#-------------------------------------------------------------------------------
+ATTRS{name}=="bdremoteng", \
+  ENV{lircudevd_enable}="true", \
+  ENV{lircudevd_keymap}="bdremoteng.keymap"
+
+#-------------------------------------------------------------------------------
+# Ask lircudevd to handle input event devices created by wminput. This rule
+# assumes that wminput performs all key mappings, so the rule does not  
provide a
+# value for "lircudevd_keymap" For more information on wminput, see
+# <http://abstrakraft.org/cwiid/>.
+#-------------------------------------------------------------------------------
+ATTRS{name}=="bdremoteng", \
+  ENV{lircudevd_enable}="true"
+
+#-------------------------------------------------------------------------------
+# Ask lircudevd to handle USB HID devices that show up as event devices  
and are
+# known to be remote controls. For simplicity, the keymap file names have  
the
+# format <BUSTYPE>_<VENDOR>_<PRODUCT>.keymap.
+#-------------------------------------------------------------------------------
+SUBSYSTEMS=="usb", GOTO="begin-usb"
+GOTO="end-usb"
+LABEL="begin-usb"
+
+ENV{ID_USB_INTERFACES}=="", IMPORT{program}="usb_id --export %p"
+
+ENV{ID_VENDOR}=="05a4", ENV{ID_MODEL}=="9881", \
+  ENV{lircudevd_enable}="true", \
+  ENV{lircudevd_keymap}="03_$env{ID_VENDOR}_$env{ID_MODEL}.keymap"
+
+ENV{ID_VENDOR}=="0766", ENV{ID_MODEL}=="0204", \
+  ENV{lircudevd_enable}="true", \
+  ENV{lircudevd_keymap}="03_$env{ID_VENDOR}_$env{ID_MODEL}.keymap"
+
+ENV{ID_VENDOR}=="147a", ENV{ID_MODEL}=="e02d", \
+  ENV{lircudevd_enable}="true", \
+  ENV{lircudevd_keymap}="03_$env{ID_VENDOR}_$env{ID_MODEL}.keymap"
+
+# Enable wake-on-usb for the USB remotes.
+ENV{lircudevd_enable}=="true", RUN+="wakeup_enable"
+
+LABEL="end-usb"
+
+LABEL="end"
=======================================
--- /dev/null
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/udev/wakeup_enable.in
  
Wed Dec 16 14:40:19 2009
@@ -0,0 +1,17 @@
+#!/bin/sh
+################################################################################
+# wakeup_enable
+################################################################################
+
+devpath=`readlink -f "/sys/${DEVPATH}"`
+while echo "${devpath}" | /bin/grep -q '^/sys/devices/' > /dev/null 2>&1 ;  
do
+    if test -e "${devpath}/power/wakeup" ; then
+        state=`cat "${devpath}/power/wakeup"`
+        if test "x${state}" = "xdisabled" ; then
+            echo "enabled" > "${devpath}/power/wakeup"
+        fi
+    fi
+    devpath=`dirname "${devpath}"`
+done
+
+exit 0
=======================================
--- /trunk/gar-minimyth/script/system/lircudevd/Makefile        Sun Dec 13  
23:58:23 2009
+++ /trunk/gar-minimyth/script/system/lircudevd/Makefile        Wed Dec 16  
14:40:19 2009
@@ -14,7 +14,8 @@
  BUILD_SCRIPTS     = $(WORKSRC)/Makefile
  INSTALL_SCRIPTS   = $(WORKSRC)/Makefile

-CONFIGURE_ARGS = $(DIRPATHS) --build=$(GARBUILD) --host=$(GARHOST)
+CONFIGURE_ARGS = $(DIRPATHS) --build=$(GARBUILD) --host=$(GARHOST) \
+       --with-udev-dir=$(elibdir)/udev

  include ../../gar.mk

=======================================
---  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/Makefile.am   
 
Sun Dec 13 23:58:23 2009
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/Makefile.am   
 
Wed Dec 16 14:40:19 2009
@@ -1,3 +1,3 @@
  ACLOCAL_AMFLAGS = -I m4

-SUBDIRS = man src
+SUBDIRS = etc man src udev
=======================================
---  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/configure.ac  
 
Sun Dec 13 23:58:23 2009
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/configure.ac  
 
Wed Dec 16 14:40:19 2009
@@ -95,6 +95,11 @@
      [KEYMAP_DIR="${sysconfdir}/lircudevd.d"])
  AC_SUBST(KEYMAP_DIR)

+AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [key map  
directory @<:@/lib/udev@:>@]),
+    [UDEV_DIR="$withval"],
+    [UDEV_DIR="/lib/udev"])
+AC_SUBST(UDEV_DIR)
+
  AC_CONFIG_HEADERS([src/config.h])
-AC_CONFIG_FILES([Makefile man/Makefile man/lircudevd.8  
man/lircudevd.keymap.5 src/Makefile src/evkey_code_to_name.h.sh  
src/evkey_name_to_code.h.sh src/evkey_type.h.sh])
+AC_CONFIG_FILES([Makefile etc/Makefile man/Makefile man/lircudevd.8  
man/lircudevd.keymap.5 src/Makefile src/evkey_code_to_name.h.sh  
src/evkey_name_to_code.h.sh src/evkey_type.h.sh udev/Makefile  
udev/lircd_helper udev/wakeup_enable udev/rules.d/98-lircd.rules.disabled  
udev/rules.d/98-lircudevd.rules.disabled])
  AC_OUTPUT
=======================================
---  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/man/lircudevd.8.in
     
Sun Dec 13 23:58:23 2009
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/man/lircudevd.8.in
     
Wed Dec 16 14:40:19 2009
@@ -15,7 +15,7 @@
  .\" You should have received a copy of the GNU General Public License
  .\" along with lircudevd.  If not, see <http://www.gnu.org/licenses/>.
  .\"
-.TH lircudevd 8 "DECEMBER 09, 2009"
+.TH lircudevd 8 "DECEMBER 16, 2009"
  .SH NAME
  lircudevd \- an LIRC daemon with integrated udev support.
  .SH SYNOPSIS
@@ -46,11 +46,6 @@
  zero or more lock keys (capslock, numlock and scrolllock)
  zero or more modifier keys (ctrl, shift, alt and meta) and
  one base key (non-lock and non-modifier key).
-.LP
-Udev signals that \fBlircudevd\fR should use a device as an  
\fBlircudevd\fR input device
-by setting the environment variable \fBlircudevd.enable\fR to true.
-Udev provides \fBlircudevd\fR with the name of the key map file to use for  
mapping the keyboard shortcuts for the device
-by setting the environment variable \fBlircudevd.keymap\fR to the name of  
the key map file in the \fBlircudevd\fR key map directory.
  .SH OPTIONS
  .TP
  \fB\-h\fR \fB\-\-help\fR
@@ -78,14 +73,40 @@
  .TP
  \fB\-r\fR \fB\-\-release=suffix\fR
  Generate key release events with \fBsuffix\fR appended to the key name.
+.SH UDEV DEVICE PROPERTIES
+.LP
+Udev communicates with lircudevd using udev device properties.
+The following are the lircudevd specific udev device properties that can  
be set using ENV{} in udev rules.
+.TP
+\fBlircudevd_enable\fR
+Used to ask \fBlircudevd\fR to handle the device.
+If the value is "true", then \fBlircudevd\fR will attempt to handle the  
device.
+.TP
+\fBlircudevd_keymap\fR
+Used to tell \fBlircudevd\fR the name of the keymap file to be used with  
this device.
+If it is not set, then \fBlircudevd\fR will not perform any key mapping.
+\fBlircudevd\fR assumes that the keymap file is located in the keymap  
directory.
+.TP
+\fBlircudevd_remote\fR
+Used to tell \fBlircudevd\fR the remote control name to use in the output  
\fBlircudevd\fR sends to the lircd socket.
+If it is not set, then \fBlircudevd\fR will use "devinput" for the remote  
control name.
  .SH FILES
  .I @KEYMAP_DIR@/*.keymap
  .RS
  The per-device key map files.
  See \fBlircudevd.keymap (5)\fR for further details.
+.RE
  .I @includedir@/linux/input.h
  .RS
  The Linux input event device header file in which the key and button codes  
associated with the key event type are define.
+.RE
+.I @UDEV_DIR@/rules.d/98-lircudevd.rules.disabled
+.RS
+An example udev rules file for lircudevd.
+.RE
+.I @UDEV_DIR@/rules.d/98-lircd.rules.disabled
+.RS
+An example udev rules file for using lircd in conjuction with lircudevd.
  .SH ENVIRONMENT
  .SH DIAGNOSTICS
  .SH BUGS
=======================================
---  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/src/input.c   
 
Sun Dec 13 23:58:23 2009
+++  
/trunk/gar-minimyth/script/system/lircudevd/files/lircudevd-0.0.0/src/input.c   
 
Wed Dec 16 14:40:19 2009
@@ -133,6 +133,7 @@
          bool numlock;
          bool scrolllock;
      } led;
+    char *remote;                       /* The remote control name used in  
lircd socket output. */
      struct                              /* The input device's  
mouse/joystick event output device. */
      {
          int fd;                         /* The output device's file  
descriptor. */
@@ -1104,7 +1105,7 @@
       */
      if (input_device_event_is_key(device) == true)
      {
-        if (lircd_send(&device->current.event_out,  
evkey_code_to_name[device->current.event_out.code],  
device->current.repeat_count, device->path) != 0)
+        if (lircd_send(&device->current.event_out,  
evkey_code_to_name[device->current.event_out.code],  
device->current.repeat_count, device->remote) != 0)
          {
              return -1;
          }
@@ -1144,6 +1145,11 @@
          device->output.fd = -1;
          syslog(LOG_INFO, "destroyed output mouse/joystick device for input  
device %s", device->path);
      }
+    if (device->remote == NULL)
+    {
+        free(device->remote);
+    }
+    input_device_keymap_exit(device);
      if (device->fd != -1)
      {
          close(device->fd);
@@ -1244,6 +1250,7 @@
      const char* path;
      const char* enable;
      const char* keymap_file;
+    const char* remote;
      struct input_device *device;
      unsigned long bit[BITFIELD_LONGS_PER_ARRAY(EV_MAX)];
      unsigned long bit_key[BITFIELD_LONGS_PER_ARRAY(KEY_MAX)];
@@ -1280,13 +1287,13 @@
          return 0;
      }

-    enable =  
udev_device_get_property_value(udev_device, "lircudevd.enable");
+    enable =  
udev_device_get_property_value(udev_device, "lircudevd_enable");
      if ((enable == NULL) ||(strncmp(enable, "true", sizeof("true")) != 0))
      {
          return 0;
      }

-    keymap_file =  
udev_device_get_property_value(udev_device, "lircudevd.keymap");
+    keymap_file =  
udev_device_get_property_value(udev_device, "lircudevd_keymap");

      for (device = lircudevd_input.device_list ; device != NULL ; device =  
device->next)
      {
@@ -1295,15 +1302,28 @@
              return 0;
          }
      }
+
+    remote =  
udev_device_get_property_value(udev_device, "lircudevd_remote");
+    if (remote == NULL)
+    {
+        remote = "devinput";
+    }

      if ((device = calloc(1, sizeof(struct input_device))) == NULL)
      {
          syslog(LOG_ERR, "failed to allocate memory for the input  
device %s: %s\n", path, strerror(errno));
          return -1;
      }
+
+    device->path = NULL;
+    device->fd = -1;
+    device->keymap = NULL;
+    device->remote = NULL;
+    device->output.fd = -1;
+
      if ((device->path = strndup(path, PATH_MAX)) == NULL)
      {
-        syslog(LOG_ERR, "failed to allocate memory for the input  
device %s: %s\n", path, strerror(errno));
+        syslog(LOG_ERR, "failed to allocate memory for the path name of  
input device %s: %s\n", path, strerror(errno));
          free(device);
          return -1;
      }
@@ -1330,6 +1350,16 @@
          free(device);
          return -1;
      }
+
+    if ((device->remote = strndup(remote, PATH_MAX)) == NULL)
+    {
+        syslog(LOG_ERR, "failed to allocate memory for the remote name of  
the input device %s: %s\n", path, strerror(errno));
+        input_device_keymap_exit(device);
+        close(device->fd);
+        free(device->path);
+        free(device);
+        return -1;
+    }

      /*
       * Query the input device for event types and codes that it supports.
@@ -1387,7 +1417,7 @@
      }

      /*
-     * Check for event types and codes that are not support by lircudevd.
+     * Check for event types and codes that are not supported by lircudevd.
       */
      for (i = 1 ; i < EV_MAX ; i++)
      {
@@ -1545,6 +1575,7 @@
      if (device->output.fd == -1)
      {
          syslog(LOG_ERR, "unable to open uinput device for input  
device %s: %s\n", device->path, strerror(errno));
+        free(device->remote);
          input_device_keymap_exit(device);
          close(device->fd);
          free(device->path);
@@ -1570,6 +1601,7 @@
      if (ioctl(device->output.fd, UI_SET_PHYS, device->path) < 0)
      {
          syslog(LOG_ERR, "failed to set UI_SET_PHYS for %s: %s\n",  
device->path, strerror(errno));
+        free(device->remote);
          close(device->output.fd);
          input_device_keymap_exit(device);
          close(device->fd);
@@ -1835,6 +1867,7 @@
                     "unable to create uinput device for %s: %s\n",
                     device->path, strerror(errno));
              close(device->output.fd);
+            free(device->remote);
              input_device_keymap_exit(device);
              close(device->fd);
              free(device->path);
@@ -1854,6 +1887,7 @@
      if (monitor_client_add(device->fd, &input_device_handler, device) != 0)
      {
          close(device->output.fd);
+        free(device->remote);
          input_device_keymap_exit(device);
          close(device->fd);
          free(device->path);

--

You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en.


Reply via email to