summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-05-14 20:43:43 +0000
committerAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-05-14 20:43:43 +0000
commit6602fc5788331bd1d75b05384b519fd21f35c742 (patch)
tree78b27b509f488392a6c01cbe79ea6b2750c03f72 /drivers/mfd
parentd1bb99cd3c58a5569908d8302d2dc2352c9e51dd (diff)
parentb82e5721a17325739adef83a029340a63b53d4ad (diff)
Merge tag 'v5.4.119' into 5.4-2.3.x-imx
This is the 5.4.119 stable release Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/stm32-timers.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c
index efcd4b980c94..1adba6a46dcb 100644
--- a/drivers/mfd/stm32-timers.c
+++ b/drivers/mfd/stm32-timers.c
@@ -158,13 +158,18 @@ static const struct regmap_config stm32_timers_regmap_cfg = {
static void stm32_timers_get_arr_size(struct stm32_timers *ddata)
{
+ u32 arr;
+
+ /* Backup ARR to restore it after getting the maximum value */
+ regmap_read(ddata->regmap, TIM_ARR, &arr);
+
/*
* Only the available bits will be written so when readback
* we get the maximum value of auto reload register
*/
regmap_write(ddata->regmap, TIM_ARR, ~0L);
regmap_read(ddata->regmap, TIM_ARR, &ddata->max_arr);
- regmap_write(ddata->regmap, TIM_ARR, 0x0);
+ regmap_write(ddata->regmap, TIM_ARR, arr);
}
static void stm32_timers_dma_probe(struct device *dev,