diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2012-07-20 04:31:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-08-16 15:24:33 -0400 |
commit | 8857df3aceb7a8eb7558059b7da109e41dd1fb95 (patch) | |
tree | ba45e6d7779aab84f6a7c1ba37697d9914158b97 /include/linux/iio/frequency | |
parent | dfffd0d65fdf16d034681716dcbea74776f62e40 (diff) |
iio: frequency: ADF4350: Fix potential reference div factor overflow.
With small channel spacing values and high reference frequencies it is
possible to exceed the range of the 10-bit counter.
Workaround by checking the range and widening some constrains.
We don't use the REG1_PHASE value in this case the datasheet recommends to set
it to 1 if not used.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio/frequency')
-rw-r--r-- | include/linux/iio/frequency/adf4350.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/iio/frequency/adf4350.h b/include/linux/iio/frequency/adf4350.h index b76b4a87065e..be91f344d5fc 100644 --- a/include/linux/iio/frequency/adf4350.h +++ b/include/linux/iio/frequency/adf4350.h | |||
@@ -87,6 +87,8 @@ | |||
87 | #define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */ | 87 | #define ADF4350_MAX_BANDSEL_CLK 125000 /* Hz */ |
88 | #define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */ | 88 | #define ADF4350_MAX_FREQ_REFIN 250000000 /* Hz */ |
89 | #define ADF4350_MAX_MODULUS 4095 | 89 | #define ADF4350_MAX_MODULUS 4095 |
90 | #define ADF4350_MAX_R_CNT 1023 | ||
91 | |||
90 | 92 | ||
91 | /** | 93 | /** |
92 | * struct adf4350_platform_data - platform specific information | 94 | * struct adf4350_platform_data - platform specific information |