/* Get alarm stati: Possible values: 0 = no alarm 1 = alarm  */
static ssize_t get_alarm(struct device *dev, struct device_attribute *devattr, char *buf)
/* Get alarm stati: Possible values: 0 = no alarm 1 = alarm  */
static ssize_t get_alarm(struct device *dev, struct device_attribute *devattr, char *buf)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	struct max6650_data *data = max6650_update_device(dev);
	struct i2c_client *client = to_i2c_client(dev);
	int alarm = 0;
	if (data->alarm & attr->index) {
		mutex_lock(&data->update_lock);
		alarm = 1;
		data->alarm &= ~attr->index;
		data->alarm |= i2c_smbus_read_byte_data(client,
							MAX6650_REG_ALARM);
		mutex_unlock(&data->update_lock);
	}
	return sprintf(buf, "%d\n", alarm);
}