ARM: OMAP2+: Simplify dmtimer clock aliases
authorJon Hunter <jon-hunter@ti.com>
Tue, 5 Jun 2012 17:35:00 +0000 (12:35 -0500)
committerTony Lindgren <tony@atomide.com>
Thu, 14 Jun 2012 09:39:47 +0000 (02:39 -0700)
The OMAP dmtimer driver allows you to dynamically configure the functional
clock that drives the timer logic. The dmtimer driver uses the device name and
a "con-id" string to search for the appropriate functional clock.

Currently, we define a clock alias for each functional clock source each timer
supports. Some functional clock sources are common to all of the timers on a
device and so for these clock sources we can use a single alias with a unique
con-id string.

The possible functional clock sources for an OMAP device are a 32kHz clock,
a system (MHz range) clock and (for OMAP2 only) an external clock. By defining
a unique con-id name for each of these (timer_32k_ck, timer_sys_ck and
timer_ext_ck) we can eliminate a lot of the clock aliases for timers. This
reduces code, speeds-up searches and clock initialisation time.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/clock2420_data.c
arch/arm/mach-omap2/clock2430_data.c
arch/arm/mach-omap2/clock3xxx_data.c
arch/arm/mach-omap2/clock44xx_data.c
arch/arm/plat-omap/dmtimer.c

index bace9308a4db89616b780f310738f35c6cee5644..861767ed1a3a0492c94f7cc3f3b0a5150ee875df 100644 (file)
@@ -1901,42 +1901,9 @@ static struct omap_clk omap2420_clks[] = {
        CLK(NULL,       "pka_ick",      &pka_ick,       CK_242X),
        CLK(NULL,       "usb_fck",      &usb_fck,       CK_242X),
        CLK("musb-hdrc",        "fck",  &osc_ck,        CK_242X),
-       CLK("omap_timer.1",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.2",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.3",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.4",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.5",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.6",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.7",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.8",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.9",     "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.10",    "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.11",    "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.12",    "32k_ck",       &func_32k_ck,   CK_243X),
-       CLK("omap_timer.1",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.2",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.3",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.4",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.5",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.6",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.7",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.8",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.9",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.10",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.11",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.12",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.1",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.2",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.3",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.4",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.5",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.6",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.7",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.8",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.9",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.10",    "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.11",    "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.12",    "alt_ck",       &alt_ck,        CK_243X),
+       CLK(NULL,       "timer_32k_ck", &func_32k_ck,   CK_243X),
+       CLK(NULL,       "timer_sys_ck", &sys_ck,        CK_243X),
+       CLK(NULL,       "timer_ext_ck", &alt_ck,        CK_243X),
 };
 
 /*
index 3b4d09a5039905687b2723adbad0d76add914221..5577810dbc26328dc0d09432858cca378eed2cc8 100644 (file)
@@ -2000,42 +2000,9 @@ static struct omap_clk omap2430_clks[] = {
        CLK(NULL,       "mdm_intc_ick", &mdm_intc_ick,  CK_243X),
        CLK("omap_hsmmc.0", "mmchsdb_fck",      &mmchsdb1_fck,  CK_243X),
        CLK("omap_hsmmc.1", "mmchsdb_fck",      &mmchsdb2_fck,  CK_243X),
-       CLK("omap_timer.1",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.2",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.3",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.4",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.5",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.6",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.7",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.8",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.9",     "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.10",    "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.11",    "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.12",    "32k_ck",  &func_32k_ck,   CK_243X),
-       CLK("omap_timer.1",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.2",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.3",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.4",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.5",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.6",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.7",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.8",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.9",     "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.10",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.11",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.12",    "sys_ck",       &sys_ck,        CK_243X),
-       CLK("omap_timer.1",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.2",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.3",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.4",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.5",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.6",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.7",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.8",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.9",     "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.10",    "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.11",    "alt_ck",       &alt_ck,        CK_243X),
-       CLK("omap_timer.12",    "alt_ck",       &alt_ck,        CK_243X),
+       CLK(NULL,       "timer_32k_ck",  &func_32k_ck,   CK_243X),
+       CLK(NULL,       "timer_sys_ck", &sys_ck,        CK_243X),
+       CLK(NULL,       "timer_ext_ck", &alt_ck,        CK_243X),
 };
 
 /*
index 4e1a3b0e8cc83d5d505abf7d789273c4f1a970a0..64b2b1fafddd4085f2d24addd0a09765f2dbec06 100644 (file)
@@ -3482,30 +3482,8 @@ static struct omap_clk omap3xxx_clks[] = {
        CLK("musb-am35x",       "fck",          &hsotgusb_fck_am35xx,   CK_AM35XX),
        CLK(NULL,       "hecc_ck",      &hecc_ck,       CK_AM35XX),
        CLK(NULL,       "uart4_ick",    &uart4_ick_am35xx,      CK_AM35XX),
-       CLK("omap_timer.1",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.2",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.3",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.4",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.5",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.6",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.7",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.8",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.9",     "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.10",    "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.11",    "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.12",    "32k_ck",       &omap_32k_fck,  CK_3XXX),
-       CLK("omap_timer.1",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.2",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.3",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.4",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.5",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.6",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.7",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.8",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.9",     "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.10",    "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.11",    "sys_ck",       &sys_ck,        CK_3XXX),
-       CLK("omap_timer.12",    "sys_ck",       &sys_ck,        CK_3XXX),
+       CLK(NULL,       "timer_32k_ck", &omap_32k_fck,  CK_3XXX),
+       CLK(NULL,       "timer_sys_ck", &sys_ck,        CK_3XXX),
 };
 
 
index 2172f660384889535c6d812dae30dacf56b18eec..51f7424c7caaee2d67500e0c2d0382d427a4105a 100644 (file)
@@ -3380,28 +3380,18 @@ static struct omap_clk omap44xx_clks[] = {
        CLK("usbhs_omap",       "usbhost_ick",          &dummy_ck,              CK_443X),
        CLK("usbhs_omap",       "usbtll_fck",           &dummy_ck,      CK_443X),
        CLK("omap_wdt", "ick",                          &dummy_ck,      CK_443X),
-       CLK("omap_timer.1",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.2",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.3",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.4",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.5",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.6",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.7",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.8",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.9",     "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.10",    "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.11",    "32k_ck",       &sys_32k_ck,    CK_443X),
-       CLK("omap_timer.1",     "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.2",     "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.3",     "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.4",     "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.9",     "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.10",    "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.11",    "sys_ck",       &sys_clkin_ck,  CK_443X),
-       CLK("omap_timer.5",     "sys_ck",       &syc_clk_div_ck,        CK_443X),
-       CLK("omap_timer.6",     "sys_ck",       &syc_clk_div_ck,        CK_443X),
-       CLK("omap_timer.7",     "sys_ck",       &syc_clk_div_ck,        CK_443X),
-       CLK("omap_timer.8",     "sys_ck",       &syc_clk_div_ck,        CK_443X),
+       CLK(NULL,       "timer_32k_ck", &sys_32k_ck,    CK_443X),
+       CLK("omap_timer.1",     "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.2",     "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.3",     "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.4",     "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.9",     "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.10",    "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.11",    "timer_sys_ck", &sys_clkin_ck,  CK_443X),
+       CLK("omap_timer.5",     "timer_sys_ck", &syc_clk_div_ck,        CK_443X),
+       CLK("omap_timer.6",     "timer_sys_ck", &syc_clk_div_ck,        CK_443X),
+       CLK("omap_timer.7",     "timer_sys_ck", &syc_clk_div_ck,        CK_443X),
+       CLK("omap_timer.8",     "timer_sys_ck", &syc_clk_div_ck,        CK_443X),
 };
 
 int __init omap4xxx_clk_init(void)
index 6a7088972c55e1b861092c5afbb7c777bcf632da..54ed4e6e429ea3d4b6404f18502ea0f99d51d92d 100644 (file)
@@ -425,15 +425,15 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
 
        switch (source) {
        case OMAP_TIMER_SRC_SYS_CLK:
-               parent_name = "sys_ck";
+               parent_name = "timer_sys_ck";
                break;
 
        case OMAP_TIMER_SRC_32_KHZ:
-               parent_name = "32k_ck";
+               parent_name = "timer_32k_ck";
                break;
 
        case OMAP_TIMER_SRC_EXT_CLK:
-               parent_name = "alt_ck";
+               parent_name = "timer_ext_ck";
                break;
        }