2 * Copyright (C) 2014-2015 Intel Corporation.
10 #include <hardware/sensors.h>
11 #include "enumeration.h"
12 #include "description.h"
14 #include "transform.h"
15 #include "description.h"
17 #include "calibration.h"
20 * This table maps syfs entries in scan_elements directories to sensor types,
21 * and will also be used to determine other sysfs names as well as the iio
22 * device number associated to a specific sensor.
26 * We duplicate entries for the uncalibrated types after their respective base
27 * sensor. This is because all sensor entries must have an associated catalog entry
28 * and also because when only the uncal sensor is active it needs to take it's data
29 * from the same iio device as the base one.
32 sensor_catalog_entry_t sensor_catalog[] = {
35 .type = SENSOR_TYPE_ACCELEROMETER,
39 { DECLARE_NAMED_CHANNEL("accel", "x") },
40 { DECLARE_NAMED_CHANNEL("accel", "y") },
41 { DECLARE_NAMED_CHANNEL("accel", "z") },
46 .type = SENSOR_TYPE_GYROSCOPE,
50 { DECLARE_NAMED_CHANNEL("anglvel", "x") },
51 { DECLARE_NAMED_CHANNEL("anglvel", "y") },
52 { DECLARE_NAMED_CHANNEL("anglvel", "z") },
57 .type = SENSOR_TYPE_MAGNETIC_FIELD,
61 { DECLARE_NAMED_CHANNEL("magn", "x") },
62 { DECLARE_NAMED_CHANNEL("magn", "y") },
63 { DECLARE_NAMED_CHANNEL("magn", "z") },
68 .type = SENSOR_TYPE_LIGHT,
72 { DECLARE_NAMED_CHANNEL("intensity", "both") },
77 .type = SENSOR_TYPE_LIGHT,
81 { DECLARE_GENERIC_CHANNEL("illuminance") },
86 .type = SENSOR_TYPE_ORIENTATION,
90 { DECLARE_NAMED_CHANNEL("incli", "x") },
91 { DECLARE_NAMED_CHANNEL("incli", "y") },
92 { DECLARE_NAMED_CHANNEL("incli", "z") },
97 .type = SENSOR_TYPE_ROTATION_VECTOR,
101 { DECLARE_NAMED_CHANNEL("rot", "quat_x") },
102 { DECLARE_NAMED_CHANNEL("rot", "quat_y") },
103 { DECLARE_NAMED_CHANNEL("rot", "quat_z") },
104 { DECLARE_NAMED_CHANNEL("rot", "quat_w") },
109 .type = SENSOR_TYPE_AMBIENT_TEMPERATURE,
113 { DECLARE_GENERIC_CHANNEL("temp") },
118 .type = SENSOR_TYPE_PROXIMITY,
122 { DECLARE_GENERIC_CHANNEL("proximity") },
127 .type = SENSOR_TYPE_GYROSCOPE_UNCALIBRATED,
131 { DECLARE_GENERIC_CHANNEL("") },
137 .type = SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
141 { DECLARE_GENERIC_CHANNEL("") },
146 .type = SENSOR_TYPE_STEP_COUNTER,
150 { DECLARE_GENERIC_CHANNEL("steps") },
155 .type = SENSOR_TYPE_STEP_DETECTOR,
160 DECLARE_VOID_CHANNEL("steps")
163 { DECLARE_NAMED_EVENT("steps", "change") },
170 .type = SENSOR_TYPE_PROXIMITY,
175 DECLARE_VOID_CHANNEL("proximity0")
178 { DECLARE_EVENT("proximity0", "_", "", "", "thresh", "_", "either") },
182 DECLARE_VOID_CHANNEL("proximity1")
185 { DECLARE_EVENT("proximity1", "_", "", "", "thresh", "_", "either") },
189 DECLARE_VOID_CHANNEL("proximity2")
192 { DECLARE_EVENT("proximity2", "_", "", "", "thresh", "_", "either") },
196 DECLARE_VOID_CHANNEL("proximity3")
199 { DECLARE_EVENT("proximity3", "_", "", "", "thresh", "_", "either") },
206 unsigned int catalog_size = ARRAY_SIZE(sensor_catalog);
208 /* ACPI PLD (physical location of device) definitions, as used with sensors */
210 #define PANEL_FRONT 4
213 /* We equate sensor handles to indices in these tables */
215 struct sensor_t sensor_desc[MAX_SENSORS]; /* Android-level descriptors */
216 sensor_info_t sensor[MAX_SENSORS]; /* Internal descriptors */
217 int sensor_count; /* Detected sensors */
220 /* if the sensor has an _en attribute, we need to enable it */
221 int get_needs_enable(int dev_num, const char *tag)
223 char sysfs_path[PATH_MAX];
226 sprintf(sysfs_path, SENSOR_ENABLE_PATH, dev_num, tag);
228 fd = open(sysfs_path, O_RDWR);
236 static void setup_properties_from_pld (int s, int panel, int rotation,
240 * Generate suitable order and opt_scale directives from the PLD panel
241 * and rotation codes we got. This can later be superseded by the usual
242 * properties if necessary. Eventually we'll need to replace these
243 * mechanisms by a less convoluted one, such as a 3x3 placement matrix.
250 int angle = rotation * 45;
252 /* Only deal with 3 axis chips for now */
253 if (num_channels < 3)
256 if (panel == PANEL_BACK) {
257 /* Chip placed on the back panel ; negate x and z */
263 case 90: /* 90° clockwise: negate y then swap x,y */
268 case 180: /* Upside down: negate x and y */
273 case 270: /* 90° counter clockwise: negate x then swap x,y */
280 sensor[s].order[0] = 1;
281 sensor[s].order[1] = 0;
282 sensor[s].order[2] = 2;
283 sensor[s].quirks |= QUIRK_FIELD_ORDERING;
286 sensor[s].channel[0].opt_scale = x;
287 sensor[s].channel[1].opt_scale = y;
288 sensor[s].channel[2].opt_scale = z;
292 static int is_valid_pld (int panel, int rotation)
294 if (panel != PANEL_FRONT && panel != PANEL_BACK) {
295 ALOGW("Unhandled PLD panel spec: %d\n", panel);
299 /* Only deal with 90° rotations for now */
300 if (rotation < 0 || rotation > 7 || (rotation & 1)) {
301 ALOGW("Unhandled PLD rotation spec: %d\n", rotation);
309 static int read_pld_from_properties (int s, int* panel, int* rotation)
313 if (sensor_get_prop(s, "panel", &p))
316 if (sensor_get_prop(s, "rotation", &r))
319 if (!is_valid_pld(p, r))
325 ALOGI("S%d PLD from properties: panel=%d, rotation=%d\n", s, p, r);
331 static int read_pld_from_sysfs (int s, int dev_num, int* panel, int* rotation)
333 char sysfs_path[PATH_MAX];
336 sprintf(sysfs_path, BASE_PATH "../firmware_node/pld/panel", dev_num);
338 if (sysfs_read_int(sysfs_path, &p))
341 sprintf(sysfs_path, BASE_PATH "../firmware_node/pld/rotation", dev_num);
343 if (sysfs_read_int(sysfs_path, &r))
346 if (!is_valid_pld(p, r))
352 ALOGI("S%d PLD from sysfs: panel=%d, rotation=%d\n", s, p, r);
358 static void decode_placement_information (int dev_num, int num_channels, int s)
361 * See if we have optional "physical location of device" ACPI tags.
362 * We're only interested in panel and rotation specifiers. Use the
363 * .panel and .rotation properties in priority, and the actual ACPI
364 * values as a second source.
370 if (read_pld_from_properties(s, &panel, &rotation) &&
371 read_pld_from_sysfs(s, dev_num, &panel, &rotation))
372 return; /* No PLD data available */
374 /* Map that to field ordering and scaling mechanisms */
375 setup_properties_from_pld(s, panel, rotation, num_channels);
379 static void populate_descriptors (int s, int sensor_type)
381 int32_t min_delay_us;
382 max_delay_t max_delay_us;
384 /* Initialize Android-visible descriptor */
385 sensor_desc[s].name = sensor_get_name(s);
386 sensor_desc[s].vendor = sensor_get_vendor(s);
387 sensor_desc[s].version = sensor_get_version(s);
388 sensor_desc[s].handle = s;
389 sensor_desc[s].type = sensor_type;
391 sensor_desc[s].maxRange = sensor_get_max_range(s);
392 sensor_desc[s].resolution = sensor_get_resolution(s);
393 sensor_desc[s].power = sensor_get_power(s);
394 sensor_desc[s].stringType = sensor_get_string_type(s);
396 /* None of our supported sensors requires a special permission */
397 sensor_desc[s].requiredPermission = "";
399 sensor_desc[s].flags = sensor_get_flags(s);
400 sensor_desc[s].minDelay = sensor_get_min_delay(s);
401 sensor_desc[s].maxDelay = sensor_get_max_delay(s);
403 ALOGV("Sensor %d (%s) type(%d) minD(%d) maxD(%d) flags(%2.2x)\n",
404 s, sensor[s].friendly_name, sensor_desc[s].type,
405 sensor_desc[s].minDelay, sensor_desc[s].maxDelay,
406 sensor_desc[s].flags);
408 /* We currently do not implement batching */
409 sensor_desc[s].fifoReservedEventCount = 0;
410 sensor_desc[s].fifoMaxEventCount = 0;
412 min_delay_us = sensor_desc[s].minDelay;
413 max_delay_us = sensor_desc[s].maxDelay;
415 sensor[s].min_supported_rate = max_delay_us ? 1000000.0 / max_delay_us : 1;
416 sensor[s].max_supported_rate = min_delay_us && min_delay_us != -1 ? 1000000.0 / min_delay_us : 0;
420 static void add_virtual_sensor (int catalog_index)
425 if (sensor_count == MAX_SENSORS) {
426 ALOGE("Too many sensors!\n");
430 sensor_type = sensor_catalog[catalog_index].type;
434 sensor[s].is_virtual = 1;
435 sensor[s].catalog_index = catalog_index;
436 sensor[s].type = sensor_type;
438 populate_descriptors(s, sensor_type);
440 /* Initialize fields related to sysfs reads offloading */
441 sensor[s].thread_data_fd[0] = -1;
442 sensor[s].thread_data_fd[1] = -1;
443 sensor[s].acquisition_thread = -1;
449 static void add_sensor (int dev_num, int catalog_index, int mode)
454 char sysfs_path[PATH_MAX];
461 char suffix[MAX_NAME_SIZE + 8];
464 if (sensor_count == MAX_SENSORS) {
465 ALOGE("Too many sensors!\n");
469 sensor_type = sensor_catalog[catalog_index].type;
472 * At this point we could check that the expected sysfs attributes are
473 * present ; that would enable having multiple catalog entries with the
474 * same sensor type, accomodating different sets of sysfs attributes.
479 sensor[s].dev_num = dev_num;
480 sensor[s].catalog_index = catalog_index;
481 sensor[s].type = sensor_type;
482 sensor[s].mode = mode;
484 num_channels = sensor_catalog[catalog_index].num_channels;
486 if (mode == MODE_POLL)
487 sensor[s].num_channels = 0;
489 sensor[s].num_channels = num_channels;
491 prefix = sensor_catalog[catalog_index].tag;
494 * receiving the illumination sensor calibration inputs from
495 * the Android properties and setting it within sysfs
497 if (sensor_type == SENSOR_TYPE_LIGHT) {
498 retval = sensor_get_illumincalib(s);
500 sprintf(sysfs_path, ILLUMINATION_CALIBPATH, dev_num);
501 sysfs_write_int(sysfs_path, retval);
506 * See if we have optional calibration biases for each of the channels of this sensor. These would be expressed using properties like
507 * iio.accel.y.calib_bias = -1, or possibly something like iio.temp.calib_bias if the sensor has a single channel. This value gets stored in the
508 * relevant calibbias sysfs file if that file can be located and then used internally by the iio sensor driver.
512 for (c = 0; c < num_channels; c++) {
513 ch_name = sensor_catalog[catalog_index].channel[c].name;
514 sprintf(suffix, "%s.calib_bias", ch_name);
515 if (!sensor_get_prop(s, suffix, &calib_bias) && calib_bias) {
516 sprintf(suffix, "%s_%s", prefix, sensor_catalog[catalog_index].channel[c].name);
517 sprintf(sysfs_path, SENSOR_CALIB_BIAS_PATH, dev_num, suffix);
518 sysfs_write_int(sysfs_path, calib_bias);
522 if (!sensor_get_prop(s, "calib_bias", &calib_bias) && calib_bias) {
523 sprintf(sysfs_path, SENSOR_CALIB_BIAS_PATH, dev_num, prefix);
524 sysfs_write_int(sysfs_path, calib_bias);
527 /* Read name attribute, if available */
528 sprintf(sysfs_path, NAME_PATH, dev_num);
529 sysfs_read_str(sysfs_path, sensor[s].internal_name, MAX_NAME_SIZE);
531 /* See if we have general offsets and scale values for this sensor */
533 sprintf(sysfs_path, SENSOR_OFFSET_PATH, dev_num, prefix);
534 sysfs_read_float(sysfs_path, &sensor[s].offset);
536 sprintf(sysfs_path, SENSOR_SCALE_PATH, dev_num, prefix);
537 if (!sensor_get_fl_prop(s, "scale", &scale)) {
539 * There is a chip preferred scale specified,
540 * so try to store it in sensor's scale file
542 if (sysfs_write_float(sysfs_path, scale) == -1 && errno == ENOENT) {
543 ALOGE("Failed to store scale[%g] into %s - file is missing", scale, sysfs_path);
544 /* Store failed, try to store the scale into channel specific file */
545 for (c = 0; c < num_channels; c++)
547 sprintf(sysfs_path, BASE_PATH "%s", dev_num,
548 sensor_catalog[catalog_index].channel[c].scale_path);
549 if (sysfs_write_float(sysfs_path, scale) == -1)
550 ALOGE("Failed to store scale[%g] into %s", scale, sysfs_path);
555 sprintf(sysfs_path, SENSOR_SCALE_PATH, dev_num, prefix);
556 if (!sysfs_read_float(sysfs_path, &scale)) {
557 sensor[s].scale = scale;
558 ALOGV("Scale path:%s scale:%g dev_num:%d\n",
559 sysfs_path, scale, dev_num);
563 /* Read channel specific scale if any*/
564 for (c = 0; c < num_channels; c++)
566 sprintf(sysfs_path, BASE_PATH "%s", dev_num,
567 sensor_catalog[catalog_index].channel[c].scale_path);
569 if (!sysfs_read_float(sysfs_path, &scale)) {
570 sensor[s].channel[c].scale = scale;
573 ALOGV( "Scale path:%s "
574 "channel scale:%g dev_num:%d\n",
575 sysfs_path, scale, dev_num);
580 /* Set default scaling - if num_channels is zero, we have one channel */
582 sensor[s].channel[0].opt_scale = 1;
584 for (c = 1; c < num_channels; c++)
585 sensor[s].channel[c].opt_scale = 1;
587 for (c = 0; c < num_channels; c++) {
588 /* Check the presence of the channel's input_path */
589 sprintf(sysfs_path, BASE_PATH "%s", dev_num,
590 sensor_catalog[catalog_index].channel[c].input_path);
591 sensor[s].channel[c].input_path_present = (access(sysfs_path, R_OK) != -1);
592 /* Check the presence of the channel's raw_path */
593 sprintf(sysfs_path, BASE_PATH "%s", dev_num,
594 sensor_catalog[catalog_index].channel[c].raw_path);
595 sensor[s].channel[c].raw_path_present = (access(sysfs_path, R_OK) != -1);
598 /* Read ACPI _PLD attributes for this sensor, if there are any */
599 decode_placement_information(dev_num, num_channels, s);
602 * See if we have optional correction scaling factors for each of the
603 * channels of this sensor. These would be expressed using properties
604 * like iio.accel.y.opt_scale = -1. In case of a single channel we also
605 * support things such as iio.temp.opt_scale = -1. Note that this works
606 * for all types of sensors, and whatever transform is selected, on top
607 * of any previous conversions.
611 for (c = 0; c < num_channels; c++) {
612 ch_name = sensor_catalog[catalog_index].channel[c].name;
613 sprintf(suffix, "%s.opt_scale", ch_name);
614 if (!sensor_get_fl_prop(s, suffix, &opt_scale))
615 sensor[s].channel[c].opt_scale = opt_scale;
618 if (!sensor_get_fl_prop(s, "opt_scale", &opt_scale))
619 sensor[s].channel[0].opt_scale = opt_scale;
621 populate_descriptors(s, sensor_type);
623 /* Populate the quirks array */
624 sensor_get_quirks(s);
626 if (sensor[s].internal_name[0] == '\0') {
628 * In case the kernel-mode driver doesn't expose a name for
629 * the iio device, use (null)-dev%d as the trigger name...
630 * This can be considered a kernel-mode iio driver bug.
632 ALOGW("Using null trigger on sensor %d (dev %d)\n", s, dev_num);
633 strcpy(sensor[s].internal_name, "(null)");
636 switch (sensor_type) {
637 case SENSOR_TYPE_ACCELEROMETER:
638 /* Only engage accelerometer bias compensation if really needed */
639 if (sensor_get_quirks(s) & QUIRK_BIASED)
640 sensor[s].cal_data = calloc(1, sizeof(accel_cal_t));
643 case SENSOR_TYPE_GYROSCOPE:
644 sensor[s].cal_data = malloc(sizeof(gyro_cal_t));
647 case SENSOR_TYPE_MAGNETIC_FIELD:
648 sensor[s].cal_data = malloc(sizeof(compass_cal_t));
652 sensor[s].max_cal_level = sensor_get_cal_steps(s);
654 /* Select one of the available sensor sample processing styles */
657 /* Initialize fields related to sysfs reads offloading */
658 sensor[s].thread_data_fd[0] = -1;
659 sensor[s].thread_data_fd[1] = -1;
660 sensor[s].acquisition_thread = -1;
662 /* Check if we have a special ordering property on this sensor */
663 if (sensor_get_order(s, sensor[s].order))
664 sensor[s].quirks |= QUIRK_FIELD_ORDERING;
666 sensor[s].needs_enable = get_needs_enable(dev_num, sensor_catalog[catalog_index].tag);
671 static void virtual_sensors_check (void)
679 int gyro_cal_idx = 0;
680 int magn_cal_idx = 0;
683 for (i=0; i<sensor_count; i++)
684 switch (sensor[i].type) {
685 case SENSOR_TYPE_ACCELEROMETER:
688 case SENSOR_TYPE_GYROSCOPE:
692 case SENSOR_TYPE_MAGNETIC_FIELD:
696 case SENSOR_TYPE_ORIENTATION:
699 case SENSOR_TYPE_ROTATION_VECTOR:
704 for (j=0; j<catalog_size; j++)
705 switch (sensor_catalog[j].type) {
707 * If we have accel + gyro + magn but no rotation vector sensor,
708 * SensorService replaces the HAL provided orientation sensor by the
709 * AOSP version... provided we report one. So initialize a virtual
710 * orientation sensor with zero values, which will get replaced. See:
711 * frameworks/native/services/sensorservice/SensorService.cpp, looking
712 * for SENSOR_TYPE_ROTATION_VECTOR; that code should presumably fall
713 * back to mUserSensorList.add instead of replaceAt, but accommodate it.
716 case SENSOR_TYPE_ORIENTATION:
717 if (has_acc && has_gyr && has_mag && !has_rot && !has_ori)
718 add_sensor(0, j, MODE_POLL);
720 case SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
722 sensor[sensor_count].base_count = 1;
723 sensor[sensor_count].base[0] = gyro_cal_idx;
724 add_virtual_sensor(j);
727 case SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
729 sensor[sensor_count].base_count = 1;
730 sensor[sensor_count].base[0] = magn_cal_idx;
731 add_virtual_sensor(j);
740 static void propose_new_trigger (int s, char trigger_name[MAX_NAME_SIZE],
744 * A new trigger has been enumerated for this sensor. Check if it makes sense to use it over the currently selected one,
745 * and select it if it is so. The format is something like sensor_name-dev0.
748 const char *suffix = trigger_name + sensor_name_len + 1;
750 /* dev is the default, and lowest priority; no need to update */
751 if (!memcmp(suffix, "dev", 3))
754 /* If we found any-motion trigger, record it */
756 if (!memcmp(suffix, "any-motion-", 11)) {
757 strcpy(sensor[s].motion_trigger_name, trigger_name);
762 * It's neither the default "dev" nor an "any-motion" one. Make sure we use this though, as we may not have any other indication of the name
763 * of the trigger to use with this sensor.
765 strcpy(sensor[s].init_trigger_name, trigger_name);
769 static void update_sensor_matching_trigger_name (char name[MAX_NAME_SIZE])
772 * Check if we have a sensor matching the specified trigger name, which should then begin with the sensor name, and end with a number
773 * equal to the iio device number the sensor is associated to. If so, update the string we're going to write to trigger/current_trigger
774 * when enabling this sensor.
784 * First determine the iio device number this trigger refers to. We expect the last few characters (typically one) of the trigger name
785 * to be this number, so perform a few checks.
787 len = strnlen(name, MAX_NAME_SIZE);
792 cursor = name + len - 1;
794 if (!isdigit(*cursor))
797 while (len && isdigit(*cursor)) {
802 dev_num = atoi(cursor+1);
804 /* See if that matches a sensor */
805 for (s=0; s<sensor_count; s++)
806 if (sensor[s].dev_num == dev_num) {
808 sensor_name_len = strlen(sensor[s].internal_name);
810 if (!strncmp(name, sensor[s].internal_name, sensor_name_len))
811 /* Switch to new trigger if appropriate */
812 propose_new_trigger(s, name, sensor_name_len);
817 static void setup_trigger_names (void)
819 char filename[PATH_MAX];
820 char buf[MAX_NAME_SIZE];
825 /* By default, use the name-dev convention that most drivers use */
826 for (s=0; s<sensor_count; s++)
827 snprintf(sensor[s].init_trigger_name, MAX_NAME_SIZE, "%s-dev%d", sensor[s].internal_name, sensor[s].dev_num);
829 /* Now have a look to /sys/bus/iio/devices/triggerX entries */
831 for (trigger=0; trigger<MAX_TRIGGERS; trigger++) {
833 snprintf(filename, sizeof(filename), TRIGGER_FILE_PATH,trigger);
835 ret = sysfs_read_str(filename, buf, sizeof(buf));
840 /* Record initial and any-motion triggers names */
841 update_sensor_matching_trigger_name(buf);
845 * Certain drivers expose only motion triggers even though they should be continous. For these, use the default trigger name as the motion
846 * trigger. The code generating intermediate events is dependent on motion_trigger_name being set to a non empty string.
849 for (s=0; s<sensor_count; s++)
850 if ((sensor[s].quirks & QUIRK_TERSE_DRIVER) && sensor[s].motion_trigger_name[0] == '\0')
851 strcpy(sensor[s].motion_trigger_name, sensor[s].init_trigger_name);
853 for (s=0; s<sensor_count; s++)
854 if (sensor[s].mode == MODE_TRIGGER) {
855 ALOGI("Sensor %d (%s) default trigger: %s\n", s, sensor[s].friendly_name, sensor[s].init_trigger_name);
856 if (sensor[s].motion_trigger_name[0])
857 ALOGI("Sensor %d (%s) motion trigger: %s\n", s, sensor[s].friendly_name, sensor[s].motion_trigger_name);
861 void enumerate_sensors (void)
864 * Discover supported sensors and allocate control structures for them. Multiple sensors can potentially rely on a single iio device (each
865 * using their own channels). We can't have multiple sensors of the same type on the same device. In case of detection as both a poll-mode
866 * and trigger-based sensor, use the trigger usage mode.
868 char poll_sensors[catalog_size];
869 char trig_sensors[catalog_size];
870 char event_sensors[catalog_size];
875 for (dev_num=0; dev_num<MAX_DEVICES; dev_num++) {
878 discover_sensors(dev_num, BASE_PATH, poll_sensors, check_poll_sensors);
879 discover_sensors(dev_num, CHANNEL_PATH, trig_sensors, check_trig_sensors);
880 discover_sensors(dev_num, EVENTS_PATH, event_sensors, check_event_sensors);
882 for (i=0; i<catalog_size; i++) {
883 if (event_sensors[i]) {
884 add_sensor(dev_num, i, MODE_EVENT);
887 if (trig_sensors[i]) {
888 add_sensor(dev_num, i, MODE_TRIGGER);
892 if (poll_sensors[i]) {
893 add_sensor(dev_num, i, MODE_POLL);
899 build_sensor_report_maps(dev_num);
902 ALOGI("Discovered %d sensors\n", sensor_count);
904 /* Set up default - as well as custom - trigger names */
905 setup_trigger_names();
907 virtual_sensors_check();
911 void delete_enumeration_data (void)
914 for (i = 0; i < sensor_count; i++)
915 if (sensor[i].cal_data) {
916 free(sensor[i].cal_data);
917 sensor[i].cal_data = NULL;
918 sensor[i].cal_level = 0;
921 /* Reset sensor count */
926 int get_sensors_list (__attribute__((unused)) struct sensors_module_t* module,
927 struct sensor_t const** list)