Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: iio: ad9832: Moved contents of the header to the source file

Moved the contents of the header(ad9832.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>

authored by

Narcisa Ana Maria Vasile and committed by
Jonathan Cameron
d89aa245 a8baa3c0

+92 -92
+92
drivers/staging/iio/frequency/ad9832.c
··· 22 22 23 23 #include "ad9832.h" 24 24 25 + /* Registers */ 26 + 27 + #define AD9832_FREQ0LL 0x0 28 + #define AD9832_FREQ0HL 0x1 29 + #define AD9832_FREQ0LM 0x2 30 + #define AD9832_FREQ0HM 0x3 31 + #define AD9832_FREQ1LL 0x4 32 + #define AD9832_FREQ1HL 0x5 33 + #define AD9832_FREQ1LM 0x6 34 + #define AD9832_FREQ1HM 0x7 35 + #define AD9832_PHASE0L 0x8 36 + #define AD9832_PHASE0H 0x9 37 + #define AD9832_PHASE1L 0xA 38 + #define AD9832_PHASE1H 0xB 39 + #define AD9832_PHASE2L 0xC 40 + #define AD9832_PHASE2H 0xD 41 + #define AD9832_PHASE3L 0xE 42 + #define AD9832_PHASE3H 0xF 43 + 44 + #define AD9832_PHASE_SYM 0x10 45 + #define AD9832_FREQ_SYM 0x11 46 + #define AD9832_PINCTRL_EN 0x12 47 + #define AD9832_OUTPUT_EN 0x13 48 + 49 + /* Command Control Bits */ 50 + 51 + #define AD9832_CMD_PHA8BITSW 0x1 52 + #define AD9832_CMD_PHA16BITSW 0x0 53 + #define AD9832_CMD_FRE8BITSW 0x3 54 + #define AD9832_CMD_FRE16BITSW 0x2 55 + #define AD9832_CMD_FPSELECT 0x6 56 + #define AD9832_CMD_SYNCSELSRC 0x8 57 + #define AD9832_CMD_SLEEPRESCLR 0xC 58 + 59 + #define AD9832_FREQ BIT(11) 60 + #define AD9832_PHASE(x) (((x) & 3) << 9) 61 + #define AD9832_SYNC BIT(13) 62 + #define AD9832_SELSRC BIT(12) 63 + #define AD9832_SLEEP BIT(13) 64 + #define AD9832_RESET BIT(12) 65 + #define AD9832_CLR BIT(11) 66 + #define CMD_SHIFT 12 67 + #define ADD_SHIFT 8 68 + #define AD9832_FREQ_BITS 32 69 + #define AD9832_PHASE_BITS 12 70 + #define RES_MASK(bits) ((1 << (bits)) - 1) 71 + 72 + /** 73 + * struct ad9832_state - driver instance specific data 74 + * @spi: spi_device 75 + * @avdd: supply regulator for the analog section 76 + * @dvdd: supply regulator for the digital section 77 + * @mclk: external master clock 78 + * @ctrl_fp: cached frequency/phase control word 79 + * @ctrl_ss: cached sync/selsrc control word 80 + * @ctrl_src: cached sleep/reset/clr word 81 + * @xfer: default spi transfer 82 + * @msg: default spi message 83 + * @freq_xfer: tuning word spi transfer 84 + * @freq_msg: tuning word spi message 85 + * @phase_xfer: tuning word spi transfer 86 + * @phase_msg: tuning word spi message 87 + * @data: spi transmit buffer 88 + * @phase_data: tuning word spi transmit buffer 89 + * @freq_data: tuning word spi transmit buffer 90 + */ 91 + 92 + struct ad9832_state { 93 + struct spi_device *spi; 94 + struct regulator *avdd; 95 + struct regulator *dvdd; 96 + unsigned long mclk; 97 + unsigned short ctrl_fp; 98 + unsigned short ctrl_ss; 99 + unsigned short ctrl_src; 100 + struct spi_transfer xfer; 101 + struct spi_message msg; 102 + struct spi_transfer freq_xfer[4]; 103 + struct spi_message freq_msg; 104 + struct spi_transfer phase_xfer[2]; 105 + struct spi_message phase_msg; 106 + /* 107 + * DMA (thus cache coherency maintenance) requires the 108 + * transfer buffers to live in their own cache lines. 109 + */ 110 + union { 111 + __be16 freq_data[4]____cacheline_aligned; 112 + __be16 phase_data[2]; 113 + __be16 data; 114 + }; 115 + }; 116 + 25 117 static unsigned long ad9832_calc_freqreg(unsigned long mclk, unsigned long fout) 26 118 { 27 119 unsigned long long freqreg = (u64)fout *
-92
drivers/staging/iio/frequency/ad9832.h
··· 8 8 #ifndef IIO_DDS_AD9832_H_ 9 9 #define IIO_DDS_AD9832_H_ 10 10 11 - /* Registers */ 12 - 13 - #define AD9832_FREQ0LL 0x0 14 - #define AD9832_FREQ0HL 0x1 15 - #define AD9832_FREQ0LM 0x2 16 - #define AD9832_FREQ0HM 0x3 17 - #define AD9832_FREQ1LL 0x4 18 - #define AD9832_FREQ1HL 0x5 19 - #define AD9832_FREQ1LM 0x6 20 - #define AD9832_FREQ1HM 0x7 21 - #define AD9832_PHASE0L 0x8 22 - #define AD9832_PHASE0H 0x9 23 - #define AD9832_PHASE1L 0xA 24 - #define AD9832_PHASE1H 0xB 25 - #define AD9832_PHASE2L 0xC 26 - #define AD9832_PHASE2H 0xD 27 - #define AD9832_PHASE3L 0xE 28 - #define AD9832_PHASE3H 0xF 29 - 30 - #define AD9832_PHASE_SYM 0x10 31 - #define AD9832_FREQ_SYM 0x11 32 - #define AD9832_PINCTRL_EN 0x12 33 - #define AD9832_OUTPUT_EN 0x13 34 - 35 - /* Command Control Bits */ 36 - 37 - #define AD9832_CMD_PHA8BITSW 0x1 38 - #define AD9832_CMD_PHA16BITSW 0x0 39 - #define AD9832_CMD_FRE8BITSW 0x3 40 - #define AD9832_CMD_FRE16BITSW 0x2 41 - #define AD9832_CMD_FPSELECT 0x6 42 - #define AD9832_CMD_SYNCSELSRC 0x8 43 - #define AD9832_CMD_SLEEPRESCLR 0xC 44 - 45 - #define AD9832_FREQ BIT(11) 46 - #define AD9832_PHASE(x) (((x) & 3) << 9) 47 - #define AD9832_SYNC BIT(13) 48 - #define AD9832_SELSRC BIT(12) 49 - #define AD9832_SLEEP BIT(13) 50 - #define AD9832_RESET BIT(12) 51 - #define AD9832_CLR BIT(11) 52 - #define CMD_SHIFT 12 53 - #define ADD_SHIFT 8 54 - #define AD9832_FREQ_BITS 32 55 - #define AD9832_PHASE_BITS 12 56 - #define RES_MASK(bits) ((1 << (bits)) - 1) 57 - 58 - /** 59 - * struct ad9832_state - driver instance specific data 60 - * @spi: spi_device 61 - * @avdd: supply regulator for the analog section 62 - * @dvdd: supply regulator for the digital section 63 - * @mclk: external master clock 64 - * @ctrl_fp: cached frequency/phase control word 65 - * @ctrl_ss: cached sync/selsrc control word 66 - * @ctrl_src: cached sleep/reset/clr word 67 - * @xfer: default spi transfer 68 - * @msg: default spi message 69 - * @freq_xfer: tuning word spi transfer 70 - * @freq_msg: tuning word spi message 71 - * @phase_xfer: tuning word spi transfer 72 - * @phase_msg: tuning word spi message 73 - * @data: spi transmit buffer 74 - * @phase_data: tuning word spi transmit buffer 75 - * @freq_data: tuning word spi transmit buffer 76 - */ 77 - 78 - struct ad9832_state { 79 - struct spi_device *spi; 80 - struct regulator *avdd; 81 - struct regulator *dvdd; 82 - unsigned long mclk; 83 - unsigned short ctrl_fp; 84 - unsigned short ctrl_ss; 85 - unsigned short ctrl_src; 86 - struct spi_transfer xfer; 87 - struct spi_message msg; 88 - struct spi_transfer freq_xfer[4]; 89 - struct spi_message freq_msg; 90 - struct spi_transfer phase_xfer[2]; 91 - struct spi_message phase_msg; 92 - /* 93 - * DMA (thus cache coherency maintenance) requires the 94 - * transfer buffers to live in their own cache lines. 95 - */ 96 - union { 97 - __be16 freq_data[4]____cacheline_aligned; 98 - __be16 phase_data[2]; 99 - __be16 data; 100 - }; 101 - }; 102 - 103 11 /* 104 12 * TODO: struct ad9832_platform_data needs to go into include/linux/iio 105 13 */