2 * Copyright (C) 2014, Samsung Electronics Co. Ltd. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef _SSP_SENSORS_H_
16 #define _SSP_SENSORS_H_
18 #include <linux/iio/iio.h>
20 #define SSP_TIME_SIZE 4
21 #define SSP_ACCELEROMETER_SIZE 6
22 #define SSP_GYROSCOPE_SIZE 6
23 #define SSP_BIO_HRM_RAW_SIZE 8
24 #define SSP_BIO_HRM_RAW_FAC_SIZE 36
25 #define SSP_BIO_HRM_LIB_SIZE 8
28 * enum ssp_sensor_type - SSP sensor type
30 enum ssp_sensor_type
{
31 SSP_ACCELEROMETER_SENSOR
= 0,
33 SSP_GEOMAGNETIC_UNCALIB_SENSOR
,
35 SSP_GEOMAGNETIC_SENSOR
,
39 SSP_TEMPERATURE_HUMIDITY_SENSOR
,
42 SSP_ORIENTATION_SENSOR
,
44 SSP_SIG_MOTION_SENSOR
,
45 SSP_GYRO_UNCALIB_SENSOR
,
46 SSP_GAME_ROTATION_VECTOR
,
58 * struct ssp_sensor_data - Sensor object
59 * @process_data: Callback to feed sensor data.
60 * @type: Used sensor type.
61 * @buffer: Received data buffer.
63 struct ssp_sensor_data
{
64 int (*process_data
)(struct iio_dev
*indio_dev
, void *buf
,
66 enum ssp_sensor_type type
;
70 void ssp_register_consumer(struct iio_dev
*indio_dev
,
71 enum ssp_sensor_type type
);
73 int ssp_enable_sensor(struct ssp_data
*data
, enum ssp_sensor_type type
,
76 int ssp_disable_sensor(struct ssp_data
*data
, enum ssp_sensor_type type
);
78 u32
ssp_get_sensor_delay(struct ssp_data
*data
, enum ssp_sensor_type
);
80 int ssp_change_delay(struct ssp_data
*data
, enum ssp_sensor_type type
,
82 #endif /* _SSP_SENSORS_H_ */