Skip to contentSkip to conversation

clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of

PATCH Applied Anson Huang 2 participants 2 messages Dec 7, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of

i.MX TPM needs "ipg" clock for register access and "per" clock for timer function, the driver gets "ipg" clock by searching the clock name, but timer-of initialization will get first clock in device tree TPM node since no clock name specified in of_clk, that means the "per" clock MUST be the first clock entry in device tree TPM node, this patch specifies clock name for of_clk to avoid this restriction, it makes TPM driver work properly with different sequence of clock entries in device tree TPM node.

---
 drivers/clocksource/timer-imx-tpm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/clocksource/timer-imx-tpm.c +3 -0
index c3dd4d2..c1d52d5 100644
@@ -139,6 +139,9 @@ static struct timer_of to_tpm = {
 		.handler		= tpm_timer_interrupt,
 		.flags			= IRQF_TIMER | IRQF_IRQPOLL,
 	},
+	.of_clk = {
+		.name = "per",
+	},
 };
 
 static int __init tpm_clocksource_init(void)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 11 lines · Anson Huang

i.MX TPM needs "ipg" clock for register access and "per" clock for timer function, the driver gets "ipg" clock by searching the clock name, but timer-of initialization will get first clock in device tree TPM node since no clock name specified in of_clk, that means the "per" clock MUST be the first clock entry in device tree TPM node, this patch specifies clock name for of_clk to avoid this restriction, it makes TPM driver work properly with different sequence of clock entries in device tree TPM node.

---

Applied.

Thanks.

-- Daniel

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog