drivers: serial: serial_omap: populate default clock frequency when not found in dt
authorMugunthan V N <mugunthanvnm@ti.com>
Mon, 28 Sep 2015 10:47:47 +0000 (16:17 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 22 Oct 2015 18:43:58 +0000 (14:43 -0400)
In some platforms like am437x, serial node is not populated with
clock-frequency node. So in that case have a default clock-clock
frequency.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/serial/serial_omap.c

index e8d544f0da4f5aff81cd083f6b31ad0118fc5ed6..970944448904c846599abfb69de4ce9a2d7b5346 100644 (file)
@@ -12,6 +12,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define DEFAULT_CLK_SPEED 48000000 /* 48Mhz */
+
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 static const struct udevice_id omap_serial_ids[] = {
        { .compatible = "ti,omap3-uart" },
@@ -28,7 +30,7 @@ static int omap_serial_ofdata_to_platdata(struct udevice *dev)
        if (ret)
                return ret;
        plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
-                                    "clock-frequency", -1);
+                                    "clock-frequency", DEFAULT_CLK_SPEED);
        plat->reg_shift = 2;
 
        return 0;