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

Commit f316983f authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman
Browse files

staging: iio: adc: convert ADI drivers to use kfifo.



sw_ring is depreciated and therefore won't move out of staging.
Prerequisite for lifting affected drivers is to convert them to kfifo.
Update copyright.

Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 949fd38c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ config AD7606
	depends on GPIOLIB
	select IIO_BUFFER
	select IIO_TRIGGER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	help
	  Say yes here to build support for Analog Devices:
	  ad7606, ad7606-6, ad7606-4 analog to digital converters (ADC).
@@ -63,7 +63,7 @@ config AD799X_RING_BUFFER
	bool "Analog Devices AD799x: use ring buffer"
	depends on AD799X
	select IIO_BUFFER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	help
	  Say yes here to include ring buffer support in the AD799X
	  ADC driver.
@@ -72,7 +72,7 @@ config AD7476
	tristate "Analog Devices AD7475/6/7/8 AD7466/7/8 and AD7495 ADC driver"
	depends on SPI
	select IIO_BUFFER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	select IIO_TRIGGER
	help
	  Say yes here to build support for Analog Devices
@@ -87,7 +87,7 @@ config AD7887
	tristate "Analog Devices AD7887 ADC driver"
	depends on SPI
	select IIO_BUFFER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	select IIO_TRIGGER
	help
	  Say yes here to build support for Analog Devices
@@ -113,7 +113,7 @@ config AD7793
	tristate "Analog Devices AD7792 AD7793 ADC driver"
	depends on SPI
	select IIO_BUFFER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	select IIO_TRIGGER
	help
	  Say yes here to build support for Analog Devices
@@ -135,7 +135,7 @@ config AD7192
	tristate "Analog Devices AD7190 AD7192 AD7195 ADC driver"
	depends on SPI
	select IIO_BUFFER
	select IIO_SW_RING
	select IIO_KFIFO_BUF
	select IIO_TRIGGER
	help
	  Say yes here to build support for Analog Devices AD7190,
+7 −7
Original line number Diff line number Diff line
/*
 * AD7190 AD7192 AD7195 SPI ADC driver
 *
 * Copyright 2011 Analog Devices Inc.
 * Copyright 2011-2012 Analog Devices Inc.
 *
 * Licensed under the GPL-2.
 */
@@ -20,7 +20,7 @@
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/buffer.h>
#include "../ring_sw.h"
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger.h>
#include <linux/iio/trigger_consumer.h>

@@ -544,7 +544,7 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev)
{
	int ret;

	indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
	indio_dev->buffer = iio_kfifo_allocate(indio_dev);
	if (!indio_dev->buffer) {
		ret = -ENOMEM;
		goto error_ret;
@@ -557,7 +557,7 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev)
						 indio_dev->id);
	if (indio_dev->pollfunc == NULL) {
		ret = -ENOMEM;
		goto error_deallocate_sw_rb;
		goto error_deallocate_kfifo;
	}

	/* Ring buffer functions - here trigger setup related */
@@ -567,8 +567,8 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
	return 0;

error_deallocate_sw_rb:
	iio_sw_rb_free(indio_dev->buffer);
error_deallocate_kfifo:
	iio_kfifo_free(indio_dev->buffer);
error_ret:
	return ret;
}
@@ -576,7 +576,7 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev)
static void ad7192_ring_cleanup(struct iio_dev *indio_dev)
{
	iio_dealloc_pollfunc(indio_dev->pollfunc);
	iio_sw_rb_free(indio_dev->buffer);
	iio_kfifo_free(indio_dev->buffer);
}

/**
+7 −7
Original line number Diff line number Diff line
/*
 * AD7298 SPI ADC driver
 *
 * Copyright 2011 Analog Devices Inc.
 * Copyright 2011-2012 Analog Devices Inc.
 *
 * Licensed under the GPL-2.
 */
@@ -13,7 +13,7 @@

#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include "../ring_sw.h"
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>

#include "ad7298.h"
@@ -118,7 +118,7 @@ int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)
{
	int ret;

	indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
	indio_dev->buffer = iio_kfifo_allocate(indio_dev);
	if (!indio_dev->buffer) {
		ret = -ENOMEM;
		goto error_ret;
@@ -132,7 +132,7 @@ int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)

	if (indio_dev->pollfunc == NULL) {
		ret = -ENOMEM;
		goto error_deallocate_sw_rb;
		goto error_deallocate_kfifo;
	}

	/* Ring buffer functions - here trigger setup related */
@@ -143,8 +143,8 @@ int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
	return 0;

error_deallocate_sw_rb:
	iio_sw_rb_free(indio_dev->buffer);
error_deallocate_kfifo:
	iio_kfifo_free(indio_dev->buffer);
error_ret:
	return ret;
}
@@ -152,5 +152,5 @@ int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)
void ad7298_ring_cleanup(struct iio_dev *indio_dev)
{
	iio_dealloc_pollfunc(indio_dev->pollfunc);
	iio_sw_rb_free(indio_dev->buffer);
	iio_kfifo_free(indio_dev->buffer);
}
+7 −7
Original line number Diff line number Diff line
/*
 * Copyright 2010 Analog Devices Inc.
 * Copyright 2010-2012 Analog Devices Inc.
 * Copyright (C) 2008 Jonathan Cameron
 *
 * Licensed under the GPL-2 or later.
@@ -15,7 +15,7 @@

#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include "../ring_sw.h"
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>

#include "ad7476.h"
@@ -63,7 +63,7 @@ int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	struct ad7476_state *st = iio_priv(indio_dev);
	int ret = 0;

	indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
	indio_dev->buffer = iio_kfifo_allocate(indio_dev);
	if (!indio_dev->buffer) {
		ret = -ENOMEM;
		goto error_ret;
@@ -78,7 +78,7 @@ int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev)
				     indio_dev->id);
	if (indio_dev->pollfunc == NULL) {
		ret = -ENOMEM;
		goto error_deallocate_sw_rb;
		goto error_deallocate_kfifo;
	}

	/* Ring buffer functions - here trigger setup related */
@@ -89,8 +89,8 @@ int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
	return 0;

error_deallocate_sw_rb:
	iio_sw_rb_free(indio_dev->buffer);
error_deallocate_kfifo:
	iio_kfifo_free(indio_dev->buffer);
error_ret:
	return ret;
}
@@ -98,5 +98,5 @@ int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev)
void ad7476_ring_cleanup(struct iio_dev *indio_dev)
{
	iio_dealloc_pollfunc(indio_dev->pollfunc);
	iio_sw_rb_free(indio_dev->buffer);
	iio_kfifo_free(indio_dev->buffer);
}
+8 −8
Original line number Diff line number Diff line
/*
 * Copyright 2011 Analog Devices Inc.
 * Copyright 2011-2012 Analog Devices Inc.
 *
 * Licensed under the GPL-2.
 *
@@ -13,7 +13,7 @@

#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
#include "../ring_sw.h"
#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>

#include "ad7606.h"
@@ -102,7 +102,7 @@ int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	struct ad7606_state *st = iio_priv(indio_dev);
	int ret;

	indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
	indio_dev->buffer = iio_kfifo_allocate(indio_dev);
	if (!indio_dev->buffer) {
		ret = -ENOMEM;
		goto error_ret;
@@ -117,7 +117,7 @@ int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev)
						 indio_dev->id);
	if (indio_dev->pollfunc == NULL) {
		ret = -ENOMEM;
		goto error_deallocate_sw_rb;
		goto error_deallocate_kfifo;
	}

	/* Ring buffer functions - here trigger setup related */
@@ -131,8 +131,8 @@ int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev)
	indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
	return 0;

error_deallocate_sw_rb:
	iio_sw_rb_free(indio_dev->buffer);
error_deallocate_kfifo:
	iio_kfifo_free(indio_dev->buffer);
error_ret:
	return ret;
}
@@ -140,5 +140,5 @@ int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev)
void ad7606_ring_cleanup(struct iio_dev *indio_dev)
{
	iio_dealloc_pollfunc(indio_dev->pollfunc);
	iio_sw_rb_free(indio_dev->buffer);
	iio_kfifo_free(indio_dev->buffer);
}
Loading