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
This commit is contained in:
@@ -170,10 +170,10 @@ static ssize_t stm32_tt_read_frequency(struct device *dev,
|
||||
regmap_read(priv->regmap, TIM_PSC, &psc);
|
||||
regmap_read(priv->regmap, TIM_ARR, &arr);
|
||||
|
||||
if (psc && arr && (cr1 & TIM_CR1_CEN)) {
|
||||
if (cr1 & TIM_CR1_CEN) {
|
||||
freq = (unsigned long long)clk_get_rate(priv->clk);
|
||||
do_div(freq, psc);
|
||||
do_div(freq, arr);
|
||||
do_div(freq, psc + 1);
|
||||
do_div(freq, arr + 1);
|
||||
}
|
||||
|
||||
return sprintf(buf, "%d\n", (unsigned int)freq);
|
||||
|
||||
Reference in New Issue
Block a user