aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 16:08:26 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-01 16:08:26 -0500
commit5982557ac6ee5d36a02248be18a2ba945360d9f6 (patch)
tree51b3441bd9cfc31c5515b2ddd07e4183392fbe8d
parent48436e82fd2925a42293f670f3570b5c855c90c1 (diff)
parent17a2f46c3d8877fe2a0b6ff391d1df30e67892a6 (diff)
Merge tag 'iio-fixes-for-4.5b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: Second set of IIO fixes for the 4.5 cycle. These ones are mostly dependent on patches from the recent merge cycle. * adc, imu and iio staging drivers - !HAS_IOMEM dependency fixes * dht11 - use boottime clock for time measurement to avoid incorrect measurements due to clock updates. * lidar - correct a return value for short i2c transfers.
-rw-r--r--drivers/iio/adc/Kconfig2
-rw-r--r--drivers/iio/humidity/dht11.c8
-rw-r--r--drivers/iio/imu/inv_mpu6050/Kconfig2
-rw-r--r--drivers/iio/proximity/pulsedlight-lidar-lite-v2.c2
-rw-r--r--drivers/staging/iio/adc/Kconfig1
5 files changed, 9 insertions, 6 deletions
diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
index 97b20aa0b36c..283ded7747a9 100644
--- a/drivers/iio/adc/Kconfig
+++ b/drivers/iio/adc/Kconfig
@@ -175,6 +175,7 @@ config DA9150_GPADC
175config EXYNOS_ADC 175config EXYNOS_ADC
176 tristate "Exynos ADC driver support" 176 tristate "Exynos ADC driver support"
177 depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST) 177 depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
178 depends on HAS_IOMEM
178 help 179 help
179 Core support for the ADC block found in the Samsung EXYNOS series 180 Core support for the ADC block found in the Samsung EXYNOS series
180 of SoCs for drivers such as the touchscreen and hwmon to use to share 181 of SoCs for drivers such as the touchscreen and hwmon to use to share
@@ -207,6 +208,7 @@ config INA2XX_ADC
207config IMX7D_ADC 208config IMX7D_ADC
208 tristate "IMX7D ADC driver" 209 tristate "IMX7D ADC driver"
209 depends on ARCH_MXC || COMPILE_TEST 210 depends on ARCH_MXC || COMPILE_TEST
211 depends on HAS_IOMEM
210 help 212 help
211 Say yes here to build support for IMX7D ADC. 213 Say yes here to build support for IMX7D ADC.
212 214
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c
index 1165b1c4f9d6..cfc5a051ab9f 100644
--- a/drivers/iio/humidity/dht11.c
+++ b/drivers/iio/humidity/dht11.c
@@ -117,7 +117,7 @@ static int dht11_decode(struct dht11 *dht11, int offset, int timeres)
117 if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum) 117 if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum)
118 return -EIO; 118 return -EIO;
119 119
120 dht11->timestamp = ktime_get_real_ns(); 120 dht11->timestamp = ktime_get_boot_ns();
121 if (hum_int < 20) { /* DHT22 */ 121 if (hum_int < 20) { /* DHT22 */
122 dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) * 122 dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
123 ((temp_int & 0x80) ? -100 : 100); 123 ((temp_int & 0x80) ? -100 : 100);
@@ -145,7 +145,7 @@ static irqreturn_t dht11_handle_irq(int irq, void *data)
145 145
146 /* TODO: Consider making the handler safe for IRQ sharing */ 146 /* TODO: Consider making the handler safe for IRQ sharing */
147 if (dht11->num_edges < DHT11_EDGES_PER_READ && dht11->num_edges >= 0) { 147 if (dht11->num_edges < DHT11_EDGES_PER_READ && dht11->num_edges >= 0) {
148 dht11->edges[dht11->num_edges].ts = ktime_get_real_ns(); 148 dht11->edges[dht11->num_edges].ts = ktime_get_boot_ns();
149 dht11->edges[dht11->num_edges++].value = 149 dht11->edges[dht11->num_edges++].value =
150 gpio_get_value(dht11->gpio); 150 gpio_get_value(dht11->gpio);
151 151
@@ -164,7 +164,7 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
164 int ret, timeres; 164 int ret, timeres;
165 165
166 mutex_lock(&dht11->lock); 166 mutex_lock(&dht11->lock);
167 if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_real_ns()) { 167 if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_boot_ns()) {
168 timeres = ktime_get_resolution_ns(); 168 timeres = ktime_get_resolution_ns();
169 if (DHT11_DATA_BIT_HIGH < 2 * timeres) { 169 if (DHT11_DATA_BIT_HIGH < 2 * timeres) {
170 dev_err(dht11->dev, "timeresolution %dns too low\n", 170 dev_err(dht11->dev, "timeresolution %dns too low\n",
@@ -279,7 +279,7 @@ static int dht11_probe(struct platform_device *pdev)
279 return -EINVAL; 279 return -EINVAL;
280 } 280 }
281 281
282 dht11->timestamp = ktime_get_real_ns() - DHT11_DATA_VALID_TIME - 1; 282 dht11->timestamp = ktime_get_boot_ns() - DHT11_DATA_VALID_TIME - 1;
283 dht11->num_edges = -1; 283 dht11->num_edges = -1;
284 284
285 platform_set_drvdata(pdev, iio); 285 platform_set_drvdata(pdev, iio);
diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig
index 48fbc0bc7e2a..8f8d1370ed8b 100644
--- a/drivers/iio/imu/inv_mpu6050/Kconfig
+++ b/drivers/iio/imu/inv_mpu6050/Kconfig
@@ -5,9 +5,9 @@
5config INV_MPU6050_IIO 5config INV_MPU6050_IIO
6 tristate "Invensense MPU6050 devices" 6 tristate "Invensense MPU6050 devices"
7 depends on I2C && SYSFS 7 depends on I2C && SYSFS
8 depends on I2C_MUX
8 select IIO_BUFFER 9 select IIO_BUFFER
9 select IIO_TRIGGERED_BUFFER 10 select IIO_TRIGGERED_BUFFER
10 select I2C_MUX
11 help 11 help
12 This driver supports the Invensense MPU6050 devices. 12 This driver supports the Invensense MPU6050 devices.
13 This driver can also support MPU6500 in MPU6050 compatibility mode 13 This driver can also support MPU6500 in MPU6050 compatibility mode
diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
index 93e29fb67fa0..db35e04a0637 100644
--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
+++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
@@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
87 87
88 ret = i2c_transfer(client->adapter, msg, 2); 88 ret = i2c_transfer(client->adapter, msg, 2);
89 89
90 return (ret == 2) ? 0 : ret; 90 return (ret == 2) ? 0 : -EIO;
91} 91}
92 92
93static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len) 93static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 58d4517e1836..b9519be90fda 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -6,6 +6,7 @@ menu "Analog to digital converters"
6config AD7606 6config AD7606
7 tristate "Analog Devices AD7606 ADC driver" 7 tristate "Analog Devices AD7606 ADC driver"
8 depends on GPIOLIB || COMPILE_TEST 8 depends on GPIOLIB || COMPILE_TEST
9 depends on HAS_IOMEM
9 select IIO_BUFFER 10 select IIO_BUFFER
10 select IIO_TRIGGERED_BUFFER 11 select IIO_TRIGGERED_BUFFER
11 help 12 help