/* Unique to this driver currently */
#define IIO_DEV_ATTR_ACCEL_XY(_show, _addr) \
- IIO_DEVICE_ATTR(accel_xy, S_IRUGO, _show, NULL, _addr)
+ IIO_DEVICE_ATTR(in_accel_xy, S_IRUGO, _show, NULL, _addr)
#define IIO_DEV_ATTR_ACCEL_XYPEAK(_show, _addr) \
- IIO_DEVICE_ATTR(accel_xypeak, S_IRUGO, _show, NULL, _addr)
+ IIO_DEVICE_ATTR(in_accel_xypeak, S_IRUGO, _show, NULL, _addr)
static IIO_DEV_ATTR_ACCEL_XY(adis16204_read_14bit_signed,
ADIS16204_XY_RSS_OUT);
static IIO_DEV_ATTR_ACCEL_XYPEAK(adis16204_read_14bit_signed,
ADIS16204_XY_PEAK_OUT);
-static IIO_CONST_ATTR(accel_xy_scale, "0.017125");
+static IIO_CONST_ATTR(in_accel_xy_scale, "0.017125");
static IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, adis16204_write_reset, 0);
static struct attribute *adis16204_attributes[] = {
&iio_dev_attr_reset.dev_attr.attr,
- &iio_dev_attr_accel_xy.dev_attr.attr,
- &iio_dev_attr_accel_xypeak.dev_attr.attr,
- &iio_const_attr_accel_xy_scale.dev_attr.attr,
+ &iio_dev_attr_in_accel_xy.dev_attr.attr,
+ &iio_dev_attr_in_accel_xypeak.dev_attr.attr,
+ &iio_const_attr_in_accel_xy_scale.dev_attr.attr,
NULL
};
return ret;
}
-static IIO_DEVICE_ATTR(accel_xyz_squared_peak_raw, S_IRUGO,
+static IIO_DEVICE_ATTR(in_accel_xyz_squared_peak_raw, S_IRUGO,
adis16240_read_12bit_signed, NULL,
ADIS16240_XYZPEAK_OUT);
};
static struct attribute *adis16240_attributes[] = {
- &iio_dev_attr_accel_xyz_squared_peak_raw.dev_attr.attr,
+ &iio_dev_attr_in_accel_xyz_squared_peak_raw.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_reset.dev_attr.attr,
NULL
&iio_dev_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
/* Only present if temp sensor is */
- &iio_dev_attr_temp_raw.dev_attr.attr,
- &iio_const_attr_temp_offset.dev_attr.attr,
- &iio_const_attr_temp_scale.dev_attr.attr,
+ &iio_dev_attr_in_temp_raw.dev_attr.attr,
+ &iio_const_attr_in_temp_offset.dev_attr.attr,
+ &iio_const_attr_in_temp_scale.dev_attr.attr,
NULL,
};
/* Free fall detector related event attribute */
static IIO_DEVICE_ATTR_NAMED(accel_xayaz_mag_falling_en,
- accel_x&y&z_mag_falling_en,
+ in_accel_x&y&z_mag_falling_en,
S_IRUGO | S_IWUSR,
sca3000_query_free_fall_mode,
sca3000_set_free_fall_mode,
0);
static IIO_CONST_ATTR_NAMED(accel_xayaz_mag_falling_period,
- accel_x&y&z_mag_falling_period,
+ in_accel_x&y&z_mag_falling_period,
"0.226");
static struct attribute *sca3000_event_attributes[] = {
return sprintf(buf, "0.%06d\n", 4*st->info->scale);
}
-static IIO_DEVICE_ATTR(accel_scale,
+static IIO_DEVICE_ATTR(in_accel_scale,
S_IRUGO,
sca3000_show_buffer_scale,
NULL,
&dev_attr_enable.attr,
&iio_dev_attr_50_percent.dev_attr.attr,
&iio_dev_attr_75_percent.dev_attr.attr,
- &iio_dev_attr_accel_scale.dev_attr.attr,
+ &iio_dev_attr_in_accel_scale.dev_attr.attr,
NULL,
};
return len;
}
-static IIO_DEVICE_ATTR_NAMED(in_m_in_scale_available, in-in_scale_available,
+static IIO_DEVICE_ATTR_NAMED(in_v_m_v_scale_available,
+ in_voltage-voltage_scale_available,
S_IRUGO, ad7192_show_scale_available, NULL, 0);
-static IIO_DEVICE_ATTR(in_scale_available, S_IRUGO,
+static IIO_DEVICE_ATTR(in_voltage_scale_available, S_IRUGO,
ad7192_show_scale_available, NULL, 0);
static ssize_t ad7192_show_ac_excitation(struct device *dev,
static struct attribute *ad7192_attributes[] = {
&iio_dev_attr_sampling_frequency.dev_attr.attr,
- &iio_dev_attr_in_m_in_scale_available.dev_attr.attr,
- &iio_dev_attr_in_scale_available.dev_attr.attr,
+ &iio_dev_attr_in_v_m_v_scale_available.dev_attr.attr,
+ &iio_dev_attr_in_voltage_scale_available.dev_attr.attr,
&iio_dev_attr_bridge_switch_en.dev_attr.attr,
&iio_dev_attr_ac_excitation_en.dev_attr.attr,
NULL
}
static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
- in-in_thresh_low_value,
+ in_voltage-voltage_thresh_low_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
- in-in_thresh_high_value,
+ in_voltage-voltage_thresh_high_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_OVERVOLTAGE);
-static IIO_DEVICE_ATTR(temp_thresh_low_value,
+static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_AUX_ADC_UNDERVOLTAGE);
-static IIO_DEVICE_ATTR(temp_thresh_high_value,
+static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
S_IRUGO | S_IWUSR,
ad7280_read_channel_config,
ad7280_write_channel_config,
static struct attribute *ad7280_event_attributes[] = {
&iio_dev_attr_in_thresh_low_value.dev_attr.attr,
&iio_dev_attr_in_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_temp_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_temp_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_temp_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_temp_thresh_high_value.dev_attr.attr,
NULL,
};
#define IIO_DEV_ATTR_CONVERSION_MODE(_mode, _show, _store) \
IIO_DEVICE_ATTR(conversion_mode, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_CAP_SETUP(_mode, _show, _store) \
- IIO_DEVICE_ATTR(cap_setup, _mode, _show, _store, 0)
+ IIO_DEVICE_ATTR(in_capacitance_setup, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_VT_SETUP(_mode, _show, _store) \
- IIO_DEVICE_ATTR(in0_setup, _mode, _show, _store, 0)
+ IIO_DEVICE_ATTR(in_voltage0_setup, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_EXEC_SETUP(_mode, _show, _store) \
IIO_DEVICE_ATTR(exec_setup, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_VOLT_GAIN(_mode, _show, _store) \
- IIO_DEVICE_ATTR(in0_gain, _mode, _show, _store, 0)
+ IIO_DEVICE_ATTR(in_voltage0_gain, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_CAP_OFFS(_mode, _show, _store) \
- IIO_DEVICE_ATTR(cap_offs, _mode, _show, _store, 0)
+ IIO_DEVICE_ATTR(in_capacitance_offs, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_CAP_GAIN(_mode, _show, _store) \
- IIO_DEVICE_ATTR(cap_gain, _mode, _show, _store, 0)
+ IIO_DEVICE_ATTR(in_capacitance_gain, _mode, _show, _store, 0)
#define IIO_DEV_ATTR_CAP_DATA(_show) \
- IIO_DEVICE_ATTR(cap0_raw, S_IRUGO, _show, NULL, 0)
+ IIO_DEVICE_ATTR(in_capacitance0_raw, S_IRUGO, _show, NULL, 0)
#define IIO_DEV_ATTR_VT_DATA(_show) \
- IIO_DEVICE_ATTR(in0_raw, S_IRUGO, _show, NULL, 0)
+ IIO_DEVICE_ATTR(in_voltage0_raw, S_IRUGO, _show, NULL, 0)
static ssize_t ad774x_show_conversion_modes(struct device *dev,
struct device_attribute *attr,
return -EINVAL;
}
-static IIO_DEVICE_ATTR(capdac0_raw, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_capacitance0_raw, S_IRUGO | S_IWUSR,
ad774x_show_dac_value,
ad774x_store_dac_value,
AD774X_CAPDACA);
-static IIO_DEVICE_ATTR(capdac1_raw, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_capacitance1_raw, S_IRUGO | S_IWUSR,
ad774x_show_dac_value,
ad774x_store_dac_value,
AD774X_CAPDACB);
static struct attribute *ad774x_attributes[] = {
&iio_dev_attr_available_conversion_modes.dev_attr.attr,
&iio_dev_attr_conversion_mode.dev_attr.attr,
- &iio_dev_attr_cap_setup.dev_attr.attr,
- &iio_dev_attr_in0_setup.dev_attr.attr,
+ &iio_dev_attr_in_capacitance_setup.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_setup.dev_attr.attr,
&iio_dev_attr_exec_setup.dev_attr.attr,
- &iio_dev_attr_cap_offs.dev_attr.attr,
- &iio_dev_attr_cap_gain.dev_attr.attr,
- &iio_dev_attr_in0_gain.dev_attr.attr,
- &iio_dev_attr_in0_raw.dev_attr.attr,
- &iio_dev_attr_cap0_raw.dev_attr.attr,
- &iio_dev_attr_capdac0_raw.dev_attr.attr,
- &iio_dev_attr_capdac1_raw.dev_attr.attr,
+ &iio_dev_attr_in_capacitance_offs.dev_attr.attr,
+ &iio_dev_attr_in_capacitance_gain.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_gain.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_raw.dev_attr.attr,
+ &iio_dev_attr_in_capacitance0_raw.dev_attr.attr,
+ &iio_dev_attr_out_capacitance0_raw.dev_attr.attr,
+ &iio_dev_attr_out_capacitance1_raw.dev_attr.attr,
NULL,
};
return IRQ_HANDLED;
}
-static IIO_DEVICE_ATTR(in0_thresh_low_value,
+static IIO_DEVICE_ATTR(in_voltage0_thresh_low_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATALOW_CH1_REG);
-static IIO_DEVICE_ATTR(in0_thresh_high_value,
+static IIO_DEVICE_ATTR(in_voltage0_thresh_high_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATAHIGH_CH1_REG);
-static IIO_DEVICE_ATTR(in0_thresh_both_hyst_raw,
+static IIO_DEVICE_ATTR(in_voltage0_thresh_both_hyst_raw,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_HYST_CH1_REG);
-static IIO_DEVICE_ATTR(in1_thresh_low_value,
+static IIO_DEVICE_ATTR(in_voltage1_thresh_low_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATALOW_CH2_REG);
-static IIO_DEVICE_ATTR(in1_thresh_high_value,
+static IIO_DEVICE_ATTR(in_voltage1_thresh_high_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATAHIGH_CH2_REG);
-static IIO_DEVICE_ATTR(in1_thresh_both_hyst_raw,
+static IIO_DEVICE_ATTR(in_voltage1_thresh_both_hyst_raw,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_HYST_CH2_REG);
-static IIO_DEVICE_ATTR(in2_thresh_low_value,
+static IIO_DEVICE_ATTR(in_voltage2_thresh_low_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATALOW_CH3_REG);
-static IIO_DEVICE_ATTR(in2_thresh_high_value,
+static IIO_DEVICE_ATTR(in_voltage2_thresh_high_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATAHIGH_CH3_REG);
-static IIO_DEVICE_ATTR(in2_thresh_both_hyst_raw,
+static IIO_DEVICE_ATTR(in_voltage2_thresh_both_hyst_raw,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_HYST_CH3_REG);
-static IIO_DEVICE_ATTR(in3_thresh_low_value,
+static IIO_DEVICE_ATTR(in_voltage3_thresh_low_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATALOW_CH4_REG);
-static IIO_DEVICE_ATTR(in3_thresh_high_value,
+static IIO_DEVICE_ATTR(in_voltage3_thresh_high_value,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
AD7998_DATAHIGH_CH4_REG);
-static IIO_DEVICE_ATTR(in3_thresh_both_hyst_raw,
+static IIO_DEVICE_ATTR(in_voltage3_thresh_both_hyst_raw,
S_IRUGO | S_IWUSR,
ad799x_read_channel_config,
ad799x_write_channel_config,
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("15625 7812 3906 1953 976 488 244 0");
static struct attribute *ad7993_4_7_8_event_attributes[] = {
- &iio_dev_attr_in0_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in0_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in0_thresh_both_hyst_raw.dev_attr.attr,
- &iio_dev_attr_in1_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in1_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in1_thresh_both_hyst_raw.dev_attr.attr,
- &iio_dev_attr_in2_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in2_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in2_thresh_both_hyst_raw.dev_attr.attr,
- &iio_dev_attr_in3_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in3_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in3_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage2_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage2_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage2_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage3_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage3_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage3_thresh_both_hyst_raw.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
NULL,
};
static struct attribute *ad7992_event_attributes[] = {
- &iio_dev_attr_in0_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in0_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in0_thresh_both_hyst_raw.dev_attr.attr,
- &iio_dev_attr_in1_thresh_low_value.dev_attr.attr,
- &iio_dev_attr_in1_thresh_high_value.dev_attr.attr,
- &iio_dev_attr_in1_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_thresh_both_hyst_raw.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_low_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_high_value.dev_attr.attr,
+ &iio_dev_attr_in_voltage1_thresh_both_hyst_raw.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
NULL,
return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
}
-static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5446_show_scale, NULL, 0);
+static IIO_DEVICE_ATTR(out_voltage_scale, S_IRUGO, ad5446_show_scale, NULL, 0);
static ssize_t ad5446_write_powerdown_mode(struct device *dev,
struct device_attribute *attr,
return ret ? ret : len;
}
-static IIO_DEVICE_ATTR(out_powerdown_mode, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage_powerdown_mode, S_IRUGO | S_IWUSR,
ad5446_read_powerdown_mode,
ad5446_write_powerdown_mode, 0);
-static IIO_CONST_ATTR(out_powerdown_mode_available,
+static IIO_CONST_ATTR(out_voltage_powerdown_mode_available,
"1kohm_to_gnd 100kohm_to_gnd three_state");
-static IIO_DEVICE_ATTR(out0_powerdown, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_powerdown, S_IRUGO | S_IWUSR,
ad5446_read_dac_powerdown,
ad5446_write_dac_powerdown, 0);
static struct attribute *ad5446_attributes[] = {
- &iio_dev_attr_out0_raw.dev_attr.attr,
- &iio_dev_attr_out_scale.dev_attr.attr,
- &iio_dev_attr_out0_powerdown.dev_attr.attr,
- &iio_dev_attr_out_powerdown_mode.dev_attr.attr,
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage_powerdown_mode.dev_attr.attr,
+ &iio_const_attr_out_voltage_powerdown_mode_available.dev_attr.attr,
NULL,
};
mode_t mode = attr->mode;
if (!st->chip_info->store_pwr_down &&
- (attr == &iio_dev_attr_out0_powerdown.dev_attr.attr ||
- attr == &iio_dev_attr_out_powerdown_mode.dev_attr.attr ||
+ (attr == &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr ||
+ attr == &iio_dev_attr_out_voltage_powerdown_mode.
+ dev_attr.attr ||
attr ==
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr))
+ &iio_const_attr_out_voltage_powerdown_mode_available.
+ dev_attr.attr))
mode = 0;
return mode;
return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
}
-static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5504_show_scale, NULL, 0);
+static IIO_DEVICE_ATTR(out_voltage_scale, S_IRUGO, ad5504_show_scale, NULL, 0);
#define IIO_DEV_ATTR_OUT_RW_RAW(_num, _show, _store, _addr) \
- IIO_DEVICE_ATTR(out##_num##_raw, \
+ IIO_DEVICE_ATTR(out_voltage##_num##_raw, \
S_IRUGO | S_IWUSR, _show, _store, _addr)
static IIO_DEV_ATTR_OUT_RW_RAW(0, ad5504_read_dac,
static IIO_DEV_ATTR_OUT_RW_RAW(3, ad5504_read_dac,
ad5504_write_dac, AD5504_ADDR_DAC3);
-static IIO_DEVICE_ATTR(out_powerdown_mode, S_IRUGO |
+static IIO_DEVICE_ATTR(out_voltage_powerdown_mode, S_IRUGO |
S_IWUSR, ad5504_read_powerdown_mode,
ad5504_write_powerdown_mode, 0);
-static IIO_CONST_ATTR(out_powerdown_mode_available,
+static IIO_CONST_ATTR(out_voltage_powerdown_mode_available,
"20kohm_to_gnd three_state");
#define IIO_DEV_ATTR_DAC_POWERDOWN(_num, _show, _store, _addr) \
- IIO_DEVICE_ATTR(out##_num##_powerdown, \
+ IIO_DEVICE_ATTR(out_voltage##_num##_powerdown, \
S_IRUGO | S_IWUSR, _show, _store, _addr)
-
static IIO_DEV_ATTR_DAC_POWERDOWN(0, ad5504_read_dac_powerdown,
ad5504_write_dac_powerdown, 0);
static IIO_DEV_ATTR_DAC_POWERDOWN(1, ad5504_read_dac_powerdown,
ad5504_write_dac_powerdown, 3);
static struct attribute *ad5504_attributes[] = {
- &iio_dev_attr_out0_raw.dev_attr.attr,
- &iio_dev_attr_out1_raw.dev_attr.attr,
- &iio_dev_attr_out2_raw.dev_attr.attr,
- &iio_dev_attr_out3_raw.dev_attr.attr,
- &iio_dev_attr_out0_powerdown.dev_attr.attr,
- &iio_dev_attr_out1_powerdown.dev_attr.attr,
- &iio_dev_attr_out2_powerdown.dev_attr.attr,
- &iio_dev_attr_out3_powerdown.dev_attr.attr,
- &iio_dev_attr_out_powerdown_mode.dev_attr.attr,
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr,
- &iio_dev_attr_out_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage_powerdown_mode.dev_attr.attr,
+ &iio_const_attr_out_voltage_powerdown_mode_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage_scale.dev_attr.attr,
NULL,
};
};
static struct attribute *ad5501_attributes[] = {
- &iio_dev_attr_out0_raw.dev_attr.attr,
- &iio_dev_attr_out0_powerdown.dev_attr.attr,
- &iio_dev_attr_out_powerdown_mode.dev_attr.attr,
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr,
- &iio_dev_attr_out_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage_powerdown_mode.dev_attr.attr,
+ &iio_const_attr_out_voltage_powerdown_mode_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage_scale.dev_attr.attr,
NULL,
};
return sprintf(buf, "%d.%03d\n", scale_uv / 1000, scale_uv % 1000);
}
-static IIO_DEVICE_ATTR(out_scale, S_IRUGO, ad5624r_show_scale, NULL, 0);
+static IIO_DEVICE_ATTR(out_voltage_scale, S_IRUGO, ad5624r_show_scale, NULL, 0);
static IIO_DEV_ATTR_OUT_RAW(0, ad5624r_write_dac, AD5624R_ADDR_DAC0);
static IIO_DEV_ATTR_OUT_RAW(1, ad5624r_write_dac, AD5624R_ADDR_DAC1);
static IIO_DEV_ATTR_OUT_RAW(2, ad5624r_write_dac, AD5624R_ADDR_DAC2);
static IIO_DEV_ATTR_OUT_RAW(3, ad5624r_write_dac, AD5624R_ADDR_DAC3);
-static IIO_DEVICE_ATTR(out_powerdown_mode, S_IRUGO |
+static IIO_DEVICE_ATTR(out_voltage_powerdown_mode, S_IRUGO |
S_IWUSR, ad5624r_read_powerdown_mode,
ad5624r_write_powerdown_mode, 0);
-static IIO_CONST_ATTR(out_powerdown_mode_available,
+static IIO_CONST_ATTR(out_voltage_powerdown_mode_available,
"1kohm_to_gnd 100kohm_to_gnd three_state");
#define IIO_DEV_ATTR_DAC_POWERDOWN(_num, _show, _store, _addr) \
- IIO_DEVICE_ATTR(out##_num##_powerdown, \
+ IIO_DEVICE_ATTR(out_voltage##_num##_powerdown, \
S_IRUGO | S_IWUSR, _show, _store, _addr)
static IIO_DEV_ATTR_DAC_POWERDOWN(0, ad5624r_read_dac_powerdown,
ad5624r_write_dac_powerdown, 3);
static struct attribute *ad5624r_attributes[] = {
- &iio_dev_attr_out0_raw.dev_attr.attr,
- &iio_dev_attr_out1_raw.dev_attr.attr,
- &iio_dev_attr_out2_raw.dev_attr.attr,
- &iio_dev_attr_out3_raw.dev_attr.attr,
- &iio_dev_attr_out0_powerdown.dev_attr.attr,
- &iio_dev_attr_out1_powerdown.dev_attr.attr,
- &iio_dev_attr_out2_powerdown.dev_attr.attr,
- &iio_dev_attr_out3_powerdown.dev_attr.attr,
- &iio_dev_attr_out_powerdown_mode.dev_attr.attr,
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr,
- &iio_dev_attr_out_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage_powerdown_mode.dev_attr.attr,
+ &iio_const_attr_out_voltage_powerdown_mode_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage_scale.dev_attr.attr,
NULL,
};
return ret ? ret : len;
}
-static IIO_CONST_ATTR(out_powerdown_mode_available,
+static IIO_CONST_ATTR(out_voltage_powerdown_mode_available,
"1kohm_to_gnd 100kohm_to_gnd three_state");
-#define IIO_DEV_ATTR_DAC_POWERDOWN_MODE(_num) \
- IIO_DEVICE_ATTR(out##_num##_powerdown_mode, S_IRUGO | S_IWUSR, \
+#define IIO_DEV_ATTR_DAC_POWERDOWN_MODE(_num) \
+ IIO_DEVICE_ATTR(out_voltage##_num##_powerdown_mode, \
+ S_IRUGO | S_IWUSR, \
ad5686_read_powerdown_mode, \
ad5686_write_powerdown_mode, _num)
static IIO_DEV_ATTR_DAC_POWERDOWN_MODE(2);
static IIO_DEV_ATTR_DAC_POWERDOWN_MODE(3);
-#define IIO_DEV_ATTR_DAC_POWERDOWN(_num) \
- IIO_DEVICE_ATTR(out##_num##_powerdown, S_IRUGO | S_IWUSR, \
+#define IIO_DEV_ATTR_DAC_POWERDOWN(_num) \
+ IIO_DEVICE_ATTR(out_voltage##_num##_powerdown, \
+ S_IRUGO | S_IWUSR, \
ad5686_read_dac_powerdown, \
ad5686_write_dac_powerdown, _num)
static IIO_DEV_ATTR_DAC_POWERDOWN(3);
static struct attribute *ad5686_attributes[] = {
- &iio_dev_attr_out0_powerdown.dev_attr.attr,
- &iio_dev_attr_out1_powerdown.dev_attr.attr,
- &iio_dev_attr_out2_powerdown.dev_attr.attr,
- &iio_dev_attr_out3_powerdown.dev_attr.attr,
- &iio_dev_attr_out0_powerdown_mode.dev_attr.attr,
- &iio_dev_attr_out1_powerdown_mode.dev_attr.attr,
- &iio_dev_attr_out2_powerdown_mode.dev_attr.attr,
- &iio_dev_attr_out3_powerdown_mode.dev_attr.attr,
- &iio_const_attr_out_powerdown_mode_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_powerdown.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_powerdown_mode.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_powerdown_mode.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_powerdown_mode.dev_attr.attr,
+ &iio_dev_attr_out_voltage3_powerdown_mode.dev_attr.attr,
+ &iio_const_attr_out_voltage_powerdown_mode_available.dev_attr.attr,
NULL,
};
*/
#define IIO_DEV_ATTR_OUT_RAW(_num, _store, _addr) \
- IIO_DEVICE_ATTR(out##_num##_raw, S_IWUSR, NULL, _store, _addr)
+ IIO_DEVICE_ATTR(out_voltage##_num##_raw, S_IWUSR, NULL, _store, _addr)
{
return max517_set_value(dev, attr, buf, count, 3);
}
-static IIO_DEVICE_ATTR_NAMED(out1and2_raw, out1&2_raw, S_IWUSR, NULL,
- max517_set_value_both, -1);
+static IIO_DEVICE_ATTR_NAMED(out_voltage1and2_raw,
+ out_voltage1&2_raw, S_IWUSR, NULL,
+ max517_set_value_both, -1);
static ssize_t max517_show_scale(struct device *dev,
struct device_attribute *attr,
{
return max517_show_scale(dev, attr, buf, 1);
}
-static IIO_DEVICE_ATTR(out1_scale, S_IRUGO, max517_show_scale1, NULL, 0);
+static IIO_DEVICE_ATTR(out_voltage1_scale, S_IRUGO,
+ max517_show_scale1, NULL, 0);
static ssize_t max517_show_scale2(struct device *dev,
struct device_attribute *attr,
{
return max517_show_scale(dev, attr, buf, 2);
}
-static IIO_DEVICE_ATTR(out2_scale, S_IRUGO, max517_show_scale2, NULL, 0);
+static IIO_DEVICE_ATTR(out_voltage2_scale, S_IRUGO,
+ max517_show_scale2, NULL, 0);
/* On MAX517 variant, we have one output */
static struct attribute *max517_attributes[] = {
- &iio_dev_attr_out1_raw.dev_attr.attr,
- &iio_dev_attr_out1_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_scale.dev_attr.attr,
NULL
};
/* On MAX518 and MAX519 variant, we have two outputs */
static struct attribute *max518_attributes[] = {
- &iio_dev_attr_out1_raw.dev_attr.attr,
- &iio_dev_attr_out1_scale.dev_attr.attr,
- &iio_dev_attr_out2_raw.dev_attr.attr,
- &iio_dev_attr_out2_scale.dev_attr.attr,
- &iio_dev_attr_out1and2_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage1_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_raw.dev_attr.attr,
+ &iio_dev_attr_out_voltage2_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage1and2_raw.dev_attr.attr,
NULL
};
return ret ? ret : len;
}
-static IIO_DEVICE_ATTR(out0_freq_start, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_start, S_IRUGO | S_IWUSR,
ad5933_show_frequency,
ad5933_store_frequency,
AD5933_REG_FREQ_START);
-static IIO_DEVICE_ATTR(out0_freq_increment, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_increment, S_IRUGO | S_IWUSR,
ad5933_show_frequency,
ad5933_store_frequency,
AD5933_REG_FREQ_INC);
return ret ? ret : len;
}
-static IIO_DEVICE_ATTR(out0_scale, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_scale, S_IRUGO | S_IWUSR,
ad5933_show,
ad5933_store,
AD5933_OUT_RANGE);
-static IIO_DEVICE_ATTR(out0_scale_available, S_IRUGO,
+static IIO_DEVICE_ATTR(out_voltage0_scale_available, S_IRUGO,
ad5933_show,
NULL,
AD5933_OUT_RANGE_AVAIL);
-static IIO_DEVICE_ATTR(in0_scale, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(in_voltage0_scale, S_IRUGO | S_IWUSR,
ad5933_show,
ad5933_store,
AD5933_IN_PGA_GAIN);
-static IIO_DEVICE_ATTR(in0_scale_available, S_IRUGO,
+static IIO_DEVICE_ATTR(in_voltage0_scale_available, S_IRUGO,
ad5933_show,
NULL,
AD5933_IN_PGA_GAIN_AVAIL);
-static IIO_DEVICE_ATTR(out0_freq_points, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_points, S_IRUGO | S_IWUSR,
ad5933_show,
ad5933_store,
AD5933_FREQ_POINTS);
-static IIO_DEVICE_ATTR(out0_settling_cycles, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_settling_cycles, S_IRUGO | S_IWUSR,
ad5933_show,
ad5933_store,
AD5933_OUT_SETTLING_CYCLES);
* don't create dedicated sysfs channel attributes for out0 and in0.
*/
static struct attribute *ad5933_attributes[] = {
- &iio_dev_attr_out0_scale.dev_attr.attr,
- &iio_dev_attr_out0_scale_available.dev_attr.attr,
- &iio_dev_attr_out0_freq_start.dev_attr.attr,
- &iio_dev_attr_out0_freq_increment.dev_attr.attr,
- &iio_dev_attr_out0_freq_points.dev_attr.attr,
- &iio_dev_attr_out0_settling_cycles.dev_attr.attr,
- &iio_dev_attr_in0_scale.dev_attr.attr,
- &iio_dev_attr_in0_scale_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_scale.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_scale_available.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_freq_start.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_freq_increment.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_freq_points.dev_attr.attr,
+ &iio_dev_attr_out_voltage0_settling_cycles.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_scale.dev_attr.attr,
+ &iio_dev_attr_in_voltage0_scale_available.dev_attr.attr,
NULL
};
return count;
}
-static IIO_DEVICE_ATTR(magn_range,
+static IIO_DEVICE_ATTR(in_magn_range,
S_IWUSR | S_IRUGO,
show_range,
set_range,
&iio_dev_attr_meas_conf.dev_attr.attr,
&iio_dev_attr_operating_mode.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
- &iio_dev_attr_magn_range.dev_attr.attr,
+ &iio_dev_attr_in_magn_range.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
NULL
};
}
static IIO_DEV_ATTR_TEMP_RAW(ade7753_read_8bit);
-static IIO_CONST_ATTR(temp_offset, "-25 C");
-static IIO_CONST_ATTR(temp_scale, "0.67 C");
+static IIO_CONST_ATTR(in_temp_offset, "-25 C");
+static IIO_CONST_ATTR(in_temp_scale, "0.67 C");
static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
ade7753_read_frequency,
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("27900 14000 7000 3500");
static struct attribute *ade7753_attributes[] = {
- &iio_dev_attr_temp_raw.dev_attr.attr,
- &iio_const_attr_temp_offset.dev_attr.attr,
- &iio_const_attr_temp_scale.dev_attr.attr,
+ &iio_dev_attr_in_temp_raw.dev_attr.attr,
+ &iio_const_attr_in_temp_offset.dev_attr.attr,
+ &iio_const_attr_in_temp_scale.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_reset.dev_attr.attr,
return ret ? ret : len;
}
static IIO_DEV_ATTR_TEMP_RAW(ade7754_read_8bit);
-static IIO_CONST_ATTR(temp_offset, "129 C");
-static IIO_CONST_ATTR(temp_scale, "4 C");
+static IIO_CONST_ATTR(in_temp_offset, "129 C");
+static IIO_CONST_ATTR(in_temp_scale, "4 C");
static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
ade7754_read_frequency,
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("26000 13000 65000 33000");
static struct attribute *ade7754_attributes[] = {
- &iio_dev_attr_temp_raw.dev_attr.attr,
- &iio_const_attr_temp_offset.dev_attr.attr,
- &iio_const_attr_temp_scale.dev_attr.attr,
+ &iio_dev_attr_in_temp_raw.dev_attr.attr,
+ &iio_const_attr_in_temp_offset.dev_attr.attr,
+ &iio_const_attr_in_temp_scale.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_reset.dev_attr.attr,
}
static IIO_DEV_ATTR_TEMP_RAW(ade7758_read_8bit);
-static IIO_CONST_ATTR(temp_offset, "129 C");
-static IIO_CONST_ATTR(temp_scale, "4 C");
+static IIO_CONST_ATTR(in_temp_offset, "129 C");
+static IIO_CONST_ATTR(in_temp_scale, "4 C");
static IIO_DEV_ATTR_AWATTHR(ade7758_read_16bit,
ADE7758_AWATTHR);
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("26040 13020 6510 3255");
static struct attribute *ade7758_attributes[] = {
- &iio_dev_attr_temp_raw.dev_attr.attr,
- &iio_const_attr_temp_offset.dev_attr.attr,
- &iio_const_attr_temp_scale.dev_attr.attr,
+ &iio_dev_attr_in_temp_raw.dev_attr.attr,
+ &iio_const_attr_in_temp_offset.dev_attr.attr,
+ &iio_const_attr_in_temp_scale.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_reset.dev_attr.attr,
return ret ? ret : len;
}
static IIO_DEV_ATTR_TEMP_RAW(ade7759_read_8bit);
-static IIO_CONST_ATTR(temp_offset, "70 C");
-static IIO_CONST_ATTR(temp_scale, "1 C");
+static IIO_CONST_ATTR(in_temp_offset, "70 C");
+static IIO_CONST_ATTR(in_temp_scale, "1 C");
static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
ade7759_read_frequency,
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("27900 14000 7000 3500");
static struct attribute *ade7759_attributes[] = {
- &iio_dev_attr_temp_raw.dev_attr.attr,
- &iio_const_attr_temp_offset.dev_attr.attr,
- &iio_const_attr_temp_scale.dev_attr.attr,
+ &iio_dev_attr_in_temp_raw.dev_attr.attr,
+ &iio_const_attr_in_temp_offset.dev_attr.attr,
+ &iio_const_attr_in_temp_scale.dev_attr.attr,
&iio_dev_attr_sampling_frequency.dev_attr.attr,
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_reset.dev_attr.attr,
IIO_CONST_ATTR(sampling_frequency_available, _string)
#define IIO_DEV_ATTR_TEMP_RAW(_show) \
- IIO_DEVICE_ATTR(temp_raw, S_IRUGO, _show, NULL, 0)
+ IIO_DEVICE_ATTR(in_temp_raw, S_IRUGO, _show, NULL, 0)
#define IIO_CONST_ATTR_TEMP_OFFSET(_string) \
- IIO_CONST_ATTR(temp_offset, _string)
+ IIO_CONST_ATTR(in_temp_offset, _string)
#define IIO_CONST_ATTR_TEMP_SCALE(_string) \
- IIO_CONST_ATTR(temp_scale, _string)
+ IIO_CONST_ATTR(in_temp_scale, _string)
enum iio_event_type {
IIO_EV_TYPE_THRESH,