X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=enumeration.c;h=359fa90cfae4c12843c06d1aa78acac726beba10;hb=refs%2Ftags%2Fandroid-x86-8.1-r2;hp=f4f2afe8894c7bf7456b749b3c7a0a41005d0fce;hpb=2b340a9c6849f3d53adcb9c76b22a62e7eb1fdc4;p=android-x86%2Fhardware-intel-libsensors.git diff --git a/enumeration.c b/enumeration.c index f4f2afe..359fa90 100644 --- a/enumeration.c +++ b/enumeration.c @@ -651,10 +651,10 @@ static int add_sensor (int dev_num, int catalog_index, int mode) /* Set default scaling - if num_channels is zero, we have one channel */ - sensor[s].channel[0].opt_scale = 1; + sensor[s].channel[0].opt_scale = (sensor_type == SENSOR_TYPE_ACCELEROMETER) ? -1 : 1; for (c = 1; c < num_channels; c++) - sensor[s].channel[c].opt_scale = 1; + sensor[s].channel[c].opt_scale = sensor[s].channel[0].opt_scale; for (c = 0; c < num_channels; c++) { /* Check the presence of the channel's input_path */ @@ -689,7 +689,7 @@ static int add_sensor (int dev_num, int catalog_index, int mode) ch_name = sensor_catalog[catalog_index].channel[c].name; sprintf(suffix, "%s.opt_scale", ch_name); if (!sensor_get_fl_prop(s, suffix, &opt_scale)) - sensor[s].channel[c].opt_scale = opt_scale; + sensor[s].channel[c].opt_scale *= opt_scale; } } else { if (!sensor_get_fl_prop(s, "opt_scale", &opt_scale))