Lines Matching refs:tmp102
54 struct tmp102 { struct
75 struct tmp102 *tmp102 = dev_get_drvdata(dev); in tmp102_read() argument
82 if (time_before(jiffies, tmp102->ready_time)) { in tmp102_read()
98 err = regmap_read(tmp102->regmap, reg, ®val); in tmp102_read()
109 struct tmp102 *tmp102 = dev_get_drvdata(dev); in tmp102_write() local
124 return regmap_write(tmp102->regmap, reg, tmp102_mC_to_reg(temp)); in tmp102_write()
165 struct tmp102 *tmp102 = data; in tmp102_restore_config() local
167 regmap_write(tmp102->regmap, TMP102_CONF_REG, tmp102->config_orig); in tmp102_restore_config()
196 struct tmp102 *tmp102; in tmp102_probe() local
207 tmp102 = devm_kzalloc(dev, sizeof(*tmp102), GFP_KERNEL); in tmp102_probe()
208 if (!tmp102) in tmp102_probe()
211 i2c_set_clientdata(client, tmp102); in tmp102_probe()
213 tmp102->regmap = devm_regmap_init_i2c(client, &tmp102_regmap_config); in tmp102_probe()
214 if (IS_ERR(tmp102->regmap)) in tmp102_probe()
215 return PTR_ERR(tmp102->regmap); in tmp102_probe()
217 err = regmap_read(tmp102->regmap, TMP102_CONF_REG, ®val); in tmp102_probe()
229 tmp102->config_orig = regval; in tmp102_probe()
231 err = devm_add_action_or_reset(dev, tmp102_restore_config, tmp102); in tmp102_probe()
238 err = regmap_write(tmp102->regmap, TMP102_CONF_REG, regval); in tmp102_probe()
248 tmp102->ready_time = jiffies + msecs_to_jiffies(CONVERSION_TIME_MS); in tmp102_probe()
251 tmp102, in tmp102_probe()
266 struct tmp102 *tmp102 = i2c_get_clientdata(client); in tmp102_suspend() local
268 return regmap_update_bits(tmp102->regmap, TMP102_CONF_REG, in tmp102_suspend()
275 struct tmp102 *tmp102 = i2c_get_clientdata(client); in tmp102_resume() local
278 err = regmap_update_bits(tmp102->regmap, TMP102_CONF_REG, in tmp102_resume()
281 tmp102->ready_time = jiffies + msecs_to_jiffies(CONVERSION_TIME_MS); in tmp102_resume()