diff --git a/general/overlay/etc/wireless/sdio b/general/overlay/etc/wireless/sdio index 9ad5d66d..54406c79 100755 --- a/general/overlay/etc/wireless/sdio +++ b/general/overlay/etc/wireless/sdio @@ -8,6 +8,14 @@ set_gpio() { sleep 1 } + +set_mmc() { + mmc=/sys/devices/platform/jzmmc_v1.2.$1/present + if [ "$(cat $mmc)" = "N" ]; then + echo "INSERT" > $mmc + fi +} + # T31 ATBM603X mmc0 if [ "$1" = "atbm603x-t31-mmc0" ]; then # PB10 in wifi mmc1 is in the pull-down state by default, it needs to be set to a high-impedance state @@ -15,11 +23,7 @@ if [ "$1" = "atbm603x-t31-mmc0" ]; then # set wifi mmc1 clk drive capability to 8mA devmem 0x10011134 32 0x20000 - # "insert" the bus mmc0 device - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.0/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.0/present - sleep 1 - fi + set_mmc 0 cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp @@ -33,11 +37,7 @@ if [ "$1" = "atbm603x-t31-mmc1" ]; then # not sure what this does, but it's copied from the stock fw devmem 0x10011110 32 0x6e094800 - # "insert" the bus mmc1 device - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.1/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.1/present - sleep 1 - fi + set_mmc 1 cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp @@ -46,14 +46,11 @@ if [ "$1" = "atbm603x-t31-mmc1" ]; then exit 0 fi -# T31 Wyze V3 / AtomCam 2 ATBM6031 +# T31 Wyze V3 / AtomCam 2 ATBM603x if [ "$1" = "atbm603x-t31-wyze-v3" ]; then set_gpio 57 1 - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.1/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.1/present - sleep 1 - fi + set_mmc 1 cp /usr/share/atbm603x_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm603x_conf/set_rate_power.txt /tmp @@ -67,10 +64,7 @@ fi if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then set_gpio 57 1 - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.1/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.1/present - sleep 1 - fi + set_mmc 1 modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 sleep 1 @@ -79,10 +73,7 @@ fi # T31 Wyze DB3 RTL8189FTV if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then - if [ "$(cat /sys/devices/platform/jzmmc_v1.2.1/present)" = "N" ]; then - echo "INSERT" > /sys/devices/platform/jzmmc_v1.2.1/present - sleep 1 - fi + set_mmc 1 modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 sleep 1