lkml.org 
[lkml]   [2023]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[LINUX PATCH v2 1/3] clocksource: timer-cadence-ttc: Do not probe TTC device configured as PWM
Date
TTC device can act either as clocksource/clockevent or
PWM generator, it would be decided by pwm-cells property.
TTC PWM feature would be supported through separate driver
based on PWM framework.

If pwm-cells property is present in TTC node, it would be
treated as PWM device, and clocksource driver should just
skip it.

Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com>
---
Changes for v2:
- Added comment regarding pwm-cells property
---
drivers/clocksource/timer-cadence-ttc.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 32daaac9b132..f8fcb1a4bdd0 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -477,6 +477,13 @@ static int __init ttc_timer_probe(struct platform_device *pdev)
u32 timer_width = 16;
struct device_node *timer = pdev->dev.of_node;

+ /*
+ * If pwm-cells property is present in TTC node,
+ * it would be treated as PWM device.
+ */
+ if (of_property_read_bool(timer, "#pwm-cells"))
+ return -ENODEV;
+
if (initialized)
return 0;

--
2.25.1
\
 
 \ /
  Last update: 2023-11-20 13:59    [W:0.591 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site