From 871480933a1c28f8a9fed4c4d34d06c439a7a422 Mon Sep 17 00:00:00 2001 From: Srikant Patnaik Date: Sun, 11 Jan 2015 12:28:04 +0530 Subject: Moved, renamed, and deleted files The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure. --- drivers/input/sensor/sensor.h | 91 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 drivers/input/sensor/sensor.h (limited to 'drivers/input/sensor/sensor.h') 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 +#include +#include +#include +#include + +#ifdef CONFIG_HAS_EARLYSUSPEND +#include +#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 -- cgit