blob: d4b5a516502e0b0ed15a28cef5171647b8695de0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#!/bin/sh -e
#
# ST-Ericsson Snowball board peripherial setup script
#
#
# (Limited) OTG HOST support
start_musb() {
modprobe g_multi
}
stop_musb() {
modprobe -r g_multi
}
# Bluetooth
start_bluetooth() {
hciattach -a 23 -s 115200 /dev/ttyAMA0 cg2900 115200 flow
sleep 4
hciconfig hci0 up
}
stop_bluetooth() {
killall hciattach
}
# WLAN (requires Bluetooth to be running currently!)
start_wlan() {
if [ "$WLAN_MAC" ]
then
modprobe cw1200_wlan macaddr=$WLAN_MAC
else
modprobe cw1200_wlan
fi
}
stop_wlan() {
modprobe -r cw1200_wlan
}
# AV8100 output mode
# 0 = HDMI (default)
# 1 = CVBS
# 2 = DVI-D
set_av8100_mode() {
if [ "$AV8100_MODE" ]
then
echo $AV8100_MODE > /sys/devices/av8100_hdmi.3/hdmisdtvswitch
fi
}
# Configuration options:
# - a line with 'WLAN_MAC=0x00,0x80,0xe1,0xb6,0xaf,0xed' sets WLAN MAC
# - a line with 'AV8100_MODE=N' selects AV8100 mode
if [ -e /etc/snowballrc ]
then
. /etc/snowballrc
fi
case "$1" in
start)
start_musb
start_bluetooth
start_wlan
set_av8100_mode
;;
stop)
stop_musb
stop_bluetooth
stop_wlan
;;
force-reload|restart)
stop_musb
stop_bluetooth
stop_wlan
sleep 5
start_musb
start_bluetooth
start_wlan
set_av8100_mode
;;
*)
echo "Usage: $0 {start|stop|restart}"
;;
esac
exit 0
|