Пример #1
0
static int tmp102_read_temp(void *dev, long *temp)
{
	struct tmp102 *tmp102 = tmp102_update_device(to_i2c_client(dev));

	*temp = tmp102->temp[0];

	return 0;
}
Пример #2
0
static int tmp102_read_temp(void *dev, int *temp)
{
	struct tmp102 *tmp102 = tmp102_update_device(dev);

	*temp = tmp102->temp[0];

	return 0;
}
Пример #3
0
static ssize_t tmp102_show_temp(struct device *dev,
				struct device_attribute *attr,
				char *buf)
{
	struct sensor_device_attribute *sda = to_sensor_dev_attr(attr);
	struct tmp102 *tmp102 = tmp102_update_device(to_i2c_client(dev));

	return sprintf(buf, "%d\n", tmp102->temp[sda->index]);
}