summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/ms5611_spi.c
diff options
context:
space:
mode:
authorDaniel Baluta <daniel.baluta@intel.com>2016-02-03 19:50:38 +0300
committerJonathan Cameron <jic23@kernel.org>2016-02-06 21:18:13 +0300
commit713bbb4efb9dcda2e96c8338db1f21c68f2d822a (patch)
tree39ad0c0528497f7dcf79f783f71ba044d94e070a /drivers/iio/pressure/ms5611_spi.c
parent1ad1ce9b669095bfe94c32ecd19f2a426837eb93 (diff)
downloadlinux-713bbb4efb9dcda2e96c8338db1f21c68f2d822a.tar.xz
iio: pressure: ms5611: Add triggered buffer support
This will be used together with an external trigger (e.g hrtimer based software trigger). Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/pressure/ms5611_spi.c')
-rw-r--r--drivers/iio/pressure/ms5611_spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c
index aaa0c4ba91a7..c4bf4e8f7c5c 100644
--- a/drivers/iio/pressure/ms5611_spi.c
+++ b/drivers/iio/pressure/ms5611_spi.c
@@ -90,6 +90,8 @@ static int ms5611_spi_probe(struct spi_device *spi)
if (!indio_dev)
return -ENOMEM;
+ spi_set_drvdata(spi, indio_dev);
+
spi->mode = SPI_MODE_0;
spi->max_speed_hz = 20000000;
spi->bits_per_word = 8;
@@ -107,6 +109,11 @@ static int ms5611_spi_probe(struct spi_device *spi)
spi_get_device_id(spi)->driver_data);
}
+static int ms5611_spi_remove(struct spi_device *spi)
+{
+ return ms5611_remove(spi_get_drvdata(spi));
+}
+
static const struct spi_device_id ms5611_id[] = {
{ "ms5611", MS5611 },
{ "ms5607", MS5607 },
@@ -120,6 +127,7 @@ static struct spi_driver ms5611_driver = {
},
.id_table = ms5611_id,
.probe = ms5611_spi_probe,
+ .remove = ms5611_spi_remove,
};
module_spi_driver(ms5611_driver);