Lines Matching full:sensor
33 #include <linux/sensor-dev.h>
67 /****************operate according to sensor chip:start************/
71 struct sensor_private_data *sensor = in sensor_active() local
76 sensor->ops->ctrl_data = sensor_read_reg(client, sensor->ops->ctrl_reg); in sensor_active()
82 sensor->ops->ctrl_data |= status; in sensor_active()
87 sensor->ops->ctrl_data &= status; in sensor_active()
90 …DBG("%s:reg=0x%x,reg_ctrl=0x%x,enable=%d\n",__func__,sensor->ops->ctrl_reg, sensor->ops->ctrl_data… in sensor_active()
91 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
93 printk("%s:fail to active sensor\n",__func__); in sensor_active()
101 struct sensor_private_data *sensor = in sensor_init() local
105 result = sensor->ops->active(client,0,0); in sensor_init()
112 sensor->status_cur = SENSOR_OFF; in sensor_init()
123 if(sensor->pdata->irq_enable) //open interrupt in sensor_init()
133 sensor->ops->ctrl_data = 1<<8; //Interrupt output INT is push-pull in sensor_init()
134 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_init()
151 //struct sensor_private_data *sensor = in sensor_convert_data()
153 //int precision = sensor->ops->precision; in sensor_convert_data()
163 struct sensor_private_data *sensor = in gsensor_report_value() local
166 if (sensor->status_cur == SENSOR_ON) { in gsensor_report_value()
167 /* Report acceleration sensor information */ in gsensor_report_value()
168 input_report_abs(sensor->input_dev, ABS_X, axis->x); in gsensor_report_value()
169 input_report_abs(sensor->input_dev, ABS_Y, axis->y); in gsensor_report_value()
170 input_report_abs(sensor->input_dev, ABS_Z, axis->z); in gsensor_report_value()
171 input_sync(sensor->input_dev); in gsensor_report_value()
180 struct sensor_private_data *sensor = in sensor_report_value() local
182 struct sensor_platform_data *pdata = sensor->pdata; in sensor_report_value()
189 if(sensor->ops->read_len < 3) //sensor->ops->read_len = 3 in sensor_report_value()
191 printk("%s:lenth is error,len=%d\n",__func__,sensor->ops->read_len); in sensor_report_value()
199 *buffer = sensor->ops->read_reg; in sensor_report_value()
200 ret = sensor_rx_data(client, buffer, sensor->ops->read_len); in sensor_report_value()
207 x = sensor_convert_data(sensor->client, 0, buffer[0]); //buffer[1]:high bit in sensor_report_value()
208 y = sensor_convert_data(sensor->client, 0, buffer[1]); in sensor_report_value()
209 z = sensor_convert_data(sensor->client, 0, buffer[2]); in sensor_report_value()
217 mutex_lock(&sensor->data_mutex); in sensor_report_value()
218 sensor->axis = axis; in sensor_report_value()
219 mutex_unlock(&sensor->data_mutex); in sensor_report_value()
221 …if((sensor->pdata->irq_enable)&& (sensor->ops->int_status_reg >= 0)) //read sensor intterupt statu… in sensor_report_value()
224 value = sensor_read_reg(client, sensor->ops->int_status_reg); in sensor_report_value()
225 DBG("%s:sensor int status :0x%x\n",__func__,value); in sensor_report_value()
250 /****************operate according to sensor chip:end************/