Commit 11f05c7715fb079d1753c44d1fda32e46e1b6b47
Committed by
Greg Kroah-Hartman
1 parent
4f64b80144
Exists in
master
and in
7 other branches
staging: iio: hmc5843 change ABI to comply with documentation
this one completes my last patch set to compile fine for all drivers. Signed-off-by: Manuel Stahl <manuel.stahl@iis.fraunhofer.de> Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Datta, Shubhrajyoti <shubhrajyoti@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 16 additions and 16 deletions Side-by-side Diff
drivers/staging/iio/magnetometer/hmc5843.c
... | ... | @@ -95,15 +95,15 @@ |
95 | 95 | #define CONF_NOT_USED 0x03 |
96 | 96 | #define MEAS_CONF_MASK 0x03 |
97 | 97 | |
98 | -static const int regval_to_counts_per_mg[] = { | |
99 | - 1620, | |
100 | - 1300, | |
101 | - 970, | |
102 | - 780, | |
103 | - 530, | |
104 | - 460, | |
105 | - 390, | |
106 | - 280 | |
98 | +static const char *regval_to_scale[] = { | |
99 | + "0.0000006173", | |
100 | + "0.0000007692", | |
101 | + "0.0000010309", | |
102 | + "0.0000012821", | |
103 | + "0.0000018868", | |
104 | + "0.0000021739", | |
105 | + "0.0000025641", | |
106 | + "0.0000035714", | |
107 | 107 | }; |
108 | 108 | static const int regval_to_input_field_mg[] = { |
109 | 109 | 700, |
... | ... | @@ -326,7 +326,7 @@ |
326 | 326 | * 6 | 50 |
327 | 327 | * 7 | Not used |
328 | 328 | */ |
329 | -static IIO_CONST_ATTR_AVAIL_SAMP_FREQ("0.5 1 2 5 10 20 50"); | |
329 | +static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("0.5 1 2 5 10 20 50"); | |
330 | 330 | |
331 | 331 | static s32 hmc5843_set_rate(struct i2c_client *client, |
332 | 332 | u8 rate) |
333 | 333 | |
334 | 334 | |
335 | 335 | |
... | ... | @@ -468,17 +468,17 @@ |
468 | 468 | set_range, |
469 | 469 | HMC5843_CONFIG_REG_B); |
470 | 470 | |
471 | -static ssize_t show_gain(struct device *dev, | |
471 | +static ssize_t show_scale(struct device *dev, | |
472 | 472 | struct device_attribute *attr, |
473 | 473 | char *buf) |
474 | 474 | { |
475 | 475 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
476 | 476 | struct hmc5843_data *data = indio_dev->dev_data; |
477 | - return sprintf(buf, "%d\n", regval_to_counts_per_mg[data->range]); | |
477 | + return strlen(strcpy(buf, regval_to_scale[data->range])); | |
478 | 478 | } |
479 | -static IIO_DEVICE_ATTR(magn_gain, | |
479 | +static IIO_DEVICE_ATTR(magn_scale, | |
480 | 480 | S_IRUGO, |
481 | - show_gain, | |
481 | + show_scale, | |
482 | 482 | NULL , 0); |
483 | 483 | |
484 | 484 | static struct attribute *hmc5843_attributes[] = { |
485 | 485 | |
... | ... | @@ -486,11 +486,11 @@ |
486 | 486 | &iio_dev_attr_operating_mode.dev_attr.attr, |
487 | 487 | &iio_dev_attr_sampling_frequency.dev_attr.attr, |
488 | 488 | &iio_dev_attr_magn_range.dev_attr.attr, |
489 | - &iio_dev_attr_magn_gain.dev_attr.attr, | |
489 | + &iio_dev_attr_magn_scale.dev_attr.attr, | |
490 | 490 | &iio_dev_attr_magn_x_raw.dev_attr.attr, |
491 | 491 | &iio_dev_attr_magn_y_raw.dev_attr.attr, |
492 | 492 | &iio_dev_attr_magn_z_raw.dev_attr.attr, |
493 | - &iio_const_attr_available_sampling_frequency.dev_attr.attr, | |
493 | + &iio_const_attr_sampling_frequency_available.dev_attr.attr, | |
494 | 494 | NULL |
495 | 495 | }; |
496 | 496 |