[PATCH 15/43] pwm: ep93xx: add DT support for Cirrus EP93xx

From: Nikita Shubin
Date: Mon Apr 24 2023 - 06:35:35 EST


- find register range from the device tree
- provide clock access via of

Signed-off-by: Nikita Shubin <nikita.shubin@xxxxxxxxxxx>
---

Notes:
Arnd Bergmann:
- wildcards ep93xx to something meaningful, i.e. ep9301
- drop wrappers

drivers/pwm/pwm-ep93xx.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index c45a75e65c86..8bfe6cfbb3db 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -17,6 +17,7 @@
*/

#include <linux/module.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/clk.h>
@@ -190,9 +191,16 @@ static int ep93xx_pwm_probe(struct platform_device *pdev)
return 0;
}

+static const struct of_device_id ep93xx_pwm_of_ids[] = {
+ { .compatible = "cirrus,ep9301-pwm" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, ep93xx_pwm_of_ids);
+
static struct platform_driver ep93xx_pwm_driver = {
.driver = {
.name = "ep93xx-pwm",
+ .of_match_table = ep93xx_pwm_of_ids,
},
.probe = ep93xx_pwm_probe,
};
--
2.39.2