Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281391
b: refs/heads/master
c: 617156f
h: refs/heads/master
i:
  281389: 4d9b190
  281387: 3e6e502
  281383: c79d10f
  281375: d537fd4
v: v3
  • Loading branch information
Michael Hennerich authored and Greg Kroah-Hartman committed Dec 16, 2011
1 parent 78c280b commit f75a5d3
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9631135dd9396aca149a3041197bce452fa0ce90
refs/heads/master: 617156fb71dd95574194ea022c0b076afd1b27ca
6 changes: 3 additions & 3 deletions trunk/drivers/staging/iio/gyro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ config ADIS16260
will be called adis16260.

config ADXRS450
tristate "Analog Devices ADXRS450 Digital Output Gyroscope SPI driver"
tristate "Analog Devices ADXRS450/3 Digital Output Gyroscope SPI driver"
depends on SPI
help
Say yes here to build support for Analog Devices ADXRS450 programmable
digital output gyroscope.
Say yes here to build support for Analog Devices ADXRS450 and ADXRS453
programmable digital output gyroscope.

This driver can also be built as a module. If so, the module
will be called adxrs450.
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/staging/iio/gyro/adxrs450.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

#define ADXRS450_GET_ST(a) ((a >> 26) & 0x3)

enum {
ID_ADXRS450,
ID_ADXRS453,
};

/**
* struct adxrs450_state - device instance specific data
* @us: actual spi_device
Expand Down
60 changes: 42 additions & 18 deletions trunk/drivers/staging/iio/gyro/adxrs450_core.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* ADXRS450 Digital Output Gyroscope Driver
* ADXRS450/ADXRS453 Digital Output Gyroscope Driver
*
* Copyright 2011 Analog Devices Inc.
*
Expand Down Expand Up @@ -323,20 +323,36 @@ static int adxrs450_read_raw(struct iio_dev *indio_dev,
return ret;
}

static const struct iio_chan_spec adxrs450_channels[] = {
{
.type = IIO_ANGL_VEL,
.modified = 1,
.channel2 = IIO_MOD_Z,
.info_mask = IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, {
.type = IIO_TEMP,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}
static const struct iio_chan_spec adxrs450_channels[2][2] = {
[ID_ADXRS450] = {
{
.type = IIO_ANGL_VEL,
.modified = 1,
.channel2 = IIO_MOD_Z,
.info_mask = IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}, {
.type = IIO_TEMP,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}
},
[ID_ADXRS453] = {
{
.type = IIO_ANGL_VEL,
.modified = 1,
.channel2 = IIO_MOD_Z,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW_SEPARATE_BIT,
}, {
.type = IIO_TEMP,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
}
},
};

static const struct iio_info adxrs450_info = {
Expand Down Expand Up @@ -366,7 +382,8 @@ static int __devinit adxrs450_probe(struct spi_device *spi)
indio_dev->dev.parent = &spi->dev;
indio_dev->info = &adxrs450_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = adxrs450_channels;
indio_dev->channels =
adxrs450_channels[spi_get_device_id(spi)->driver_data];
indio_dev->num_channels = ARRAY_SIZE(adxrs450_channels);
indio_dev->name = spi->dev.driver->name;

Expand Down Expand Up @@ -396,13 +413,21 @@ static int adxrs450_remove(struct spi_device *spi)
return 0;
}

static const struct spi_device_id adxrs450_id[] = {
{"adxrs450", ID_ADXRS450},
{"adxrs453", ID_ADXRS453},
{}
};
MODULE_DEVICE_TABLE(spi, adxrs450_id);

static struct spi_driver adxrs450_driver = {
.driver = {
.name = "adxrs450",
.owner = THIS_MODULE,
},
.probe = adxrs450_probe,
.remove = __devexit_p(adxrs450_remove),
.id_table = adxrs450_id,
};

static __init int adxrs450_init(void)
Expand All @@ -418,6 +443,5 @@ static __exit void adxrs450_exit(void)
module_exit(adxrs450_exit);

MODULE_AUTHOR("Cliff Cai <cliff.cai@xxxxxxxxxx>");
MODULE_DESCRIPTION("Analog Devices ADXRS450 Gyroscope SPI driver");
MODULE_DESCRIPTION("Analog Devices ADXRS450/ADXRS453 Gyroscope SPI driver");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("spi:adxrs450");

0 comments on commit f75a5d3

Please sign in to comment.