diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 13:38:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-18 13:38:38 -0400 |
commit | df47c0a638b07dab18b202b307506e4b86b02e9a (patch) | |
tree | 4aa332ed227e39aa7d693b72c82348312feae1d1 /drivers/iio/trigger/stm32-timer-trigger.c | |
parent | d47e5382358021303b47a0977c7472fdda1eeb40 (diff) | |
parent | ed3730c435f1a9f9559ed7762035d22d8a95adfe (diff) |
Merge tag 'iio-fixes-for-4.11e' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Fifth set of IIO fixes for the 4.11 cycle.
As these are rather late in the cycle, they may sneak over into 4.12.
There is a fix for a regression caused by another fix (hid sensors
hardware seems to vary a lot in how various corner cases are handled).
* ad7303
- fix channel description. Numeric values were being passed as characters
presumably leading to garbage from the userspace interface.
* as3935
- the write data macro was wrong so fix it.
* bmp280
- incorrect handling of negative values as being unsigned broke humidity
calculation.
* hid-sensor
- Restore the poll and hysteresis values after resume as some hardware
doesn't do it.
* stm32-trigger
- buglet in reading the sampling frequency
Diffstat (limited to 'drivers/iio/trigger/stm32-timer-trigger.c')
-rw-r--r-- | drivers/iio/trigger/stm32-timer-trigger.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c index 0f1a2cf334bf..25248d644e7c 100644 --- a/drivers/iio/trigger/stm32-timer-trigger.c +++ b/drivers/iio/trigger/stm32-timer-trigger.c | |||
@@ -170,10 +170,10 @@ static ssize_t stm32_tt_read_frequency(struct device *dev, | |||
170 | regmap_read(priv->regmap, TIM_PSC, &psc); | 170 | regmap_read(priv->regmap, TIM_PSC, &psc); |
171 | regmap_read(priv->regmap, TIM_ARR, &arr); | 171 | regmap_read(priv->regmap, TIM_ARR, &arr); |
172 | 172 | ||
173 | if (psc && arr && (cr1 & TIM_CR1_CEN)) { | 173 | if (cr1 & TIM_CR1_CEN) { |
174 | freq = (unsigned long long)clk_get_rate(priv->clk); | 174 | freq = (unsigned long long)clk_get_rate(priv->clk); |
175 | do_div(freq, psc); | 175 | do_div(freq, psc + 1); |
176 | do_div(freq, arr); | 176 | do_div(freq, arr + 1); |
177 | } | 177 | } |
178 | 178 | ||
179 | return sprintf(buf, "%d\n", (unsigned int)freq); | 179 | return sprintf(buf, "%d\n", (unsigned int)freq); |