/drivers/media/i2c/smiapp/ |
D | smiapp-core.c | 66 static int smiapp_read_frame_fmt(struct smiapp_sensor *sensor) in smiapp_read_frame_fmt() argument 68 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in smiapp_read_frame_fmt() 76 rval = smiapp_read(sensor, SMIAPP_REG_U8_FRAME_FORMAT_MODEL_TYPE, in smiapp_read_frame_fmt() 81 rval = smiapp_read(sensor, SMIAPP_REG_U8_FRAME_FORMAT_MODEL_SUBTYPE, in smiapp_read_frame_fmt() 107 sensor, in smiapp_read_frame_fmt() 121 sensor, in smiapp_read_frame_fmt() 178 || pixels >= sensor->limits[SMIAPP_LIMIT_MIN_FRAME_LENGTH_LINES] / 2) in smiapp_read_frame_fmt() 198 static int smiapp_pll_configure(struct smiapp_sensor *sensor) in smiapp_pll_configure() argument 200 struct smiapp_pll *pll = &sensor->pll; in smiapp_pll_configure() 204 sensor, SMIAPP_REG_U16_VT_PIX_CLK_DIV, pll->vt.pix_clk_div); in smiapp_pll_configure() [all …]
|
D | smiapp-quirk.c | 23 static int smiapp_write_8(struct smiapp_sensor *sensor, u16 reg, u8 val) in smiapp_write_8() argument 25 return smiapp_write(sensor, SMIAPP_REG_MK_U8(reg), val); in smiapp_write_8() 28 static int smiapp_write_8s(struct smiapp_sensor *sensor, in smiapp_write_8s() argument 31 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in smiapp_write_8s() 35 rval = smiapp_write_8(sensor, regs->reg, regs->val); in smiapp_write_8s() 47 void smiapp_replace_limit(struct smiapp_sensor *sensor, in smiapp_replace_limit() argument 50 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in smiapp_replace_limit() 55 sensor->limits[limit] = val; in smiapp_replace_limit() 58 static int jt8ew9_limits(struct smiapp_sensor *sensor) in jt8ew9_limits() argument 60 if (sensor->minfo.revision_number_major < 0x03) in jt8ew9_limits() [all …]
|
D | smiapp-quirk.h | 48 int (*limits)(struct smiapp_sensor *sensor); 49 int (*post_poweron)(struct smiapp_sensor *sensor); 50 int (*pre_streamon)(struct smiapp_sensor *sensor); 51 int (*post_streamoff)(struct smiapp_sensor *sensor); 52 unsigned long (*pll_flags)(struct smiapp_sensor *sensor); 53 int (*init)(struct smiapp_sensor *sensor); 54 int (*reg_access)(struct smiapp_sensor *sensor, bool write, u32 *reg, 66 void smiapp_replace_limit(struct smiapp_sensor *sensor, 75 #define smiapp_call_quirk(sensor, _quirk, ...) \ argument 76 ((sensor)->minfo.quirk && \ [all …]
|
D | smiapp-regs.c | 75 static int ____smiapp_read(struct smiapp_sensor *sensor, u16 reg, in ____smiapp_read() argument 78 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in ____smiapp_read() 134 static int ____smiapp_read_8only(struct smiapp_sensor *sensor, u16 reg, in ____smiapp_read_8only() argument 145 rval = ____smiapp_read(sensor, reg + i, 1, &val8); in ____smiapp_read_8only() 158 static int __smiapp_read(struct smiapp_sensor *sensor, u32 reg, u32 *val, in __smiapp_read() argument 161 struct i2c_client *client = v4l2_get_subdevdata(&sensor->src->sd); in __smiapp_read() 170 rval = ____smiapp_read(sensor, SMIAPP_REG_ADDR(reg), len, val); in __smiapp_read() 172 rval = ____smiapp_read_8only(sensor, SMIAPP_REG_ADDR(reg), len, in __smiapp_read() 183 int smiapp_read_no_quirk(struct smiapp_sensor *sensor, u32 reg, u32 *val) in smiapp_read_no_quirk() argument 186 sensor, reg, val, in smiapp_read_no_quirk() [all …]
|
/drivers/thermal/st/ |
D | st_thermal.c | 28 static int st_thermal_alloc_regfields(struct st_thermal_sensor *sensor) in st_thermal_alloc_regfields() argument 30 struct device *dev = sensor->dev; in st_thermal_alloc_regfields() 31 struct regmap *regmap = sensor->regmap; in st_thermal_alloc_regfields() 32 const struct reg_field *reg_fields = sensor->cdata->reg_fields; in st_thermal_alloc_regfields() 34 sensor->dcorrect = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields() 37 sensor->overflow = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields() 40 sensor->temp_data = devm_regmap_field_alloc(dev, regmap, in st_thermal_alloc_regfields() 43 if (IS_ERR(sensor->dcorrect) || in st_thermal_alloc_regfields() 44 IS_ERR(sensor->overflow) || in st_thermal_alloc_regfields() 45 IS_ERR(sensor->temp_data)) { in st_thermal_alloc_regfields() [all …]
|
D | st_thermal_memmap.c | 43 struct st_thermal_sensor *sensor = sdata; in st_mmap_thermal_trip_handler() local 45 thermal_zone_device_update(sensor->thermal_dev); in st_mmap_thermal_trip_handler() 51 static int st_mmap_power_ctrl(struct st_thermal_sensor *sensor, in st_mmap_power_ctrl() argument 57 return regmap_update_bits(sensor->regmap, STIH416_MPE_CONF, mask, val); in st_mmap_power_ctrl() 60 static int st_mmap_alloc_regfields(struct st_thermal_sensor *sensor) in st_mmap_alloc_regfields() argument 62 struct device *dev = sensor->dev; in st_mmap_alloc_regfields() 63 struct regmap *regmap = sensor->regmap; in st_mmap_alloc_regfields() 64 const struct reg_field *reg_fields = sensor->cdata->reg_fields; in st_mmap_alloc_regfields() 66 sensor->int_thresh_hi = devm_regmap_field_alloc(dev, regmap, in st_mmap_alloc_regfields() 68 sensor->int_enable = devm_regmap_field_alloc(dev, regmap, in st_mmap_alloc_regfields() [all …]
|
D | st_thermal_syscfg.c | 67 static int st_syscfg_power_ctrl(struct st_thermal_sensor *sensor, in st_syscfg_power_ctrl() argument 70 return regmap_field_write(sensor->pwr, power_state); in st_syscfg_power_ctrl() 73 static int st_syscfg_alloc_regfields(struct st_thermal_sensor *sensor) in st_syscfg_alloc_regfields() argument 75 struct device *dev = sensor->dev; in st_syscfg_alloc_regfields() 77 sensor->pwr = devm_regmap_field_alloc(dev, sensor->regmap, in st_syscfg_alloc_regfields() 78 sensor->cdata->reg_fields[TEMP_PWR]); in st_syscfg_alloc_regfields() 80 if (IS_ERR(sensor->pwr)) { in st_syscfg_alloc_regfields() 82 return PTR_ERR(sensor->pwr); in st_syscfg_alloc_regfields() 88 static int st_syscfg_regmap_init(struct st_thermal_sensor *sensor) in st_syscfg_regmap_init() argument 90 sensor->regmap = in st_syscfg_regmap_init() [all …]
|
/drivers/media/i2c/ |
D | mt9m032.c | 168 #define to_dev(sensor) \ argument 169 (&((struct i2c_client *)v4l2_get_subdevdata(&(sensor)->subdev))->dev) 181 static u32 mt9m032_row_time(struct mt9m032 *sensor, unsigned int width) in mt9m032_row_time() argument 187 ns = div_u64(1000000000ULL * effective_width, sensor->pix_clock); in mt9m032_row_time() 188 dev_dbg(to_dev(sensor), "MT9M032 line time: %u ns\n", ns); in mt9m032_row_time() 192 static int mt9m032_update_timing(struct mt9m032 *sensor, in mt9m032_update_timing() argument 195 struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev); in mt9m032_update_timing() 196 struct v4l2_rect *crop = &sensor->crop; in mt9m032_update_timing() 202 interval = &sensor->frame_interval; in mt9m032_update_timing() 204 row_time = mt9m032_row_time(sensor, crop->width); in mt9m032_update_timing() [all …]
|
D | s5k6a3.c | 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 144 mf = __s5k6a3_get_format(sensor, cfg, fmt->pad, fmt->which); in s5k6a3_set_fmt() 146 mutex_lock(&sensor->lock); in s5k6a3_set_fmt() 149 mutex_unlock(&sensor->lock); in s5k6a3_set_fmt() 158 struct s5k6a3 *sensor = sd_to_s5k6a3(sd); in s5k6a3_get_fmt() local 161 mf = __s5k6a3_get_format(sensor, cfg, fmt->pad, fmt->which); in s5k6a3_get_fmt() 163 mutex_lock(&sensor->lock); in s5k6a3_get_fmt() [all …]
|
D | vs6624.c | 576 struct vs6624 *sensor = to_vs6624(sd); in vs6624_set_fmt() local 646 sensor->fmt = *fmt; in vs6624_set_fmt() 655 struct vs6624 *sensor = to_vs6624(sd); in vs6624_get_fmt() local 660 format->format = sensor->fmt; in vs6624_get_fmt() 666 struct vs6624 *sensor = to_vs6624(sd); in vs6624_g_parm() local 674 cp->timeperframe.numerator = sensor->frame_rate.denominator; in vs6624_g_parm() 675 cp->timeperframe.denominator = sensor->frame_rate.numerator; in vs6624_g_parm() 681 struct vs6624 *sensor = to_vs6624(sd); in vs6624_s_parm() local 696 sensor->frame_rate.numerator = tpf->denominator; in vs6624_s_parm() 697 sensor->frame_rate.denominator = tpf->numerator; in vs6624_s_parm() [all …]
|
/drivers/hwmon/ |
D | scpi-hwmon.c | 54 struct sensor_data *sensor = &scpi_sensors->data[zone->sensor_id]; in scpi_read_temp() local 58 ret = scpi_ops->sensor_get_value(sensor->info.sensor_id, &value); in scpi_read_temp() 72 struct sensor_data *sensor; in scpi_show_sensor() local 76 sensor = container_of(attr, struct sensor_data, dev_attr_input); in scpi_show_sensor() 78 ret = scpi_ops->sensor_get_value(sensor->info.sensor_id, &value); in scpi_show_sensor() 88 struct sensor_data *sensor; in scpi_show_label() local 90 sensor = container_of(attr, struct sensor_data, dev_attr_label); in scpi_show_label() 92 return sprintf(buf, "%s\n", sensor->info.name); in scpi_show_label() 150 struct sensor_data *sensor = &scpi_sensors->data[idx]; in scpi_hwmon_probe() local 152 ret = scpi_ops->sensor_get_info(i, &sensor->info); in scpi_hwmon_probe() [all …]
|
/drivers/thermal/ |
D | hisi_thermal.c | 80 struct hisi_thermal_sensor *sensor) in hisi_thermal_get_sensor_temp() argument 94 writel((sensor->id << 12), data->regs + TEMP0_CFG); in hisi_thermal_get_sensor_temp() 112 struct hisi_thermal_sensor *sensor; in hisi_thermal_enable_bind_irq_sensor() local 116 sensor = &data->sensors[data->irq_bind_sensor]; in hisi_thermal_enable_bind_irq_sensor() 126 writel((sensor->id << 12), data->regs + TEMP0_CFG); in hisi_thermal_enable_bind_irq_sensor() 129 writel(_temp_to_step(sensor->thres_temp) | 0x0FFFFFF00, in hisi_thermal_enable_bind_irq_sensor() 160 struct hisi_thermal_sensor *sensor = _sensor; in hisi_thermal_get_temp() local 161 struct hisi_thermal_data *data = sensor->thermal; in hisi_thermal_get_temp() 166 *temp = hisi_thermal_get_sensor_temp(data, sensor); in hisi_thermal_get_temp() 168 sensor->sensor_temp = *temp; in hisi_thermal_get_temp() [all …]
|
/drivers/input/misc/ |
D | mpu3050.c | 198 struct mpu3050_sensor *sensor = input_get_drvdata(input); in mpu3050_input_open() local 201 pm_runtime_get(sensor->dev); in mpu3050_input_open() 204 error = i2c_smbus_write_byte_data(sensor->client, MPU3050_INT_CFG, in mpu3050_input_open() 209 pm_runtime_put(sensor->dev); in mpu3050_input_open() 225 struct mpu3050_sensor *sensor = input_get_drvdata(input); in mpu3050_input_close() local 227 pm_runtime_put(sensor->dev); in mpu3050_input_close() 240 struct mpu3050_sensor *sensor = data; in mpu3050_interrupt_thread() local 243 mpu3050_read_xyz(sensor->client, &axis); in mpu3050_interrupt_thread() 245 input_report_abs(sensor->idev, ABS_X, axis.x); in mpu3050_interrupt_thread() 246 input_report_abs(sensor->idev, ABS_Y, axis.y); in mpu3050_interrupt_thread() [all …]
|
/drivers/gpu/drm/nouveau/nvkm/subdev/therm/ |
D | g84.c | 56 struct nvbios_therm_sensor *sensor = &therm->bios_sensor; in g84_therm_program_alarms() local 61 spin_lock_irqsave(&therm->sensor.alarm_program_lock, flags); in g84_therm_program_alarms() 67 nvkm_wr32(device, 0x20484, sensor->thrs_shutdown.hysteresis); in g84_therm_program_alarms() 68 nvkm_wr32(device, 0x20480, sensor->thrs_shutdown.temp); in g84_therm_program_alarms() 71 nvkm_wr32(device, 0x204c4, sensor->thrs_fan_boost.temp); in g84_therm_program_alarms() 74 nvkm_wr32(device, 0x204c0, sensor->thrs_critical.temp); in g84_therm_program_alarms() 77 nvkm_wr32(device, 0x20414, sensor->thrs_down_clock.temp); in g84_therm_program_alarms() 78 spin_unlock_irqrestore(&therm->sensor.alarm_program_lock, flags); in g84_therm_program_alarms() 82 sensor->thrs_fan_boost.temp, in g84_therm_program_alarms() 83 sensor->thrs_fan_boost.hysteresis, in g84_therm_program_alarms() [all …]
|
D | temp.c | 62 therm->sensor.alarm_state[thrs] = st; in nvkm_therm_sensor_set_threshold_state() 70 return therm->sensor.alarm_state[thrs]; in nvkm_therm_sensor_get_threshold_state() 165 container_of(alarm, struct nvkm_therm, sensor.therm_poll_alarm); in alarm_timer_callback() 166 struct nvbios_therm_sensor *sensor = &therm->bios_sensor; in alarm_timer_callback() local 170 spin_lock_irqsave(&therm->sensor.alarm_program_lock, flags); in alarm_timer_callback() 172 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_fan_boost, in alarm_timer_callback() 176 &sensor->thrs_down_clock, in alarm_timer_callback() 179 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_critical, in alarm_timer_callback() 182 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, in alarm_timer_callback() 185 spin_unlock_irqrestore(&therm->sensor.alarm_program_lock, flags); in alarm_timer_callback() [all …]
|
D | nv50.c | 132 struct nvbios_therm_sensor *sensor = &therm->bios_sensor; in nv50_temp_get() local 138 if (!sensor->slope_div || !sensor->slope_mult || in nv50_temp_get() 139 !sensor->offset_num || !sensor->offset_den) in nv50_temp_get() 142 core_temp = core_temp * sensor->slope_mult / sensor->slope_div; in nv50_temp_get() 143 core_temp = core_temp + sensor->offset_num / sensor->offset_den; in nv50_temp_get() 144 core_temp = core_temp + sensor->offset_constant - 8; in nv50_temp_get()
|
/drivers/media/usb/gspca/ |
D | t613.c | 51 u8 sensor; member 526 all_gain_reg[7] = sensor_data[sd->sensor].reg80; in setawb_n_RGB() 548 switch (sd->sensor) { in setfreq() 582 const struct additional_sensor_data *sensor; in sd_init() local 600 sd->sensor = SENSOR_TAS5130A; in sd_init() 604 sd->sensor = SENSOR_LT168G; in sd_init() 608 sd->sensor = SENSOR_OTHER; in sd_init() 612 sd->sensor = SENSOR_OM6802; in sd_init() 619 if (sd->sensor == SENSOR_OM6802) { in sd_init() 644 sensor = &sensor_data[sd->sensor]; in sd_init() [all …]
|
D | sq930x.c | 46 u8 sensor; member 497 const struct sensor_s *sensor; in i2c_write() local 505 sensor = &sensor_tb[sd->sensor]; in i2c_write() 507 val = (sensor->i2c_addr << 8) | SQ930_CTRL_I2C_IO; in i2c_write() 511 *buf++ = sensor->i2c_dum; in i2c_write() 518 *buf++ = sensor->i2c_dum; in i2c_write() 642 const struct sensor_s *sensor; in cmos_probe() local 652 sensor = &sensor_tb[probe_order[i]]; in cmos_probe() 653 ucbus_write(&sd->gspca_dev, sensor->cmd, sensor->cmd_len, 8); in cmos_probe() 654 gpio_init(sd, sensor->gpio); in cmos_probe() [all …]
|
D | sonixb.c | 80 __u8 sensor; /* Type of image sensor chip */ member 118 #define SENS(bridge, sensor, _flags, _sensor_addr) \ argument 121 .sensor_init = sensor, \ 122 .sensor_init_size = sizeof(sensor), \ 550 switch (sd->sensor) { in setbrightness() 557 i2cOV[1] = sensor_data[sd->sensor].sensor_addr; in setbrightness() 570 if (sd->sensor == SENSOR_PAS106) { in setbrightness() 597 switch (sd->sensor) { in setgain() 642 if (sd->sensor == SENSOR_OV7630 && gain >= 32) in setgain() 645 i2c[1] = sensor_data[sd->sensor].sensor_addr; in setgain() [all …]
|
D | sonixj.c | 82 u8 sensor; /* Type of image sensor chip */ member 1249 switch (sd->sensor) { in i2c_w1() 1312 switch (sd->sensor) { in i2c_r() 1410 sd->sensor = SENSOR_MI0360B; in mi0360_probe() 1414 sd->sensor = SENSOR_MT9V111; in mi0360_probe() 1441 sd->sensor = SENSOR_SOI768; in ov7630_probe() 1481 sd->sensor = SENSOR_PO1030; in ov7648_probe() 1504 sd->sensor = SENSOR_GC0307; in po2030n_probe() 1534 sd->sensor = id->driver_info >> 8; in sd_config() 1538 if (sd->sensor == SENSOR_ADCM1700) { in sd_config() [all …]
|
/drivers/media/usb/gspca/m5602/ |
D | m5602_core.c | 105 if (!len || len > sd->sensor->i2c_regW) in m5602_read_sensor() 113 sd->sensor->i2c_slave_id); in m5602_read_sensor() 125 if (sd->sensor->i2c_regW == 1) { in m5602_read_sensor() 158 if (len > sd->sensor->i2c_regW || !len) in m5602_write_sensor() 164 buf[11] = sd->sensor->i2c_slave_id; in m5602_write_sensor() 209 sd->sensor = &po1030; in m5602_probe_sensor() 210 if (!sd->sensor->probe(sd)) in m5602_probe_sensor() 214 sd->sensor = &mt9m111; in m5602_probe_sensor() 215 if (!sd->sensor->probe(sd)) in m5602_probe_sensor() 219 sd->sensor = &s5k4aa; in m5602_probe_sensor() [all …]
|
/drivers/iio/light/ |
D | Kconfig | 22 tristate "ADJD-S311-CR999 digital color sensor" 28 digital color light sensor. 34 tristate "AL3320A ambient light sensor" 38 ambient light sensor. 44 tristate "APDS9300 ambient light sensor" 48 ambient light sensor. 54 tristate "Avago APDS9960 gesture/RGB/ALS/proximity sensor" 61 APDS9960 gesture/RGB/ALS/proximity sensor. 67 tristate "ROHM BH1750 ambient light sensor" 81 This option enables ambient light sensor using [all …]
|
/drivers/gpu/drm/nouveau/nvkm/subdev/bios/ |
D | therm.c | 69 struct nvbios_therm_sensor *sensor) in nvbios_therm_sensor_parse() argument 96 sensor->offset_constant = offset; in nvbios_therm_sensor_parse() 102 sensor->thrs_critical.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse() 103 sensor->thrs_critical.hysteresis = value & 0xf; in nvbios_therm_sensor_parse() 109 sensor->thrs_down_clock.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse() 110 sensor->thrs_down_clock.hysteresis = value & 0xf; in nvbios_therm_sensor_parse() 116 sensor->thrs_fan_boost.temp = (value & 0xff0) >> 4; in nvbios_therm_sensor_parse() 117 sensor->thrs_fan_boost.hysteresis = value & 0xf; in nvbios_therm_sensor_parse() 123 sensor->offset_num = value; in nvbios_therm_sensor_parse() 128 sensor->offset_den = value; in nvbios_therm_sensor_parse() [all …]
|
/drivers/hwmon/pmbus/ |
D | pmbus_core.c | 390 struct pmbus_sensor *sensor; in pmbus_update_device() local 421 for (sensor = data->sensors; sensor; sensor = sensor->next) { in pmbus_update_device() 422 if (!data->valid || sensor->update) in pmbus_update_device() 423 sensor->data in pmbus_update_device() 425 sensor->page, in pmbus_update_device() 426 sensor->reg); in pmbus_update_device() 441 struct pmbus_sensor *sensor) in pmbus_reg2data_linear() argument 447 if (sensor->class == PSC_VOLTAGE_OUT) { /* LINEAR16 */ in pmbus_reg2data_linear() 448 exponent = data->exponent[sensor->page]; in pmbus_reg2data_linear() 449 mantissa = (u16) sensor->data; in pmbus_reg2data_linear() [all …]
|
/drivers/media/usb/gspca/stv06xx/ |
D | stv06xx.c | 87 if (sd->sensor->i2c_len == 2) { in stv06xx_write_sensor() 130 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_bytes() 162 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_write_sensor_words() 182 err = stv06xx_write_bridge(sd, STV_I2C_FLUSH, sd->sensor->i2c_flush); in stv06xx_read_sensor() 190 buf[0x20] = sd->sensor->i2c_addr; in stv06xx_read_sensor() 205 0x04, 0xc0, 0x1410, 0, buf, sd->sensor->i2c_len, in stv06xx_read_sensor() 207 if (sd->sensor->i2c_len == 2) in stv06xx_read_sensor() 262 err = sd->sensor->init(sd); in stv06xx_init() 264 if (dump_sensor && sd->sensor->dump) in stv06xx_init() 265 sd->sensor->dump(sd); in stv06xx_init() [all …]
|