Unverified Commit eba6e881 authored by pjgowtham's avatar pjgowtham
Browse files

nicky: CameraHelper: Modify for realme X

parent 1a31d5c5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -28,13 +28,13 @@ public class CameraMotorController {

    // Camera motor paths
    private static final String CAMERA_MOTOR_ENABLE_PATH =
            "/sys/devices/platform/vendor/vendor:motor_pl/enable";
            "/sys/class/motor/enable";
    public static final String CAMERA_MOTOR_HALL_CALIBRATION =
            "/sys/devices/platform/vendor/vendor:motor_pl/hall_calibration";
            "/sys/class/motor/hall_calibration";
    private static final String CAMERA_MOTOR_DIRECTION_PATH =
            "/sys/devices/platform/vendor/vendor:motor_pl/direction";
            "/sys/class/motor/direction";
    private static final String CAMERA_MOTOR_POSITION_PATH =
            "/sys/devices/platform/vendor/vendor:motor_pl/position";
            "/sys/class/motor/position";

    // Motor calibration data path
    public static final String CAMERA_PERSIST_HALL_CALIBRATION =
+1 −0
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ PRODUCT_PACKAGES += \

PRODUCT_PACKAGES += \
    init.oplus.rc \
    init.oppo.vendor.motor.rc \
    init.qcom.power.rc \
    init.qcom.rc \
    init.qcom.recovery.rc \
+7 −0
Original line number Diff line number Diff line
@@ -23,6 +23,13 @@ prebuilt_etc {
    device_specific: true,
}

prebuilt_etc {
    name: "init.oppo.vendor.motor.rc",
    src: "init.oppo.vendor.motor.rc",
    sub_dir: "init/hw",
    device_specific: true,
}

prebuilt_etc {
    name: "init.qcom.rc",
    src: "init.qcom.rc",
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#

import /odm/etc/init/hw/init.oppo.vendor.motor.rc

on fs
    # Update touchpanel firmware in case we ship newer firmware in /odm
    write /proc/touchpanel/tp_fw_update 0
+51 −0
Original line number Diff line number Diff line
##########################################################
# Copyright (C), 2008-2018, OPPO Mobile Comm Corp., Ltd
# VENDOR_EDIT
# File: init.oppo.rc
#
# Description:
#	Definitions for init.oppo.vendor.motor.rc.
#
# Version: 1.0
# Date created: 2018/10/30,20:27
# Author: Fei.Mo@PSW.BSP.Sensor
#
# --------------------------- Revision History: ------------------------------------
# <version>		<date>		<author>		<desc>
# Revision 1.0		2018/10/30	Fei.Mo@PSW.BSP.Sensor	Created
#######################################################

on init
    chown system system /sys/class/motor/direction
    chown system system /sys/class/motor/enable
    chown system system /sys/class/motor/speed
    chown system system /sys/class/motor/hall_data
    chown system system /sys/class/motor/hall_max_data
    chown system system /sys/class/motor/hall_calibration
    chown system system /sys/class/motor/in_calibration
    chown system system /sys/class/motor/hall_irq_count
    chown system system /sys/class/motor/move_state
    chown system system /sys/class/motor/sw_switch
    chown system system /sys/class/motor/manual2auto_switch
    chown system system /sys/class/motor/motor_test
    chown system system /sys/class/motor/force_move
    chown system system /sys/class/motor/mode
    chown system system /sys/class/motor/stop_range
    chown system system /sys/class/motor/stop_in_advance
    chmod 0666 /sys/class/motor/direction
    chmod 0666 /sys/class/motor/enable
    chmod 0666 /sys/class/motor/speed
    chmod 0666 /sys/class/motor/hall_data
    chmod 0666 /sys/class/motor/hall_max_data
    chmod 0666 /sys/class/motor/hall_calibration
    chmod 0666 /sys/class/motor/in_calibration
    chmod 0666 /sys/class/motor/hall_irq_count
    chmod 0666 /sys/class/motor/move_state
    chmod 0666 /sys/class/motor/sw_switch
    chmod 0666 /sys/class/motor/manual2auto_switch
    chmod 0666 /sys/class/motor/motor_test
    chmod 0666 /sys/class/motor/force_move
    chmod 0666 /sys/class/motor/mode
    chmod 0666 /sys/class/motor/stop_range
    chmod 0666 /sys/class/motor/stop_in_advance