From: Greg Kroah-Hartman Date: Mon, 23 Mar 2020 07:01:20 +0000 (+0100) Subject: Merge 5.6-rc7 into staging-next X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6203da9803017701da5782998157d9826215059d;p=linux.git Merge 5.6-rc7 into staging-next We need the staging/iio fixes in here as well Signed-off-by: Greg Kroah-Hartman --- 6203da9803017701da5782998157d9826215059d diff --cc drivers/iio/trigger/stm32-timer-trigger.c index 37545a8a02b71,2f82e8c32186f..7d8962d6566a1 --- a/drivers/iio/trigger/stm32-timer-trigger.c +++ b/drivers/iio/trigger/stm32-timer-trigger.c @@@ -177,9 -161,10 +177,10 @@@ static int stm32_timer_start(struct stm return 0; } - static void stm32_timer_stop(struct stm32_timer_trigger *priv) + static void stm32_timer_stop(struct stm32_timer_trigger *priv, + struct iio_trigger *trig) { - u32 ccer, cr1; + u32 ccer; regmap_read(priv->regmap, TIM_CCER, &ccer); if (ccer & TIM_CCER_CCXE) @@@ -192,14 -180,14 +193,20 @@@ regmap_write(priv->regmap, TIM_PSC, 0); regmap_write(priv->regmap, TIM_ARR, 0); + /* Force disable master mode */ + if (stm32_timer_is_trgo2_name(trig->name)) + regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS2, 0); + else + regmap_update_bits(priv->regmap, TIM_CR2, TIM_CR2_MMS, 0); + /* Make sure that registers are updated */ regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); + + if (priv->enabled) { + priv->enabled = false; + clk_disable(priv->clk); + } + mutex_unlock(&priv->lock); } static ssize_t stm32_tt_store_frequency(struct device *dev,