summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-01-22 01:43:44 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2014-01-22 01:46:47 +0000
commitac317de88144c3e6629c0389234fe9b1287421fa (patch)
treee6dfdc70222bd70894d2419acace2228abdf5221
parent9065716b62d809422336a40f6415842b65f0b024 (diff)
Add hardware tunables to Settings
Make kcal and tap-to-wake configurable Change-Id: Id96df99bf715f6b2ec8f5e005ce2f1a3bfae44d1
-rw-r--r--BoardConfig.mk2
-rw-r--r--cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java44
-rw-r--r--cmhw/org/cyanogenmod/hardware/TapToWake.java38
-rwxr-xr-xinit.awifi.rc13
4 files changed, 93 insertions, 4 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 3c9ae24..500f1d3 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -148,3 +148,5 @@ BOARD_SEPOLICY_UNION := \
TARGET_RELEASETOOLS_EXTENSIONS := device/lge/v500/releasetools
BOARD_USES_QC_TIME_SERVICES := true
+
+BOARD_HARDWARE_CLASS := device/lge/v500/cmhw/
diff --git a/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java b/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java
new file mode 100644
index 0000000..f933f3d
--- /dev/null
+++ b/cmhw/org/cyanogenmod/hardware/DisplayColorCalibration.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2013 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.cyanogenmod.hardware;
+
+import org.cyanogenmod.hardware.util.FileUtils;
+
+public class DisplayColorCalibration {
+ private static final String COLOR_FILE = "/sys/devices/platform/kcal_ctrl.0/kcal";
+ private static final String COLOR_FILE_CTRL = "/sys/devices/platform/kcal_ctrl.0/kcal_ctrl";
+
+ public static boolean isSupported() {
+ return true;
+ }
+
+ public static int getMaxValue() {
+ return 255;
+ }
+ public static int getMinValue() {
+ return 0;
+ }
+ public static String getCurColors() {
+ return FileUtils.readOneLine(COLOR_FILE);
+ }
+ public static boolean setColors(String colors) {
+ if (!FileUtils.writeLine(COLOR_FILE, colors)) {
+ return false;
+ }
+ return FileUtils.writeLine(COLOR_FILE_CTRL, "1");
+ }
+}
diff --git a/cmhw/org/cyanogenmod/hardware/TapToWake.java b/cmhw/org/cyanogenmod/hardware/TapToWake.java
new file mode 100644
index 0000000..76a3bec
--- /dev/null
+++ b/cmhw/org/cyanogenmod/hardware/TapToWake.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014 The CyanogenMod Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.cyanogenmod.hardware;
+
+import org.cyanogenmod.hardware.util.FileUtils;
+
+public class TapToWake {
+
+ private static String CONTROL_PATH = "/sys/devices/i2c-3/3-004b/knock_on";
+ private static boolean mEnabled = true;
+
+ public static boolean isSupported() {
+ return true;
+ }
+
+ public static boolean isEnabled() {
+ return mEnabled;
+ }
+
+ public static boolean setEnabled(boolean state) {
+ mEnabled = state;
+ return FileUtils.writeLine(CONTROL_PATH, (state ? "1" : "0"));
+ }
+}
diff --git a/init.awifi.rc b/init.awifi.rc
index a1a9ceb..d199cc1 100755
--- a/init.awifi.rc
+++ b/init.awifi.rc
@@ -176,9 +176,6 @@ service usf-post-boot /system/bin/sh /system/etc/usf_post_boot.sh
on property:init.svc.bootanim=stopped
start usf-post-boot
-on property:dev.bootcomplete=1
- write /sys/devices/i2c-3/3-004b/knock_on 1
-
service time_daemon /system/bin/time_daemon
class late_start
user root
@@ -689,10 +686,18 @@ on post-fs-data
setprop ro.ssbd.session /dev/block/platform/msm_sdcc.1/by-name/eksst
setprop ro.ssbd.offset 0
-
# bonkang.koo@lge.com 2012.10.23 set default sdcard fs type
setprop vold.sdcard_fs_type none
+ chown root system /sys/devices/platform/kcal_ctrl.0/kcal
+ chown root system /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
+ chmod 0664 /sys/class/timed_output/vibrator/amp
+ chmod 0664 /sys/devices/platform/kcal_ctrl.0/kcal
+ chmod 0664 /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
+ restorecon /sys/class/timed_output/vibrator/amp
+ restorecon /sys/devices/platform/kcal_ctrl.0/kcal
+ restorecon /sys/devices/platform/kcal_ctrl.0/kcal_ctrl
+
# Export GPIO56 for fusion targets to enable/disable hub
service usbhub_init /system/bin/usbhub_init
class late_start