aboutsummaryrefslogtreecommitdiffstats
path: root/package/mmc_over_gpio/files
diff options
context:
space:
mode:
authorMichael Büsch <mb@bu3sch.de>2008-03-21 17:38:16 +0000
committerMichael Büsch <mb@bu3sch.de>2008-03-21 17:38:16 +0000
commit414325c08c3df17b7f67de96ad83eb0bcb5c8cd0 (patch)
tree3b053b78b2f09e854f114697460b3125fe241fc0 /package/mmc_over_gpio/files
parent12b5a779b900708c9b787811c93763b9041282ad (diff)
downloadupstream-414325c08c3df17b7f67de96ad83eb0bcb5c8cd0.tar.gz
upstream-414325c08c3df17b7f67de96ad83eb0bcb5c8cd0.tar.bz2
upstream-414325c08c3df17b7f67de96ad83eb0bcb5c8cd0.zip
mmc_over_gpio: Add initscript that will create a device Note that we should use a config file where we can define an arbitrary number of devices.
SVN-Revision: 10638
Diffstat (limited to 'package/mmc_over_gpio/files')
-rw-r--r--package/mmc_over_gpio/files/mmc_over_gpio.init25
1 files changed, 25 insertions, 0 deletions
diff --git a/package/mmc_over_gpio/files/mmc_over_gpio.init b/package/mmc_over_gpio/files/mmc_over_gpio.init
new file mode 100644
index 0000000000..88d9e41027
--- /dev/null
+++ b/package/mmc_over_gpio/files/mmc_over_gpio.init
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2008 OpenWrt.org
+START=90
+
+SYSFS="/sys"
+SYSFS_DRIVERDIR="$SYSFS/bus/platform/drivers/spi-gpio-mmc"
+
+# add_device(name, DI_pin, DO_pin, CLK_pin, CS_pin, mode)
+add_device() {
+ echo -n "$1" "$2","$3","$4","$5" "$6" > $SYSFS_DRIVERDIR/add
+}
+
+# remove_device(name)
+remove_device() {
+ echo -n "$1" > $SYSFS_DRIVERDIR/remove
+}
+
+start() {
+ #FIXME we should use a config file, but I dunno how that parser works.
+ add_device "default" 5 4 3 7 0
+}
+
+stop() {
+ remove_device "default"
+}