reset: reset-brcmstb-rescal: Support shared use
authorPhil Elwell <phil@raspberrypi.com>
Tue, 7 Sep 2021 13:49:00 +0000 (14:49 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:42 +0000 (11:33 +0000)
reset_control_reset should not be used with shared reset controllers.
Add support for reset_control_assert and _deassert to get the desired
behaviour and avoid ugly warnings in the kernel log.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/reset/reset-brcmstb-rescal.c

index 823317772bacfa6d1695c922f0bb31a223fc6823..89c1cae675a0934e229c65391a21717c69007b2f 100644 (file)
@@ -20,6 +20,7 @@ struct brcm_rescal_reset {
        struct reset_controller_dev rcdev;
 };
 
+/* Also doubles a deassert */
 static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev,
                                 unsigned long id)
 {
@@ -52,6 +53,13 @@ static int brcm_rescal_reset_set(struct reset_controller_dev *rcdev,
        return 0;
 }
 
+/* A dummy function - deassert/reset does all the work */
+static int brcm_rescal_reset_assert(struct reset_controller_dev *rcdev,
+                                   unsigned long id)
+{
+       return 0;
+}
+
 static int brcm_rescal_reset_xlate(struct reset_controller_dev *rcdev,
                                   const struct of_phandle_args *reset_spec)
 {
@@ -61,6 +69,8 @@ static int brcm_rescal_reset_xlate(struct reset_controller_dev *rcdev,
 
 static const struct reset_control_ops brcm_rescal_reset_ops = {
        .reset = brcm_rescal_reset_set,
+       .deassert = brcm_rescal_reset_set,
+       .assert = brcm_rescal_reset_assert,
 };
 
 static int brcm_rescal_reset_probe(struct platform_device *pdev)