distribution/packages/hardware/quirks/devices/Anbernic RG552/030-enable_wifi

21 lines
621 B
Text
Raw Normal View History

#!/bin/sh
2023-07-28 13:16:04 +00:00
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present JELOS (https://github.com/JustEnoughLinuxOS)
2023-07-28 13:16:04 +00:00
. /etc/profile.d/001-functions
2023-07-28 13:16:04 +00:00
# Get Internal Wifi State
INTERNAL_WIFI_STATE=$(get_setting "internal.wifi")
if [ ! -n "${INTERNAL_WIFI_STATE}" ]; then
INTERNAL_WIFI_STATE=1
set_setting "internal.wifi" "1"
fi
# Set export GPIO for Wifi and set state
2023-07-28 13:16:04 +00:00
if [ ! -d "/sys/class/gpio/gpio${DEVICE_WIFI}" ]; then
echo ${DEVICE_WIFI} > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction
echo ${INTERNAL_WIFI_STATE} > /sys/class/gpio/gpio${DEVICE_WIFI}/value
2023-07-28 13:16:04 +00:00
fi