mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karol Wrona <k.wrona@samsung.com>
To: Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	linux-kernel@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Karol Wrona <k.wrona@samsung.com>
Subject: [RFC/PATCH 1/6] iio:sensorhub: Add sensorhub common library
Date: Wed, 03 Sep 2014 16:55:45 +0200	[thread overview]
Message-ID: <1409756150-30889-2-git-send-email-k.wrona@samsung.com> (raw)
In-Reply-To: <1409756150-30889-1-git-send-email-k.wrona@samsung.com>

This patch adds common sensorhub library for sensorhub driver and iio drivers
which uses sensorhub MCU to communicate with sensors.

Signed-off-by: Karol Wrona <k.wrona@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 include/linux/iio/common/ssp_sensors.h |   82 ++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
 create mode 100644 include/linux/iio/common/ssp_sensors.h

diff --git a/include/linux/iio/common/ssp_sensors.h b/include/linux/iio/common/ssp_sensors.h
new file mode 100644
index 0000000..ca4bdc4
--- /dev/null
+++ b/include/linux/iio/common/ssp_sensors.h
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (C) 2014, Samsung Electronics Co. Ltd. All Rights Reserved.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ */
+#ifndef _SSP_SENSORS_H_
+#define _SSP_SENSORS_H_
+
+#define SSP_TIME_SIZE	4
+
+#define SSP_ACCELEROMETER_SIZE			6
+#define SSP_GYROSCOPE_SIZE			6
+#define	SSP_BIO_HRM_RAW_SIZE			8
+#define	SSP_BIO_HRM_RAW_FAC_SIZE		36
+#define	SSP_BIO_HRM_LIB_SIZE			8
+
+/**
+ * enum ssp_sensor_tyoe - SSP sensor type
+ */
+enum ssp_sensor_type {
+	SSP_ACCELEROMETER_SENSOR = 0,
+	SSP_GYROSCOPE_SENSOR,
+	SSP_GEOMAGNETIC_UNCALIB_SENSOR,
+	SSP_GEOMAGNETIC_RAW,
+	SSP_GEOMAGNETIC_SENSOR,
+	SSP_PRESSURE_SENSOR,
+	SSP_GESTURE_SENSOR,
+	SSP_PROXIMITY_SENSOR,
+	SSP_TEMPERATURE_HUMIDITY_SENSOR,
+	SSP_LIGHT_SENSOR,
+	SSP_PROXIMITY_RAW,
+	SSP_ORIENTATION_SENSOR,
+	SSP_STEP_DETECTOR,
+	SSP_SIG_MOTION_SENSOR,
+	SSP_GYRO_UNCALIB_SENSOR,
+	SSP_GAME_ROTATION_VECTOR,
+	SSP_ROTATION_VECTOR,
+	SSP_STEP_COUNTER,
+	SSP_BIO_HRM_RAW,
+	SSP_BIO_HRM_RAW_FAC,
+	SSP_BIO_HRM_LIB,
+	SSP_SENSOR_MAX,
+};
+
+struct ssp_data;
+
+/**
+ * struct ssp_sensor_data - Sensor object
+ * @process_data:	Callback to feed sensor data.
+ * @destroy:		Callback to destroy and cleanup sensor object.
+ * @prv_data:		Sensor private data.
+ * @type:		Used sensor type.
+ */
+struct ssp_sensor_data {
+	int (*process_data)(struct iio_dev *indio_dev, void *buf,
+			    s64 timestamp);
+	void *prv_data;
+	enum ssp_sensor_type type;
+};
+
+void ssp_register_consumer(struct iio_dev *indio_dev, enum ssp_sensor_type);
+
+int ssp_enable_sensor(struct ssp_data *data, enum ssp_sensor_type type,
+		       u32 delay);
+
+int ssp_disable_sensor(struct ssp_data *data, enum ssp_sensor_type type);
+
+u32 ssp_get_sensor_delay(struct ssp_data *data, enum ssp_sensor_type);
+
+int ssp_change_delay(struct ssp_data *data, enum ssp_sensor_type type,
+		     u32 delay);
+
+#endif /* _SSP_SENSORS_H_ */
-- 
1.7.9.5


  reply	other threads:[~2014-09-03 14:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 14:55 [RFC/PATCH 0/6] iio: Add sensorhub driver Karol Wrona
2014-09-03 14:55 ` Karol Wrona [this message]
2014-09-14 14:17   ` [RFC/PATCH 1/6] iio:sensorhub: Add sensorhub common library Jonathan Cameron
2014-09-03 14:55 ` [RFC/PATCH 2/6] misc: sensorhub: Add sensorhub driver Karol Wrona
2014-09-14 15:42   ` Jonathan Cameron
2014-09-03 14:55 ` [RFC/PATCH 3/6] sensorhub: Add sensorhub bindings Karol Wrona
2014-09-14 15:45   ` Jonathan Cameron
2014-09-03 14:55 ` [RFC/PATCH 4/6] iio: sensorhub: Add sensorhub iio commons Karol Wrona
2014-09-14 15:54   ` Jonathan Cameron
2014-09-03 14:55 ` [RFC/PATCH 5/6] iio: sensorhub: Add sensorhub accelerometer sensor Karol Wrona
2014-09-14 17:10   ` Jonathan Cameron
2014-09-03 14:55 ` [RFC/PATCH 6/6] iio: sensorhub: Add sensorhub gyroscope sensor Karol Wrona
2014-09-14 17:09   ` Jonathan Cameron
2014-09-03 19:52 ` [RFC/PATCH 0/6] iio: Add sensorhub driver Jonathan Cameron
2014-09-08 14:55   ` Karol Wrona
2014-09-11 11:05     ` Octavian Purdila
2014-09-14 14:14       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409756150-30889-2-git-send-email-k.wrona@samsung.com \
    --to=k.wrona@samsung.com \
    --cc=arnd@arndb.de \
    --cc=b.zolnierkie@samsung.com \
    --cc=jic23@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®