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

Commit 2209a305 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging and IIO driver fixes from Greg KH:
 "Here are some Staging and IIO driver fixes to resolve some reported
  problems for 5.2-rc3.

  Nothing major here, just some tiny changes, full details are in the
  shortlog.

  All have been in linux-next for a while with no reported issues"

* tag 'staging-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000'
  staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup()
  staging: vc04_services: prevent integer overflow in create_pagelist()
  Staging: vc04_services: Fix a couple error codes
  staging: wlan-ng: fix adapter initialization failure
  staging: kpc2000: double unlock in error handling in kpc_dma_transfer()
  staging: kpc2000: Fix build error without CONFIG_UIO
  staging: kpc2000: fix build error on xtensa
  staging: erofs: set sb->s_root to NULL when failing from __getname()
  iio: adc: ti-ads8688: fix timestamp is not updated in buffer
  iio: dac: ds4422/ds4424 fix chip verification
  iio: imu: mpu6050: Fix FIFO layout for ICM20602
  iio: adc: ads124: avoid buffer overflow
  iio: adc: modify NPCM ADC read reference voltage
parents dbde71df e61ff0fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ static int npcm_adc_read_raw(struct iio_dev *indio_dev,
		}
		return IIO_VAL_INT;
	case IIO_CHAN_INFO_SCALE:
		if (info->vref) {
		if (!IS_ERR(info->vref)) {
			vref_uv = regulator_get_voltage(info->vref);
			*val = vref_uv / 1000;
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
	};

	priv->data[0] = ADS124S08_CMD_RDATA;
	memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data));
	memset(&priv->data[1], ADS124S08_CMD_NOP, sizeof(priv->data) - 1);

	ret = spi_sync_transfer(priv->spi, t, ARRAY_SIZE(t));
	if (ret < 0)
+1 −1
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ static irqreturn_t ads8688_trigger_handler(int irq, void *p)
	}

	iio_push_to_buffers_with_timestamp(indio_dev, buffer,
			pf->timestamp);
			iio_get_time_ns(indio_dev));

	iio_trigger_notify_done(indio_dev->trig);

+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev)
{
	int ret, val;

	ret = ds4424_get_value(indio_dev, &val, DS4424_DAC_ADDR(0));
	ret = ds4424_get_value(indio_dev, &val, 0);
	if (ret < 0)
		dev_err(&indio_dev->dev,
				"%s failed. ret: %d\n", __func__, ret);
+42 −4
Original line number Diff line number Diff line
@@ -471,6 +471,9 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
			return IIO_VAL_INT_PLUS_MICRO;
		case IIO_TEMP:
			*val = 0;
			if (st->chip_type == INV_ICM20602)
				*val2 = INV_ICM20602_TEMP_SCALE;
			else
				*val2 = INV_MPU6050_TEMP_SCALE;

			return IIO_VAL_INT_PLUS_MICRO;
@@ -480,6 +483,9 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev,
	case IIO_CHAN_INFO_OFFSET:
		switch (chan->type) {
		case IIO_TEMP:
			if (st->chip_type == INV_ICM20602)
				*val = INV_ICM20602_TEMP_OFFSET;
			else
				*val = INV_MPU6050_TEMP_OFFSET;

			return IIO_VAL_INT;
@@ -847,6 +853,32 @@ static const struct iio_chan_spec inv_mpu_channels[] = {
	INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z),
};

static const struct iio_chan_spec inv_icm20602_channels[] = {
	IIO_CHAN_SOFT_TIMESTAMP(INV_ICM20602_SCAN_TIMESTAMP),
	{
		.type = IIO_TEMP,
		.info_mask_separate = BIT(IIO_CHAN_INFO_RAW)
				| BIT(IIO_CHAN_INFO_OFFSET)
				| BIT(IIO_CHAN_INFO_SCALE),
		.scan_index = INV_ICM20602_SCAN_TEMP,
		.scan_type = {
				.sign = 's',
				.realbits = 16,
				.storagebits = 16,
				.shift = 0,
				.endianness = IIO_BE,
			     },
	},

	INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_X, INV_ICM20602_SCAN_GYRO_X),
	INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Y, INV_ICM20602_SCAN_GYRO_Y),
	INV_MPU6050_CHAN(IIO_ANGL_VEL, IIO_MOD_Z, INV_ICM20602_SCAN_GYRO_Z),

	INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Y, INV_ICM20602_SCAN_ACCL_Y),
	INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_X, INV_ICM20602_SCAN_ACCL_X),
	INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_ICM20602_SCAN_ACCL_Z),
};

/*
 * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and
 * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by the
@@ -1102,8 +1134,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
		indio_dev->name = name;
	else
		indio_dev->name = dev_name(dev);

	if (chip_type == INV_ICM20602) {
		indio_dev->channels = inv_icm20602_channels;
		indio_dev->num_channels = ARRAY_SIZE(inv_icm20602_channels);
	} else {
		indio_dev->channels = inv_mpu_channels;
		indio_dev->num_channels = ARRAY_SIZE(inv_mpu_channels);
	}

	indio_dev->info = &mpu_info;
	indio_dev->modes = INDIO_BUFFER_TRIGGERED;
Loading