aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2011-07-10 07:54:12 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-10 07:54:12 -0400
commitbf1e0776cf5e4ef2622de3a4b63f84175b5b48ab (patch)
treedf9b0b1c02f1f7c4774464bf5ca58d6ca791db9b /arch
parentc84584139aaeef7631df152e13cbf319d8e55950 (diff)
OMAP: omap_device: Create clkdev entry for hwmod main_clk
Extend the existing function to create clkdev for every optional clocks to add a well one "fck" alias for the main_clk of the omap_hwmod. It will allow to remove these static clkdev entries from the clockXXX_data.c file. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@ti.com> Cc: Todd Poynor <toddpoynor@google.com> [paul@pwsan.com: remove all of the "fck" role clkdev aliases from the clock data files; fixed error message] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c22
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c32
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c44
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c38
-rw-r--r--arch/arm/plat-omap/omap_device.c85
5 files changed, 118 insertions, 103 deletions
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 2926d028b6e9..debc040872f1 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1805,9 +1805,9 @@ static struct omap_clk omap2420_clks[] = {
1805 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X), 1805 CLK(NULL, "gfx_ick", &gfx_ick, CK_242X),
1806 /* DSS domain clocks */ 1806 /* DSS domain clocks */
1807 CLK("omapdss_dss", "ick", &dss_ick, CK_242X), 1807 CLK("omapdss_dss", "ick", &dss_ick, CK_242X),
1808 CLK("omapdss_dss", "fck", &dss1_fck, CK_242X), 1808 CLK(NULL, "dss1_fck", &dss1_fck, CK_242X),
1809 CLK("omapdss_dss", "sys_clk", &dss2_fck, CK_242X), 1809 CLK(NULL, "dss2_fck", &dss2_fck, CK_242X),
1810 CLK("omapdss_dss", "tv_clk", &dss_54m_fck, CK_242X), 1810 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_242X),
1811 /* L3 domain clocks */ 1811 /* L3 domain clocks */
1812 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X), 1812 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X),
1813 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X), 1813 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X),
@@ -1844,13 +1844,13 @@ static struct omap_clk omap2420_clks[] = {
1844 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X), 1844 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X),
1845 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X), 1845 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X),
1846 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X), 1846 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X),
1847 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_242X), 1847 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_242X),
1848 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X), 1848 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X),
1849 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_242X), 1849 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_242X),
1850 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X), 1850 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X),
1851 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_242X), 1851 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_242X),
1852 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X), 1852 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X),
1853 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_242X), 1853 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_242X),
1854 CLK(NULL, "uart1_ick", &uart1_ick, CK_242X), 1854 CLK(NULL, "uart1_ick", &uart1_ick, CK_242X),
1855 CLK(NULL, "uart1_fck", &uart1_fck, CK_242X), 1855 CLK(NULL, "uart1_fck", &uart1_fck, CK_242X),
1856 CLK(NULL, "uart2_ick", &uart2_ick, CK_242X), 1856 CLK(NULL, "uart2_ick", &uart2_ick, CK_242X),
@@ -1860,7 +1860,7 @@ static struct omap_clk omap2420_clks[] = {
1860 CLK(NULL, "gpios_ick", &gpios_ick, CK_242X), 1860 CLK(NULL, "gpios_ick", &gpios_ick, CK_242X),
1861 CLK(NULL, "gpios_fck", &gpios_fck, CK_242X), 1861 CLK(NULL, "gpios_fck", &gpios_fck, CK_242X),
1862 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X), 1862 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X),
1863 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_242X), 1863 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_242X),
1864 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X), 1864 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X),
1865 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X), 1865 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X),
1866 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X), 1866 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X),
@@ -1880,11 +1880,11 @@ static struct omap_clk omap2420_clks[] = {
1880 CLK(NULL, "eac_ick", &eac_ick, CK_242X), 1880 CLK(NULL, "eac_ick", &eac_ick, CK_242X),
1881 CLK(NULL, "eac_fck", &eac_fck, CK_242X), 1881 CLK(NULL, "eac_fck", &eac_fck, CK_242X),
1882 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X), 1882 CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X),
1883 CLK("omap_hdq.1", "fck", &hdq_fck, CK_242X), 1883 CLK("omap_hdq.0", "fck", &hdq_fck, CK_242X),
1884 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X), 1884 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_242X),
1885 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_242X), 1885 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_242X),
1886 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X), 1886 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_242X),
1887 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_242X), 1887 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_242X),
1888 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), 1888 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
1889 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), 1889 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
1890 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), 1890 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X),
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 0c79d39e3021..96a942e42db1 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1895,9 +1895,9 @@ static struct omap_clk omap2430_clks[] = {
1895 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), 1895 CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X),
1896 /* DSS domain clocks */ 1896 /* DSS domain clocks */
1897 CLK("omapdss_dss", "ick", &dss_ick, CK_243X), 1897 CLK("omapdss_dss", "ick", &dss_ick, CK_243X),
1898 CLK("omapdss_dss", "fck", &dss1_fck, CK_243X), 1898 CLK(NULL, "dss1_fck", &dss1_fck, CK_243X),
1899 CLK("omapdss_dss", "sys_clk", &dss2_fck, CK_243X), 1899 CLK(NULL, "dss2_fck", &dss2_fck, CK_243X),
1900 CLK("omapdss_dss", "tv_clk", &dss_54m_fck, CK_243X), 1900 CLK(NULL, "dss_54m_fck", &dss_54m_fck, CK_243X),
1901 /* L3 domain clocks */ 1901 /* L3 domain clocks */
1902 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X), 1902 CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X),
1903 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X), 1903 CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X),
@@ -1934,21 +1934,21 @@ static struct omap_clk omap2430_clks[] = {
1934 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X), 1934 CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X),
1935 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X), 1935 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X),
1936 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X), 1936 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X),
1937 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X), 1937 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_243X),
1938 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X), 1938 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X),
1939 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X), 1939 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_243X),
1940 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), 1940 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X),
1941 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X), 1941 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_243X),
1942 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), 1942 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X),
1943 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X), 1943 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_243X),
1944 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), 1944 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X),
1945 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X), 1945 CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_243X),
1946 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X), 1946 CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X),
1947 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X), 1947 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_243X),
1948 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X), 1948 CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X),
1949 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X), 1949 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_243X),
1950 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), 1950 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X),
1951 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X), 1951 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_243X),
1952 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X), 1952 CLK(NULL, "uart1_ick", &uart1_ick, CK_243X),
1953 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X), 1953 CLK(NULL, "uart1_fck", &uart1_fck, CK_243X),
1954 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X), 1954 CLK(NULL, "uart2_ick", &uart2_ick, CK_243X),
@@ -1958,7 +1958,7 @@ static struct omap_clk omap2430_clks[] = {
1958 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X), 1958 CLK(NULL, "gpios_ick", &gpios_ick, CK_243X),
1959 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X), 1959 CLK(NULL, "gpios_fck", &gpios_fck, CK_243X),
1960 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X), 1960 CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X),
1961 CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X), 1961 CLK(NULL, "mpu_wdt_fck", &mpu_wdt_fck, CK_243X),
1962 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X), 1962 CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X),
1963 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X), 1963 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X),
1964 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X), 1964 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X),
@@ -1975,9 +1975,9 @@ static struct omap_clk omap2430_clks[] = {
1975 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), 1975 CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X),
1976 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), 1976 CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X),
1977 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X), 1977 CLK("omap_i2c.1", "ick", &i2c1_ick, CK_243X),
1978 CLK("omap_i2c.1", "fck", &i2chs1_fck, CK_243X), 1978 CLK(NULL, "i2chs1_fck", &i2chs1_fck, CK_243X),
1979 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X), 1979 CLK("omap_i2c.2", "ick", &i2c2_ick, CK_243X),
1980 CLK("omap_i2c.2", "fck", &i2chs2_fck, CK_243X), 1980 CLK(NULL, "i2chs2_fck", &i2chs2_fck, CK_243X),
1981 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), 1981 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X),
1982 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), 1982 CLK(NULL, "sdma_fck", &sdma_fck, CK_243X),
1983 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), 1983 CLK(NULL, "sdma_ick", &sdma_ick, CK_243X),
@@ -1990,9 +1990,9 @@ static struct omap_clk omap2430_clks[] = {
1990 CLK(NULL, "usb_fck", &usb_fck, CK_243X), 1990 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
1991 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), 1991 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
1992 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X), 1992 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
1993 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X), 1993 CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_243X),
1994 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X), 1994 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
1995 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X), 1995 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_243X),
1996 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), 1996 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1997 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), 1997 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), 1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 75b119bd9cda..ffd55b1c4396 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3289,25 +3289,25 @@ static struct omap_clk omap3xxx_clks[] = {
3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3292 CLK("omap_hsmmc.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3292 CLK(NULL, "mmchs3_fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3293 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_3XXX), 3293 CLK(NULL, "mmchs2_fck", &mmchs2_fck, CK_3XXX),
3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), 3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX),
3295 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_3XXX), 3295 CLK(NULL, "mmchs1_fck", &mmchs1_fck, CK_3XXX),
3296 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), 3296 CLK(NULL, "i2c3_fck", &i2c3_fck, CK_3XXX),
3297 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), 3297 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_3XXX),
3298 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), 3298 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_3XXX),
3299 CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_3XXX), 3299 CLK(NULL, "mcbsp5_fck", &mcbsp5_fck, CK_3XXX),
3300 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_3XXX), 3300 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_3XXX),
3301 CLK(NULL, "core_48m_fck", &core_48m_fck, CK_3XXX), 3301 CLK(NULL, "core_48m_fck", &core_48m_fck, CK_3XXX),
3302 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_3XXX), 3302 CLK(NULL, "mcspi4_fck", &mcspi4_fck, CK_3XXX),
3303 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_3XXX), 3303 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_3XXX),
3304 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_3XXX), 3304 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_3XXX),
3305 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_3XXX), 3305 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_3XXX),
3306 CLK(NULL, "uart2_fck", &uart2_fck, CK_3XXX), 3306 CLK(NULL, "uart2_fck", &uart2_fck, CK_3XXX),
3307 CLK(NULL, "uart1_fck", &uart1_fck, CK_3XXX), 3307 CLK(NULL, "uart1_fck", &uart1_fck, CK_3XXX),
3308 CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), 3308 CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1),
3309 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), 3309 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX),
3310 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), 3310 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX),
3311 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), 3311 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1),
3312 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX), 3312 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3313 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3313 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
@@ -3356,11 +3356,11 @@ static struct omap_clk omap3xxx_clks[] = {
3356 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX), 3356 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX),
3357 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX), 3357 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX),
3358 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX), 3358 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX),
3359 CLK("omapdss_dss", "fck", &dss1_alwon_fck_3430es1, CK_3430ES1), 3359 CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
3360 CLK("omapdss_dss", "fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3360 CLK(NULL, "dss1_alwon_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3361 CLK("omapdss_dss", "tv_clk", &dss_tv_fck, CK_3XXX), 3361 CLK(NULL, "dss_tv_fck", &dss_tv_fck, CK_3XXX),
3362 CLK("omapdss_dss", "video_clk", &dss_96m_fck, CK_3XXX), 3362 CLK(NULL, "dss_96m_fck", &dss_96m_fck, CK_3XXX),
3363 CLK("omapdss_dss", "sys_clk", &dss2_alwon_fck, CK_3XXX), 3363 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck, CK_3XXX),
3364 CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1), 3364 CLK("omapdss_dss", "ick", &dss_ick_3430es1, CK_3430ES1),
3365 CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3365 CLK("omapdss_dss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3366 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX), 3366 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
@@ -3385,7 +3385,7 @@ static struct omap_clk omap3xxx_clks[] = {
3385 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3385 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3386 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3386 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
3387 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX), 3387 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX),
3388 CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX), 3388 CLK(NULL, "wdt2_fck", &wdt2_fck, CK_3XXX),
3389 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX), 3389 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX),
3390 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX), 3390 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX),
3391 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), 3391 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX),
@@ -3436,9 +3436,9 @@ static struct omap_clk omap3xxx_clks[] = {
3436 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX), 3436 CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX),
3437 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX), 3437 CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX),
3438 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX), 3438 CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX),
3439 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_3XXX), 3439 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_3XXX),
3440 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_3XXX), 3440 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_3XXX),
3441 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_3XXX), 3441 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_3XXX),
3442 CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX), 3442 CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX),
3443 CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX), 3443 CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX),
3444 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX), 3444 CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX),
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 257882028492..763507f54339 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3057,12 +3057,12 @@ static struct omap_clk omap44xx_clks[] = {
3057 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X), 3057 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X),
3058 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X), 3058 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X),
3059 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X), 3059 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X),
3060 CLK("omap2_hdq.0", "fck", &hdq1w_fck, CK_443X), 3060 CLK(NULL, "hdq1w_fck", &hdq1w_fck, CK_443X),
3061 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X), 3061 CLK(NULL, "hsi_fck", &hsi_fck, CK_443X),
3062 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_443X), 3062 CLK(NULL, "i2c1_fck", &i2c1_fck, CK_443X),
3063 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_443X), 3063 CLK(NULL, "i2c2_fck", &i2c2_fck, CK_443X),
3064 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_443X), 3064 CLK(NULL, "i2c3_fck", &i2c3_fck, CK_443X),
3065 CLK("omap_i2c.4", "fck", &i2c4_fck, CK_443X), 3065 CLK(NULL, "i2c4_fck", &i2c4_fck, CK_443X),
3066 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X), 3066 CLK(NULL, "ipu_fck", &ipu_fck, CK_443X),
3067 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X), 3067 CLK(NULL, "iss_ctrlclk", &iss_ctrlclk, CK_443X),
3068 CLK(NULL, "iss_fck", &iss_fck, CK_443X), 3068 CLK(NULL, "iss_fck", &iss_fck, CK_443X),
@@ -3073,23 +3073,23 @@ static struct omap_clk omap44xx_clks[] = {
3073 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X), 3073 CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X),
3074 CLK(NULL, "mcasp_fck", &mcasp_fck, CK_443X), 3074 CLK(NULL, "mcasp_fck", &mcasp_fck, CK_443X),
3075 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X), 3075 CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X),
3076 CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_443X), 3076 CLK(NULL, "mcbsp1_fck", &mcbsp1_fck, CK_443X),
3077 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X), 3077 CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X),
3078 CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_443X), 3078 CLK(NULL, "mcbsp2_fck", &mcbsp2_fck, CK_443X),
3079 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X), 3079 CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X),
3080 CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_443X), 3080 CLK(NULL, "mcbsp3_fck", &mcbsp3_fck, CK_443X),
3081 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X), 3081 CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X),
3082 CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_443X), 3082 CLK(NULL, "mcbsp4_fck", &mcbsp4_fck, CK_443X),
3083 CLK(NULL, "mcpdm_fck", &mcpdm_fck, CK_443X), 3083 CLK(NULL, "mcpdm_fck", &mcpdm_fck, CK_443X),
3084 CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_443X), 3084 CLK(NULL, "mcspi1_fck", &mcspi1_fck, CK_443X),
3085 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), 3085 CLK(NULL, "mcspi2_fck", &mcspi2_fck, CK_443X),
3086 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), 3086 CLK(NULL, "mcspi3_fck", &mcspi3_fck, CK_443X),
3087 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), 3087 CLK(NULL, "mcspi4_fck", &mcspi4_fck, CK_443X),
3088 CLK("omap_hsmmc.0", "fck", &mmc1_fck, CK_443X), 3088 CLK(NULL, "mmc1_fck", &mmc1_fck, CK_443X),
3089 CLK("omap_hsmmc.1", "fck", &mmc2_fck, CK_443X), 3089 CLK(NULL, "mmc2_fck", &mmc2_fck, CK_443X),
3090 CLK("omap_hsmmc.2", "fck", &mmc3_fck, CK_443X), 3090 CLK(NULL, "mmc3_fck", &mmc3_fck, CK_443X),
3091 CLK("omap_hsmmc.3", "fck", &mmc4_fck, CK_443X), 3091 CLK(NULL, "mmc4_fck", &mmc4_fck, CK_443X),
3092 CLK("omap_hsmmc.4", "fck", &mmc5_fck, CK_443X), 3092 CLK(NULL, "mmc5_fck", &mmc5_fck, CK_443X),
3093 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), 3093 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
3094 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), 3094 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
3095 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), 3095 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
@@ -3146,7 +3146,7 @@ static struct omap_clk omap44xx_clks[] = {
3146 CLK(NULL, "usim_ck", &usim_ck, CK_443X), 3146 CLK(NULL, "usim_ck", &usim_ck, CK_443X),
3147 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3147 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
3148 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3148 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
3149 CLK("omap_wdt", "fck", &wd_timer2_fck, CK_443X), 3149 CLK(NULL, "wd_timer2_fck", &wd_timer2_fck, CK_443X),
3150 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X), 3150 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X),
3151 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), 3151 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
3152 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X), 3152 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X),
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index c8b9cd1716ba..be45147651cb 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -236,56 +236,71 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
236 return 0; 236 return 0;
237} 237}
238 238
239static void _add_clkdev(struct omap_device *od, const char *clk_alias,
240 const char *clk_name)
241{
242 struct clk *r;
243 struct clk_lookup *l;
244
245 if (!clk_alias || !clk_name)
246 return;
247
248 pr_debug("omap_device: %s: Creating %s -> %s\n",
249 dev_name(&od->pdev.dev), clk_alias, clk_name);
250
251 r = clk_get_sys(dev_name(&od->pdev.dev), clk_alias);
252 if (!IS_ERR(r)) {
253 pr_warning("omap_device: %s: alias %s already exists\n",
254 dev_name(&od->pdev.dev), clk_alias);
255 clk_put(r);
256 return;
257 }
258
259 r = omap_clk_get_by_name(clk_name);
260 if (IS_ERR(r)) {
261 pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
262 dev_name(&od->pdev.dev), clk_name);
263 return;
264 }
265
266 l = clkdev_alloc(r, clk_alias, dev_name(&od->pdev.dev));
267 if (!l) {
268 pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
269 dev_name(&od->pdev.dev), clk_alias);
270 return;
271 }
272
273 clkdev_add(l);
274}
275
239/** 276/**
240 * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks 277 * _add_hwmod_clocks_clkdev - Add clkdev entry for hwmod optional clocks
278 * and main clock
241 * @od: struct omap_device *od 279 * @od: struct omap_device *od
280 * @oh: struct omap_hwmod *oh
242 * 281 *
243 * For every optional clock present per hwmod per omap_device, this function 282 * For the main clock and every optional clock present per hwmod per
244 * adds an entry in the clkdev table of the form <dev-id=dev_name, con-id=role> 283 * omap_device, this function adds an entry in the clkdev table of the
245 * if it does not exist already. 284 * form <dev-id=dev_name, con-id=role> if it does not exist already.
246 * 285 *
247 * The function is called from inside omap_device_build_ss(), after 286 * The function is called from inside omap_device_build_ss(), after
248 * omap_device_register. 287 * omap_device_register.
249 * 288 *
250 * This allows drivers to get a pointer to its optional clocks based on its role 289 * This allows drivers to get a pointer to its optional clocks based on its role
251 * by calling clk_get(<dev*>, <role>). 290 * by calling clk_get(<dev*>, <role>).
291 * In the case of the main clock, a "fck" alias is used.
252 * 292 *
253 * No return value. 293 * No return value.
254 */ 294 */
255static void _add_optional_clock_clkdev(struct omap_device *od, 295static void _add_hwmod_clocks_clkdev(struct omap_device *od,
256 struct omap_hwmod *oh) 296 struct omap_hwmod *oh)
257{ 297{
258 int i; 298 int i;
259 299
260 for (i = 0; i < oh->opt_clks_cnt; i++) { 300 _add_clkdev(od, "fck", oh->main_clk);
261 struct omap_hwmod_opt_clk *oc;
262 struct clk *r;
263 struct clk_lookup *l;
264
265 oc = &oh->opt_clks[i];
266
267 if (!oc->_clk)
268 continue;
269
270 r = clk_get_sys(dev_name(&od->pdev.dev), oc->role);
271 if (!IS_ERR(r))
272 continue; /* clkdev entry exists */
273 301
274 r = omap_clk_get_by_name((char *)oc->clk); 302 for (i = 0; i < oh->opt_clks_cnt; i++)
275 if (IS_ERR(r)) { 303 _add_clkdev(od, oh->opt_clks[i].role, oh->opt_clks[i].clk);
276 pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
277 dev_name(&od->pdev.dev), oc->clk);
278 continue;
279 }
280
281 l = clkdev_alloc(r, oc->role, dev_name(&od->pdev.dev));
282 if (!l) {
283 pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
284 dev_name(&od->pdev.dev), oc->role);
285 return;
286 }
287 clkdev_add(l);
288 }
289} 304}
290 305
291 306
@@ -492,7 +507,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
492 507
493 for (i = 0; i < oh_cnt; i++) { 508 for (i = 0; i < oh_cnt; i++) {
494 hwmods[i]->od = od; 509 hwmods[i]->od = od;
495 _add_optional_clock_clkdev(od, hwmods[i]); 510 _add_hwmod_clocks_clkdev(od, hwmods[i]);
496 } 511 }
497 512
498 if (ret) 513 if (ret)