summaryrefslogtreecommitdiffstats
path: root/sensors/kr3dm.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-12-21 17:21:26 +0100
committerPaul Kocialkowski <contact@paulk.fr>2014-01-03 23:33:43 +0100
commit8f588313abf068f0eca3819651a63ce769324ab7 (patch)
tree57d90ff22f0f65df9b0c84cbd7031741b542fde9 /sensors/kr3dm.h
parent63f28807de5f73597605fc80a0fcddae23eca833 (diff)
downloaddevice_samsung_crespo-8f588313abf068f0eca3819651a63ce769324ab7.zip
device_samsung_crespo-8f588313abf068f0eca3819651a63ce769324ab7.tar.gz
device_samsung_crespo-8f588313abf068f0eca3819651a63ce769324ab7.tar.bz2
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'sensors/kr3dm.h')
-rw-r--r--sensors/kr3dm.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sensors/kr3dm.h b/sensors/kr3dm.h
new file mode 100644
index 0000000..d404d28
--- /dev/null
+++ b/sensors/kr3dm.h
@@ -0,0 +1,46 @@
+/*
+ * STMicroelectronics kr3dm acceleration sensor driver
+ *
+ * Copyright (C) 2010 Samsung Electronics Co.Ltd
+ *
+ * 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 __KR3DM_ACC_HEADER__
+#define __KR3DM__ACC_HEADER__
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+
+struct kr3dm_acceldata {
+ __s16 x;
+ __s16 y;
+ __s16 z;
+};
+
+/* dev info */
+#define ACC_DEV_NAME "accelerometer"
+
+/* kr3dm ioctl command label */
+#define KR3DM_IOCTL_BASE 'a'
+#define KR3DM_IOCTL_SET_DELAY _IOW(KR3DM_IOCTL_BASE, 0, int64_t)
+#define KR3DM_IOCTL_GET_DELAY _IOR(KR3DM_IOCTL_BASE, 1, int64_t)
+#define KR3DM_IOCTL_READ_ACCEL_XYZ _IOR(KR3DM_IOCTL_BASE, 8, \
+ struct kr3dm_acceldata)
+
+#ifdef __KERNEL__
+struct kr3dm_platform_data {
+ int gpio_acc_int; /* gpio for kr3dm int output */
+ s8 *rotation; /* rotation matrix, if NULL assume Id */
+};
+#endif /* __KERNEL__ */
+
+#endif