]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
OMAP hwmod: convert hwmod to use hardware clock names rather than clkdev dev+con
authorPaul Walmsley <paul@pwsan.com>
Tue, 23 Feb 2010 05:09:31 +0000 (22:09 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 24 Feb 2010 19:29:44 +0000 (12:29 -0700)
The OMAP hwmod core code is intended to use SoC IP block description
structures that are autogenerated from TI's OMAP hardware database.
Currently the hwmod code uses clkdev device + connection addressing to
identify clocks.  This causes problems in the hwmod autogeneration
process, since the TI hardware database doesn't use platform_device or
clkdev addressing; it uses a single clock signal name string, which
tends to bear some resemblance to what is used in the OMAP TRMs.  This
patch converts the hwmod code and existing data to use omap_clk_get_by_name(),
introduced in the previous patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: BenoƮt Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/mach-omap2/omap_hwmod_2420.h
arch/arm/mach-omap2/omap_hwmod_2430.h
arch/arm/mach-omap2/omap_hwmod_34xx.h
arch/arm/plat-omap/include/plat/omap_hwmod.h

index fb11ec176d551551c0e5fee69ddd160e3f8108c5..501660aae962bed05c2da10e5ec6708cfaa40891 100644 (file)
@@ -416,18 +416,18 @@ static int _init_main_clk(struct omap_hwmod *oh)
        struct clk *c;
        int ret = 0;
 
-       if (!oh->clkdev_con_id)
+       if (!oh->main_clk)
                return 0;
 
-       c = clk_get_sys(oh->clkdev_dev_id, oh->clkdev_con_id);
-       WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s.%s\n",
-            oh->name, oh->clkdev_dev_id, oh->clkdev_con_id);
+       c = omap_clk_get_by_name(oh->main_clk);
+       WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s\n",
+            oh->name, oh->main_clk);
        if (IS_ERR(c))
                ret = -EINVAL;
        oh->_clk = c;
 
        WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n",
-            oh->clkdev_con_id, c->name);
+            oh->main_clk, c->name);
 
        return ret;
 }
@@ -450,13 +450,12 @@ static int _init_interface_clks(struct omap_hwmod *oh)
                return 0;
 
        for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) {
-               if (!os->clkdev_con_id)
+               if (!os->clk)
                        continue;
 
-               c = clk_get_sys(os->clkdev_dev_id, os->clkdev_con_id);
+               c = omap_clk_get_by_name(os->clk);
                WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get "
-                    "interface_clk %s.%s\n", oh->name,
-                    os->clkdev_dev_id, os->clkdev_con_id);
+                    "interface_clk %s\n", oh->name, os->clk);
                if (IS_ERR(c))
                        ret = -EINVAL;
                os->_clk = c;
@@ -480,10 +479,9 @@ static int _init_opt_clks(struct omap_hwmod *oh)
        int ret = 0;
 
        for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
-               c = clk_get_sys(oc->clkdev_dev_id, oc->clkdev_con_id);
+               c = omap_clk_get_by_name(oc->clk);
                WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get opt_clk "
-                    "%s.%s\n", oh->name, oc->clkdev_dev_id,
-                    oc->clkdev_con_id);
+                    "%s\n", oh->name, oc->clk);
                if (IS_ERR(c))
                        ret = -EINVAL;
                oc->_clk = c;
index a9ca1b99a301bab4429aed0a01e7e7509a2bf9f2..5932c1d3e07ba150237293067543f32e5a0d450b 100644 (file)
@@ -117,8 +117,7 @@ static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
 /* MPU */
 static struct omap_hwmod omap2420_mpu_hwmod = {
        .name           = "mpu_hwmod",
-       .clkdev_dev_id  = NULL,
-       .clkdev_con_id  = "mpu_ck",
+       .main_clk       = "mpu_ck",
        .masters        = omap2420_mpu_masters,
        .masters_cnt    = ARRAY_SIZE(omap2420_mpu_masters),
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
index 59a208bea6c266de9aa1f6e70c5536d558d9e907..91f79c05a98ca1aac598cd6413376f90aee8f831 100644 (file)
@@ -119,8 +119,7 @@ static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
 /* MPU */
 static struct omap_hwmod omap2430_mpu_hwmod = {
        .name           = "mpu_hwmod",
-       .clkdev_dev_id  = NULL,
-       .clkdev_con_id  = "mpu_ck",
+       .main_clk       = "mpu_ck",
        .masters        = omap2430_mpu_masters,
        .masters_cnt    = ARRAY_SIZE(omap2430_mpu_masters),
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
index 2e629dcb2fb175252913b834db01a0e1b16a429f..26991147d5ee0a55aed7557ba4bd9f0057b11f41 100644 (file)
@@ -143,8 +143,7 @@ static struct omap_hwmod_ocp_if *omap34xx_mpu_masters[] = {
 /* MPU */
 static struct omap_hwmod omap34xx_mpu_hwmod = {
        .name           = "mpu_hwmod",
-       .clkdev_dev_id  = NULL,
-       .clkdev_con_id  = "arm_fck",
+       .main_clk       = "arm_fck",
        .masters        = omap34xx_mpu_masters,
        .masters_cnt    = ARRAY_SIZE(omap34xx_mpu_masters),
        .omap_chip      = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
index 665420e89c218c03193f439bf4fc81e3b0fec3f2..de4d0422cd2a502a4135cf097f23d14fb0ae83f8 100644 (file)
@@ -110,8 +110,7 @@ struct omap_hwmod_dma_info {
 /**
  * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
  * @role: "sys", "32k", "tv", etc -- for use in clk_get()
- * @clkdev_dev_id: opt clock: clkdev dev_id string
- * @clkdev_con_id: opt clock: clkdev con_id string
+ * @clk: opt clock: OMAP clock name
  * @_clk: pointer to the struct clk (filled in at runtime)
  *
  * The module's interface clock and main functional clock should not
@@ -119,8 +118,7 @@ struct omap_hwmod_dma_info {
  */
 struct omap_hwmod_opt_clk {
        const char      *role;
-       const char      *clkdev_dev_id;
-       const char      *clkdev_con_id;
+       const char      *clk;
        struct clk      *_clk;
 };
 
@@ -187,8 +185,7 @@ struct omap_hwmod_addr_space {
  * @master: struct omap_hwmod that initiates OCP transactions on this link
  * @slave: struct omap_hwmod that responds to OCP transactions on this link
  * @addr: address space associated with this link
- * @clkdev_dev_id: interface clock: clkdev dev_id string
- * @clkdev_con_id: interface clock: clkdev con_id string
+ * @clk: interface clock: OMAP clock name
  * @_clk: pointer to the interface struct clk (filled in at runtime)
  * @fw: interface firewall data
  * @addr_cnt: ARRAY_SIZE(@addr)
@@ -207,8 +204,7 @@ struct omap_hwmod_ocp_if {
        struct omap_hwmod               *master;
        struct omap_hwmod               *slave;
        struct omap_hwmod_addr_space    *addr;
-       const char                      *clkdev_dev_id;
-       const char                      *clkdev_con_id;
+       const char                      *clk;
        struct clk                      *_clk;
        union {
                struct omap_hwmod_omap2_firewall omap2;
@@ -401,8 +397,7 @@ struct omap_hwmod_omap4_prcm {
  * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt)
  * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt)
  * @prcm: PRCM data pertaining to this hwmod
- * @clkdev_dev_id: main clock: clkdev dev_id string
- * @clkdev_con_id: main clock: clkdev con_id string
+ * @main_clk: main clock: OMAP clock name
  * @_clk: pointer to the main struct clk (filled in at runtime)
  * @opt_clks: other device clocks that drivers can request (0..*)
  * @masters: ptr to array of OCP ifs that this hwmod can initiate on
@@ -426,10 +421,10 @@ struct omap_hwmod_omap4_prcm {
  * @omap_chip: OMAP chips this hwmod is present on
  * @node: list node for hwmod list (internal use)
  *
- * @clkdev_dev_id, @clkdev_con_id, and @clk all refer to this module's "main
- * clock," which for our purposes is defined as "the functional clock needed
- * for register accesses to complete."  Modules may not have a main clock if
- * the interface clock also serves as a main clock.
+ * @main_clk refers to this module's "main clock," which for our
+ * purposes is defined as "the functional clock needed for register
+ * accesses to complete."  Modules may not have a main clock if the
+ * interface clock also serves as a main clock.
  *
  * Parameter names beginning with an underscore are managed internally by
  * the omap_hwmod code and should not be set during initialization.
@@ -443,8 +438,7 @@ struct omap_hwmod {
                struct omap_hwmod_omap2_prcm omap2;
                struct omap_hwmod_omap4_prcm omap4;
        }                               prcm;
-       const char                      *clkdev_dev_id;
-       const char                      *clkdev_con_id;
+       const char                      *main_clk;
        struct clk                      *_clk;
        struct omap_hwmod_opt_clk       *opt_clks;
        struct omap_hwmod_ocp_if        **masters; /* connect to *_IA */