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

Commit 6fe8135f authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman
Browse files

staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.



This was suggested by Arnd Bergmann,  Other elements may well
move in here in future, but it definitely makes sense for these.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a3f02370
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -457,6 +457,13 @@ static const struct attribute_group adis16201_attribute_group = {
	.attrs = adis16201_attributes,
};

static const struct iio_info adis16201_info = {
	.attrs = &adis16201_attribute_group,
	.read_raw = &adis16201_read_raw,
	.write_raw = &adis16201_write_raw,
	.driver_module = THIS_MODULE,
};

static int __devinit adis16201_probe(struct spi_device *spi)
{
	int ret, regdone = 0;
@@ -490,13 +497,11 @@ static int __devinit adis16201_probe(struct spi_device *spi)

	st->indio_dev->name = spi->dev.driver->name;
	st->indio_dev->dev.parent = &spi->dev;
	st->indio_dev->attrs = &adis16201_attribute_group;
	st->indio_dev->info = &adis16201_info;

	st->indio_dev->channels = adis16201_channels;
	st->indio_dev->num_channels = ARRAY_SIZE(adis16201_channels);
	st->indio_dev->read_raw = &adis16201_read_raw;
	st->indio_dev->write_raw = &adis16201_write_raw;
	st->indio_dev->dev_data = (void *)(st);
	st->indio_dev->driver_module = THIS_MODULE;
	st->indio_dev->modes = INDIO_DIRECT_MODE;

	ret = adis16201_configure_ring(st->indio_dev);
+8 −4
Original line number Diff line number Diff line
@@ -408,6 +408,13 @@ static const struct attribute_group adis16203_attribute_group = {
	.attrs = adis16203_attributes,
};

static const struct iio_info adis16203_info = {
	.attrs = &adis16203_attribute_group,
	.read_raw = &adis16203_read_raw,
	.write_raw = &adis16203_write_raw,
	.driver_module = THIS_MODULE,
};

static int __devinit adis16203_probe(struct spi_device *spi)
{
	int ret, regdone = 0;
@@ -440,13 +447,10 @@ static int __devinit adis16203_probe(struct spi_device *spi)
	}
	st->indio_dev->name = spi->dev.driver->name;
	st->indio_dev->dev.parent = &spi->dev;
	st->indio_dev->attrs = &adis16203_attribute_group;
	st->indio_dev->channels = adis16203_channels;
	st->indio_dev->num_channels = ARRAY_SIZE(adis16203_channels);
	st->indio_dev->read_raw = &adis16203_read_raw;
	st->indio_dev->write_raw = &adis16203_write_raw;
	st->indio_dev->info = &adis16203_info;
	st->indio_dev->dev_data = (void *)(st);
	st->indio_dev->driver_module = THIS_MODULE;
	st->indio_dev->modes = INDIO_DIRECT_MODE;

	ret = adis16203_configure_ring(st->indio_dev);
+8 −4
Original line number Diff line number Diff line
@@ -473,6 +473,13 @@ static const struct attribute_group adis16204_attribute_group = {
	.attrs = adis16204_attributes,
};

static const struct iio_info adis16204_info = {
	.attrs = &adis16204_attribute_group,
	.read_raw = &adis16204_read_raw,
	.write_raw = &adis16204_write_raw,
	.driver_module = THIS_MODULE,
};

static int __devinit adis16204_probe(struct spi_device *spi)
{
	int ret, regdone = 0;
@@ -506,13 +513,10 @@ static int __devinit adis16204_probe(struct spi_device *spi)

	st->indio_dev->name = spi->dev.driver->name;
	st->indio_dev->dev.parent = &spi->dev;
	st->indio_dev->attrs = &adis16204_attribute_group;
	st->indio_dev->info = &adis16204_info;
	st->indio_dev->channels = adis16204_channels;
	st->indio_dev->num_channels = ARRAY_SIZE(adis16204_channels);
	st->indio_dev->read_raw = &adis16204_read_raw;
	st->indio_dev->write_raw = &adis16204_write_raw;
	st->indio_dev->dev_data = (void *)(st);
	st->indio_dev->driver_module = THIS_MODULE;
	st->indio_dev->modes = INDIO_DIRECT_MODE;

	ret = adis16204_configure_ring(st->indio_dev);
+8 −4
Original line number Diff line number Diff line
@@ -456,6 +456,13 @@ static const struct attribute_group adis16209_attribute_group = {
	.attrs = adis16209_attributes,
};

static const struct iio_info adis16209_info = {
	.attrs = &adis16209_attribute_group,
	.read_raw = &adis16209_read_raw,
	.write_raw = &adis16209_write_raw,
	.driver_module = THIS_MODULE,
};

static int __devinit adis16209_probe(struct spi_device *spi)
{
	int ret, regdone = 0;
@@ -489,13 +496,10 @@ static int __devinit adis16209_probe(struct spi_device *spi)

	st->indio_dev->name = spi->dev.driver->name;
	st->indio_dev->dev.parent = &spi->dev;
	st->indio_dev->attrs = &adis16209_attribute_group;
	st->indio_dev->info = &adis16209_info;
	st->indio_dev->channels = adis16209_channels;
	st->indio_dev->num_channels = ARRAY_SIZE(adis16209_channels);
	st->indio_dev->read_raw = &adis16209_read_raw;
	st->indio_dev->write_raw = &adis16209_write_raw;
	st->indio_dev->dev_data = (void *)(st);
	st->indio_dev->driver_module = THIS_MODULE;
	st->indio_dev->modes = INDIO_DIRECT_MODE;

	ret = adis16209_configure_ring(st->indio_dev);
+5 −2
Original line number Diff line number Diff line
@@ -544,6 +544,10 @@ static const struct attribute_group adis16220_attribute_group = {
	.attrs = adis16220_attributes,
};

static const struct iio_info adis16220_info = {
	.attrs = &adis16220_attribute_group,
	.driver_module = THIS_MODULE,
};
static int __devinit adis16220_probe(struct spi_device *spi)
{
	int ret, regdone = 0;
@@ -577,9 +581,8 @@ static int __devinit adis16220_probe(struct spi_device *spi)

	st->indio_dev->name = spi->dev.driver->name;
	st->indio_dev->dev.parent = &spi->dev;
	st->indio_dev->attrs = &adis16220_attribute_group;
	st->indio_dev->info = &adis16220_info;
	st->indio_dev->dev_data = (void *)(st);
	st->indio_dev->driver_module = THIS_MODULE;
	st->indio_dev->modes = INDIO_DIRECT_MODE;

	ret = iio_device_register(st->indio_dev);
Loading