Searched refs:tmp102 (Results 1 - 1 of 1) sorted by relevance
/linux-4.1.27/drivers/hwmon/ |
H A D | tmp102.c | 33 #define DRIVER_NAME "tmp102" 53 struct tmp102 { struct 81 static struct tmp102 *tmp102_update_device(struct device *dev) tmp102_update_device() 83 struct tmp102 *tmp102 = dev_get_drvdata(dev); tmp102_update_device() local 84 struct i2c_client *client = tmp102->client; tmp102_update_device() 86 mutex_lock(&tmp102->lock); tmp102_update_device() 87 if (time_after(jiffies, tmp102->last_update + HZ / 3)) { tmp102_update_device() 89 for (i = 0; i < ARRAY_SIZE(tmp102->temp); ++i) { tmp102_update_device() 93 tmp102->temp[i] = tmp102_reg_to_mC(status); tmp102_update_device() 95 tmp102->last_update = jiffies; tmp102_update_device() 97 mutex_unlock(&tmp102->lock); tmp102_update_device() 98 return tmp102; tmp102_update_device() 103 struct tmp102 *tmp102 = tmp102_update_device(dev); tmp102_read_temp() local 105 *temp = tmp102->temp[0]; tmp102_read_temp() 115 struct tmp102 *tmp102 = tmp102_update_device(dev); tmp102_show_temp() local 117 return sprintf(buf, "%d\n", tmp102->temp[sda->index]); tmp102_show_temp() 125 struct tmp102 *tmp102 = dev_get_drvdata(dev); tmp102_set_temp() local 126 struct i2c_client *client = tmp102->client; tmp102_set_temp() 134 mutex_lock(&tmp102->lock); tmp102_set_temp() 135 tmp102->temp[sda->index] = val; tmp102_set_temp() 138 mutex_unlock(&tmp102->lock); tmp102_set_temp() 156 ATTRIBUTE_GROUPS(tmp102); variable 170 struct tmp102 *tmp102; tmp102_probe() local 180 tmp102 = devm_kzalloc(dev, sizeof(*tmp102), GFP_KERNEL); tmp102_probe() 181 if (!tmp102) tmp102_probe() 184 i2c_set_clientdata(client, tmp102); tmp102_probe() 185 tmp102->client = client; tmp102_probe() 192 tmp102->config_orig = status; tmp102_probe() 210 tmp102->last_update = jiffies - HZ; tmp102_probe() 211 mutex_init(&tmp102->lock); tmp102_probe() 214 tmp102, tmp102_groups); tmp102_probe() 220 tmp102->hwmon_dev = hwmon_dev; tmp102_probe() 221 tmp102->tz = thermal_zone_of_sensor_register(hwmon_dev, 0, hwmon_dev, tmp102_probe() 223 if (IS_ERR(tmp102->tz)) tmp102_probe() 224 tmp102->tz = NULL; tmp102_probe() 232 tmp102->config_orig); tmp102_probe() 238 struct tmp102 *tmp102 = i2c_get_clientdata(client); tmp102_remove() local 240 thermal_zone_of_sensor_unregister(tmp102->hwmon_dev, tmp102->tz); tmp102_remove() 241 hwmon_device_unregister(tmp102->hwmon_dev); tmp102_remove() 244 if (tmp102->config_orig & TMP102_CONF_SD) { tmp102_remove() 287 { "tmp102", 0 },
|
Completed in 43 milliseconds