Skip to content

Commit dacd53c

Browse files
committed
Merge tag 'staging-4.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging and IIO driver fixes from Greg KH: "Here are some IIO and staging driver fixes for 4.5-rc3. All of them, except one, are for IIO drivers, and one is for a speakup driver fix caused by some earlier patches, to resolve a reported build failure" * tag 'staging-4.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: Staging: speakup: Fix allyesconfig build on mn10300 iio: dht11: Use boottime iio: ade7753: avoid uninitialized data iio: pressure: mpl115: fix temperature offset sign iio: imu: Fix dependencies for !HAS_IOMEM archs staging: iio: Fix dependencies for !HAS_IOMEM archs iio: adc: Fix dependencies for !HAS_IOMEM archs iio: inkern: fix a NULL dereference on error iio:adc:ti_am335x_adc Fix buffered mode by identifying as software buffer. iio: light: acpi-als: Report data as processed iio: dac: mcp4725: set iio name property in sysfs iio: add HAS_IOMEM dependency to VF610_ADC iio: add IIO_TRIGGER dependency to STK8BA50 iio: proximity: lidar: correct return value iio-light: Use a signed return type for ltr501_match_samp_freq()
2 parents 5af9c2e + 5982557 commit dacd53c

File tree

14 files changed

+32
-14
lines changed

14 files changed

+32
-14
lines changed

drivers/iio/accel/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ config STK8312
213213
config STK8BA50
214214
tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
215215
depends on I2C
216+
depends on IIO_TRIGGER
216217
help
217218
Say yes here to get support for the Sensortek STK8BA50 3-axis
218219
accelerometer.

drivers/iio/adc/Kconfig

+3
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

@@ -409,6 +411,7 @@ config TWL6030_GPADC
409411
config VF610_ADC
410412
tristate "Freescale vf610 ADC driver"
411413
depends on OF
414+
depends on HAS_IOMEM
412415
select IIO_BUFFER
413416
select IIO_TRIGGERED_BUFFER
414417
help

drivers/iio/adc/ti_am335x_adc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev,
289289
goto error_kfifo_free;
290290

291291
indio_dev->setup_ops = setup_ops;
292-
indio_dev->modes |= INDIO_BUFFER_HARDWARE;
292+
indio_dev->modes |= INDIO_BUFFER_SOFTWARE;
293293

294294
return 0;
295295

drivers/iio/dac/mcp4725.c

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ static int mcp4725_probe(struct i2c_client *client,
300300
data->client = client;
301301

302302
indio_dev->dev.parent = &client->dev;
303+
indio_dev->name = id->name;
303304
indio_dev->info = &mcp4725_info;
304305
indio_dev->channels = &mcp4725_channel;
305306
indio_dev->num_channels = 1;

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/inkern.c

+2
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ EXPORT_SYMBOL_GPL(iio_channel_get);
349349

350350
void iio_channel_release(struct iio_channel *channel)
351351
{
352+
if (!channel)
353+
return;
352354
iio_device_put(channel->indio_dev);
353355
kfree(channel);
354356
}

drivers/iio/light/acpi-als.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ static const struct iio_chan_spec acpi_als_channels[] = {
5454
.realbits = 32,
5555
.storagebits = 32,
5656
},
57-
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
57+
/* _RAW is here for backward ABI compatibility */
58+
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
59+
BIT(IIO_CHAN_INFO_PROCESSED),
5860
},
5961
};
6062

@@ -152,7 +154,7 @@ static int acpi_als_read_raw(struct iio_dev *indio_dev,
152154
s32 temp_val;
153155
int ret;
154156

155-
if (mask != IIO_CHAN_INFO_RAW)
157+
if ((mask != IIO_CHAN_INFO_PROCESSED) && (mask != IIO_CHAN_INFO_RAW))
156158
return -EINVAL;
157159

158160
/* we support only illumination (_ALI) so far. */

drivers/iio/light/ltr501.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static const struct ltr501_samp_table ltr501_ps_samp_table[] = {
180180
{500000, 2000000}
181181
};
182182

183-
static unsigned int ltr501_match_samp_freq(const struct ltr501_samp_table *tab,
183+
static int ltr501_match_samp_freq(const struct ltr501_samp_table *tab,
184184
int len, int val, int val2)
185185
{
186186
int i, freq;

drivers/iio/pressure/mpl115.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int mpl115_read_raw(struct iio_dev *indio_dev,
117117
*val = ret >> 6;
118118
return IIO_VAL_INT;
119119
case IIO_CHAN_INFO_OFFSET:
120-
*val = 605;
120+
*val = -605;
121121
*val2 = 750000;
122122
return IIO_VAL_INT_PLUS_MICRO;
123123
case IIO_CHAN_INFO_SCALE:

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

drivers/staging/iio/meter/ade7753.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,12 @@ static ssize_t ade7753_write_16bit(struct device *dev,
217217
static int ade7753_reset(struct device *dev)
218218
{
219219
u16 val;
220+
int ret;
221+
222+
ret = ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
223+
if (ret)
224+
return ret;
220225

221-
ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
222226
val |= BIT(6); /* Software Chip Reset */
223227

224228
return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
@@ -343,8 +347,12 @@ static int ade7753_set_irq(struct device *dev, bool enable)
343347
static int ade7753_stop_device(struct device *dev)
344348
{
345349
u16 val;
350+
int ret;
351+
352+
ret = ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
353+
if (ret)
354+
return ret;
346355

347-
ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
348356
val |= BIT(4); /* AD converters can be turned off */
349357

350358
return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);

drivers/staging/speakup/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
menu "Speakup console speech"
22

33
config SPEAKUP
4-
depends on VT
4+
depends on VT && !MN10300
55
tristate "Speakup core"
66
---help---
77
This is the Speakup screen reader. Think of it as a

0 commit comments

Comments
 (0)