From 42030bb19a4f18e486cb4ec14822a5dee0db143c Mon Sep 17 00:00:00 2001 From: Archana Patni Date: Mon, 19 Mar 2012 18:56:29 +0530 Subject: [PATCH] libsensors: Added Pressure Sensor configuration for BDW-WSB This patch adds the configuration changes for Pressure Sensor for BDW-WSB. This patch depends on Change-Id: I7242be355885a0860de0fb496de800bc7b212ca3 which has pressure sensor HAL changes. Change-Id: I9ab7c54ad8dc7a3071b7e3f76835c7497707115b Signed-off-by: Archana Patni Reviewed-on: https://android.intel.com/162380 Reviewed-by: Sesha, Subramony Tested-by: Sesha, Subramony Reviewed-by: Lilja, Ola --- bdw_wsb/Android.mk | 1 + bdw_wsb/BoardConfig.cpp | 4 ++++ bdw_wsb/SensorConfig.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/bdw_wsb/Android.mk b/bdw_wsb/Android.mk index 76bf1fa..4ab989b 100644 --- a/bdw_wsb/Android.mk +++ b/bdw_wsb/Android.mk @@ -37,6 +37,7 @@ sensor_src_files := $(common_src_path)/HidSensor_Accel3D.cpp \ $(common_src_path)/HidSensor_Compass3D.cpp \ $(common_src_path)/HidSensor_ALS.cpp \ $(common_src_path)/HidSensor_Proximity.cpp \ + $(common_src_path)/HidSensor_Pressure.cpp \ $(common_src_path)/RotVecSensor.cpp \ $(common_src_path)/SynthCompassSensor.cpp \ $(common_src_path)/OrientationSensor.cpp \ diff --git a/bdw_wsb/BoardConfig.cpp b/bdw_wsb/BoardConfig.cpp index b6ae686..e3f0f7f 100644 --- a/bdw_wsb/BoardConfig.cpp +++ b/bdw_wsb/BoardConfig.cpp @@ -29,6 +29,7 @@ #include "HidSensor_Compass3D.h" #include "HidSensor_ALS.h" #include "HidSensor_Proximity.h" +#include "HidSensor_Pressure.h" #include "OrientationSensor.h" #include "RotVecSensor.h" #include "SynthCompassSensor.h" @@ -39,6 +40,7 @@ static const struct sensor_t sSensorList[] = { SynthCompassSensor::sSensorInfo_compass, ALSSensor::sSensorInfo_als, ProximitySensor::sSensorInfo_proximity, + PressureSensor::sSensorInfo_pressure, RotVecSensor::sSensorInfo_rotvec, OrientationSensor::sSensorInfo_orientation, }; @@ -102,6 +104,7 @@ void BoardConfig::initSensors(SensorBase* sensors[]) sensors[compass] = new CompassSensor(); sensors[light] = new ALSSensor(); sensors[proximity] = new ProximitySensor(); + sensors[pressure] = new PressureSensor(); sensors[rotvec] = new RotVecSensor(); sensors[syncompass] = new SynthCompassSensor(); sensors[orientation] = new OrientationSensor(); @@ -115,6 +118,7 @@ int BoardConfig::handleToDriver(int handle) case ID_M: return compass; case ID_PR: + return pressure; case ID_T: return -EINVAL; case ID_GY: diff --git a/bdw_wsb/SensorConfig.h b/bdw_wsb/SensorConfig.h index 755b7cb..d343c9f 100644 --- a/bdw_wsb/SensorConfig.h +++ b/bdw_wsb/SensorConfig.h @@ -31,6 +31,7 @@ enum { syncompass, orientation, proximity, + pressure, numSensorDrivers, numFds, }; @@ -183,4 +184,7 @@ inline float convert_from_vtf_format(int size, int exponent, unsigned int value) /*****************************************************************************/ +/* from bar to mbar(= hPA) */ +#define CONVERT_PR_HPA_VTF16E14(s,d,x) ((1000.0f)*convert_from_vtf_format(s,d,x)) + #endif // SENSOR_CONFIG_H -- 2.11.0