staging: iio: add channel info for sampling frequency
authorLaxman Dewangan <ldewangan@nvidia.com>
Fri, 13 Apr 2012 10:33:31 +0000 (16:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 18:14:35 +0000 (11:14 -0700)
Adding channel info IIO_CHAN_INFO_SAMP_FREQ to select
different sampling frequency per channel wise.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/iio.h
drivers/staging/iio/industrialio-core.c

index fa6fca0f6605b94728e7c5ccadff22e3433b79a2..b07ddd36ca42df39c20bc650531b1cff1c50508e 100644 (file)
@@ -36,6 +36,7 @@ enum iio_chan_info_enum {
        IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
        IIO_CHAN_INFO_AVERAGE_RAW,
        IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
+       IIO_CHAN_INFO_SAMP_FREQ,
 };
 
 #define IIO_CHAN_INFO_SHARED_BIT(type) BIT(type*2)
@@ -81,6 +82,10 @@ enum iio_chan_info_enum {
 #define IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY_SEPARATE_BIT \
        IIO_CHAN_INFO_SEPARATE_BIT(                            \
                IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY)
+#define IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT           \
+       IIO_CHAN_INFO_SEPARATE_BIT(IIO_CHAN_INFO_SAMP_FREQ)
+#define IIO_CHAN_INFO_SAMP_FREQ_SHARED_BIT                     \
+       IIO_CHAN_INFO_SHARED_BIT(IIO_CHAN_INFO_SAMP_FREQ)
 
 enum iio_endian {
        IIO_CPU,
index d303bfbff27fb669b6efc83f86f4b4f920977e8b..9e42713e5f554f1699615e6c9b2fa543650df0f6 100644 (file)
@@ -90,6 +90,7 @@ static const char * const iio_chan_info_postfix[] = {
        [IIO_CHAN_INFO_AVERAGE_RAW] = "mean_raw",
        [IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY]
        = "filter_low_pass_3db_frequency",
+       [IIO_CHAN_INFO_SAMP_FREQ] = "sampling_frequency",
 };
 
 const struct iio_chan_spec