android_device_xiaomi_sdm66.../rootdir/etc/init.xiaomi_parts.rc
OdSazib 9bd430ff9b
sdm660-common: XiaomiParts: Add Headphone & Mic Gain
* This is manually ported by me from Lavender tree on Corvus-Devices
* Thanks @StyloGey for reviewing the java code and giving me a better solution
* Original repo: https://github.com/Corvus-Devices/device_xiaomi_lavender.git

To get it working, you need these two commits in your kernel:
> c04d6d6e61
> 8e25ac3318

Signed-off-by: OdSazib <odsazib@gmail.com>
Change-Id: I1bb48ced1f23728daa2e5170647ce08a04347110
2020-10-19 11:36:06 +06:00

62 lines
2.5 KiB
Text

#
# Copyright 2020 Paranoid Android
#
# 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.
#
on boot
# XiaomiParts
chown system system /sys/devices/virtual/timed_output/vibrator/vtg_level
chmod 0660 /sys/devices/virtual/timed_output/vibrator/vtg_level
chown system system /sys/module/hall/parameters/hall_toggle
chmod 0660 /sys/module/hall/parameters/hall_toggle
# FPS
chown system system /sys/devices/virtual/graphics/fb0/measured_fps
chmod 0660 /sys/devices/virtual/graphics/fb0/measured_fps
chown system system /sys/class/graphics/fb0/measured_fps
chmod 0660 /sys/class/graphics/fb0/measured_fps
# Audio Amplification
chown system system /sys/kernel/sound_control/headphone_gain
chown system system /sys/kernel/sound_control/mic_gain
chmod 0660 /sys/kernel/sound_control/headphone_gain
chmod 0660 /sys/kernel/sound_control/mic_gain
# KCal
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_cont
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_enable
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_hue
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_sat
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_val
chown system system /sys/devices/platform/kcal_ctrl.0/kcal_min
chown system system /sys/devices/platform/kcal_ctrl.0/kcal
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_cont
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_enable
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_hue
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_sat
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_val
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal_min
chmod 660 /sys/devices/platform/kcal_ctrl.0/kcal
service folio_daemon /system/bin/folio_daemon
class late_start
user system
group system uhid
disabled
on property:persist.service.folio_daemon=0
stop folio_daemon
on property:persist.service.folio_daemon=1
start folio_daemon