Skip to content

Commit

Permalink
Sigmastar: update kernel module script
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda authored and themactep committed Oct 27, 2023
1 parent 5c50e08 commit 47f547b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# OpenIPC.org | 2023.07.01
# OpenIPC.org | 2023.08.01
#

PATH_MODULE=/lib/modules/4.9.84/sigmastar
Expand All @@ -10,14 +10,11 @@ detect_sensor() {
devmem 0x1F203C18 16 0x0A80
devmem 0x1F207188 16 0x0001
devmem 0x1F2608FC 16 0x0003

SENSOR=$(ipcinfo -s)
fw_setenv sensor ${SENSOR}
}

set_sensor() {
$(lsmod | grep -q ${SENSOR}) && rmmod drv_ms_cus_${SENSOR}_MIPI

case ${SENSOR} in
gc4653|imx335|sc2239|sc3335)
insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1
Expand Down Expand Up @@ -50,9 +47,7 @@ insert_ko() {

major=$(awk '$2=="mi_poll" {print $1}' /proc/devices)
mknod /dev/mi_poll c $major 0

echo isproot /etc/firmware > /dev/ispmid
mdev -s
}

if [ ! -e /dev/mi_poll ]; then
Expand All @@ -69,7 +64,7 @@ if [ -z ${SENSOR} ]; then
exit 1
else
echo -e "\n\e[1;32mSensor is assigned - ${SENSOR}\e[0m\n" | logger -s -t OpenIPC
set_sensor
$(lsmod | grep -q ${SENSOR}) || set_sensor
fi

exit 0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# OpenIPC.org | 2023.07.01
# OpenIPC.org | 2023.08.01
#

PATH_MODULE=/lib/modules/4.9.84/sigmastar
Expand All @@ -10,14 +10,11 @@ detect_sensor() {
devmem 0x1F2079A4 16 0x0111
devmem 0x1F207188 16 0x0001
devmem 0x1F2608FC 16 0x0003

SENSOR=$(ipcinfo -s)
fw_setenv sensor ${SENSOR}
}

set_sensor() {
$(lsmod | grep -q ${SENSOR}) && rmmod drv_ms_cus_${SENSOR}_MIPI

case ${SENSOR} in
imx274|imx335|imx347|imx415|sc8235)
insmod ${PATH_MODULE}/sensor_${SENSOR}_mipi.ko chmap=1
Expand Down Expand Up @@ -46,9 +43,7 @@ insert_ko() {

major=$(awk '$2=="mi_poll" {print $1}' /proc/devices)
mknod /dev/mi_poll c $major 0

echo isproot /etc/firmware > /dev/ispmid
mdev -s
}

if [ ! -e /dev/mi_poll ]; then
Expand All @@ -65,7 +60,7 @@ if [ -z ${SENSOR} ]; then
exit 1
else
echo -e "\n\e[1;32mSensor is assigned - ${SENSOR}\e[0m\n" | logger -s -t OpenIPC
set_sensor
$(lsmod | grep -q ${SENSOR}) || set_sensor
fi

exit 0

0 comments on commit 47f547b

Please sign in to comment.