1- // SPDX-License-Identifier: GPL-2.0-or-later
1+ // SPDX-License-Identifier: GPL-2.0-only
22/*
33 * Driver for Analog Devices Reset Control Unit
44 *
5- * (C) Copyright 2022 - Analog Devices, Inc.
6- *
7- * Written and/or maintained by Timesys Corporation
8- *
9- * Author: Greg Malysa <greg.malysa@timesys.com>
10- * Contact: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
5+ * (C) Copyright 2022-2026 - Analog Devices, Inc.
116 */
127
138#include <linux/bits.h>
2217#include <linux/types.h>
2318
2419#include <linux/soc/adi/rcu.h>
25- #include " sec.h"
20+ #include <linux/soc/adi/ sec.h>
2621
2722#define ADI_RCU_REBOOT_PRIORITY 255
2823#define ADI_RCU_CORE_INIT_TIMEOUT msecs_to_jiffies(2000)
@@ -51,7 +46,6 @@ void adi_rcu_writel(u32 val, struct adi_rcu *rcu, int offset)
5146{
5247 writel (val , rcu -> ioaddr + offset );
5348}
54-
5549EXPORT_SYMBOL (adi_rcu_writel );
5650
5751void adi_rcu_msg_set (struct adi_rcu * rcu , u32 bits )
@@ -114,7 +108,6 @@ int adi_rcu_check_coreid_valid(struct adi_rcu *rcu, int coreid)
114108 return - EINVAL ;
115109 return 0 ;
116110}
117-
118111EXPORT_SYMBOL (adi_rcu_check_coreid_valid );
119112
120113int adi_rcu_reset_core (struct adi_rcu * rcu , int coreid )
@@ -161,7 +154,6 @@ int adi_rcu_reset_core(struct adi_rcu *rcu, int coreid)
161154
162155 return 0 ;
163156}
164-
165157EXPORT_SYMBOL (adi_rcu_reset_core );
166158
167159int adi_rcu_start_core (struct adi_rcu * rcu , int coreid )
@@ -180,7 +172,6 @@ int adi_rcu_start_core(struct adi_rcu *rcu, int coreid)
180172
181173 return 0 ;
182174}
183-
184175EXPORT_SYMBOL (adi_rcu_start_core );
185176
186177int adi_rcu_is_core_idle (struct adi_rcu * rcu , int coreid )
@@ -192,7 +183,6 @@ int adi_rcu_is_core_idle(struct adi_rcu *rcu, int coreid)
192183 return !!(adi_rcu_readl (rcu , ADI_RCU_REG_MSG ) &
193184 (RCU0_MSG_C0IDLE << coreid ));
194185}
195-
196186EXPORT_SYMBOL (adi_rcu_is_core_idle );
197187
198188int adi_rcu_stop_core (struct adi_rcu * rcu , int coreid , int coreirq )
@@ -241,7 +231,6 @@ int adi_rcu_stop_core(struct adi_rcu *rcu, int coreid, int coreirq)
241231 adi_rcu_msg_clear (rcu , RCU0_MSG_C1ACTIVATE << (coreid - 1 ));
242232 return 0 ;
243233}
244-
245234EXPORT_SYMBOL (adi_rcu_stop_core );
246235
247236static int adi_rcu_reboot (struct notifier_block * nb , unsigned long mode ,
@@ -264,21 +253,15 @@ static int adi_rcu_probe(struct platform_device *pdev)
264253 struct device * dev = & pdev -> dev ;
265254 struct device_node * np = dev -> of_node ;
266255 struct adi_rcu * adi_rcu = NULL ;
267- struct resource * res ;
256+ // struct resource *res;
268257 void __iomem * base ;
269258 int ret ;
270259
271260 adi_rcu = devm_kzalloc (dev , sizeof (* adi_rcu ), GFP_KERNEL );
272261 if (!adi_rcu )
273262 return - ENOMEM ;
274263
275- res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
276- if (!res ) {
277- dev_err (dev , "Cannot get RCU base address\n" );
278- return - ENODEV ;
279- }
280-
281- base = devm_ioremap (dev , res -> start , resource_size (res ));
264+ base = devm_platform_ioremap_resource (pdev , 0 );
282265 if (IS_ERR (base )) {
283266 dev_err (dev , "Cannot map RCU base address\n" );
284267 return PTR_ERR (base );
@@ -323,7 +306,6 @@ static const struct of_device_id adi_rcu_match[] = {
323306 {.compatible = "adi,reset-controller" },
324307 { }
325308};
326-
327309MODULE_DEVICE_TABLE (of , adi_rcu_match );
328310
329311static struct platform_driver adi_rcu_driver = {
0 commit comments