mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
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. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10638 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
25
package/mmc_over_gpio/files/mmc_over_gpio.init
Normal file
25
package/mmc_over_gpio/files/mmc_over_gpio.init
Normal file
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user