nx: use intel iio/sysfs sensor hal

Set up in polling mode--trigger and event mode will need testing. Will
also require testing for generalized calib profile for max range.

Change-Id: I8e58cac0288ba8b53f3451c239c15c0a906db8d4
This commit is contained in:
tmakin authored and Nolen Johnson committed 2024-01-25 15:54:02 -05:00
1 parent c12b495144
commit 2ef2da1d0f
6 files changed
+94

No files matched your search

+12
View File
@@ -67,6 +67,7 @@ PRODUCT_PACKAGES += \
init.loki_foster_e_common.rc \
init.nx.rc \
init.recovery.nx.rc \
init.sensors.nx.rc \
init.vali.rc \
power.nx.rc
@@ -159,6 +160,17 @@ PRODUCT_PACKAGES += \
nvphsd.conf
endif
# Sensors
PRODUCT_PACKAGES += \
android.hardware.sensors@1.0-service \
android.hardware.sensors@1.0-impl \
sensors.iio
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
frameworks/native/data/etc/android.hardware.sensor.gyroscope.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.gyroscope.xml \
frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml
# Shipping API
$(call inherit-product, $(SRC_TARGET_DIR)/product/product_launched_with_l.mk)
+8
View File
@@ -59,6 +59,14 @@ LOCAL_ODM_MODULE := true
LOCAL_SRC_FILES := power.nx.rc
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := init.sensors.nx.rc
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := init.sensors.nx.rc
LOCAL_VENDOR_MODULE := true
LOCAL_MODULE_RELATIVE_PATH := init/hw
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lkm_loader
LOCAL_SRC_FILES := lkm_loader.sh
+1
View File
@@ -15,6 +15,7 @@
import /vendor/etc/init/hw/init.tegra.rc
import /vendor/etc/init/hw/init.t210.rc
import /vendor/etc/init/hw/init.loki_foster_e_common.rc
import /vendor/etc/init/hw/init.sensors.nx.rc
import /vendor/etc/init/hw/init.${ro.boot.hardware.sku}.rc
on init
+60
View File
@@ -0,0 +1,60 @@
# Copyright (C) 2023 The LineageOS 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.
# NOTE: some stuff might look like a typo--it is likely not. cutils properties can only
# handle <32 chars per property so they get cut. Device names are cut to 7 and
# props are cut to 31.
on init
setprop ro.hardware.sensors iio
# Force polling mode for accel and gyro
setprop ro.iio.accel.quirks no-trig,no-event
setprop ro.iio.anglvel.quirks no-trig,no-event
# LSM6DS3H
setprop ro.iio.anglvel.lsm6ds3.name "LSM6DS3H Gyroscope"
setprop ro.iio.anglvel.lsm6ds3.vendor STMicroelectronics
setprop ro.iio.anglvel.lsm6ds3.max_rang 35
setprop ro.iio.accel.lsm6ds3.name "LSM6DS3H Accelerometer"
setprop ro.iio.accel.lsm6ds3.vendor STMicroelectronics
setprop ro.iio.accel.lsm6ds3.max_range 79
# LSM6DSE
setprop ro.iio.anglvel.lsm6dse.name "LSM6DSE Gyroscope"
setprop ro.iio.anglvel.lsm6dse.vendor STMicroelectronics
setprop ro.iio.anglvel.lsm6dse.max_rang 35
setprop ro.iio.accel.lsm6dse.name "LSM6DSE Accelerometer"
setprop ro.iio.accel.lsm6dse.vendor STMicroelectronics
setprop ro.iio.accel.lsm6dse.max_range 79
# LSM6DS0
setprop ro.iio.anglvel.lsm6ds0.name "LSM6DS0 Gyroscope"
setprop ro.iio.anglvel.lsm6ds0.vendor STMicroelectronics
setprop ro.iio.anglvel.lsm6ds0.max_rang 35
setprop ro.iio.accel.lsm6ds0.name "LSM6DSE Accelerometer"
setprop ro.iio.accel.lsm6ds0.vendor STMicroelectronics
setprop ro.iio.accel.lsm6ds0.max_range 79
# ICM40607
setprop ro.iio.anglvel.icm4060.name "ICM40607 Gyroscope"
setprop ro.iio.anglvel.icm4060.vendor Invensense
setprop ro.iio.anglvel.icm4060.max_rang 18
setprop ro.iio.accel.icm4060.name "ICM40607 Accelerometer"
setprop ro.iio.accel.icm4060.vendor Invensense
setprop ro.iio.accel.icm4060.max_range 11
# BH1730FVC
setprop ro.iio.illuminance.bh1730.name "BH1730FVC Ambient Light Sensor"
setprop ro.iio.illuminance.bh1730.vendor ROHM
+4
View File
@@ -36,6 +36,10 @@
"repository": "android_kernel_nvidia_wireguard",
"target_path": "kernel/nvidia/wireguard"
},
{
"repository": "android_hardware_intel_sensors-iio",
"target_path": "hardware/intel/sensors-iio"
},
{
"repository": "android_hardware_nvidia_interfaces",
"target_path": "hardware/nvidia/interfaces"
+9
View File
@@ -1,2 +1,11 @@
<manifest version="1.0" type="device" target-level="3">
<hal format="hidl">
<name>android.hardware.sensors</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>ISensors</name>
<instance>default</instance>
</interface>
</hal>
</manifest>