[PATCH v2 2/5] reset: simple: Add active-low property support.
From: Inochi Amaoto
Date: Wed Feb 26 2025 - 18:43:30 EST
Introduce "active-low" property support for the reset-simple driver.
This property allow users to mark the reset device is active low
without adding a new device id in the driver.
Signed-off-by: Inochi Amaoto <inochiama@xxxxxxxxx>
---
drivers/reset/reset-simple.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/reset/reset-simple.c b/drivers/reset/reset-simple.c
index 276067839830..4b08f8d70942 100644
--- a/drivers/reset/reset-simple.c
+++ b/drivers/reset/reset-simple.c
@@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/property.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/reset/reset-simple.h>
@@ -190,6 +191,11 @@ static int reset_simple_probe(struct platform_device *pdev)
data->status_active_low = devdata->status_active_low;
}
+ if (device_property_present(dev, "active-low")) {
+ data->active_low = true;
+ data->status_active_low = true;
+ }
+
data->membase += reg_offset;
return devm_reset_controller_register(dev, &data->rcdev);
--
2.48.1