OSDN Git Service

android-x86/hardware-libsensors.git
2 years agoMerge remote-tracking branch 'x86/nougat-x86' into oreo-x86 oreo-x86 pie-x86 q-x86 r-x86 s-x86
Chih-Wei Huang [Thu, 17 Mar 2022 09:26:03 +0000 (17:26 +0800)]
Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86

2 years agokbdsensor: fix parsing of input device name nougat-x86
Chih-Wei Huang [Thu, 17 Mar 2022 09:25:27 +0000 (17:25 +0800)]
kbdsensor: fix parsing of input device name

Originally we use %s in sscanf to get the device name from the property.
However, %s only matches a sequence of non-white-space characters. That
means if the name contains space characters, it can't be parsed correctly.

The patch uses strsep to extract the substring before the first delimiter
as the device name.

4 years agoMerge remote-tracking branch 'x86/nougat-x86' into oreo-x86 android-x86-8.1-r3 android-x86-8.1-r4 android-x86-8.1-r5 android-x86-8.1-r6 android-x86-9.0-r1 android-x86-9.0-r2
Chih-Wei Huang [Tue, 2 Jul 2019 04:03:18 +0000 (12:03 +0800)]
Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86

4 years agokbdsensor: fix uninitialized error android-x86-7.1-r3 android-x86-7.1-r4 android-x86-7.1-r5
Chih-Wei Huang [Tue, 2 Jul 2019 03:55:43 +0000 (11:55 +0800)]
kbdsensor: fix uninitialized error

Initialize the struct sensors_poll_device_1 to zero, otherwise some
members may have unexpected value which causes crashing.

5 years agoRemove unused variables and labels android-x86-8.1-r2
Chih-Wei Huang [Wed, 13 Mar 2019 04:31:00 +0000 (12:31 +0800)]
Remove unused variables and labels

6 years agoMove libraries to /vendor android-x86-8.1-r1
Chih-Wei Huang [Wed, 11 Apr 2018 08:11:31 +0000 (16:11 +0800)]
Move libraries to /vendor

As part of Treble project in Android O, all the device specific files
have to be located in the vendor partition.

6 years agokbdsensor: fix system_server high load issue android-x86-7.1-r2
Chih-Wei Huang [Wed, 11 Apr 2018 07:19:34 +0000 (15:19 +0800)]
kbdsensor: fix system_server high load issue

After the change 1f9a8a2e, if the sensor is invalid, the polling method
will return immediately without any way to throttle the number of
executions of the main sensor thread loop. That causes CPU high load.

Indeed the HAL should not set the pointer of struct hw_device_t if the
initialization fails. Then the SensorService won't enable and poll the
sensor device.

Fixes: 1f9a8a2e (kbdsensor: update HAL version to 1_3)
Tested-by: Michael Goffioul <michael.goffioul@gmail.com>
6 years agoAdd back old sensors.iio and rename it android-x86-7.1-r1
Chih-Wei Huang [Tue, 6 Feb 2018 09:41:04 +0000 (17:41 +0800)]
Add back old sensors.iio and rename it

Rename it to sensors.iio-old so it could be built again.
Some people still want to use it.

6 years agoAdd back the setDelay function
Chih-Wei Huang [Tue, 30 Jan 2018 06:04:53 +0000 (14:04 +0800)]
Add back the setDelay function

According to https://source.android.com/devices/sensors/versioning

"Implement the batch function

... It replaces setDelay. setDelay will not be called anymore."

However, it is wrong. The setDelay is still called sometimes
as show in the system_server crashing log:

01-26 18:36:11.536 27879 27879 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-26 18:36:11.536 27879 27879 F DEBUG   : Build fingerprint: 'Android-x86/android_x86_64/x86_64:7.1.2/N2G48H/cwhuan01041741:userdebug/test-keys'
01-26 18:36:11.536 27879 27879 F DEBUG   : Revision: '0'
01-26 18:36:11.537 27879 27879 F DEBUG   : ABI: 'x86_64'
01-26 18:36:11.537 27879 27879 F DEBUG   : pid: 24500, tid: 27162, name: Binder:24500_12  >>> system_server <<<
01-26 18:36:11.537 27879 27879 F DEBUG   : signal 11 (SIGSEGV), code 128 (SI_KERNEL), fault addr 0x0
01-26 18:36:11.537 27879 27879 F DEBUG   :     rax 332f83dbf746df52  rbx 0000794e04c48500  rcx 0000000000000000  rdx 0000000001312d00
01-26 18:36:11.537 27879 27879 F DEBUG   :     rsi 0000000000000000  rdi 0000794e04d19000
01-26 18:36:11.537 27879 27879 F DEBUG   :     r8  0000794df0f4f7b0  r9  0000794e0c62d47a  r10 000000000000006e  r11 0000000000000246
01-26 18:36:11.537 27879 27879 F DEBUG   :     r12 0000794e04c1b938  r13 0000000001312d00  r14 0000794e04c48518  r15 0000000000000000
01-26 18:36:11.537 27879 27879 F DEBUG   :     cs  0000000000000033  ss  000000000000002b
01-26 18:36:11.537 27879 27879 F DEBUG   :     rip 0000794e0af228ca  rbp 0000794e04c1b920  rsp 0000794decc04fc0  eflags 0000000000010206
01-26 18:36:11.542 27879 27879 F DEBUG   :
01-26 18:36:11.542 27879 27879 F DEBUG   : backtrace:
01-26 18:36:11.542 27879 27879 F DEBUG   :     #00 pc 00000000000128ca  /system/lib64/libsensorservice.so
01-26 18:36:11.542 27879 27879 F DEBUG   :     #01 pc 000000000001e51b  /system/lib64/libsensorservice.so
01-26 18:36:11.542 27879 27879 F DEBUG   :     #02 pc 00000000000151af  /system/lib64/libsensorservice.so

6 years agoDisable my sensors.iio
Chih-Wei Huang [Fri, 29 Dec 2017 06:28:27 +0000 (14:28 +0800)]
Disable my sensors.iio

Switch to android-iio-sensors-hal of 01.org.

6 years agoiio-sensors: avoid memset a dynamic class
Chih-Wei Huang [Thu, 23 Nov 2017 06:18:27 +0000 (14:18 +0800)]
iio-sensors: avoid memset a dynamic class

A dynamic class doesn't support static initialization. The compiler
complains:

hardware/libsensors/iio-sensors.cpp:119:9: warning: destination for this 'memset' call is a pointer to dynamic class 'SensorBase'; vtable pointer will be overwritten [-Wdynamic-class-memaccess]
        memset(this, 0, sizeof(SensorBase));
        ~~~~~~ ^

Move all data members of SensorBase to a trivial class which could be
statically initialized.

Refer: http://en.cppreference.com/w/cpp/types/is_trivial

6 years agow500_sensor: update HAL version to 1_3
Chih-Wei Huang [Thu, 23 Nov 2017 03:59:29 +0000 (11:59 +0800)]
w500_sensor: update HAL version to 1_3

6 years agos103t_sensor: update HAL version to 1_3
Chih-Wei Huang [Wed, 22 Nov 2017 10:33:59 +0000 (18:33 +0800)]
s103t_sensor: update HAL version to 1_3

6 years agohdaps: update HAL version to 1_3
Chih-Wei Huang [Wed, 22 Nov 2017 10:22:05 +0000 (18:22 +0800)]
hdaps: update HAL version to 1_3

6 years agoiio-sensors: update HAL version to 1_3
Chih-Wei Huang [Wed, 22 Nov 2017 09:42:59 +0000 (17:42 +0800)]
iio-sensors: update HAL version to 1_3

6 years agokbdsensor: update HAL version to 1_3
Chih-Wei Huang [Wed, 22 Nov 2017 07:59:29 +0000 (15:59 +0800)]
kbdsensor: update HAL version to 1_3

7 years agoiio-sensors: add the missing closedir marshmallow-x86 android-x86-6.0-r1 android-x86-6.0-r2 android-x86-6.0-r3
Chih-Wei Huang [Mon, 25 Jul 2016 08:07:20 +0000 (16:07 +0800)]
iio-sensors: add the missing closedir

8 years agoiio-sensors: support conversion matrix gyroscope
Mario Holzinger [Fri, 25 Mar 2016 22:46:15 +0000 (23:46 +0100)]
iio-sensors: support conversion matrix gyroscope

With the prop hal.sensors.iio.anglvel.matrix=f1x,f1y,f1z,f2x,f2y,f2z,f3x,f3y,f3z
it is possible to manipulate the sensors directions and assignment to the
corresponding axes. The default is
hal.sensors.iio.anglvel.matrix=1,0,0,0,1,0,0,0,1

8 years agoiio-sensors: support conversion matrix magnetic field
Mario Holzinger [Fri, 25 Mar 2016 22:39:24 +0000 (23:39 +0100)]
iio-sensors: support conversion matrix magnetic field

With the prop hal.sensors.iio.magn.matrix=f1x,f1y,f1z,f2x,f2y,f2z,f3x,f3y,f3z
it is possible to manipulate the sensors directions and assignment to the
corresponding axes. The default is
hal.sensors.iio.magn.matrix=1,0,0,0,1,0,0,0,1

8 years agoiio-sensors: support conversion matrix acceleration
Mario Holzinger [Fri, 25 Mar 2016 13:09:21 +0000 (14:09 +0100)]
iio-sensors: support conversion matrix acceleration

With the prop hal.sensors.iio.accel.matrix=f1x,f1y,f1z,f2x,f2y,f2z,f3x,f3y,f3z
it is possible to manipulate accel sensors directions and assignment to the
corresponding axes. The default is
hal.sensors.iio.accel.matrix=-1,0,0,0,1,0,0,0,-1

8 years agoFix iio sensors crashing
Chih-Wei Huang [Tue, 29 Dec 2015 17:30:23 +0000 (01:30 +0800)]
Fix iio sensors crashing

Fix the incorrect condition to end the loop of probing.

8 years agoFix the building issues on Android 6.0
Chih-Wei Huang [Sat, 10 Oct 2015 17:51:33 +0000 (01:51 +0800)]
Fix the building issues on Android 6.0

The stlport is gone.

8 years agoenable multiarch builds for iio-sensors lollipop-x86
Chih-Wei Huang [Fri, 5 Jun 2015 23:35:02 +0000 (07:35 +0800)]
enable multiarch builds for iio-sensors

8 years agoMerge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
Chih-Wei Huang [Fri, 5 Jun 2015 23:37:08 +0000 (07:37 +0800)]
Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86

8 years agoiio-sensors: initial porting for iio based sensors kitkat-x86 android-x86-4.4-r3
Chih-Wei Huang [Sun, 24 May 2015 16:36:41 +0000 (00:36 +0800)]
iio-sensors: initial porting for iio based sensors

9 years agoenable multiarch builds
Chih-Wei Huang [Thu, 6 Nov 2014 02:58:59 +0000 (10:58 +0800)]
enable multiarch builds

Convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH
to support 64-bit targets.

9 years agokbdsensor: fix building issues on Android 5.0
Chih-Wei Huang [Mon, 20 Oct 2014 10:20:36 +0000 (18:20 +0800)]
kbdsensor: fix building issues on Android 5.0

More fields are added to struct sensor_t.

9 years agohdaps: add support for ST LIS302DL (Acer 1425P/1825PTZ) android-x86-4.4-r1 android-x86-4.4-r2
Tanguy Pruvot [Sat, 14 Jun 2014 13:06:39 +0000 (15:06 +0200)]
hdaps: add support for ST LIS302DL (Acer 1425P/1825PTZ)

Allow also to tune axis signs and to swap axis like X<>Y

setprop hal.sensors.axis.revert "1,-1,1" # to revert Y axis
setprop hal.sensors.axis.order "1,0,2" # for Y,X,Z

This could be required for tablet pc with Accelerometers in Base
and not in Screen part (Acer 1425P has a rotative screen)

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
9 years agokbdsensor: fix crashing if no device found
Chih-Wei Huang [Fri, 27 Jun 2014 11:55:39 +0000 (19:55 +0800)]
kbdsensor: fix crashing if no device found

9 years agow500: fix loop segfault in input devices list
Tanguy Pruvot [Fri, 13 Jun 2014 21:44:41 +0000 (23:44 +0200)]
w500: fix loop segfault in input devices list

9 years agohdaps: support Pegatron Lucid Tablet Accelerometer
Chih-Wei Huang [Wed, 26 Feb 2014 02:24:00 +0000 (10:24 +0800)]
hdaps: support Pegatron Lucid Tablet Accelerometer

10 years agoadd reverse button rotation
Kyle Evans [Mon, 10 Jun 2013 15:43:02 +0000 (10:43 -0500)]
add reverse button rotation

10 years agoallow one button rotation to be soft coded.
Kyle Evans [Mon, 10 Jun 2013 15:35:52 +0000 (10:35 -0500)]
allow one button rotation to be soft coded.

10 years agokbdsensor: fix kitkat-x86 building errors
Chih-Wei Huang [Wed, 25 Sep 2013 02:24:00 +0000 (10:24 +0800)]
kbdsensor: fix kitkat-x86 building errors

11 years agoadd WMI hotkey support
Kyle Evans [Tue, 12 Feb 2013 18:38:26 +0000 (13:38 -0500)]
add WMI hotkey support

SW_TABLET_MODE & KEY_DIRECTION, these are two events common to tablet
PC's. The first detects when the laptop is entering tablet mode and
rotates the screen to 90 if not already rotated, then back to 0 when
returning to laptop mode. The second is just a single button rotation
that can still be used when the keyboard is covered up.

11 years agoupdate for jb-x86
Chih-Wei Huang [Mon, 4 Feb 2013 08:35:44 +0000 (16:35 +0800)]
update for jb-x86

Now all sensors libraries are built into the iso image.
Use the property hal.sensors to select the correct one.

11 years agoallow to select rotation keys at runtime
Chih-Wei Huang [Sun, 3 Feb 2013 02:28:21 +0000 (10:28 +0800)]
allow to select rotation keys at runtime

hal.sensors.kbd.keys - define all keys configuration
hal.sensors.kbd.type - predefined configuration type

11 years agoadd s103t_sensor.c for S10-3t tablet
Chih-Wei Huang [Sun, 15 Jul 2012 11:04:08 +0000 (19:04 +0800)]
add s103t_sensor.c for S10-3t tablet

Moved from libsensors_s103t of device/lenovo/s103t with a bugfix.

12 years agoadd alternate button config, F5-F8
Kyle Evans [Thu, 1 Mar 2012 18:44:57 +0000 (13:44 -0500)]
add alternate button config, F5-F8

12 years agoadd module for HDAPS accelerometer found in many IBM Thinkpads
Stefan Seidel [Fri, 10 Feb 2012 16:24:24 +0000 (17:24 +0100)]
add module for HDAPS accelerometer found in many IBM Thinkpads

12 years agoremove remapping keys via uinput
Chih-Wei Huang [Fri, 3 Feb 2012 06:49:22 +0000 (14:49 +0800)]
remove remapping keys via uinput

Now we use the keylayout file to remap or ignore key events.

12 years agofix ics rotation issue
Chih-Wei Huang [Thu, 2 Feb 2012 14:03:35 +0000 (22:03 +0800)]
fix ics rotation issue

The ics framework checks the events more restrictly.
The timestamp delta must be less than one second.

Use clock_gettime() to get more precise timestamp,
suggested by RvdB.

12 years agosupport rotation keys configuration honeycomb-x86
Chih-Wei Huang [Sun, 13 Nov 2011 07:25:02 +0000 (15:25 +0800)]
support rotation keys configuration

12 years agofix issues on honeycomb-x86
Chih-Wei Huang [Tue, 16 Aug 2011 02:21:05 +0000 (10:21 +0800)]
fix issues on honeycomb-x86

13 years agoupdate to use new sensor interface of gingerbread gingerbread-x86
Chih-Wei Huang [Wed, 20 Apr 2011 08:37:39 +0000 (16:37 +0800)]
update to use new sensor interface of gingerbread

13 years agochange to C++ style struct initializer
Chih-Wei Huang [Tue, 19 Apr 2011 07:54:10 +0000 (15:54 +0800)]
change to C++ style struct initializer

13 years agoinitial import of kbdsensor
Chih-Wei Huang [Thu, 24 Mar 2011 08:05:10 +0000 (16:05 +0800)]
initial import of kbdsensor