]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: iio: ad9834: Moved contents of the header to the source file
authorNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Mon, 27 Feb 2017 22:15:11 +0000 (00:15 +0200)
committerJonathan Cameron <jic23@kernel.org>
Thu, 2 Mar 2017 19:44:06 +0000 (19:44 +0000)
Moved the contents of the header(ad9834.h) into the corresponding source
file with the exception of the platform data struct which is supposed to be
used from somewhere else other than the driver.

Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/frequency/ad9834.c
drivers/staging/iio/frequency/ad9834.h

index 19216af1dfc92e5bf22b14a60272272d9b123a06..f92ff7fef6f3c355b151e8d035499dd03bd3bf46 100644 (file)
 
 #include "ad9834.h"
 
+/* Registers */
+
+#define AD9834_REG_CMD         0
+#define AD9834_REG_FREQ0       BIT(14)
+#define AD9834_REG_FREQ1       BIT(15)
+#define AD9834_REG_PHASE0      (BIT(15) | BIT(14))
+#define AD9834_REG_PHASE1      (BIT(15) | BIT(14) | BIT(13))
+
+/* Command Control Bits */
+
+#define AD9834_B28             BIT(13)
+#define AD9834_HLB             BIT(12)
+#define AD9834_FSEL            BIT(11)
+#define AD9834_PSEL            BIT(10)
+#define AD9834_PIN_SW          BIT(9)
+#define AD9834_RESET           BIT(8)
+#define AD9834_SLEEP1          BIT(7)
+#define AD9834_SLEEP12         BIT(6)
+#define AD9834_OPBITEN         BIT(5)
+#define AD9834_SIGN_PIB                BIT(4)
+#define AD9834_DIV2            BIT(3)
+#define AD9834_MODE            BIT(1)
+
+#define AD9834_FREQ_BITS       28
+#define AD9834_PHASE_BITS      12
+
+#define RES_MASK(bits) (BIT(bits) - 1)
+
+/**
+ * struct ad9834_state - driver instance specific data
+ * @spi:               spi_device
+ * @reg:               supply regulator
+ * @mclk:              external master clock
+ * @control:           cached control word
+ * @xfer:              default spi transfer
+ * @msg:               default spi message
+ * @freq_xfer:         tuning word spi transfer
+ * @freq_msg:          tuning word spi message
+ * @data:              spi transmit buffer
+ * @freq_data:         tuning word spi transmit buffer
+ */
+
+struct ad9834_state {
+       struct spi_device               *spi;
+       struct regulator                *reg;
+       unsigned int                    mclk;
+       unsigned short                  control;
+       unsigned short                  devid;
+       struct spi_transfer             xfer;
+       struct spi_message              msg;
+       struct spi_transfer             freq_xfer[2];
+       struct spi_message              freq_msg;
+
+       /*
+        * DMA (thus cache coherency maintenance) requires the
+        * transfer buffers to live in their own cache lines.
+        */
+       __be16                          data ____cacheline_aligned;
+       __be16                          freq_data[2];
+};
+
+/**
+ * ad9834_supported_device_ids:
+ */
+
+enum ad9834_supported_device_ids {
+       ID_AD9833,
+       ID_AD9834,
+       ID_AD9837,
+       ID_AD9838,
+};
+
 static unsigned int ad9834_calc_freqreg(unsigned long mclk, unsigned long fout)
 {
        unsigned long long freqreg = (u64)fout * (u64)BIT(AD9834_FREQ_BITS);
index 40fdd5da7bd0038fc1ff3d43676d377798084283..ae620f38eb49d62e76674d9b90abc5e664b70a6c 100644 (file)
@@ -8,67 +8,6 @@
 #ifndef IIO_DDS_AD9834_H_
 #define IIO_DDS_AD9834_H_
 
-/* Registers */
-
-#define AD9834_REG_CMD         0
-#define AD9834_REG_FREQ0       BIT(14)
-#define AD9834_REG_FREQ1       BIT(15)
-#define AD9834_REG_PHASE0      (BIT(15) | BIT(14))
-#define AD9834_REG_PHASE1      (BIT(15) | BIT(14) | BIT(13))
-
-/* Command Control Bits */
-
-#define AD9834_B28             BIT(13)
-#define AD9834_HLB             BIT(12)
-#define AD9834_FSEL            BIT(11)
-#define AD9834_PSEL            BIT(10)
-#define AD9834_PIN_SW          BIT(9)
-#define AD9834_RESET           BIT(8)
-#define AD9834_SLEEP1          BIT(7)
-#define AD9834_SLEEP12         BIT(6)
-#define AD9834_OPBITEN         BIT(5)
-#define AD9834_SIGN_PIB                BIT(4)
-#define AD9834_DIV2            BIT(3)
-#define AD9834_MODE            BIT(1)
-
-#define AD9834_FREQ_BITS       28
-#define AD9834_PHASE_BITS      12
-
-#define RES_MASK(bits) (BIT(bits) - 1)
-
-/**
- * struct ad9834_state - driver instance specific data
- * @spi:               spi_device
- * @reg:               supply regulator
- * @mclk:              external master clock
- * @control:           cached control word
- * @xfer:              default spi transfer
- * @msg:               default spi message
- * @freq_xfer:         tuning word spi transfer
- * @freq_msg:          tuning word spi message
- * @data:              spi transmit buffer
- * @freq_data:         tuning word spi transmit buffer
- */
-
-struct ad9834_state {
-       struct spi_device               *spi;
-       struct regulator                *reg;
-       unsigned int                    mclk;
-       unsigned short                  control;
-       unsigned short                  devid;
-       struct spi_transfer             xfer;
-       struct spi_message              msg;
-       struct spi_transfer             freq_xfer[2];
-       struct spi_message              freq_msg;
-
-       /*
-        * DMA (thus cache coherency maintenance) requires the
-        * transfer buffers to live in their own cache lines.
-        */
-       __be16                          data ____cacheline_aligned;
-       __be16                          freq_data[2];
-};
-
 /*
  * TODO: struct ad7887_platform_data needs to go into include/linux/iio
  */
@@ -97,15 +36,4 @@ struct ad9834_platform_data {
        bool                    en_signbit_msb_out;
 };
 
-/**
- * ad9834_supported_device_ids:
- */
-
-enum ad9834_supported_device_ids {
-       ID_AD9833,
-       ID_AD9834,
-       ID_AD9837,
-       ID_AD9838,
-};
-
 #endif /* IIO_DDS_AD9834_H_ */