Просмотр исходного кода

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()
Linus Torvalds 10 лет назад
Родитель
Сommit
dacd53c805

+ 1 - 0
drivers/iio/accel/Kconfig

@@ -213,6 +213,7 @@ config STK8312
 config STK8BA50
 config STK8BA50
 	tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
 	tristate "Sensortek STK8BA50 3-Axis Accelerometer Driver"
 	depends on I2C
 	depends on I2C
+	depends on IIO_TRIGGER
 	help
 	help
 	  Say yes here to get support for the Sensortek STK8BA50 3-axis
 	  Say yes here to get support for the Sensortek STK8BA50 3-axis
 	  accelerometer.
 	  accelerometer.

+ 3 - 0
drivers/iio/adc/Kconfig

@@ -175,6 +175,7 @@ config DA9150_GPADC
 config EXYNOS_ADC
 config EXYNOS_ADC
 	tristate "Exynos ADC driver support"
 	tristate "Exynos ADC driver support"
 	depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
 	depends on ARCH_EXYNOS || ARCH_S3C24XX || ARCH_S3C64XX || (OF && COMPILE_TEST)
+	depends on HAS_IOMEM
 	help
 	help
 	  Core support for the ADC block found in the Samsung EXYNOS series
 	  Core support for the ADC block found in the Samsung EXYNOS series
 	  of SoCs for drivers such as the touchscreen and hwmon to use to share
 	  of SoCs for drivers such as the touchscreen and hwmon to use to share
@@ -207,6 +208,7 @@ config INA2XX_ADC
 config IMX7D_ADC
 config IMX7D_ADC
 	tristate "IMX7D ADC driver"
 	tristate "IMX7D ADC driver"
 	depends on ARCH_MXC || COMPILE_TEST
 	depends on ARCH_MXC || COMPILE_TEST
+	depends on HAS_IOMEM
 	help
 	help
 	  Say yes here to build support for IMX7D ADC.
 	  Say yes here to build support for IMX7D ADC.
 
 
@@ -409,6 +411,7 @@ config TWL6030_GPADC
 config VF610_ADC
 config VF610_ADC
 	tristate "Freescale vf610 ADC driver"
 	tristate "Freescale vf610 ADC driver"
 	depends on OF
 	depends on OF
+	depends on HAS_IOMEM
 	select IIO_BUFFER
 	select IIO_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	help
 	help

+ 1 - 1
drivers/iio/adc/ti_am335x_adc.c

@@ -289,7 +289,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev,
 		goto error_kfifo_free;
 		goto error_kfifo_free;
 
 
 	indio_dev->setup_ops = setup_ops;
 	indio_dev->setup_ops = setup_ops;
-	indio_dev->modes |= INDIO_BUFFER_HARDWARE;
+	indio_dev->modes |= INDIO_BUFFER_SOFTWARE;
 
 
 	return 0;
 	return 0;
 
 

+ 1 - 0
drivers/iio/dac/mcp4725.c

@@ -300,6 +300,7 @@ static int mcp4725_probe(struct i2c_client *client,
 	data->client = client;
 	data->client = client;
 
 
 	indio_dev->dev.parent = &client->dev;
 	indio_dev->dev.parent = &client->dev;
+	indio_dev->name = id->name;
 	indio_dev->info = &mcp4725_info;
 	indio_dev->info = &mcp4725_info;
 	indio_dev->channels = &mcp4725_channel;
 	indio_dev->channels = &mcp4725_channel;
 	indio_dev->num_channels = 1;
 	indio_dev->num_channels = 1;

+ 4 - 4
drivers/iio/humidity/dht11.c

@@ -117,7 +117,7 @@ static int dht11_decode(struct dht11 *dht11, int offset, int timeres)
 	if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum)
 	if (((hum_int + hum_dec + temp_int + temp_dec) & 0xff) != checksum)
 		return -EIO;
 		return -EIO;
 
 
-	dht11->timestamp = ktime_get_real_ns();
+	dht11->timestamp = ktime_get_boot_ns();
 	if (hum_int < 20) {  /* DHT22 */
 	if (hum_int < 20) {  /* DHT22 */
 		dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
 		dht11->temperature = (((temp_int & 0x7f) << 8) + temp_dec) *
 					((temp_int & 0x80) ? -100 : 100);
 					((temp_int & 0x80) ? -100 : 100);
@@ -145,7 +145,7 @@ static irqreturn_t dht11_handle_irq(int irq, void *data)
 
 
 	/* TODO: Consider making the handler safe for IRQ sharing */
 	/* TODO: Consider making the handler safe for IRQ sharing */
 	if (dht11->num_edges < DHT11_EDGES_PER_READ && dht11->num_edges >= 0) {
 	if (dht11->num_edges < DHT11_EDGES_PER_READ && dht11->num_edges >= 0) {
-		dht11->edges[dht11->num_edges].ts = ktime_get_real_ns();
+		dht11->edges[dht11->num_edges].ts = ktime_get_boot_ns();
 		dht11->edges[dht11->num_edges++].value =
 		dht11->edges[dht11->num_edges++].value =
 						gpio_get_value(dht11->gpio);
 						gpio_get_value(dht11->gpio);
 
 
@@ -164,7 +164,7 @@ static int dht11_read_raw(struct iio_dev *iio_dev,
 	int ret, timeres;
 	int ret, timeres;
 
 
 	mutex_lock(&dht11->lock);
 	mutex_lock(&dht11->lock);
-	if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_real_ns()) {
+	if (dht11->timestamp + DHT11_DATA_VALID_TIME < ktime_get_boot_ns()) {
 		timeres = ktime_get_resolution_ns();
 		timeres = ktime_get_resolution_ns();
 		if (DHT11_DATA_BIT_HIGH < 2 * timeres) {
 		if (DHT11_DATA_BIT_HIGH < 2 * timeres) {
 			dev_err(dht11->dev, "timeresolution %dns too low\n",
 			dev_err(dht11->dev, "timeresolution %dns too low\n",
@@ -279,7 +279,7 @@ static int dht11_probe(struct platform_device *pdev)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	dht11->timestamp = ktime_get_real_ns() - DHT11_DATA_VALID_TIME - 1;
+	dht11->timestamp = ktime_get_boot_ns() - DHT11_DATA_VALID_TIME - 1;
 	dht11->num_edges = -1;
 	dht11->num_edges = -1;
 
 
 	platform_set_drvdata(pdev, iio);
 	platform_set_drvdata(pdev, iio);

+ 1 - 1
drivers/iio/imu/inv_mpu6050/Kconfig

@@ -5,9 +5,9 @@
 config INV_MPU6050_IIO
 config INV_MPU6050_IIO
 	tristate "Invensense MPU6050 devices"
 	tristate "Invensense MPU6050 devices"
 	depends on I2C && SYSFS
 	depends on I2C && SYSFS
+	depends on I2C_MUX
 	select IIO_BUFFER
 	select IIO_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	select IIO_TRIGGERED_BUFFER
-	select I2C_MUX
 	help
 	help
 	  This driver supports the Invensense MPU6050 devices.
 	  This driver supports the Invensense MPU6050 devices.
 	  This driver can also support MPU6500 in MPU6050 compatibility mode
 	  This driver can also support MPU6500 in MPU6050 compatibility mode

+ 2 - 0
drivers/iio/inkern.c

@@ -349,6 +349,8 @@ EXPORT_SYMBOL_GPL(iio_channel_get);
 
 
 void iio_channel_release(struct iio_channel *channel)
 void iio_channel_release(struct iio_channel *channel)
 {
 {
+	if (!channel)
+		return;
 	iio_device_put(channel->indio_dev);
 	iio_device_put(channel->indio_dev);
 	kfree(channel);
 	kfree(channel);
 }
 }

+ 4 - 2
drivers/iio/light/acpi-als.c

@@ -54,7 +54,9 @@ static const struct iio_chan_spec acpi_als_channels[] = {
 			.realbits	= 32,
 			.realbits	= 32,
 			.storagebits	= 32,
 			.storagebits	= 32,
 		},
 		},
-		.info_mask_separate	= BIT(IIO_CHAN_INFO_RAW),
+		/* _RAW is here for backward ABI compatibility */
+		.info_mask_separate	= BIT(IIO_CHAN_INFO_RAW) |
+					  BIT(IIO_CHAN_INFO_PROCESSED),
 	},
 	},
 };
 };
 
 
@@ -152,7 +154,7 @@ static int acpi_als_read_raw(struct iio_dev *indio_dev,
 	s32 temp_val;
 	s32 temp_val;
 	int ret;
 	int ret;
 
 
-	if (mask != IIO_CHAN_INFO_RAW)
+	if ((mask != IIO_CHAN_INFO_PROCESSED) && (mask != IIO_CHAN_INFO_RAW))
 		return -EINVAL;
 		return -EINVAL;
 
 
 	/* we support only illumination (_ALI) so far. */
 	/* we support only illumination (_ALI) so far. */

+ 1 - 1
drivers/iio/light/ltr501.c

@@ -180,7 +180,7 @@ static const struct ltr501_samp_table ltr501_ps_samp_table[] = {
 			{500000, 2000000}
 			{500000, 2000000}
 };
 };
 
 
-static unsigned int ltr501_match_samp_freq(const struct ltr501_samp_table *tab,
+static int ltr501_match_samp_freq(const struct ltr501_samp_table *tab,
 					   int len, int val, int val2)
 					   int len, int val, int val2)
 {
 {
 	int i, freq;
 	int i, freq;

+ 1 - 1
drivers/iio/pressure/mpl115.c

@@ -117,7 +117,7 @@ static int mpl115_read_raw(struct iio_dev *indio_dev,
 		*val = ret >> 6;
 		*val = ret >> 6;
 		return IIO_VAL_INT;
 		return IIO_VAL_INT;
 	case IIO_CHAN_INFO_OFFSET:
 	case IIO_CHAN_INFO_OFFSET:
-		*val = 605;
+		*val = -605;
 		*val2 = 750000;
 		*val2 = 750000;
 		return IIO_VAL_INT_PLUS_MICRO;
 		return IIO_VAL_INT_PLUS_MICRO;
 	case IIO_CHAN_INFO_SCALE:
 	case IIO_CHAN_INFO_SCALE:

+ 1 - 1
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)
 
 
 	ret = i2c_transfer(client->adapter, msg, 2);
 	ret = i2c_transfer(client->adapter, msg, 2);
 
 
-	return (ret == 2) ? 0 : ret;
+	return (ret == 2) ? 0 : -EIO;
 }
 }
 
 
 static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
 static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)

+ 1 - 0
drivers/staging/iio/adc/Kconfig

@@ -6,6 +6,7 @@ menu "Analog to digital converters"
 config AD7606
 config AD7606
 	tristate "Analog Devices AD7606 ADC driver"
 	tristate "Analog Devices AD7606 ADC driver"
 	depends on GPIOLIB || COMPILE_TEST
 	depends on GPIOLIB || COMPILE_TEST
+	depends on HAS_IOMEM
 	select IIO_BUFFER
 	select IIO_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	help
 	help

+ 10 - 2
drivers/staging/iio/meter/ade7753.c

@@ -217,8 +217,12 @@ error_ret:
 static int ade7753_reset(struct device *dev)
 static int ade7753_reset(struct device *dev)
 {
 {
 	u16 val;
 	u16 val;
+	int ret;
+
+	ret = ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
+	if (ret)
+		return ret;
 
 
-	ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
 	val |= BIT(6); /* Software Chip Reset */
 	val |= BIT(6); /* Software Chip Reset */
 
 
 	return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
 	return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
@@ -343,8 +347,12 @@ error_ret:
 static int ade7753_stop_device(struct device *dev)
 static int ade7753_stop_device(struct device *dev)
 {
 {
 	u16 val;
 	u16 val;
+	int ret;
+
+	ret = ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
+	if (ret)
+		return ret;
 
 
-	ade7753_spi_read_reg_16(dev, ADE7753_MODE, &val);
 	val |= BIT(4);  /* AD converters can be turned off */
 	val |= BIT(4);  /* AD converters can be turned off */
 
 
 	return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);
 	return ade7753_spi_write_reg_16(dev, ADE7753_MODE, val);

+ 1 - 1
drivers/staging/speakup/Kconfig

@@ -1,7 +1,7 @@
 menu "Speakup console speech"
 menu "Speakup console speech"
 
 
 config SPEAKUP
 config SPEAKUP
-	depends on VT
+	depends on VT && !MN10300
 	tristate "Speakup core"
 	tristate "Speakup core"
 	---help---
 	---help---
 		This is the Speakup screen reader.  Think of it as a
 		This is the Speakup screen reader.  Think of it as a