瀏覽代碼

timer: sandbox: Use device tree to pass the clock frequency

We should use device tree to pass the clock frequency of the timer
instead of hardcoded in the driver codes.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Bin Meng 9 年之前
父節點
當前提交
f838f12452
共有 2 個文件被更改,包括 1 次插入4 次删除
  1. 1 0
      arch/sandbox/dts/sandbox.dts
  2. 0 4
      drivers/timer/sandbox_timer.c

+ 1 - 0
arch/sandbox/dts/sandbox.dts

@@ -179,6 +179,7 @@
 
 	timer {
 		compatible = "sandbox,timer";
+		clock-frequency = <1000000>;
 	};
 
 	tpm {

+ 0 - 4
drivers/timer/sandbox_timer.c

@@ -27,10 +27,6 @@ static int sandbox_timer_get_count(struct udevice *dev, unsigned long *count)
 
 static int sandbox_timer_probe(struct udevice *dev)
 {
-	struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-
-	uc_priv->clock_rate = 1000000;
-
 	return 0;
 }