Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-intel-libsensors: Commit

hardware/intel/libsensors


Commit MetaInfo

Revision84048675daaf09be430c3f6cedbb551b67282d64 (tree)
Zeit2019-06-26 12:30:18
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Merge branch 'lineage-16.0' of https://github.com/me176c-dev/android_hardware_iio-sensors-hal into oreo-x86

Ändern Zusammenfassung

Diff

--- a/Android.mk
+++ b/Android.mk
@@ -56,7 +56,7 @@ LOCAL_MODULE := sens
5656 LOCAL_CFLAGS := -DLOG_TAG=\"Sensors\" -fvisibility=hidden
5757 LOCAL_SHARED_LIBRARIES := liblog libcutils libdl
5858 LOCAL_SRC_FILES := sens.c
59-LOCAL_MODULE_TAGS := eng
59+LOCAL_MODULE_TAGS := optional
6060 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
6161 include $(BUILD_EXECUTABLE)
6262
@@ -87,6 +87,6 @@ LOCAL_MODULE := activity
8787 LOCAL_CFLAGS := -DLOG_TAG=\"Activity\" -fvisibility=hidden
8888 LOCAL_SHARED_LIBRARIES := liblog libcutils libdl
8989 LOCAL_SRC_FILES := activity.c
90-LOCAL_MODULE_TAGS := eng
90+LOCAL_MODULE_TAGS := optional
9191 LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
9292 include $(BUILD_EXECUTABLE)
--- a/activity_event_utils.h
+++ b/activity_event_utils.h
@@ -24,10 +24,6 @@
2424 #define MAX_ACTIVITIES 6
2525 #define MAX_EVENTS_PER_ACTIVITY 2
2626
27-typedef unsigned bool;
28-#define true 1
29-#define false 0
30-
3127 /* For each activity in activity_recognition.h we can monitor 2 events at most :
3228 * ENTER and EXIT */
3329 struct activity_event_info {
--- a/common.h
+++ b/common.h
@@ -40,6 +40,7 @@
4040 #define SENSOR_OFFSET_PATH BASE_PATH "in_%s_offset"
4141 #define SENSOR_SCALE_PATH BASE_PATH "in_%s_scale"
4242 #define SENSOR_SAMPLING_PATH BASE_PATH "in_%s_sampling_frequency"
43+#define SENSOR_AVAIL_FREQ_PATH BASE_PATH "in_%s_sampling_frequency_available"
4344 #define DEVICE_SAMPLING_PATH BASE_PATH "sampling_frequency"
4445 #define DEVICE_AVAIL_FREQ_PATH BASE_PATH "sampling_frequency_available"
4546 #define ILLUMINATION_CALIBPATH BASE_PATH "in_illuminance_calibscale"
--- a/description.c
+++ b/description.c
@@ -482,6 +482,7 @@ int sensor_get_order (int s, unsigned char map[MAX_CHANNELS])
482482 int sensor_get_available_frequencies (int s)
483483 {
484484 int dev_num = sensor[s].dev_num, err, i;
485+ const char *prefix = sensor_catalog[sensor[s].catalog_index].tag;
485486 char avail_sysfs_path[PATH_MAX], freqs_buf[100];
486487 char *p, *end;
487488 float f;
@@ -492,8 +493,12 @@ int sensor_get_available_frequencies (int s)
492493 sprintf(avail_sysfs_path, DEVICE_AVAIL_FREQ_PATH, dev_num);
493494
494495 err = sysfs_read_str(avail_sysfs_path, freqs_buf, sizeof(freqs_buf));
495- if (err < 0)
496- return 0;
496+ if (err < 0) {
497+ sprintf(avail_sysfs_path, SENSOR_AVAIL_FREQ_PATH, dev_num, prefix);
498+ err = sysfs_read_str(avail_sysfs_path, freqs_buf, sizeof(freqs_buf));
499+ if (err < 0)
500+ return 0;
501+ }
497502
498503 for (p = freqs_buf, f = strtof(p, &end); p != end; p = end, f = strtof(p, &end))
499504 sensor[s].avail_freqs_count++;
Show on old repository browser