Patch: Fix some sensors and new device.

351 views
Skip to first unread message

André Vitor

unread,
Dec 23, 2014, 9:42:38 PM12/23/14
to andro...@googlegroups.com
The following patches will fix accelerometer(!) and orientation sensors to work properly plus support baytrail device Zmax B10T (Brazilian Zmax Windows Tablet) (Only kernel 3.16+).

A note to the accelerometer sensor: The X-axis and Y-axis may be wrong for some devices (or all), I don't know if it was only my device but its X-axis is being to right from landscape screen and Y-axis to the top as well from landscape screen, that's actually correct but this landscape screen is seen as portrait to the sensor.

This is messing up with apps which uses accelerometer.

I don't know if android tablets really do work like this though, I don't own one.

Otherwise orientation sensor is showing correct data even with this problem plus rotation screen is fully functional.
add_intel_hsb_sensor.patch
add_zmax_b10t_device.patch
fix_intel_hal_sensors.patch

Chih-Wei Huang

unread,
Dec 24, 2014, 1:25:35 AM12/24/14
to Android-x86
Thank you for the patches.

add_intel_hsb_sensor.patch is not necessary since
sensors.hsb is already added in device/generic/x86/packages.mk
(unless you didn't build the android_x86 target)

For add_zmax_b10t_device.patch, do you think
adding it behind *T*00LA* would be simpler?
(though it may add modules you don't need)

diff --git a/init.sh b/init.sh
index 9c7ea17..a8b33e5 100644
--- a/init.sh
+++ b/init.sh
@@ -142,7 +142,7 @@ function init_hal_power()
function init_hal_sensors()
{
case "$(cat $DMIPATH/uevent)" in
- *T*00LA*)
+ *T*00LA*|*Zmax*B10T*)
modprobe kfifo-buf
modprobe industrialio-triggered-buffer
modprobe hid-sensor-hub


For fix_intel_hal_sensors.patch,
I need to verify it doesn't change the behavior
of the devices I have. Stay tuned.

André Vitor

unread,
Dec 24, 2014, 7:14:42 AM12/24/14
to andro...@googlegroups.com
For add_zmax_b10t_device.patch, do you think 
adding it behind *T*00LA* would be simpler? 
(though it may add modules you don't need) 

When this device loads hid-sensor-gyro-3d the hal starts reading random data, so I though that would do something bad about the system.

About 'fix_intel_hal_sensors.patch' I needed this change to get the sensors from my baytrail tablet (Zmax B10T) to get working.

André Vitor

unread,
Dec 24, 2014, 7:32:53 AM12/24/14
to andro...@googlegroups.com
thought***

Maybe someone who have a T100 or any other baytrail device can test and verify if 'fix_intel_hal_sensors.patch' does changes to them.

Chih-Wei Huang

unread,
Dec 24, 2014, 10:15:56 AM12/24/14
to Android-x86
2014-12-24 20:14 GMT+08:00 André Vitor <andr...@gmail.com>:
>> For add_zmax_b10t_device.patch, do you think
>>
>> adding it behind *T*00LA* would be simpler?
>> (though it may add modules you don't need)
>
>
> When this device loads hid-sensor-gyro-3d the hal starts reading random
> data, so I though that would do something bad about the system.

OK. I will apply it.

> About 'fix_intel_hal_sensors.patch' I needed this change to get the sensors
> from my baytrail tablet (Zmax B10T) to get working.

Will test it.

Chih-Wei Huang

unread,
Dec 28, 2014, 7:22:43 AM12/28/14
to Android-x86
Hi André,
I've updated the sensor.hsb to be compatible with
the kernel 3.18 iio abi.
Please sync and test it:

repo sync hardware/intel/libsensors

and build it with kernel 3.18 (details in another mail thread already)

I also suggest remove the modprobe hid-sensor-*
in the init.sh. The new kernel seems automatically detect
the sensor hub and load the drivers correctly.

diff --git a/init.sh b/init.sh
index 7941a1e..2c0d605 100644
--- a/init.sh
+++ b/init.sh
@@ -142,16 +141,7 @@ function init_hal_power()
function init_hal_sensors()
{
case "$(cat $DMIPATH/uevent)" in
- *T*00LA*)
- modprobe kfifo-buf
- modprobe industrialio-triggered-buffer
- modprobe hid-sensor-hub
- modprobe hid-sensor-iio-common
- modprobe hid-sensor-trigger
- modprobe hid-sensor-accel-3d
- modprobe hid-sensor-gyro-3d
- modprobe hid-sensor-als
- modprobe hid-sensor-magn-3d
+ *T*00LA*|*Zmax*B10T*)
sleep 1; busybox chown -R 1000.1000
/sys/bus/iio/devices/iio:device?/
set_property hal.sensors hsb
;;

Let me know if it works for you.
If not, please show me the result of

cat /sys/bus/iio/devices/iio:device?/in_accel_scale


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

André Vitor

unread,
Dec 28, 2014, 1:37:52 PM12/28/14
to andro...@googlegroups.com
It's working perfectly.
Reply all
Reply to author
Forward
0 new messages