Skip to content

Commit 5982557

Browse files
committed
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.
2 parents 48436e8 + 17a2f46 commit 5982557

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

drivers/iio/adc/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ config DA9150_GPADC
175175
config EXYNOS_ADC
176176
tristate "Exynos ADC driver support"
177177
depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
178+
depends on HAS_IOMEM
178179
help
179180
Core support for the ADC block found in the Samsung EXYNOS series
180181
of SoCs for drivers such as the touchscreen and hwmon to use to share
@@ -207,6 +208,7 @@ config INA2XX_ADC
207208
config IMX7D_ADC
208209
tristate "IMX7D ADC driver"
209210
depends on ARCH_MXC || COMPILE_TEST
211+
depends on HAS_IOMEM
210212
help
211213
Say yes here to build support for IMX7D ADC.
212214

drivers/iio/humidity/dht11.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int dht11_decode(struct dht11 *dht11, int offset, int timeres)
117117
if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum)
118118
return -EIO;
119119

120-
dht11->timestamp = ktime_get_real_ns();
120+
dht11->timestamp = ktime_get_boot_ns();
121121
if (hum_int < 20) { /* DHT22 */
122122
dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
123123
((temp_int & 0x80) ? -100 : 100);
@@ -145,7 +145,7 @@ static irqreturn_t dht11_handle_irq(int irq, void *data)
145145

146146
/* TODO: Consider making the handler safe for IRQ sharing */
147147
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();
149149
dht11->edges[dht11->num_edges++].value =
150150
gpio_get_value(dht11->gpio);
151151

@@ -164,7 +164,7 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
164164
int ret, timeres;
165165

166166
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()) {
168168
timeres = ktime_get_resolution_ns();
169169
if (DHT11_DATA_BIT_HIGH < 2 * timeres) {
170170
dev_err(dht11->dev, "timeresolution %dns too low\n",
@@ -279,7 +279,7 @@ static int dht11_probe(struct platform_device *pdev)
279279
return -EINVAL;
280280
}
281281

282-
dht11->timestamp = ktime_get_real_ns() - DHT11_DATA_VALID_TIME - 1;
282+
dht11->timestamp = ktime_get_boot_ns() - DHT11_DATA_VALID_TIME - 1;
283283
dht11->num_edges = -1;
284284

285285
platform_set_drvdata(pdev, iio);

drivers/iio/imu/inv_mpu6050/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
config INV_MPU6050_IIO
66
tristate "Invensense MPU6050 devices"
77
depends on I2C && SYSFS
8+
depends on I2C_MUX
89
select IIO_BUFFER
910
select IIO_TRIGGERED_BUFFER
10-
select I2C_MUX
1111
help
1212
This driver supports the Invensense MPU6050 devices.
1313
This driver can also support MPU6500 in MPU6050 compatibility mode

drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
8787

8888
ret = i2c_transfer(client->adapter, msg, 2);
8989

90-
return (ret == 2) ? 0 : ret;
90+
return (ret == 2) ? 0 : -EIO;
9191
}
9292

9393
static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)

drivers/staging/iio/adc/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ menu "Analog to digital converters"
66
config AD7606
77
tristate "Analog Devices AD7606 ADC driver"
88
depends on GPIOLIB || COMPILE_TEST
9+
depends on HAS_IOMEM
910
select IIO_BUFFER
1011
select IIO_TRIGGERED_BUFFER
1112
help

0 commit comments

Comments
 (0)