pine64-pinephone: add script to bring up EG25 on current sample (!620)
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
This commit is contained in:
parent
f8ba7b6a20
commit
5bf2defdcf
2 changed files with 43 additions and 2 deletions
|
@ -2,7 +2,7 @@
|
|||
pkgname="device-pine64-pinephone"
|
||||
pkgdesc="PINE64 PinePhone"
|
||||
pkgver=0.1
|
||||
pkgrel=16
|
||||
pkgrel=17
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
|
@ -20,6 +20,7 @@ source="
|
|||
hwtest.ini
|
||||
ucm/sun50i-a64-audio.conf
|
||||
ucm/HiFi
|
||||
eg25.initd
|
||||
"
|
||||
|
||||
build() {
|
||||
|
@ -39,6 +40,8 @@ package() {
|
|||
"$pkgdir"/usr/share/alsa/ucm2/sun50i-a64-audio/sun50i-a64-audio.conf
|
||||
install -D -m644 "$srcdir"/HiFi \
|
||||
"$pkgdir"/usr/share/alsa/ucm2/sun50i-a64-audio/HiFi
|
||||
|
||||
install -Dm755 "$srcdir"/eg25.initd "$pkgdir"/etc/init.d/eg25
|
||||
}
|
||||
|
||||
nonfree_firmware() {
|
||||
|
@ -52,4 +55,5 @@ sha512sums="bfb39f14c5a0b928d08cbcb5d19e63e141b052ebb72186c7c26f54d89c2ebf069674
|
|||
c4c57d1627dd451213e1ef20d89de9266cd4edcc2d33a69aa9a1f13e16d9f9742036b69dc149fd910d7213f7525c41eb79576d4457bc85cc96eba0d986382d27 weston.ini
|
||||
3dd6d612c381cb0002049d1974d8fb5aa5a53a1eb4d6bcbf62eb2ad52cfdc45f0f6ad24a699716d3513b0371aa1316f25dc72afc10d7176cc3b99d0965c3f030 hwtest.ini
|
||||
775b7f7612102fc8ff12b2ffc8a7d479bfcf0ab054e331e4bd7873264cc63cbcbf5073d8dc2a80ef0f36226ad5c8b435396801c7d712161ff80ef036ecdc29b6 sun50i-a64-audio.conf
|
||||
8018532bd68b4682455690922560933ddb0dd1dae6a3b2f8611ae89ad09e37ea3c5a17cb9fd39ac165e4e598e0eb9ebbd1395f5908020108ee8a301aae516c3c HiFi"
|
||||
8018532bd68b4682455690922560933ddb0dd1dae6a3b2f8611ae89ad09e37ea3c5a17cb9fd39ac165e4e598e0eb9ebbd1395f5908020108ee8a301aae516c3c HiFi
|
||||
5a1a9c774253e8211cc54f4b3961c4bdc35427726d037b0ecad099915e856590e8267a4a47943ab753772d57261eef89924b407b305b1099a9c4ecd7b5f00b35 eg25.initd"
|
||||
|
|
37
device/device-pine64-pinephone/eg25.initd
Normal file
37
device/device-pine64-pinephone/eg25.initd
Normal file
|
@ -0,0 +1,37 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
description="Starting EG25 WWAN module"
|
||||
|
||||
depend()
|
||||
{
|
||||
before ofono
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
ebegin "Enabling EG25 WWAN module"
|
||||
# GPIO35 is PWRKEY
|
||||
# GPIO68 is RESET_N
|
||||
# GPIO232 is W_DISABLE#
|
||||
for i in 35 68 232
|
||||
do
|
||||
[ -e /sys/class/gpio/gpio$i ] && continue
|
||||
echo $i > /sys/class/gpio/export || return 1
|
||||
echo out > /sys/class/gpio/gpio$i/direction || return 1
|
||||
done
|
||||
|
||||
echo 0 > /sys/class/gpio/gpio68/value || return 1
|
||||
echo 0 > /sys/class/gpio/gpio232/value || return 1
|
||||
|
||||
( echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value ) || return 1
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
ebegin "Disabling EG25 WWAN module"
|
||||
echo 1 > /sys/class/gpio/gpio68/value
|
||||
echo 1 > /sys/class/gpio/gpio232/value
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio35/value && sleep 2 && echo 0 > /sys/class/gpio/gpio35/value
|
||||
sleep 30 # Wait for the module to power off
|
||||
}
|
Loading…
Reference in a new issue