|
@@ -231,3 +231,68 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
|
|
|
"deactivate latency %d higher than expected. (%llu > %d)\n",
|
|
|
od->pm_lat_level, deact_lat,
|
|
|
odpl->deactivate_lat);
|
|
|
+ }
|
|
|
+
|
|
|
+ od->dev_wakeup_lat += odpl->activate_lat;
|
|
|
+
|
|
|
+ od->pm_lat_level++;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static void _add_clkdev(struct omap_device *od, const char *clk_alias,
|
|
|
+ const char *clk_name)
|
|
|
+{
|
|
|
+ struct clk *r;
|
|
|
+ struct clk_lookup *l;
|
|
|
+
|
|
|
+ if (!clk_alias || !clk_name)
|
|
|
+ return;
|
|
|
+
|
|
|
+ dev_dbg(&od->pdev->dev, "Creating %s -> %s\n", clk_alias, clk_name);
|
|
|
+
|
|
|
+ r = clk_get_sys(dev_name(&od->pdev->dev), clk_alias);
|
|
|
+ if (!IS_ERR(r)) {
|
|
|
+ dev_warn(&od->pdev->dev,
|
|
|
+ "alias %s already exists\n", clk_alias);
|
|
|
+ clk_put(r);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ r = clk_get(NULL, clk_name);
|
|
|
+ if (IS_ERR(r)) {
|
|
|
+ dev_err(&od->pdev->dev,
|
|
|
+ "clk_get for %s failed\n", clk_name);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev->dev));
|
|
|
+ if (!l) {
|
|
|
+ dev_err(&od->pdev->dev,
|
|
|
+ "clkdev_alloc for %s failed\n", clk_alias);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ clkdev_add(l);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * _add_hwmod_clocks_clkdev - Add clkdev entry for hwmod optional clocks
|
|
|
+ * and main clock
|
|
|
+ * @od: struct omap_device *od
|
|
|
+ * @oh: struct omap_hwmod *oh
|
|
|
+ *
|
|
|
+ * For the main clock and every optional clock present per hwmod per
|
|
|
+ * omap_device, this function adds an entry in the clkdev table of the
|
|
|
+ * form <dev-id=dev_name, con-id=role> if it does not exist already.
|
|
|
+ *
|
|
|
+ * The function is called from inside omap_device_build_ss(), after
|
|
|
+ * omap_device_register.
|
|
|
+ *
|
|
|
+ * This allows drivers to get a pointer to its optional clocks based on its role
|
|
|
+ * by calling clk_get(<dev*>, <role>).
|
|
|
+ * In the case of the main clock, a "fck" alias is used.
|
|
|
+ *
|
|
|
+ * No return value.
|
|
|
+ */
|