Commit 0dfaa465 authored by Nuno Sá's avatar Nuno Sá Committed by Jonathan Cameron
Browse files

iio: adis16475: Drop adis_burst usage



Burst mode variables are now part of the `adis_data` struct. The driver
also has now to explicitly define the length of the burst buffer.

Signed-off-by: default avatarNuno Sá <nuno.sa@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20200917155223.218500-4-nuno.sa@analog.com
parent f81d053b
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -565,6 +565,9 @@ static int adis16475_enable_irq(struct adis *adis, bool enable)
		BIT(ADIS16475_DIAG_STAT_CLK),				\
	.enable_irq = adis16475_enable_irq,				\
	.timeouts = (_timeouts),					\
	.burst_reg_cmd = ADIS16475_REG_GLOB_CMD,			\
	.burst_len = ADIS16475_BURST_MAX_DATA,				\
	.burst_max_len = ADIS16475_BURST32_MAX_DATA			\
}

static const struct adis16475_sync adis16475_sync_mode[] = {
@@ -910,20 +913,6 @@ static const struct iio_info adis16475_info = {
	.debugfs_reg_access = adis_debugfs_reg_access,
};

static struct adis_burst adis16475_burst = {
	.en = true,
	.reg_cmd = ADIS16475_REG_GLOB_CMD,
	/*
	 * adis_update_scan_mode_burst() sets the burst length in respect with
	 * the number of channels and allocates 16 bits for each. However,
	 * adis1647x devices also need space for DIAG_STAT, DATA_CNTR or
	 * TIME_STAMP (depending on the clock mode but for us these bytes are
	 * don't care...) and CRC.
	 */
	.extra_len = 3 * sizeof(u16),
	.burst_max_len = ADIS16475_BURST32_MAX_DATA,
};

static bool adis16475_validate_crc(const u8 *buffer, u16 crc,
				   const bool burst32)
{
@@ -1279,7 +1268,6 @@ static int adis16475_probe(struct spi_device *spi)

	st = iio_priv(indio_dev);
	spi_set_drvdata(spi, indio_dev);
	st->adis.burst = &adis16475_burst;

	st->info = device_get_match_data(&spi->dev);
	if (!st->info)