Commit e68b1db1 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

staging:iio:adc:ad7192: add temp_scale attribute, change module description

Use KBUILD_MODNAME
Fix indention style
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c11f02ed
...@@ -102,7 +102,7 @@ struct ad7291_chip_info { ...@@ -102,7 +102,7 @@ struct ad7291_chip_info {
u16 int_vref_mv; u16 int_vref_mv;
u16 command; u16 command;
u16 c_mask; /* Active voltage channels for events */ u16 c_mask; /* Active voltage channels for events */
struct mutex state_lock; struct mutex state_lock;
}; };
static int ad7291_i2c_read(struct ad7291_chip_info *chip, u8 reg, u16 *data) static int ad7291_i2c_read(struct ad7291_chip_info *chip, u8 reg, u16 *data)
...@@ -510,6 +510,13 @@ static int ad7291_read_raw(struct iio_dev *indio_dev, ...@@ -510,6 +510,13 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
*val = scale_uv / 1000; *val = scale_uv / 1000;
*val2 = (scale_uv % 1000) * 1000; *val2 = (scale_uv % 1000) * 1000;
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case (1 << IIO_CHAN_INFO_SCALE_SEPARATE):
/*
* One LSB of the ADC corresponds to 0.25 deg C.
* The temperature reading is in 12-bit twos complement format
*/
*val = 250;
return IIO_VAL_INT;
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -536,7 +543,8 @@ static const struct iio_chan_spec ad7291_channels[] = { ...@@ -536,7 +543,8 @@ static const struct iio_chan_spec ad7291_channels[] = {
AD7291_VOLTAGE_CHAN(7), AD7291_VOLTAGE_CHAN(7),
{ {
.type = IIO_TEMP, .type = IIO_TEMP,
.info_mask = (1 << IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE), .info_mask = (1 << IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE) |
(1 << IIO_CHAN_INFO_SCALE_SEPARATE),
.indexed = 1, .indexed = 1,
.channel = 0, .channel = 0,
.event_mask = .event_mask =
...@@ -680,7 +688,7 @@ MODULE_DEVICE_TABLE(i2c, ad7291_id); ...@@ -680,7 +688,7 @@ MODULE_DEVICE_TABLE(i2c, ad7291_id);
static struct i2c_driver ad7291_driver = { static struct i2c_driver ad7291_driver = {
.driver = { .driver = {
.name = "ad7291", .name = KBUILD_MODNAME,
}, },
.probe = ad7291_probe, .probe = ad7291_probe,
.remove = __devexit_p(ad7291_remove), .remove = __devexit_p(ad7291_remove),
...@@ -698,8 +706,7 @@ static __exit void ad7291_exit(void) ...@@ -698,8 +706,7 @@ static __exit void ad7291_exit(void)
} }
MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>");
MODULE_DESCRIPTION("Analog Devices AD7291 digital" MODULE_DESCRIPTION("Analog Devices AD7291 ADC driver");
" temperature sensor driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
module_init(ad7291_init); module_init(ad7291_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment