]> Git Repo - J-linux.git/blobdiff - drivers/pwm/pwm-stm32.c
Merge tag 'amd-drm-next-6.5-2023-06-09' of https://gitlab.freedesktop.org/agd5f/linux...
[J-linux.git] / drivers / pwm / pwm-stm32.c
index 21e4a34dfff3c0305197ec5d6cf91363d940c112..62e397aeb9aa3ff59c19ea1d0a6d89e8f7fbbcce 100644 (file)
@@ -207,6 +207,10 @@ static int stm32_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
        regmap_write(priv->regmap, TIM_ARR, priv->max_arr);
        regmap_write(priv->regmap, TIM_PSC, psc);
 
+       /* Reset input selector to its default input and disable slave mode */
+       regmap_write(priv->regmap, TIM_TISEL, 0x0);
+       regmap_write(priv->regmap, TIM_SMCR, 0x0);
+
        /* Map TI1 or TI2 PWM input to IC1 & IC2 (or TI3/4 to IC3 & IC4) */
        regmap_update_bits(priv->regmap,
                           pwm->hwpwm < 2 ? TIM_CCMR1 : TIM_CCMR2,
@@ -642,7 +646,7 @@ static int stm32_pwm_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int stm32_pwm_remove(struct platform_device *pdev)
+static void stm32_pwm_remove(struct platform_device *pdev)
 {
        struct stm32_pwm *priv = platform_get_drvdata(pdev);
        unsigned int i;
@@ -651,8 +655,6 @@ static int stm32_pwm_remove(struct platform_device *pdev)
                pwm_disable(&priv->chip.pwms[i]);
 
        pwmchip_remove(&priv->chip);
-
-       return 0;
 }
 
 static int __maybe_unused stm32_pwm_suspend(struct device *dev)
@@ -699,7 +701,7 @@ MODULE_DEVICE_TABLE(of, stm32_pwm_of_match);
 
 static struct platform_driver stm32_pwm_driver = {
        .probe  = stm32_pwm_probe,
-       .remove = stm32_pwm_remove,
+       .remove_new = stm32_pwm_remove,
        .driver = {
                .name = "stm32-pwm",
                .of_match_table = stm32_pwm_of_match,
This page took 0.027922 seconds and 4 git commands to generate.