Exemplo n.º 1
0
static ssize_t show_alarms_temp(struct device *dev, struct device_attribute
                                *devattr, char *buf)
{
    struct f71805f_data *data = f71805f_update_device(dev);

    return sprintf(buf, "%d\n", (data->alarms[1] >> 3) & 0x07);
}
Exemplo n.º 2
0
static ssize_t show_in0_min(struct device *dev, struct device_attribute
                            *devattr, char *buf)
{
    struct f71805f_data *data = f71805f_update_device(dev);

    return sprintf(buf, "%ld\n", in0_from_reg(data->in_low[0]));
}
Exemplo n.º 3
0
static ssize_t show_alarms_in(struct device *dev, struct device_attribute
			      *devattr, char *buf)
{
	struct f71805f_data *data = f71805f_update_device(dev);

	return sprintf(buf, "%lu\n", data->alarms & 0x7ff);
}
Exemplo n.º 4
0
static ssize_t show_alarms_in(struct device *dev, struct device_attribute
                              *devattr, char *buf)
{
    struct f71805f_data *data = f71805f_update_device(dev);

    return sprintf(buf, "%d\n", data->alarms[0] |
                   ((data->alarms[1] & 0x01) << 8));
}
Exemplo n.º 5
0
static ssize_t show_temp_hyst(struct device *dev, struct device_attribute
                              *devattr, char *buf)
{
    struct f71805f_data *data = f71805f_update_device(dev);
    struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
    int nr = attr->index;

    return sprintf(buf, "%ld\n", temp_from_reg(data->temp_hyst[nr]));
}
Exemplo n.º 6
0
static ssize_t show_alarm(struct device *dev, struct device_attribute
			  *devattr, char *buf)
{
	struct f71805f_data *data = f71805f_update_device(dev);
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	int bitnr = attr->index;

	return sprintf(buf, "%lu\n", (data->alarms >> bitnr) & 1);
}
Exemplo n.º 7
0
static ssize_t show_pwm_mode(struct device *dev, struct device_attribute
			     *devattr, char *buf)
{
	struct f71805f_data *data = f71805f_update_device(dev);
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	int nr = attr->index;

	return sprintf(buf, "%d\n", pwm_mode_from_reg(data->fan_ctrl[nr]));
}
Exemplo n.º 8
0
static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr,
			char *buf)
{
	struct f71805f_data *data = f71805f_update_device(dev);
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	int nr = attr->index;

	return sprintf(buf, "%d\n", (int)data->pwm[nr]);
}
Exemplo n.º 9
0
static ssize_t show_temp_type(struct device *dev, struct device_attribute
                              *devattr, char *buf)
{
    struct f71805f_data *data = f71805f_update_device(dev);
    struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
    int nr = attr->index;

    /* 3 is diode, 4 is thermistor */
    return sprintf(buf, "%u\n", (data->temp_mode & (1 << nr)) ? 3 : 4);
}
Exemplo n.º 10
0
static ssize_t show_pwm_enable(struct device *dev, struct device_attribute
			       *devattr, char *buf)
{
	struct f71805f_data *data = f71805f_update_device(dev);
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	int nr = attr->index;
	int mode;

	switch (data->fan_ctrl[nr] & FAN_CTRL_MODE_MASK) {
	case FAN_CTRL_MODE_SPEED:
		mode = 3;
		break;
	case FAN_CTRL_MODE_TEMPERATURE:
		mode = 2;
		break;
	default: /* MANUAL */
		mode = 1;
	}

	return sprintf(buf, "%d\n", mode);
}