Home
last modified time | relevance | path

Searched full:sensor (Results 1 – 25 of 2505) sorted by relevance

12345678910>>...101

/OK3568_Linux_fs/kernel/drivers/input/sensors/
H A Dsensor-dev.c1 /* drivers/input/sensors/sensor-dev.c - handle all gsensor in this file
37 #include <linux/sensor-dev.h>
105 struct sensor_private_data *sensor = g_sensor[SENSOR_TYPE_ACCEL]; in accel_calibration_show() local
107 if (sensor == NULL) in accel_calibration_show()
108 return sprintf(buf, "no accel sensor find\n"); in accel_calibration_show()
116 dev_err(&sensor->client->dev, "read accel sensor calibration data failed\n"); in accel_calibration_show()
131 static int accel_do_calibration(struct sensor_private_data *sensor) in accel_do_calibration() argument
138 mutex_lock(&sensor->operation_mutex); in accel_do_calibration()
140 ret = sensor->ops->report(sensor->client); in accel_do_calibration()
142 dev_err(&sensor->client->dev, "in %s read accel data error\n", __func__); in accel_do_calibration()
[all …]
/OK3568_Linux_fs/kernel/drivers/media/i2c/smiapp/
H A Dsmiapp-core.c12 * Based on smia-sensor.c by Tuukka Toivonen <tuukkat76@gmail.com>
60 static u32 smiapp_get_limit(struct smiapp_sensor *sensor, in smiapp_get_limit() argument
66 return sensor->limits[limit]; in smiapp_get_limit()
69 #define SMIA_LIM(sensor, limit) \ argument
70 smiapp_get_limit(sensor, SMIAPP_LIMIT_##limit)
72 static int smiapp_read_all_smia_limits(struct smiapp_sensor *sensor) in smiapp_read_all_smia_limits() argument
74 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in smiapp_read_all_smia_limits()
82 sensor, smiapp_reg_limits[i].addr, &val); in smiapp_read_all_smia_limits()
86 sensor->limits[i] = val; in smiapp_read_all_smia_limits()
93 if (SMIA_LIM(sensor, SCALER_N_MIN) == 0) in smiapp_read_all_smia_limits()
[all …]
/OK3568_Linux_fs/kernel/drivers/thermal/st/
H A Dstm_thermal.c102 static int stm_enable_irq(struct stm_thermal_sensor *sensor) in stm_enable_irq() argument
106 dev_dbg(sensor->dev, "low:%d high:%d\n", sensor->low_temp_enabled, in stm_enable_irq()
107 sensor->high_temp_enabled); in stm_enable_irq()
110 value = readl_relaxed(sensor->base + DTS_ITENR_OFFSET); in stm_enable_irq()
113 if (sensor->low_temp_enabled) in stm_enable_irq()
116 if (sensor->high_temp_enabled) in stm_enable_irq()
120 writel_relaxed(value, sensor->base + DTS_ITENR_OFFSET); in stm_enable_irq()
127 struct stm_thermal_sensor *sensor = sdata; in stm_thermal_irq_handler() local
129 dev_dbg(sensor->dev, "sr:%d\n", in stm_thermal_irq_handler()
130 readl_relaxed(sensor->base + DTS_SR_OFFSET)); in stm_thermal_irq_handler()
[all …]
H A Dst_thermal.c3 * ST Thermal Sensor Driver core routines
23 static int st_thermal_alloc_regfields(struct st_thermal_sensor *sensor) in st_thermal_alloc_regfields() argument
25 struct device *dev = sensor->dev; in st_thermal_alloc_regfields()
26 struct regmap *regmap = sensor->regmap; in st_thermal_alloc_regfields()
27 const struct reg_field *reg_fields = sensor->cdata->reg_fields; in st_thermal_alloc_regfields()
29 sensor->dcorrect = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields()
32 sensor->overflow = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields()
35 sensor->temp_data = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields()
38 if (IS_ERR(sensor->dcorrect) || in st_thermal_alloc_regfields()
39 IS_ERR(sensor->overflow) || in st_thermal_alloc_regfields()
[all …]
H A Dst_thermal_memmap.c3 * ST Thermal Sensor Driver for memory mapped sensors.
19 /* Power control bits for the memory mapped thermal sensor */
25 * According to the STIH416 MPE temp sensor data sheet -
28 * sensor. regmap_update_bits() will be used to update the register.
39 struct st_thermal_sensor *sensor = sdata; in st_mmap_thermal_trip_handler() local
41 thermal_zone_device_update(sensor->thermal_dev, in st_mmap_thermal_trip_handler()
48 static int st_mmap_power_ctrl(struct st_thermal_sensor *sensor, in st_mmap_power_ctrl() argument
54 return regmap_update_bits(sensor->regmap, STIH416_MPE_CONF, mask, val); in st_mmap_power_ctrl()
57 static int st_mmap_alloc_regfields(struct st_thermal_sensor *sensor) in st_mmap_alloc_regfields() argument
59 struct device *dev = sensor->dev; in st_mmap_alloc_regfields()
[all …]
/OK3568_Linux_fs/kernel/drivers/media/i2c/
H A Dsensor_adapter.c3 * sensor driver
45 #define SENSOR_NAME "sensor"
68 struct sensor { struct
98 static struct sensor *g_sensor[RKMODULE_MAX_SENSOR_NUM]; argument
124 #define to_sensor(sd) container_of(sd, struct sensor, subdev)
128 * the same as the current output resolution of the sensor.
195 struct sensor *sensor = to_sensor(sd); in sensor_set_fmt() local
197 mutex_lock(&sensor->mutex); in sensor_set_fmt()
200 sensor->cur_mode->bus_fmt = fmt->format.code; in sensor_set_fmt()
201 sensor->cur_mode->width = fmt->format.width; in sensor_set_fmt()
[all …]
H A Dov2680.c3 * Omnivision OV2680 CMOS Image Sensor driver
7 * Based on OV5640 Sensor Driver
186 static struct device *ov2680_to_dev(struct ov2680_dev *sensor) in ov2680_to_dev() argument
188 return &sensor->i2c_client->dev; in ov2680_to_dev()
197 static int __ov2680_write_reg(struct ov2680_dev *sensor, u16 reg, in __ov2680_write_reg() argument
200 struct i2c_client *client = sensor->i2c_client; in __ov2680_write_reg()
227 static int __ov2680_read_reg(struct ov2680_dev *sensor, u16 reg, in __ov2680_read_reg() argument
230 struct i2c_client *client = sensor->i2c_client; in __ov2680_read_reg()
269 static int ov2680_mod_reg(struct ov2680_dev *sensor, u16 reg, u8 mask, u8 val) in ov2680_mod_reg() argument
274 ret = ov2680_read_reg(sensor, reg, &readval); in ov2680_mod_reg()
[all …]
H A DKconfig454 tristate "sensor otp from eeprom support"
543 This is a Video4Linux2 sensor driver for the TI TVP5146/47
893 It is used to allow usage of CSI-2 sensor with PARALLEL port
914 menu "Camera sensor devices"
924 tristate "Aptina AR0230 sensor support"
929 Support for the Aptina AR0230 sensor.
935 tristate "Onsemi AR0822 sensor support"
940 This is a Video4Linux2 sensor driver for the Onsemi
947 tristate "GalaxyCore GC02M2 sensor support"
952 Support for the GalaxyCore GC02M2 sensor.
[all …]
H A Dmt9m032.c3 * Driver for MT9M032 CMOS Image Sensor from Micron
125 * for this sensor.
155 #define to_dev(sensor) \ argument
156 (&((struct i2c_client *)v4l2_get_subdevdata(&(sensor)->subdev))->dev)
168 static u32 mt9m032_row_time(struct mt9m032 *sensor, unsigned int width) in mt9m032_row_time() argument
174 ns = div_u64(1000000000ULL * effective_width, sensor->pix_clock); in mt9m032_row_time()
175 dev_dbg(to_dev(sensor), "MT9M032 line time: %u ns\n", ns); in mt9m032_row_time()
179 static int mt9m032_update_timing(struct mt9m032 *sensor, in mt9m032_update_timing() argument
182 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in mt9m032_update_timing()
183 struct v4l2_rect *crop = &sensor->crop; in mt9m032_update_timing()
[all …]
H A Ds5k6a3.c3 * Samsung S5K6A3 image sensor driver
45 * struct s5k6a3 - fimc-is sensor data structure
47 * @subdev: the image sensor's v4l2 subdev
49 * @supplies: image sensor's voltage regulator supplies
50 * @gpio_reset: GPIO connected to the sensor's reset pin
52 * @format: media bus format at the sensor's source pad
126 struct s5k6a3 *sensor, struct v4l2_subdev_pad_config *cfg, in __s5k6a3_get_format() argument
130 return cfg ? v4l2_subdev_get_try_format(&sensor->subdev, cfg, pad) : NULL; in __s5k6a3_get_format()
132 return &sensor->format; in __s5k6a3_get_format()
139 struct s5k6a3 *sensor = sd_to_s5k6a3(sd); in s5k6a3_set_fmt() local
[all …]
H A Dov5640.c545 /* power-on sensor init reg table */
602 static int ov5640_init_slave_id(struct ov5640_dev *sensor) in ov5640_init_slave_id() argument
604 struct i2c_client *client = sensor->i2c_client; in ov5640_init_slave_id()
630 static int ov5640_write_reg(struct ov5640_dev *sensor, u16 reg, u8 val) in ov5640_write_reg() argument
632 struct i2c_client *client = sensor->i2c_client; in ov5640_write_reg()
656 static int ov5640_read_reg(struct ov5640_dev *sensor, u16 reg, u8 *val) in ov5640_read_reg() argument
658 struct i2c_client *client = sensor->i2c_client; in ov5640_read_reg()
687 static int ov5640_read_reg16(struct ov5640_dev *sensor, u16 reg, u16 *val) in ov5640_read_reg16() argument
692 ret = ov5640_read_reg(sensor, reg, &hi); in ov5640_read_reg16()
695 ret = ov5640_read_reg(sensor, reg + 1, &lo); in ov5640_read_reg16()
[all …]
/OK3568_Linux_fs/kernel/drivers/iio/light/
H A DKconfig11 tristate "ACPI Ambient Light Sensor"
18 Ambient Light Sensor.
24 tristate "ADJD-S311-CR999 digital color sensor"
30 digital color light sensor.
36 tristate "ADUX1020 photometric sensor"
41 ADUX1020 photometric sensor.
47 tristate "AL3010 ambient light sensor"
51 ambient light sensor.
57 tristate "AL3320A ambient light sensor"
61 ambient light sensor.
[all …]
/OK3568_Linux_fs/kernel/drivers/thermal/
H A Dhisi_thermal.c2 * Hisilicon thermal sensor driver
77 int (*get_temp)(struct hisi_thermal_sensor *sensor);
78 int (*enable_sensor)(struct hisi_thermal_sensor *sensor);
79 int (*disable_sensor)(struct hisi_thermal_sensor *sensor);
80 int (*irq_handler)(struct hisi_thermal_sensor *sensor);
86 struct hisi_thermal_sensor *sensor; member
252 * Temperature configuration register - Sensor selection
256 * 0x0: local sensor (default)
257 * 0x1: remote sensor 1 (ACPU cluster 1)
258 * 0x2: remote sensor 2 (ACPU cluster 0)
[all …]
/OK3568_Linux_fs/kernel/drivers/input/sensors/compass/
H A Dak09911.c32 #include <linux/sensor-dev.h>
109 /****************operate according to sensor chip:start************/
112 struct sensor_private_data *sensor = in sensor_active() local
117 sensor->ops->ctrl_data = AK09911_MODE_SNG_MEASURE; in sensor_active()
119 sensor->ops->ctrl_data = AK09911_MODE_POWERDOWN; in sensor_active()
121 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
123 pr_err("%s:fail to active sensor\n", __func__); in sensor_active()
130 struct sensor_private_data *sensor = in sensor_init() local
136 result = sensor->ops->active(client, 0, 0); in sensor_init()
142 sensor->status_cur = SENSOR_OFF; in sensor_init()
[all …]
H A Dak09918.c25 #include <linux/sensor-dev.h>
101 /****************operate according to sensor chip:start************/
104 struct sensor_private_data *sensor = in sensor_active() local
109 sensor->ops->ctrl_data = AK09918_MODE_SNG_MEASURE; in sensor_active()
111 sensor->ops->ctrl_data = AK09918_MODE_POWERDOWN; in sensor_active()
114 sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
117 "%s: fail to active sensor(%d)\n", __func__, result); in sensor_active()
124 struct sensor_private_data *sensor = in sensor_init() local
130 result = sensor->ops->active(client, 0, 0); in sensor_init()
137 sensor->status_cur = SENSOR_OFF; in sensor_init()
[all …]
H A Dak8975.c33 #include <linux/sensor-dev.h>
113 /****************operate according to sensor chip:start************/
117 struct sensor_private_data *sensor = in sensor_active() local
121 //sensor->ops->ctrl_data = sensor_read_reg(client, sensor->ops->ctrl_reg); in sensor_active()
126 sensor->ops->ctrl_data = AK8975_MODE_SNG_MEASURE; in sensor_active()
130 sensor->ops->ctrl_data = AK8975_MODE_POWERDOWN; in sensor_active()
133 …DBG("%s:reg=0x%x,reg_ctrl=0x%x,enable=%d\n",__func__,sensor->ops->ctrl_reg, sensor->ops->ctrl_data… in sensor_active()
134 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
136 printk("%s:fail to active sensor\n",__func__); in sensor_active()
144 struct sensor_private_data *sensor = in sensor_init() local
[all …]
H A Dak8963.c32 #include <linux/sensor-dev.h>
109 /****************operate according to sensor chip:start************/
113 struct sensor_private_data *sensor = in sensor_active() local
118 sensor->ops->ctrl_data = AK8963_MODE_SNG_MEASURE; in sensor_active()
120 sensor->ops->ctrl_data = AK8963_MODE_POWERDOWN; in sensor_active()
122 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
124 pr_err("%s:fail to active sensor\n", __func__); in sensor_active()
131 struct sensor_private_data *sensor = in sensor_init() local
138 result = sensor->ops->active(client, 0, 0); in sensor_init()
144 sensor->status_cur = SENSOR_OFF; in sensor_init()
[all …]
/OK3568_Linux_fs/kernel/drivers/input/rmi4/
H A Drmi_2d_sensor.c22 void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor, in rmi_2d_sensor_abs_process() argument
26 struct rmi_2d_axis_alignment *axis_align = &sensor->axis_align; in rmi_2d_sensor_abs_process()
33 obj->x = sensor->max_x - obj->x; in rmi_2d_sensor_abs_process()
36 obj->y = sensor->max_y - obj->y; in rmi_2d_sensor_abs_process()
56 obj->x = min(sensor->max_x, obj->x); in rmi_2d_sensor_abs_process()
59 obj->y = min(sensor->max_y, obj->y); in rmi_2d_sensor_abs_process()
61 sensor->tracking_pos[slot].x = obj->x; in rmi_2d_sensor_abs_process()
62 sensor->tracking_pos[slot].y = obj->y; in rmi_2d_sensor_abs_process()
66 void rmi_2d_sensor_abs_report(struct rmi_2d_sensor *sensor, in rmi_2d_sensor_abs_report() argument
70 struct rmi_2d_axis_alignment *axis_align = &sensor->axis_align; in rmi_2d_sensor_abs_report()
[all …]
H A Drmi_f12.c29 struct rmi_2d_sensor sensor; member
66 struct rmi_2d_sensor *sensor = &f12->sensor; in rmi_f12_read_sensor_tuning() local
67 struct rmi_function *fn = sensor->fn; in rmi_f12_read_sensor_tuning()
80 "F12 does not have the sensor tuning control register\n"); in rmi_f12_read_sensor_tuning()
100 sensor->max_x = (buf[offset + 1] << 8) | buf[offset]; in rmi_f12_read_sensor_tuning()
101 sensor->max_y = (buf[offset + 3] << 8) | buf[offset + 2]; in rmi_f12_read_sensor_tuning()
106 sensor->max_x, sensor->max_y); in rmi_f12_read_sensor_tuning()
115 /* Units 1/128 sensor pitch */ in rmi_f12_read_sensor_tuning()
131 /* Skip over sensor flags */ in rmi_f12_read_sensor_tuning()
135 sensor->x_mm = (pitch_x * rx_receivers) >> 12; in rmi_f12_read_sensor_tuning()
[all …]
H A Drmi_f11.c36 * a given sensor are described by its query registers. The number of query
38 * queries as well as the sensor query information.
40 * Similarly, each sensor has control registers that govern its behavior. The
41 * size and layout of the control registers for a given sensor can be determined
44 * And in a likewise fashion, each sensor has data registers where it reports
49 * registers in order to determine the attributes of a sensor. Then
51 * registers for sensor.
66 * @rezero - writing this to the F11 command register will cause the sensor to
183 * @nr_fingers - describes the maximum number of fingers the 2-D sensor
185 * @has_rel - the sensor supports relative motion reporting.
[all …]
/OK3568_Linux_fs/kernel/drivers/iio/imu/st_lsm6dsr/
H A Dst_lsm6dsr_shub.c3 * STMicroelectronics st_lsm6dsr sensor hub library driver
37 * reg: Generic sensor register description.
38 * off_val: Value to write into register to power off external sensor.
39 * on_val: Value to write into register for power on external sensor.
49 * @brief External sensor descritor entry
53 * odr_table: ODR sensor table.
62 * data_len: Sensor output data len.
235 struct st_lsm6dsr_sensor *sensor; in st_lsm6dsr_shub_wait_complete() local
238 sensor = iio_priv(hw->iio_devs[ST_LSM6DSR_ID_ACC]); in st_lsm6dsr_shub_wait_complete()
240 odr = (hw->enable_mask & BIT(ST_LSM6DSR_ID_ACC)) ? sensor->odr : 13; in st_lsm6dsr_shub_wait_complete()
[all …]
/OK3568_Linux_fs/kernel/drivers/hwmon/
H A Dscpi-hwmon.c3 * System Control and Power Interface(SCPI) based hwmon sensor driver
57 static void scpi_scale_reading(u64 *value, struct sensor_data *sensor) in scpi_scale_reading() argument
59 if (scpi_scale[sensor->info.class] != sensor->scale) { in scpi_scale_reading()
60 *value *= scpi_scale[sensor->info.class]; in scpi_scale_reading()
61 do_div(*value, sensor->scale); in scpi_scale_reading()
70 struct sensor_data *sensor = &scpi_sensors->data[zone->sensor_id]; in scpi_read_temp() local
74 ret = scpi_ops->sensor_get_value(sensor->info.sensor_id, &value); in scpi_read_temp()
78 scpi_scale_reading(&value, sensor); in scpi_read_temp()
90 struct sensor_data *sensor; in scpi_show_sensor() local
94 sensor = container_of(attr, struct sensor_data, dev_attr_input); in scpi_show_sensor()
[all …]
/OK3568_Linux_fs/kernel/drivers/media/i2c/et8ek8/
H A Det8ek8_driver.c70 * This table describes what should be written to the sensor register
551 * If power is on, also updates the sensor analog and digital gains.
554 static int et8ek8_set_gain(struct et8ek8_sensor *sensor, s32 gain) in et8ek8_set_gain() argument
556 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_gain()
582 static int et8ek8_set_test_pattern(struct et8ek8_sensor *sensor, s32 mode) in et8ek8_set_test_pattern() argument
584 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_test_pattern()
638 struct et8ek8_sensor *sensor = in et8ek8_set_ctrl() local
643 return et8ek8_set_gain(sensor, ctrl->val); in et8ek8_set_ctrl()
648 v4l2_get_subdevdata(&sensor->subdev); in et8ek8_set_ctrl()
655 return et8ek8_set_test_pattern(sensor, ctrl->val); in et8ek8_set_ctrl()
[all …]
/OK3568_Linux_fs/kernel/drivers/input/sensors/accel/
H A Dmxc622x.c33 #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
[all …]
/OK3568_Linux_fs/kernel/drivers/input/sensors/angle/
H A Dangle_kxtik.c32 #include <linux/sensor-dev.h>
117 /****************operate according to sensor chip:start************/
121 struct sensor_private_data *sensor = in sensor_active() local
126 sensor->ops->ctrl_data = sensor_read_reg(client, sensor->ops->ctrl_reg); in sensor_active()
132 sensor->ops->ctrl_data |= status; in sensor_active()
137 sensor->ops->ctrl_data &= status; in sensor_active()
140 …DBG("%s:reg=0x%x,reg_ctrl=0x%x,enable=%d\n",__func__,sensor->ops->ctrl_reg, sensor->ops->ctrl_data… in sensor_active()
141 result = sensor_write_reg(client, sensor->ops->ctrl_reg, sensor->ops->ctrl_data); in sensor_active()
143 printk("%s:fail to active sensor\n",__func__); in sensor_active()
151 struct sensor_private_data *sensor = in sensor_init() local
[all …]

12345678910>>...101