diff options
author | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
---|---|---|
committer | Srikant Patnaik | 2015-01-11 12:28:04 +0530 |
commit | 871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch) | |
tree | 8718f573808810c2a1e8cb8fb6ac469093ca2784 /drivers/input/sensor/sensor.h | |
parent | 9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff) | |
download | FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2 FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip |
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized.
Changes are basically to make it look like kernel structure.
Diffstat (limited to 'drivers/input/sensor/sensor.h')
-rwxr-xr-x | drivers/input/sensor/sensor.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/input/sensor/sensor.h b/drivers/input/sensor/sensor.h new file mode 100755 index 00000000..9a51433d --- /dev/null +++ b/drivers/input/sensor/sensor.h @@ -0,0 +1,91 @@ +#ifndef __SENSOR_H__
+#define __SENSOR_H__
+#include <linux/i2c.h>
+#include <linux/i2c-dev.h> +#include <linux/proc_fs.h> +#include <linux/input.h>
+#include <linux/delay.h> +
+#ifdef CONFIG_HAS_EARLYSUSPEND
+#include <linux/earlysuspend.h>
+#endif
+
+
+//#define GSENSOR_I2C_NAME "unused"
+//#define GSENSOR_I2C_ADDR 0xff
+
+
+#define GSENSOR_PROC_NAME "gsensor_config"
+#define GSENSOR_INPUT_NAME "g-sensor"
+#define GSENSOR_DEV_NODE "sensor_ctrl"
+
+#define SENSOR_PROC_NAME "lsensor_config"
+#define SENSOR_INPUT_NAME "l-sensor"
+#define SENSOR_DEV_NODE "lsensor_ctrl"
+
+#undef dbg +#define dbg(fmt, args...) if (l_sensorconfig.isdbg) printk(KERN_ALERT "[%s]: " fmt, __FUNCTION__, ## args)
+ +#undef errlog +#undef klog +#define errlog(fmt, args...) printk(KERN_ERR "[%s]: " fmt, __FUNCTION__, ## args) +#define klog(fmt, args...) printk(KERN_ALERT "[%s]: " fmt, __FUNCTION__, ## args) +
+enum gsensor_id
+{
+ MMA7660_DRVID = 0,
+ MC3230_DRVID ,
+ DMARD08_DRVID ,
+ DMARD06_DRVID ,
+ DMARD10_DRVID ,
+ MXC622X_DRVID ,
+ MMA8452Q_DRVID ,
+ STK8312_DRVID ,
+ KIONIX_DRVID,
+ DMARD09_DRVID ,
+ //add new gsensor id here, must be in order
+};
+
+#define ISL29023_DRVID 0
+
+struct wmt_gsensor_data{
+ // for control
+ int int_gpio; //0-3 + int op; + int samp; + int xyz_axis[3][2]; // (axis,direction)
+ struct proc_dir_entry* sensor_proc; + struct input_dev *input_dev; + //struct work_struct work; + struct delayed_work work; // for polling + struct workqueue_struct *queue; + int isdbg; + int sensor_samp; // + int sensor_enable; // 0 --> disable sensor, 1 --> enable sensor + int test_pass; + int offset[3];
+ struct i2c_client *client;
+#ifdef CONFIG_HAS_EARLYSUSPEND
+ struct early_suspend earlysuspend;
+#endif
+
+}; +
+///////////////////////// ioctrl cmd ////////////////////////
+#define WMTGSENSOR_IOCTL_MAGIC 0x09
+#define WMT_IOCTL_SENSOR_CAL_OFFSET _IOW(WMTGSENSOR_IOCTL_MAGIC, 0x01, int) //offset calibration
+#define ECS_IOCTL_APP_SET_AFLAG _IOW(WMTGSENSOR_IOCTL_MAGIC, 0x02, short)
+#define ECS_IOCTL_APP_SET_DELAY _IOW(WMTGSENSOR_IOCTL_MAGIC, 0x03, short)
+#define WMT_IOCTL_SENSOR_GET_DRVID _IOW(WMTGSENSOR_IOCTL_MAGIC, 0x04, unsigned int)
+#define WMT_IOCTL_SENOR_GET_RESOLUTION _IOR(WMTGSENSOR_IOCTL_MAGIC, 0x05, short)
+
+#define WMT_LSENSOR_IOCTL_MAGIC 0x10
+#define LIGHT_IOCTL_SET_ENABLE _IOW(WMT_LSENSOR_IOCTL_MAGIC, 0x01, short)
+
+/* Function prototypes */
+extern struct i2c_client *sensor_i2c_register_device (int bus_no, int client_addr, const char *client_name);
+extern struct i2c_client *sensor_i2c_register_device2(int bus_no, int client_addr, const char *client_name,void *pdata);
+extern void sensor_i2c_unregister_device(struct i2c_client *client);
+
+
+#endif
|