summaryrefslogtreecommitdiff
path: root/packages/linux-hotplug/files
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2005-06-30 08:19:37 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-06-30 08:19:37 +0000
commitc8e5702127e507e82e6f68a4b8c546803accea9d (patch)
tree00583491f40ecc640f2b28452af995e3a63a09d7 /packages/linux-hotplug/files
parent87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff)
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/linux-hotplug/files')
-rw-r--r--packages/linux-hotplug/files/.mtn2git_empty0
-rw-r--r--packages/linux-hotplug/files/collie/.mtn2git_empty0
-rw-r--r--packages/linux-hotplug/files/collie/usbd1
-rwxr-xr-x[-rw-r--r--]packages/linux-hotplug/files/mmc.agent0
-rwxr-xr-x[-rw-r--r--]packages/linux-hotplug/files/sleeve.agent120
-rwxr-xr-x[-rw-r--r--]packages/linux-hotplug/files/sleeve.rc60
-rw-r--r--packages/linux-hotplug/files/soc.agent62
-rw-r--r--packages/linux-hotplug/files/sysconfig-hotplug12
-rw-r--r--packages/linux-hotplug/files/tosa/.mtn2git_empty0
-rw-r--r--packages/linux-hotplug/files/tosa/sysconfig-usb2
-rw-r--r--packages/linux-hotplug/files/usbd2
-rwxr-xr-x[-rw-r--r--]packages/linux-hotplug/files/usbd.agent63
12 files changed, 322 insertions, 0 deletions
diff --git a/packages/linux-hotplug/files/.mtn2git_empty b/packages/linux-hotplug/files/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux-hotplug/files/.mtn2git_empty
diff --git a/packages/linux-hotplug/files/collie/.mtn2git_empty b/packages/linux-hotplug/files/collie/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux-hotplug/files/collie/.mtn2git_empty
diff --git a/packages/linux-hotplug/files/collie/usbd b/packages/linux-hotplug/files/collie/usbd
index e69de29bb2..38aff0adcb 100644
--- a/packages/linux-hotplug/files/collie/usbd
+++ b/packages/linux-hotplug/files/collie/usbd
@@ -0,0 +1 @@
+usbdmodule="sa1100_bi"
diff --git a/packages/linux-hotplug/files/mmc.agent b/packages/linux-hotplug/files/mmc.agent
index 3b2050d7eb..3b2050d7eb 100644..100755
--- a/packages/linux-hotplug/files/mmc.agent
+++ b/packages/linux-hotplug/files/mmc.agent
diff --git a/packages/linux-hotplug/files/sleeve.agent b/packages/linux-hotplug/files/sleeve.agent
index e69de29bb2..55befca1b1 100644..100755
--- a/packages/linux-hotplug/files/sleeve.agent
+++ b/packages/linux-hotplug/files/sleeve.agent
@@ -0,0 +1,120 @@
+#!/bin/sh
+#
+# H3600 Sleeve hotplug policy agent for Linux 2.4 kernels
+#
+# Kernel NET hotplug params include:
+#
+# ACTION=%s [add or remove]
+# VENDOR_ID=%s
+# DEVICE_ID=%x
+# DEVICE_NAME=%s
+#
+
+. /etc/hotplug/hotplug.functions
+#DEBUG=yes export DEBUG
+
+if [ "$DEBUG" != "" ]; then
+ mesg "Executing $0 action=$ACTION, device=$DEVICE_NAME ($VENDOR_ID,$DEVICE_ID)"
+fi
+
+COMPACTFLASH_TIMING_INCREMENT=0
+PCMCIA_TIMING_INCREMENT=0
+DUAL_PCMCIA_TIMING_INCREMENT=0
+NAVMAN_TIMING_INCREMENT=0
+BACKPAQ_TIMING_INCREMENT=-100
+
+if [ -f /etc/sysconfig/hotplug ] ; then
+ . /etc/sysconfig/hotplug
+fi
+
+case $ACTION in
+add)
+ case $DEVICE_NAME in
+ "Compaq Mercury Backpaq")
+ mkdir -p /backpaq
+ echo $BACKPAQ_TIMING_INCREMENT > /proc/sys/backpaq/pcmcia/timing_increment_ns
+ ## mount -t jffs2 /dev/mtdblock/4 /backpaq
+ modprobe h3600_backpaq_fpga || mesg 'could not load backpaq fpga driver'
+ modprobe h3600_backpaq_camera || mesg 'could not load backpaq camera driver'
+ if [ -c /dev/v4l/video0 ] ; then
+ ln -s /dev/v4l/video0 /dev/video0
+ ln -s /dev/v4l/video0 /dev/video
+ fi
+ CAMERATYPE=`/bin/grep "CameraType" /proc/backpaq/camera | /bin/sed -e 's/.*: //'`
+ BACKPAQ_NUMBER=`/bin/grep "Major revision" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'`
+ FPGA_NUMBER=`/bin/grep "FPGA version" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'`
+ CAMERA_NUMBER=`/bin/grep "Camera" /proc/backpaq/eeprom | /bin/sed -e 's/.*0x//'`
+
+ echo "CAMERA_TYPE = $CAMERATYPE"
+ echo "BACKPAQ_NUMBER = $BACKPAQ_NUMBER"
+ echo "FPGA_NUMBER = $FPGA_NUMBER"
+ echo "CAMERA_NUMBER = $CAMERA_NUMBER"
+ echo "looking for file: /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin"
+ if [ -e /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin ] ; then
+ cat /etc/fpga_B${BACKPAQ_NUMBER}_F${FPGA_NUMBER}_C${CAMERA_NUMBER}.bin > /dev/backpaq/fpga
+ elif [ -e /etc/fpga_$CAMERATYPE.bin ] ; then
+ cat /etc/fpga_$CAMERATYPE.bin > /dev/backpaq/fpga
+ elif [ -e /etc/fpga.bin ] ; then
+ cat /etc/fpga.bin > /dev/backpaq/fpga
+ else
+ mesg 'unable to program the backpaq fpga'
+ fi
+ modprobe h3600_backpaq_accel || mesg 'could not load backpaq accelerometer driver'
+ mesg 'BackPAQ drivers loaded'
+ ;;
+ "Compaq CompactFlash Sleeve")
+ mesg 'CompactFlash drivers loaded'
+ echo $COMPACTFLASH_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns
+ ;;
+ "Compaq PC Card Sleeve")
+ mesg 'PC card sleeve drivers loaded'
+ echo $PCMCIA_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns
+ ;;
+ "Compaq Dual PC Card Sleeve")
+ mesg 'Dual PC card sleeve drivers loaded'
+ echo $DUAL_PCMCIA_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns
+ ;;
+ "Navman GPS/CF Sleeve")
+ mesg 'Navman GPS sleeve drivers loaded'
+ echo $NAVMAN_TIMING_INCREMENT > /proc/sys/bus/pcmcia/timing_increment_ns
+ start-stop-daemon --start --exec /usr/sbin/gpsd.bin -- -p /dev/tts/0 -s 57600
+ ;;
+ *)
+ mesg "$1 $ACTION event not handled for $DEVICE_NAME"
+ ;;
+ esac
+ ;;
+
+remove)
+ case $DEVICE_NAME in
+ "Compaq Mercury Backpaq")
+ mesg 'Unloading BackPAQ drivers'
+ ## umount /backpaq
+ rmmod h3600_backpaq_camera
+ rmmod h3600_backpaq_accel
+ rmmod h3600_backpaq_fpga
+ ;;
+ "Compaq CompactFlash Sleeve")
+ mesg 'Unloading CompactFlash sleeve'
+ ;;
+ "Compaq PC Card Sleeve")
+ mesg 'Unloading PC Card sleeve'
+ ;;
+ "Compaq Dual PC Card Sleeve")
+ mesg 'Unloading Dual PC Card sleeve'
+ ;;
+ "Navman GPS/CF Sleeve")
+ mesg 'Unloading Navman GPS sleeve'
+ start-stop-daemon --stop --name gpsd.bin
+ ;;
+ *)
+ mesg $1 $ACTION event not handled for $DEVICE_NAME
+ ;;
+ esac
+ ;;
+
+*)
+ mesg "$1 $ACTION event not supported"
+ exit 1 ;;
+
+esac
diff --git a/packages/linux-hotplug/files/sleeve.rc b/packages/linux-hotplug/files/sleeve.rc
index e69de29bb2..864a2eb182 100644..100755
--- a/packages/linux-hotplug/files/sleeve.rc
+++ b/packages/linux-hotplug/files/sleeve.rc
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# H3600 Sleeve hotplug *.rc agent.
+# This script is called by /etc/init.d/hotplug whenever
+# a run level has changed.
+#
+# A single argument is passed - start, restart, status, or stop
+#
+# We set up parameters that are equivalent to the ones created
+# by the Kernel and pass them along to /sbin/hotplug (the
+# function called by the kernel).
+#
+# Kernel NET hotplug params include:
+#
+# ACTION=%s [add or remove]
+# VENDOR_ID=%s
+# DEVICE_ID=%x
+# DEVICE_NAME=%s
+#
+
+. /etc/hotplug/hotplug.functions
+# DEBUG=yes export DEBUG
+
+SLEEVEFILE="/proc/bus/sleeve/device"
+[ ! -f $SLEEVEFILE ] && exit 0
+
+# give the sleeve driver a kick to make sure it recognizes the card -Jamey 6/26/01
+# echo > /proc/sys/sleeve/insert
+
+export DEVICE_NAME=`/bin/grep driver $SLEEVEFILE | /bin/sed -e 's/.*=//'`
+export DEVICE_ID=`/bin/grep device $SLEEVEFILE | /bin/sed -e 's/.*=//'`
+export VENDOR_ID=`/bin/grep vendor $SLEEVEFILE | /bin/sed -e 's/.*=//'`
+
+case "$1" in
+ start)
+ export ACTION="add"
+ /sbin/hotplug sleeve
+ ;;
+ stop)
+ export ACTION="remove"
+ /sbin/hotplug sleeve
+ ;;
+ restart)
+ export ACTION="remove"
+ /sbin/hotplug sleeve
+ export ACTION="add"
+ /sbin/hotplug sleeve
+ ;;
+ status)
+ if [ -f /var/lock/subsys/hotplug ]; then
+ mesg "Hot plug sleeve has been started, current device $DEVICE_NAME"
+ else
+ mesg "Hot plug sleeve has not been started, current device $DEVICE_NAME"
+ fi
+ ;;
+ *)
+ mesg "Usage: $0 {start|stop|status|restart}"
+ ;;
+esac
+
diff --git a/packages/linux-hotplug/files/soc.agent b/packages/linux-hotplug/files/soc.agent
index e69de29bb2..e91246196f 100644
--- a/packages/linux-hotplug/files/soc.agent
+++ b/packages/linux-hotplug/files/soc.agent
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# SoC hotplug agent for 2.6 kernels
+#
+# ACTION=add
+# SOC_ID=1234
+#
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+MAP_CURRENT=$MODULE_DIR/modules.socmap
+
+#
+# stdin is "modules.socmap" syntax
+# on return, all matching modules were added to $DRIVERS
+#
+soc_map_modules ()
+{
+ while read line
+ do
+ # comments are lines that start with "#" ...
+ # be careful, they still get parsed by bash!
+ case "$line" in
+ \#*) continue ;;
+ esac
+
+ set $line
+
+ module="$1"
+ id="$2"
+
+ if [ "$id" != "0x$SOC_ID" ]; then
+ continue
+ fi
+
+ # It was a match!
+ case " $DRIVERS " in
+ *" $module "* )
+ : already found
+ ;;
+ * )
+ DRIVERS="$module $DRIVERS"
+ ;;
+ esac
+ : drivers $DRIVERS
+ done
+}
+
+case $ACTION in
+
+add)
+
+ load_drivers soc $MAP_CURRENT "$SOC_ID"
+ ;;
+
+*)
+ debug_mesg SoC $ACTION event not supported
+ exit 1
+ ;;
+
+esac
diff --git a/packages/linux-hotplug/files/sysconfig-hotplug b/packages/linux-hotplug/files/sysconfig-hotplug
index e69de29bb2..7ee5a20c31 100644
--- a/packages/linux-hotplug/files/sysconfig-hotplug
+++ b/packages/linux-hotplug/files/sysconfig-hotplug
@@ -0,0 +1,12 @@
+##
+## Each of these may be assigned to the number of nanoseconds by which to
+## increase the timing of pcmcia bus transactions
+##
+# COMPACTFLASH_TIMING_INCREMENT=0
+## the single pcmcia sleeve seems to be a bit slow, but 25ns makes my
+## orinoco card detectable. -Jamey 4/2/2002
+PCMCIA_TIMING_INCREMENT=25
+# DUAL_PCMCIA_TIMING_INCREMENT=0
+
+## mount options used by MMC
+MMC_MOUNT_OPTIONS="-t auto -o sync,noatime"
diff --git a/packages/linux-hotplug/files/tosa/.mtn2git_empty b/packages/linux-hotplug/files/tosa/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/linux-hotplug/files/tosa/.mtn2git_empty
diff --git a/packages/linux-hotplug/files/tosa/sysconfig-usb b/packages/linux-hotplug/files/tosa/sysconfig-usb
index e69de29bb2..cbd18c6566 100644
--- a/packages/linux-hotplug/files/tosa/sysconfig-usb
+++ b/packages/linux-hotplug/files/tosa/sysconfig-usb
@@ -0,0 +1,2 @@
+## Specify the USB host controller driver
+HCD="usb_ohci_tc6393"
diff --git a/packages/linux-hotplug/files/usbd b/packages/linux-hotplug/files/usbd
index e69de29bb2..aa4e6d2de7 100644
--- a/packages/linux-hotplug/files/usbd
+++ b/packages/linux-hotplug/files/usbd
@@ -0,0 +1,2 @@
+usbdmodule=""
+
diff --git a/packages/linux-hotplug/files/usbd.agent b/packages/linux-hotplug/files/usbd.agent
index e69de29bb2..6613b4810a 100644..100755
--- a/packages/linux-hotplug/files/usbd.agent
+++ b/packages/linux-hotplug/files/usbd.agent
@@ -0,0 +1,63 @@
+#!/bin/ash
+
+# DEBUG=yes export DEBUG
+#set -x
+
+. /etc/hotplug/hotplug.functions
+. /etc/default/usbd
+cd $HOTPLUG_DIR
+
+[ -z "$INTERFACE" ] && exit 1
+[ -z "$ACTION" ] && exit 1
+[ -z "$usbdmodule" ] && exit 0
+
+debug_mesg "USBD $ACTION Action Recived"
+
+case $INTERFACE in
+
+monitor)
+ case $ACTION in
+ # called to load all usb device modules
+ load)
+ modprobe usbdcore
+ modprobe net_fd
+ modprobe $usbdmodule
+ ;;
+
+ # called to handle suspend power management event
+ suspend)
+ rmmod $usbdmodule
+ ;;
+
+ # called to reload after resume power management event
+ restore-loaded)
+ modprobe $usbdmodule
+ sleep 2
+ ;;
+
+ # called to unload after resume power management event
+ restore-unloaded)
+ modprobe -r net_fd
+ ;;
+
+ # called to unload all usb device modules
+ unload)
+ modprobe -r $usbdmodule
+ ;;
+
+ *)
+ debug_mesg USBD $ACTION event not handled
+ exit 1
+ ;;
+ esac
+ ;;
+*)
+ debug_mesg USBD $INTERFACE-$ACTION event not handled
+ exit 1
+ ;;
+esac
+
+[ -e /proc/usb-monitor ] && echo "Done" > /proc/usb-monitor
+
+exit 0
+