OSDN Git Service

android-x86/hardware-intel-libsensors.git
10 years agoREVERTME: libsensors: Add support for BYT-M
Per Persson [Thu, 12 Dec 2013 18:15:46 +0000 (17:15 -0100)]
REVERTME: libsensors: Add support for BYT-M

The following files are added for libsensor support on BYT-M:
bytm/Android.mk
bytm/BoardConfig.cpp
bytm/SensorConfig.h

Tracked-By: APDEV-759
Issue: APDEV-278

Change-Id: Ia635116ff10b4e493420a0b74e4e53a367c27c86
Signed-off-by: Per Persson <per.persson@intel.com>
10 years agolibsensors: Import OTC sensor HAL for HSB and adapt to Android KK
Mattias Pettersson [Thu, 28 Nov 2013 15:57:10 +0000 (16:57 +0100)]
libsensors: Import OTC sensor HAL for HSB and adapt to Android KK

Import libsensors from OTC/PCCG. This is the HID over I2C solution for
sensor hub. Adapt to updated definitions of Android Kitkat sensor HAL
(but don't implement new Kitkat features). Rearrange files, create
hsb-specific folder.

Issue: APDEV-49

Signed-off-by: Mattias Pettersson <mattias.pettersson@intel.com>
10 years agolibsensors: Add orientation sensor
Andy Ross [Mon, 4 Nov 2013 18:07:20 +0000 (10:07 -0800)]
libsensors: Add orientation sensor

The sensor hub emits an euler-representation orientation which
correspond's closely to Google's SENSOR_ORIENTATION sensor type.  Use
this in lieu of the SensorFusion auto-generated one.  The API is
deprecated, but old apps might still use it and we want to provide
optimal data.

Issue: AXIA-4758
Change-Id: I7e0c2486ec8e49f1a6e42658295b7f265541022e
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22522
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Tested-by: jenkins autobuilder
Works-for-me: jenkins autobuilder
Reviewed-by: Brian E Woodruff <brian.e.woodruff@intel.com>
Reviewed-by: Sridhar Uyyala <sridhar.uyyala@intel.com>
Reviewed-by: Robert Chiras <robert.chiras@intel.com>
10 years agolibsensors: Integrate the quaternion sensor and use for compass
Andy Ross [Thu, 17 Oct 2013 18:38:21 +0000 (11:38 -0700)]
libsensors: Integrate the quaternion sensor and use for compass

The sensor hub has a built-in integrated sensor integration scheme
which emits a unified quaternion orientation.  Use this in lieu of
Google's SensorFusion software implementation.

Also: the sensor hub magnetometer emits uncalibrated data because of
requirements on other platforms, but Android demands calibrated
numbers.  Instead of doing magnetometer calibration in the HAL, use
the orientation output to derive a faked "magenetometer" which always
points to magnetic north along the ground plane.  Call this a "leveled
compass".  This behavior is apparently kosher: future (JB 4.3+) API
versions separate the existing "calibrated" compass output from a new
"raw" one which matches the sensor hub behavior.

Finally, the leveled compass implementation requires a little rework
to the SensorIIODev class to allow for reference counting of the
stream (so that it can be active when the sensor itself is disabled).

Issue: AXIA-3283
Change-Id: I16e90fa1119f908e979ca1fa010b2dea7f136deb
Depends-Change-Id: Id4feb36f32d0033f744752e238717bcd163aebb5
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22344
Tested-by: jenkins autobuilder
Reviewed-by: Brian E Woodruff <brian.e.woodruff@intel.com>
Works-for-me: jenkins autobuilder
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Robert Chiras <robert.chiras@intel.com>
10 years agolibsensors: Allow IIO max sample rate to be configured via properties
Andy Ross [Thu, 26 Sep 2013 20:07:35 +0000 (13:07 -0700)]
libsensors: Allow IIO max sample rate to be configured via properties

Different hubs have different behavior.  Really we want to probe this
out of the hardware, but for HID sensors on I2C (as opposed to USB)
userspace doesn't get access to the descriptor right now.

Change-Id: I8bcd077509b43bba6025ca5f55ba9373db89cd8b
For: AXIA-3287
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22151
Tested-by: jenkins autobuilder
Reviewed-by: Russell Webb <russell.webb@intel.com>
10 years agolibsensors: correct read() usage
Andy Ross [Thu, 26 Sep 2013 19:31:26 +0000 (12:31 -0700)]
libsensors: correct read() usage

The readEvents() implementation would attempt to read buffer_len (two
by default) IIO events from the device, but would only ever process
one, leading to dropped events in the case of overflow.  It was also
not checking the return value from read and would push garbage data on
I/O errors (probably would not happen in regular usage, but IIO
devices are known to return -EBUSY or -EINVAL if there are other users
or if the sysfs parameters are set incorrectly).

Change-Id: I7f66f530c9fce0540f1596456b3ca191406bbd27
For: AXIA-3287
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22150
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Russell Webb <russell.webb@intel.com>
Tested-by: jenkins autobuilder
10 years agolibsensors: Fix memory leak when sensors are enabled
Andy Ross [Thu, 26 Sep 2013 18:29:09 +0000 (11:29 -0700)]
libsensors: Fix memory leak when sensors are enabled

BuildChannelList is called every time the sensor is opened, not simply
once on initialization.  The info_array would continually grow with
newly probed channel objects (i.e. 3 objects for
accelerometer/gyro/compass, one for ALS) appeneded every time, and it
was similarly used to size the raw_buffer used for the read() call.

Change-Id: I163fe2e3abddbd7196e90bc1774f6584b47ab3f4
For: AXIA-3287
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22149
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Russell Webb <russell.webb@intel.com>
Tested-by: jenkins autobuilder
10 years agolibsensors: Re-fix "non-streaming" state, provide for rate clamping
Andy Ross [Thu, 26 Sep 2013 18:16:48 +0000 (11:16 -0700)]
libsensors: Re-fix "non-streaming" state, provide for rate clamping

This has been fixed, rebroken and re-fixed several times now.  Here's
the deal as I understand it: HID sensors are inherently
"non-streaming" in the Android sense.  They are never guaranteed to
report events at a fixed rate (the IIO sampling_frequency property is
a command to the sensor hub which is doing filtering; some hubs send
fixed rate events, some don't).  The Android API documentation
specifies that this should be signaled by setting the minDelay of the
sensor_t to zero.

But if you do this, then the framework and apps don't know what values
are valid and will attempt to set improbabable values (e.g. 1000Hz).
Sadly the IIO driver will eject those settings instead of clamping
them to a valid range, and the result is that the sensors retain their
default values (e.g. 5Hz for compass in the linked Jira) and look very
slow.

So implement rate clamping in SensorIIODev: subclasses can set their
own minimum delay values to which the HAL will clamp before being sent
the the hardware.  These are populated currently with values specific
to (and empirically determined from) the Intel sensor hub on the
Harris Beach Ultrabook.  Future work will need to make this settable
via configuration.

Issue: AXIA-3287
Change-Id: I63b3d531ec3fadba4dbee17cff68681c9ad1b510
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/22148
Reviewed-by: Radivoje Jovanovic <radivoje.jovanovic@intel.com>
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Russell Webb <russell.webb@intel.com>
Tested-by: jenkins autobuilder
10 years agoSet minimum delay for accelerometer events.
Adriana Reus [Wed, 24 Jul 2013 10:56:01 +0000 (13:56 +0300)]
Set minimum delay for accelerometer events.

Specify minimum observed delay for the accelerometer event rate.
This is a hint to the service, which clamps higher values to the minimum supported delay.

Issue: AXIA-3061
Change-Id: I74a91f6f8eb93121407e1a452ac4690bec474cda
Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Reviewed-on: https://otc-android.intel.com/gerrit/20206
Tested-by: jenkins autobuilder
Reviewed-by: Alexandru Timohi <alexandru.timohi@intel.com>
Reviewed-by: Mihai Serban <mihai.serban@intel.com>
Reviewed-by: Daniel Leung <daniel.leung@intel.com>
Reviewed-by: Constantin Musca <constantin.musca@intel.com>
Reviewed-by: Robert Chiras <robert.chiras@intel.com>
Tested-by: Robert Chiras <robert.chiras@intel.com>
10 years agoSensors: Change MinDelay for matching non-streaming sensors
Billy [Thu, 9 May 2013 09:15:31 +0000 (17:15 +0800)]
Sensors: Change MinDelay for matching non-streaming sensors

Fix:
The HAL code set Mindelay to non-zero, but sensors don't work as
streaming. Change MinDelay to zero.

Issue: AXIA-1868
Change-Id: Ia10111191d50b4914f422b84d5d36135b4713961
Signed-off-by: Xiaobing Feng <xiaobing.feng@windriver.com>
Reviewed-on: https://otc-android.intel.com/gerrit/19193
Reviewed-by: Matthew K Gumbel <matthew.k.gumbel@intel.com>
Tested-by: Matthew K Gumbel <matthew.k.gumbel@intel.com>
10 years agobigcore: Give more time for iio device detection
Huzefa Kankroliwala [Wed, 6 Mar 2013 14:44:22 +0000 (06:44 -0800)]
bigcore: Give more time for iio device detection

Currently android framework checks if /sys/bus/iio/devices node
is created and sets sensor property based on it. The check is
performed in a for loop of ~1 sec.
Looks like for i2c based sensors it is taking more time for the
node to be created and hence setting of property fails.

Increase the loop time to ~5 sec max which gives enough time for
the node to be detected.

Issue: AXIA-2039
Change-Id: I1b33eae948482e9e6835918d61357cd6ba3d7b2b
Signed-off-by: Huzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com>
10 years agoModified supported sensor capabilities
Sharada [Fri, 25 Jan 2013 22:55:18 +0000 (14:55 -0800)]
Modified supported sensor capabilities

Sensor info needs to be updated based on the device
capability.For ACER Iconia and HSW Kalapana beach
maximum supproted sampling frequency is ACCEL :60hz,
Gyro :60Hz, Compass:15Hz.
Anything set above this frequency, firmware will default
to 5Hz.

Issue: AXIA-1721, AXIA-1722

Signed-off-by: SharadaX Palasamudram Ashok Kumar<sharadax.p
alasamudram.ashok.kumar@intel.com>

Change-Id: Ic355d30d4fd614b15fcc45368bf439a9b12b6419

10 years agolibsensors: retry more and deal with sensor hub quirk
Daniel Leung [Thu, 27 Dec 2012 20:55:57 +0000 (12:55 -0800)]
libsensors: retry more and deal with sensor hub quirk

() Sometimes the ueventd has a hard time keeping up with all
   the uevents. It causes the permissions of the IIO sysfs nodes
   to remain unchanged. This causes the sensor HAL initialization
   to fail. Need to retry a few more times.

() There is a quirk with some sensor hubs, where you have to
   enable/disable/enable for it to start sending any events.
   This adds the code to "jump-start" the hub.

Issue: AXIA-1451
Change-Id: Iecfbf8589637eb16a8b80364b47c2527a69d7cd3
Depends-Change-Id: Ibfff2a60c5223b2018c106237365967471e00e89
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
10 years agolibsensors: modified default gyro orientation
Matt Gumbel [Mon, 12 Nov 2012 18:43:12 +0000 (10:43 -0800)]
libsensors: modified default gyro orientation

Updated for IVB reference board. This approach isn't scalable -- will
need installer approach for future devices.

For: AXIA-1092
Change-Id: Ie992380b3b05468e256afbb2f97e264097784ee1
Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
10 years agolibsensors: save sensor presence from first boot
Matt Gumbel [Mon, 8 Oct 2012 20:33:56 +0000 (13:33 -0700)]
libsensors: save sensor presence from first boot

Because of delayed module loading and USB enumeration time, IIO sensors
sysfs nodes may not yet be created by the time libsensors is asked to
initialize by the frameworks. This patch will wait up to 10 sec for the
sysfs nodes to appear before reporting "no sensors" to the framework on
the first boot of the device and set a system property based on whether
or not the iio sensors were found.

On subsequent boots, it will only consult this system property and thus
no delay in system services startup.

Change-Id: Ibb7b6d69ce1c1dcadd0ddaa361a4297489a044c7
Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
10 years agobigcore/libsensors: check for presence of IIO sensors
Matt Gumbel [Tue, 25 Sep 2012 02:56:08 +0000 (19:56 -0700)]
bigcore/libsensors: check for presence of IIO sensors

bigcore libsensors BoardConfig was assuming IIO sensors are present on
the device. Some devices (e.g. samsung xe700t) do not have them and so
they should not be reported to Android's sensorservice.

For now, this is just a very simplistic yes/no test to support both
the xe700t as well as the new Win8 samsung device that actually has the
IIO sensors.

Change-Id: Ib920315aa02442f9f814d78ee1a496237b74e537
For: AXIA-837
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
10 years agoSensor HAL: Allow orientation and hysteresis config
srinivas pandruvada [Wed, 29 Aug 2012 20:15:26 +0000 (13:15 -0700)]
Sensor HAL: Allow orientation and hysteresis config

This patch adds defines for orientation and hysteresis, so
that they can be modified to tune for individual platform.
It is initializing hysteresis to 0 and orientation values to
-1.

Change-Id: I086945a73f482bfc08f3baf12ce836c7b40d4ae6
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
10 years agopc_std: rename to 'bigcore'
Andrew Boie [Tue, 11 Sep 2012 20:49:09 +0000 (13:49 -0700)]
pc_std: rename to 'bigcore'

For: AXIA-840
Depends-Change-Id: I14b8908b947e1bccf0cf6cce79d4ce18d5a219dd
Depends-Change-Id: I6e279ea4f900b8d251364458b521a15a0438e2c8
Depends-Change-Id: I8b42b677e60d4eaf35f284a0eda446de83bda5be
Depends-Change-Id: I4e567a35c5f2eab56466f84f203b1d0ec3294667
Change-Id: If76e81cb9ff0325c0c90498d8b047c8a2e60aa9b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
10 years agoSensor HAL: Added ALS
srinivas pandruvada [Wed, 30 May 2012 23:30:56 +0000 (16:30 -0700)]
Sensor HAL: Added ALS

Added HAL for ALS as defined by HID sensor usage table.
This only implements the minimal set.

Change-Id: I8720a3f02d2145e7df7d51abaf60944ec6706ea5
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
10 years agoSensor HAL: Added Compass
srinivas pandruvada [Wed, 30 May 2012 23:29:11 +0000 (16:29 -0700)]
Sensor HAL: Added Compass

Added Compass (Magnetometer) HAL as defined by HID sensor usage
table. This only implements the minimal set.

Change-Id: I19c222019b8770942e23f614ada8a2c35d401471
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
10 years agoSensor HAL: Gyro 3D
srinivas pandruvada [Wed, 30 May 2012 23:27:05 +0000 (16:27 -0700)]
Sensor HAL: Gyro 3D

Added processing for Gyro 3D as defined by HID sensor usage table.
This only implements the minimal set.

Change-Id: Ie60beebe7187569b1a483766b587fa73d633556e
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
10 years agoSensor HAL: Accelerometer 3D
srinivas pandruvada [Wed, 30 May 2012 23:24:27 +0000 (16:24 -0700)]
Sensor HAL: Accelerometer 3D

Added processing for Accelerometer 3D as defined by HID Sensor
usage table. This only implements the minimal set.

Change-Id: I0eebc550dab314cb954b8b533bae735d6179326a
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
10 years agoSensor HAL: IIO
srinivas pandruvada [Wed, 30 May 2012 22:33:24 +0000 (15:33 -0700)]
Sensor HAL: IIO

Implemented IIO based interface for sensors. This adds basic infrastructure
to parse IIO configuration and channels.
Since it is implemented for PnP devices, device can be enumerated
much later than the init process completion and also devices can
be removed during suspend causing stale handles and ownership issues.

Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
Conflicts:

common/libsensors/sensors.cpp

Change-Id: Iec71987e719f241c155587910efc48c0270e8d36

10 years agoTweak Lenovo target for Jelly Bean
Jim Bride [Thu, 12 Jul 2012 20:00:14 +0000 (13:00 -0700)]
Tweak Lenovo target for Jelly Bean

Change some logging stuff and tweak the location of the accelerometer
XML permissions file to make this target build correctly on Jelly
Bean.

Change-Id: Ic7e8ec9bf2044a07f635ec6a537df22e124c8258
Signed-off-by: Jim Bride <jim.bride@intel.com>
10 years agolibsensors framework
srinivas pandruvada [Mon, 14 May 2012 21:28:43 +0000 (14:28 -0700)]
libsensors framework

Copied libsensors from Medfield and kept only sensor core files.
Removed all sensor specific files.

The commiters includes:
ommit 21964ccb08d199672cdf986cca91a714f55302ab
Author: Dragos Tatulea <dragos.tatulea@intel.com>

    libsensors: remove unneeded double close error

commit f5d69164ee57a048c4aa0f4747e43d8e894cca2f
Author: Dragos Tatulea <dragos.tatulea@intel.com>

    libsensors: refactor sensors to close fd on disable

commit a66c57c95532739c2e05c3aa40a26e0dc91da05b
Author: Dragos Tatulea <dragos.tatulea@intel.com>

    libsensors: check & skip sensor poll errors

commit 664ec9c48708a177eee9f68f3d11e57a35400a7b
Author: Dragos Tatulea <dragos.tatulea@intel.com>

    libsensors: base class enhancements

commit 9d16e254aab71082adf16749e771a54c84d26e24
Author: Dragos Tatulea <dragos.tatulea@intel.com>

    libsensors: move to vendor and split in platform and common

Change-Id: I0fbb737155331a60e362bba9402a6a036a2ec2f6
Signed-off-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
10 years agoInitial empty repository
Jenkins [Wed, 30 Oct 2013 18:49:26 +0000 (11:49 -0700)]
Initial empty repository