summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc/ad7291.h
diff options
context:
space:
mode:
authorLars-Peter Clausen2013-06-14 17:58:00 +0200
committerJonathan Cameron2013-06-14 22:55:17 +0200
commit1df9d1d4a1cb666042c3217aef6a6dc38eed1de0 (patch)
tree4ba8780c196acc46f1612553865d4fafa84865b5 /drivers/staging/iio/adc/ad7291.h
parentstaging:iio:ad7291: Use sign_extend32 instead of open-coding it (diff)
downloadkernel-qcow2-linux-1df9d1d4a1cb666042c3217aef6a6dc38eed1de0.tar.gz
kernel-qcow2-linux-1df9d1d4a1cb666042c3217aef6a6dc38eed1de0.tar.xz
kernel-qcow2-linux-1df9d1d4a1cb666042c3217aef6a6dc38eed1de0.zip
staging:iio:ad7291: Rework regulator handling
Add platform_data for the driver which allows to specify whether an external reference voltage is used or not. It is not possible to use the return value of regulator_get() for this since the regulator framework is able to return a dummy regulator in case no regulator has been specified. In this case the driver will always get a valid regulator, no matter if it has been specified or not. Also make the regulator non-optional if platform_data states that an external reference voltage should be used. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/adc/ad7291.h')
-rw-r--r--drivers/staging/iio/adc/ad7291.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/iio/adc/ad7291.h b/drivers/staging/iio/adc/ad7291.h
new file mode 100644
index 000000000000..bbd89fa51188
--- /dev/null
+++ b/drivers/staging/iio/adc/ad7291.h
@@ -0,0 +1,12 @@
+#ifndef __IIO_AD7291_H__
+#define __IIO_AD7291_H__
+
+/**
+ * struct ad7291_platform_data - AD7291 platform data
+ * @use_external_ref: Whether to use an external or internal reference voltage
+ */
+struct ad7291_platform_data {
+ bool use_external_ref;
+};
+
+#endif