[PATCH 3/6] clocksource: mvebu: add DT support
Sebastian Hesselbarth
sebastian.hesselbarth at gmail.com
Fri Jun 28 14:25:44 EDT 2013
This adds device tree support to mvebu timer and also converts clk_get
to clk_lookup to find TCLK without device name reference.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
Cc: barebox at lists.infradead.org
---
drivers/clocksource/mvebu.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/mvebu.c b/drivers/clocksource/mvebu.c
index 8bedd99..93b0b61 100644
--- a/drivers/clocksource/mvebu.c
+++ b/drivers/clocksource/mvebu.c
@@ -57,8 +57,7 @@ static int mvebu_timer_probe(struct device_d *dev)
u32 val;
timer_base = dev_request_mem_region(dev, 0);
-
- tclk = clk_get(dev, "tclk");
+ tclk = clk_lookup("tclk");
val = __raw_readl(timer_base + TIMER_CTRL_OFF);
val &= ~TIMER0_25MHZ;
@@ -78,9 +77,15 @@ static int mvebu_timer_probe(struct device_d *dev)
return 0;
}
+static struct of_device_id mvebu_timer_dt_ids[] = {
+ { .compatible = "marvell,armada-370-xp-timer", },
+ { }
+};
+
static struct driver_d mvebu_timer_driver = {
.name = "mvebu-timer",
.probe = mvebu_timer_probe,
+ .of_compatible = DRV_OF_COMPAT(mvebu_timer_dt_ids),
};
static int mvebu_timer_init(void)
--
1.7.2.5
More information about the barebox
mailing list