Updated init.sh to support the accelerometer of HP laptops

206 views
Skip to first unread message

Suici Doga

unread,
Jun 6, 2016, 4:20:30 AM6/6/16
to Android-x86
I edited the init.sh file by adding the following entry after the ThinkPad tablet entry

<code>
*HPPaviliong*)
hal_sensors=hdaps
;;
</code>

Now my HP laptop's accelerometer is working in Android x86 (Remix OS also). This should also be for other HP laptops , not only the g series.

Chih-Wei Huang

unread,
Jun 6, 2016, 9:37:47 PM6/6/16
to Android-x86
Thank you. I'll add it.


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

Suici Doga

unread,
Jun 7, 2016, 7:58:44 AM6/7/16
to Android-x86
Can you put it as my name so it says Suici Doga added it

Suici Doga

unread,
Jun 7, 2016, 7:58:47 AM6/7/16
to Android-x86
Will it be for all HP laptops with the sensor not only the g series

Chih-Wei Huang

unread,
Jun 7, 2016, 8:12:00 AM6/7/16
to Android-x86
2016-06-07 10:51 GMT+08:00 Suici Doga <sui...@gmail.com>:
> Can you put it as my name so it says Suici Doga added it

OK. Have put your name to the commit author.

Hypo Turtle

unread,
Jun 8, 2016, 2:57:20 PM6/8/16
to Android-x86
To cover all cases: [lis3lv02d_i2c/hp_accel driver == hal_sensor=hdaps];

224d223
<             hal_sensors=hdaps
231,233d229
<         *HPPaviliong*)
<             hal_sensors=hdaps
<             ;;
245a242,243
>    
>     lsmod | grep -q lis3lv02d_i2c && hal_sensors=hdaps

Suici Doga

unread,
Jun 13, 2016, 12:57:57 AM6/13/16
to Android-x86
So where is the init.sh file in the source tree

Hypo Turtle

unread,
Jun 13, 2016, 5:41:50 AM6/13/16
to Android-x86
device/generic/common

Suici Doga

unread,
Jun 21, 2016, 11:17:46 PM6/21/16
to Android-x86
And also instead of checking if it is a g series can we check if the accelerometer module is loaded.Then it will work on all laptops that support it.


And also in sensor box it shows as KBD Orientation sensor and Linux as the manufacturer.It should be the accelerometer model and the manufacturer

Suici Doga

unread,
Jun 21, 2016, 11:17:46 PM6/21/16
to Android-x86
For some reason the accelerometer is backwards.When I tilt the laptop to the left in sensor box the ball goes to the left.On my Nexus 9 when tilting to the left the ball goes to the left

Chih-Wei Huang

unread,
Jun 22, 2016, 1:22:47 AM6/22/16
to Android-x86
2016-06-09 2:57 GMT+08:00 Hypo Turtle <hypot...@gmail.com>:
> To cover all cases: [lis3lv02d_i2c/hp_accel driver == hal_sensor=hdaps];

How did you confirm this?

Any ThinkPad Tablet owner can check
what sensor modules it is?

> 224d223
> < hal_sensors=hdaps
> 231,233d229
> < *HPPaviliong*)
> < hal_sensors=hdaps
> < ;;
> 245a242,243
>>
>> lsmod | grep -q lis3lv02d_i2c && hal_sensors=hdaps



Chih-Wei Huang

unread,
Jun 22, 2016, 1:27:19 AM6/22/16
to Android-x86
2016-06-22 10:29 GMT+08:00 Suici Doga <sui...@gmail.com>:
> And also instead of checking if it is a g series can we check if the accelerometer module is loaded.Then it will work on all laptops that support it.

Sounds reasonable but there is no
complete list of module to hal mapping.
If you have such a list, please provide.

> And also in sensor box it shows as KBD Orientation sensor and Linux as the manufacturer.It should be the accelerometer model and the manufacturer

I think it only shows the sensor hal information
as we coded.
If you have a way to get that info,
please submit a patch.

Hypo Turtle

unread,
Jun 22, 2016, 6:17:46 AM6/22/16
to Android-x86
In Suici Doga's case the lis3lv02d module (and hp_accel) was loaded but hal_sensor was still kbd.

Fairly sure (https://www.kernel.org/doc/Documentation/misc-devices/lis3lv02d) liv3lv02d is specifically a module for hdaps; so shouldn't it be set if the module is loaded?

Chih-Wei Huang

unread,
Jun 22, 2016, 7:55:26 AM6/22/16
to Android-x86
OK. I misread your patch to remove the line
in *ThinkPad*Tablet*) section.
Actually it's in *Aspire1*25*)
The old-style diff format is not easy to read.

Next time please use git format-patch
to generate a unified diff format.

2016-06-22 18:17 GMT+08:00 Hypo Turtle <hypot...@gmail.com>:
> In Suici Doga's case the lis3lv02d module (and hp_accel) was loaded but
> hal_sensor was still kbd.
>
> Fairly sure
> (https://www.kernel.org/doc/Documentation/misc-devices/lis3lv02d) liv3lv02d
> is specifically a module for hdaps; so shouldn't it be set if the module is
> loaded?
> On Wednesday, 22 June 2016 06:22:47 UTC+1, Chih-Wei Huang wrote:
>>
>> 2016-06-09 2:57 GMT+08:00 Hypo Turtle <hypot...@gmail.com>:
>> > To cover all cases: [lis3lv02d_i2c/hp_accel driver == hal_sensor=hdaps];
>>
>> How did you confirm this?
>>
>> Any ThinkPad Tablet owner can check
>> what sensor modules it is?
>>
>> > 224d223
^^^^^^^

Suici Doga

unread,
Jul 1, 2016, 2:29:43 AM7/1/16
to Android-x86
I can confirm this since on my Nexus 9 (a real Android tablet) when I tilt it left in sensor box the ball goes left.But on my HP Pavilion g7 (running Remix OS) laptop when I tilt it left the ball goes right

Suici Doga

unread,
Jul 1, 2016, 2:29:50 AM7/1/16
to Android-x86
On my Nexus 9 when tilting it left in sensor box the ball moves left.But on my HP pavilion g7 laptop tilting it left in sensor box moves the ball to the right

Hypo Turtle

unread,
Jul 1, 2016, 7:02:21 AM7/1/16
to Android-x86
If you want the same behaviour on both and if I'm reading the hdaps.c right try adding: hal.sensors.axis.revert=-1,1,1 to /system/build.prop and see if rhat changes it. If so that can be patched to init.sh
Reply all
Reply to author
Forward
0 new messages