Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c68888f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'fixes-for-4.13b' of...

Merge tag 'fixes-for-4.13b' 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.13 cycle.

Given the late stage of this series, some more involved fixes have been
held back for the upcoming merge window.

The hid-sensor issue has been causing problems for a long time so it
is great to have that one finally fixed!  No more bug reports for the
userspace guys (well about that anyway).

* documentation
  - some warning fixes due to missing colons in kernel-doc.
* adis16480
  - fix accel scale factor.
* bmp280
  - properly initialize the device for humidity readings - without this
  the humidity readings may be skipped and a magic value of 0x8000 returned.
* hid-sensor-strigger
  - fix a race with user space when powering up the sensor.
* ina291
  - Avoid an underflow for the sleeping time as a result of supporting the
  fastest rates.
* st-magnetometer
  - Fix the status register address for hte LSM303AGR,
  - Remove the ihl property for LSM303AGR as the sensor doesn't support
  active low for the dataready line.
* stm32-adc
  - Fix use of a common clock rate.
* stm32-timer
  - fix the quadrature mode get routine to account for the magic 0 value.
  set on boot.
  - fix the return value of write_raw,
  - fix the get/set down count direction as the enum value was not being
  converted to the relevant bit field,
  - add an enable attribute to actually turn it on when in encoder mode,
  - missing mask when reading the trigger mode.
parents f299aec6 8b35a5f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -644,7 +644,7 @@ static int ina2xx_capture_thread(void *data)
{
	struct iio_dev *indio_dev = data;
	struct ina2xx_chip_info *chip = iio_priv(indio_dev);
	unsigned int sampling_us = SAMPLING_PERIOD(chip);
	int sampling_us = SAMPLING_PERIOD(chip);
	int buffer_us;

	/*
+5 −5
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@
#define STM32H7_CKMODE_MASK		GENMASK(17, 16)

/* STM32 H7 maximum analog clock rate (from datasheet) */
#define STM32H7_ADC_MAX_CLK_RATE	72000000
#define STM32H7_ADC_MAX_CLK_RATE	36000000

/**
 * stm32_adc_common_regs - stm32 common registers, compatible dependent data
@@ -148,14 +148,14 @@ static int stm32f4_adc_clk_sel(struct platform_device *pdev,
		return -EINVAL;
	}

	priv->common.rate = rate;
	priv->common.rate = rate / stm32f4_pclk_div[i];
	val = readl_relaxed(priv->common.base + STM32F4_ADC_CCR);
	val &= ~STM32F4_ADC_ADCPRE_MASK;
	val |= i << STM32F4_ADC_ADCPRE_SHIFT;
	writel_relaxed(val, priv->common.base + STM32F4_ADC_CCR);

	dev_dbg(&pdev->dev, "Using analog clock source at %ld kHz\n",
		rate / (stm32f4_pclk_div[i] * 1000));
		priv->common.rate / 1000);

	return 0;
}
@@ -250,7 +250,7 @@ static int stm32h7_adc_clk_sel(struct platform_device *pdev,

out:
	/* rate used later by each ADC instance to control BOOST mode */
	priv->common.rate = rate;
	priv->common.rate = rate / div;

	/* Set common clock mode and prescaler */
	val = readl_relaxed(priv->common.base + STM32H7_ADC_CCR);
@@ -260,7 +260,7 @@ static int stm32h7_adc_clk_sel(struct platform_device *pdev,
	writel_relaxed(val, priv->common.base + STM32H7_ADC_CCR);

	dev_dbg(&pdev->dev, "Using %s clock/%d source at %ld kHz\n",
		ckmode ? "bus" : "adc", div, rate / (div * 1000));
		ckmode ? "bus" : "adc", div, priv->common.rate / 1000);

	return 0;
}
+4 −4
Original line number Diff line number Diff line
@@ -111,8 +111,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
	s32 poll_value = 0;

	if (state) {
		if (!atomic_read(&st->user_requested_state))
			return 0;
		if (sensor_hub_device_open(st->hsdev))
			return -EIO;

@@ -161,6 +159,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state)
				       &report_val);
	}

	pr_debug("HID_SENSOR %s set power_state %d report_state %d\n",
		 st->pdev->name, state_val, report_val);

	sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
			       st->power_state.index,
			       sizeof(state_val), &state_val);
@@ -182,6 +183,7 @@ int hid_sensor_power_state(struct hid_sensor_common *st, bool state)
		ret = pm_runtime_get_sync(&st->pdev->dev);
	else {
		pm_runtime_mark_last_busy(&st->pdev->dev);
		pm_runtime_use_autosuspend(&st->pdev->dev);
		ret = pm_runtime_put_autosuspend(&st->pdev->dev);
	}
	if (ret < 0) {
@@ -285,8 +287,6 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
	/* Default to 3 seconds, but can be changed from sysfs */
	pm_runtime_set_autosuspend_delay(&attrb->pdev->dev,
					 3000);
	pm_runtime_use_autosuspend(&attrb->pdev->dev);

	return ret;
error_unreg_trigger:
	iio_trigger_unregister(trig);
+1 −1
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@ static const struct adis16480_chip_info adis16480_chip_info[] = {
		.gyro_max_val = IIO_RAD_TO_DEGREE(22500),
		.gyro_max_scale = 450,
		.accel_max_val = IIO_M_S_2_TO_G(12500),
		.accel_max_scale = 5,
		.accel_max_scale = 10,
	},
	[ADIS16485] = {
		.channels = adis16485_channels,
+1 −3
Original line number Diff line number Diff line
@@ -356,9 +356,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
		.drdy_irq = {
			.addr = 0x62,
			.mask_int1 = 0x01,
			.addr_ihl = 0x63,
			.mask_ihl = 0x04,
			.addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
			.addr_stat_drdy = 0x67,
		},
		.multi_read_bit = false,
		.bootime = 2,
Loading