OSDN Git Service

Properly define TARGET_USES_64_BIT_BINDER
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index 053f96f..8758717 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -20,7 +20,7 @@ function init_misc()
 
        case "$PRODUCT" in
                T10*TA)
-                       echo on > /sys/bus/platform/drivers/sdhci-acpi/INT33BB:00/power/control
+                       modprobe ak8975
                        ;;
                *)
                        ;;
@@ -49,6 +49,7 @@ function init_hal_bluetooth()
        rmmod ath3k
        rmmod btusb
        rmmod bluetooth
+       set_property ro.rfkilldisabled 1
 }
 
 function init_hal_camera()
@@ -141,48 +142,45 @@ function init_hal_power()
 
 function init_hal_sensors()
 {
+       local hal_sensors=kbd
        case "$(cat $DMIPATH/uevent)" in
-               *T*00LA*)
-                       modprobe kfifo-buf
-                       modprobe industrialio-triggered-buffer
-                       modprobe hid-sensor-hub
-                       modprobe hid-sensor-iio-common
-                       modprobe hid-sensor-trigger
-                       modprobe hid-sensor-accel-3d
-                       modprobe hid-sensor-gyro-3d
-                       modprobe hid-sensor-als
-                       modprobe hid-sensor-magn-3d
-                       sleep 1; busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/
-                       set_property ro.hardware.sensors hsb
-                       ;;
                *Lucid-MWE*)
                        set_property ro.ignore_atkbd 1
-                       set_property ro.hardware.sensors hdaps
+                       hal_sensors=hdaps
                        ;;
                *ICONIA*W5*)
-                       set_property ro.hardware.sensors w500
+                       hal_sensors=w500
                        ;;
                *S10-3t*)
-                       set_property ro.hardware.sensors s103t
+                       hal_sensors=s103t
                        ;;
                *Inagua*)
                        #setkeycodes 0x62 29
                        #setkeycodes 0x74 56
                        set_property ro.ignore_atkbd 1
-                       set_property ro.hardware.sensors kbd
                        set_property hal.sensors.kbd.type 2
                        ;;
                *TEGA*|*2010:svnIntel:*)
                        set_property ro.ignore_atkbd 1
-                       set_property ro.hardware.sensors kbd
                        set_property hal.sensors.kbd.type 1
                        io_switch 0x0 0x1
                        setkeycodes 0x6d 125
                        ;;
+               *DLI*)
+                       set_property ro.ignore_atkbd 1
+                       set_property hal.sensors.kbd.type 1
+                       setkeycodes 0x64 1
+                       setkeycodes 0x65 172
+                       setkeycodes 0x66 120
+                       setkeycodes 0x67 116
+                       setkeycodes 0x68 114
+                       setkeycodes 0x69 115
+                       setkeycodes 0x6c 114
+                       setkeycodes 0x6d 115
+                       ;;
                *tx2*)
                        setkeycodes 0xb1 138
                        setkeycodes 0x8a 152
-                       set_property ro.hardware.sensors kbd
                        set_property hal.sensors.kbd.type 6
                        set_property poweroff.doubleclick 0
                        set_property qemu.hw.mainkeys 1
@@ -190,20 +188,31 @@ function init_hal_sensors()
                *MS-N0E1*)
                        set_property ro.ignore_atkbd 1
                        set_property poweroff.doubleclick 0
+                       setkeycodes 0xa5 125
+                       setkeycodes 0xa7 1
+                       setkeycodes 0xe3 142
                        ;;
                *Aspire1*25*)
                        modprobe lis3lv02d_i2c
-                       set_property ro.hardware.sensors hdaps
+                       hal_sensors=hdaps
                        echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode
                        ;;
                *ThinkPad*Tablet*)
                        modprobe hdaps
-                       set_property ro.hardware.sensors hdaps
+                       hal_sensors=hdaps
                        ;;
                *)
-                       set_property ro.hardware.sensors kbd
                        ;;
        esac
+
+       # has sensor-hub?
+       for i in /sys/bus/iio/devices/iio:device?; do
+               busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device?/
+               lsmod | grep -q hid_sensor_accel_3d && hal_sensors=hsb || hal_sensors=iio
+               break
+       done
+
+       set_property ro.hardware.sensors $hal_sensors
 }
 
 function create_pointercal()
@@ -220,7 +229,7 @@ function create_pointercal()
 function init_tscal()
 {
        case "$PRODUCT" in
-               T91|T101|ET2002|74499FU|945GSE-ITE8712)
+               T91|T101|ET2002|74499FU|945GSE-ITE8712|CF-19[CDYFGKLP]*)
                        create_pointercal
                        return
                        ;;
@@ -297,6 +306,8 @@ function do_bootcomplete()
        # FIXME: autosleep works better on i965?
        [ "$(getprop debug.mesa.driver)" = "i965" ] && setprop debug.autosleep 1
 
+       lsmod | grep -e brcmfmac && setprop wlan.no-unload-driver 1
+
        for bt in $(lsusb -v | awk ' /Class:.E0/ { print $9 } '); do
                chown 1002.1002 $bt && chmod 660 $bt
        done