diff options
-rw-r--r-- | drivers/video/omap2/dss/core.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 8 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 117 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.c | 32 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 15 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss_features.c | 2 | ||||
-rw-r--r-- | include/video/omapdss.h | 2 |
8 files changed, 157 insertions, 31 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 5fbf9e845fe1..3da426719dd6 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -127,8 +127,7 @@ static int dss_initialize_debugfs(void) | |||
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | #if defined(CONFIG_OMAP2_DSS_DSI) && defined(CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS) | 129 | #if defined(CONFIG_OMAP2_DSS_DSI) && defined(CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS) |
130 | debugfs_create_file("dsi_irq", S_IRUGO, dss_debugfs_dir, | 130 | dsi_create_debugfs_files_irq(dss_debugfs_dir, &dss_debug_fops); |
131 | &dsi_dump_irqs, &dss_debug_fops); | ||
132 | #endif | 131 | #endif |
133 | 132 | ||
134 | debugfs_create_file("dss", S_IRUGO, dss_debugfs_dir, | 133 | debugfs_create_file("dss", S_IRUGO, dss_debugfs_dir, |
@@ -140,8 +139,7 @@ static int dss_initialize_debugfs(void) | |||
140 | &rfbi_dump_regs, &dss_debug_fops); | 139 | &rfbi_dump_regs, &dss_debug_fops); |
141 | #endif | 140 | #endif |
142 | #ifdef CONFIG_OMAP2_DSS_DSI | 141 | #ifdef CONFIG_OMAP2_DSS_DSI |
143 | debugfs_create_file("dsi", S_IRUGO, dss_debugfs_dir, | 142 | dsi_create_debugfs_files_reg(dss_debugfs_dir, &dss_debug_fops); |
144 | &dsi_dump_regs, &dss_debug_fops); | ||
145 | #endif | 143 | #endif |
146 | #ifdef CONFIG_OMAP2_DSS_VENC | 144 | #ifdef CONFIG_OMAP2_DSS_VENC |
147 | debugfs_create_file("venc", S_IRUGO, dss_debugfs_dir, | 145 | debugfs_create_file("venc", S_IRUGO, dss_debugfs_dir, |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index df8c9921763b..1a2d835000f8 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -2250,6 +2250,10 @@ unsigned long dispc_fclk_rate(void) | |||
2250 | dsidev = dsi_get_dsidev_from_id(0); | 2250 | dsidev = dsi_get_dsidev_from_id(0); |
2251 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); | 2251 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); |
2252 | break; | 2252 | break; |
2253 | case OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC: | ||
2254 | dsidev = dsi_get_dsidev_from_id(1); | ||
2255 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); | ||
2256 | break; | ||
2253 | default: | 2257 | default: |
2254 | BUG(); | 2258 | BUG(); |
2255 | } | 2259 | } |
@@ -2276,6 +2280,10 @@ unsigned long dispc_lclk_rate(enum omap_channel channel) | |||
2276 | dsidev = dsi_get_dsidev_from_id(0); | 2280 | dsidev = dsi_get_dsidev_from_id(0); |
2277 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); | 2281 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); |
2278 | break; | 2282 | break; |
2283 | case OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC: | ||
2284 | dsidev = dsi_get_dsidev_from_id(1); | ||
2285 | r = dsi_get_pll_hsdiv_dispc_rate(dsidev); | ||
2286 | break; | ||
2279 | default: | 2287 | default: |
2280 | BUG(); | 2288 | BUG(); |
2281 | } | 2289 | } |
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c index 4d661a949b89..ff6bd30132df 100644 --- a/drivers/video/omap2/dss/dpi.c +++ b/drivers/video/omap2/dss/dpi.c | |||
@@ -53,8 +53,12 @@ static bool dpi_use_dsi_pll(struct omap_dss_device *dssdev) | |||
53 | { | 53 | { |
54 | if (dssdev->clocks.dispc.dispc_fclk_src == | 54 | if (dssdev->clocks.dispc.dispc_fclk_src == |
55 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC || | 55 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC || |
56 | dssdev->clocks.dispc.dispc_fclk_src == | ||
57 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC || | ||
56 | dssdev->clocks.dispc.channel.lcd_clk_src == | 58 | dssdev->clocks.dispc.channel.lcd_clk_src == |
57 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC) | 59 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC || |
60 | dssdev->clocks.dispc.channel.lcd_clk_src == | ||
61 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC) | ||
58 | return true; | 62 | return true; |
59 | else | 63 | else |
60 | return false; | 64 | return false; |
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 762b0fe1dc19..85ec3d63a897 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
36 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
38 | #include <linux/debugfs.h> | ||
38 | 39 | ||
39 | #include <video/omapdss.h> | 40 | #include <video/omapdss.h> |
40 | #include <plat/clock.h> | 41 | #include <plat/clock.h> |
@@ -1143,8 +1144,9 @@ static unsigned long dsi_get_txbyteclkhs(struct platform_device *dsidev) | |||
1143 | static unsigned long dsi_fclk_rate(struct platform_device *dsidev) | 1144 | static unsigned long dsi_fclk_rate(struct platform_device *dsidev) |
1144 | { | 1145 | { |
1145 | unsigned long r; | 1146 | unsigned long r; |
1147 | int dsi_module = dsi_get_dsidev_id(dsidev); | ||
1146 | 1148 | ||
1147 | if (dss_get_dsi_clk_source() == OMAP_DSS_CLK_SRC_FCK) { | 1149 | if (dss_get_dsi_clk_source(dsi_module) == OMAP_DSS_CLK_SRC_FCK) { |
1148 | /* DSI FCLK source is DSS_CLK_FCK */ | 1150 | /* DSI FCLK source is DSS_CLK_FCK */ |
1149 | r = dss_clk_get_rate(DSS_CLK_FCK); | 1151 | r = dss_clk_get_rate(DSS_CLK_FCK); |
1150 | } else { | 1152 | } else { |
@@ -1670,19 +1672,20 @@ void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes) | |||
1670 | DSSDBG("PLL uninit done\n"); | 1672 | DSSDBG("PLL uninit done\n"); |
1671 | } | 1673 | } |
1672 | 1674 | ||
1673 | void dsi_dump_clocks(struct seq_file *s) | 1675 | static void dsi_dump_dsidev_clocks(struct platform_device *dsidev, |
1676 | struct seq_file *s) | ||
1674 | { | 1677 | { |
1675 | struct platform_device *dsidev = dsi_get_dsidev_from_id(0); | ||
1676 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 1678 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
1677 | struct dsi_clock_info *cinfo = &dsi->current_cinfo; | 1679 | struct dsi_clock_info *cinfo = &dsi->current_cinfo; |
1678 | enum omap_dss_clk_source dispc_clk_src, dsi_clk_src; | 1680 | enum omap_dss_clk_source dispc_clk_src, dsi_clk_src; |
1681 | int dsi_module = dsi_get_dsidev_id(dsidev); | ||
1679 | 1682 | ||
1680 | dispc_clk_src = dss_get_dispc_clk_source(); | 1683 | dispc_clk_src = dss_get_dispc_clk_source(); |
1681 | dsi_clk_src = dss_get_dsi_clk_source(); | 1684 | dsi_clk_src = dss_get_dsi_clk_source(dsi_module); |
1682 | 1685 | ||
1683 | enable_clocks(1); | 1686 | enable_clocks(1); |
1684 | 1687 | ||
1685 | seq_printf(s, "- DSI PLL -\n"); | 1688 | seq_printf(s, "- DSI%d PLL -\n", dsi_module + 1); |
1686 | 1689 | ||
1687 | seq_printf(s, "dsi pll source = %s\n", | 1690 | seq_printf(s, "dsi pll source = %s\n", |
1688 | cinfo->use_sys_clk ? "dss_sys_clk" : "pclkfree"); | 1691 | cinfo->use_sys_clk ? "dss_sys_clk" : "pclkfree"); |
@@ -1708,7 +1711,7 @@ void dsi_dump_clocks(struct seq_file *s) | |||
1708 | dsi_clk_src == OMAP_DSS_CLK_SRC_FCK ? | 1711 | dsi_clk_src == OMAP_DSS_CLK_SRC_FCK ? |
1709 | "off" : "on"); | 1712 | "off" : "on"); |
1710 | 1713 | ||
1711 | seq_printf(s, "- DSI -\n"); | 1714 | seq_printf(s, "- DSI%d -\n", dsi_module + 1); |
1712 | 1715 | ||
1713 | seq_printf(s, "dsi fclk source = %s (%s)\n", | 1716 | seq_printf(s, "dsi fclk source = %s (%s)\n", |
1714 | dss_get_generic_clk_source_name(dsi_clk_src), | 1717 | dss_get_generic_clk_source_name(dsi_clk_src), |
@@ -1731,13 +1734,26 @@ void dsi_dump_clocks(struct seq_file *s) | |||
1731 | enable_clocks(0); | 1734 | enable_clocks(0); |
1732 | } | 1735 | } |
1733 | 1736 | ||
1737 | void dsi_dump_clocks(struct seq_file *s) | ||
1738 | { | ||
1739 | struct platform_device *dsidev; | ||
1740 | int i; | ||
1741 | |||
1742 | for (i = 0; i < MAX_NUM_DSI; i++) { | ||
1743 | dsidev = dsi_get_dsidev_from_id(i); | ||
1744 | if (dsidev) | ||
1745 | dsi_dump_dsidev_clocks(dsidev, s); | ||
1746 | } | ||
1747 | } | ||
1748 | |||
1734 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS | 1749 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS |
1735 | void dsi_dump_irqs(struct seq_file *s) | 1750 | static void dsi_dump_dsidev_irqs(struct platform_device *dsidev, |
1751 | struct seq_file *s) | ||
1736 | { | 1752 | { |
1737 | struct platform_device *dsidev = dsi_get_dsidev_from_id(0); | ||
1738 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 1753 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
1739 | unsigned long flags; | 1754 | unsigned long flags; |
1740 | struct dsi_irq_stats stats; | 1755 | struct dsi_irq_stats stats; |
1756 | int dsi_module = dsi_get_dsidev_id(dsidev); | ||
1741 | 1757 | ||
1742 | spin_lock_irqsave(&dsi->irq_stats_lock, flags); | 1758 | spin_lock_irqsave(&dsi->irq_stats_lock, flags); |
1743 | 1759 | ||
@@ -1754,7 +1770,7 @@ void dsi_dump_irqs(struct seq_file *s) | |||
1754 | #define PIS(x) \ | 1770 | #define PIS(x) \ |
1755 | seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]); | 1771 | seq_printf(s, "%-20s %10d\n", #x, stats.dsi_irqs[ffs(DSI_IRQ_##x)-1]); |
1756 | 1772 | ||
1757 | seq_printf(s, "-- DSI interrupts --\n"); | 1773 | seq_printf(s, "-- DSI%d interrupts --\n", dsi_module + 1); |
1758 | PIS(VC0); | 1774 | PIS(VC0); |
1759 | PIS(VC1); | 1775 | PIS(VC1); |
1760 | PIS(VC2); | 1776 | PIS(VC2); |
@@ -1820,12 +1836,41 @@ void dsi_dump_irqs(struct seq_file *s) | |||
1820 | PIS(ULPSACTIVENOT_ALL1); | 1836 | PIS(ULPSACTIVENOT_ALL1); |
1821 | #undef PIS | 1837 | #undef PIS |
1822 | } | 1838 | } |
1823 | #endif | ||
1824 | 1839 | ||
1825 | void dsi_dump_regs(struct seq_file *s) | 1840 | static void dsi1_dump_irqs(struct seq_file *s) |
1826 | { | 1841 | { |
1827 | struct platform_device *dsidev = dsi_get_dsidev_from_id(0); | 1842 | struct platform_device *dsidev = dsi_get_dsidev_from_id(0); |
1828 | 1843 | ||
1844 | dsi_dump_dsidev_irqs(dsidev, s); | ||
1845 | } | ||
1846 | |||
1847 | static void dsi2_dump_irqs(struct seq_file *s) | ||
1848 | { | ||
1849 | struct platform_device *dsidev = dsi_get_dsidev_from_id(1); | ||
1850 | |||
1851 | dsi_dump_dsidev_irqs(dsidev, s); | ||
1852 | } | ||
1853 | |||
1854 | void dsi_create_debugfs_files_irq(struct dentry *debugfs_dir, | ||
1855 | const struct file_operations *debug_fops) | ||
1856 | { | ||
1857 | struct platform_device *dsidev; | ||
1858 | |||
1859 | dsidev = dsi_get_dsidev_from_id(0); | ||
1860 | if (dsidev) | ||
1861 | debugfs_create_file("dsi1_irqs", S_IRUGO, debugfs_dir, | ||
1862 | &dsi1_dump_irqs, debug_fops); | ||
1863 | |||
1864 | dsidev = dsi_get_dsidev_from_id(1); | ||
1865 | if (dsidev) | ||
1866 | debugfs_create_file("dsi2_irqs", S_IRUGO, debugfs_dir, | ||
1867 | &dsi2_dump_irqs, debug_fops); | ||
1868 | } | ||
1869 | #endif | ||
1870 | |||
1871 | static void dsi_dump_dsidev_regs(struct platform_device *dsidev, | ||
1872 | struct seq_file *s) | ||
1873 | { | ||
1829 | #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsidev, r)) | 1874 | #define DUMPREG(r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsidev, r)) |
1830 | 1875 | ||
1831 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK); | 1876 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK); |
@@ -1906,6 +1951,35 @@ void dsi_dump_regs(struct seq_file *s) | |||
1906 | #undef DUMPREG | 1951 | #undef DUMPREG |
1907 | } | 1952 | } |
1908 | 1953 | ||
1954 | static void dsi1_dump_regs(struct seq_file *s) | ||
1955 | { | ||
1956 | struct platform_device *dsidev = dsi_get_dsidev_from_id(0); | ||
1957 | |||
1958 | dsi_dump_dsidev_regs(dsidev, s); | ||
1959 | } | ||
1960 | |||
1961 | static void dsi2_dump_regs(struct seq_file *s) | ||
1962 | { | ||
1963 | struct platform_device *dsidev = dsi_get_dsidev_from_id(1); | ||
1964 | |||
1965 | dsi_dump_dsidev_regs(dsidev, s); | ||
1966 | } | ||
1967 | |||
1968 | void dsi_create_debugfs_files_reg(struct dentry *debugfs_dir, | ||
1969 | const struct file_operations *debug_fops) | ||
1970 | { | ||
1971 | struct platform_device *dsidev; | ||
1972 | |||
1973 | dsidev = dsi_get_dsidev_from_id(0); | ||
1974 | if (dsidev) | ||
1975 | debugfs_create_file("dsi1_regs", S_IRUGO, debugfs_dir, | ||
1976 | &dsi1_dump_regs, debug_fops); | ||
1977 | |||
1978 | dsidev = dsi_get_dsidev_from_id(1); | ||
1979 | if (dsidev) | ||
1980 | debugfs_create_file("dsi2_regs", S_IRUGO, debugfs_dir, | ||
1981 | &dsi2_dump_regs, debug_fops); | ||
1982 | } | ||
1909 | enum dsi_cio_power_state { | 1983 | enum dsi_cio_power_state { |
1910 | DSI_COMPLEXIO_POWER_OFF = 0x0, | 1984 | DSI_COMPLEXIO_POWER_OFF = 0x0, |
1911 | DSI_COMPLEXIO_POWER_ON = 0x1, | 1985 | DSI_COMPLEXIO_POWER_ON = 0x1, |
@@ -3847,9 +3921,13 @@ EXPORT_SYMBOL(omap_dsi_update); | |||
3847 | static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | 3921 | static int dsi_display_init_dispc(struct omap_dss_device *dssdev) |
3848 | { | 3922 | { |
3849 | int r; | 3923 | int r; |
3924 | u32 irq; | ||
3925 | |||
3926 | irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ? | ||
3927 | DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2; | ||
3850 | 3928 | ||
3851 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, (void *) dssdev, | 3929 | r = omap_dispc_register_isr(dsi_framedone_irq_callback, (void *) dssdev, |
3852 | DISPC_IRQ_FRAMEDONE); | 3930 | irq); |
3853 | if (r) { | 3931 | if (r) { |
3854 | DSSERR("can't get FRAMEDONE irq\n"); | 3932 | DSSERR("can't get FRAMEDONE irq\n"); |
3855 | return r; | 3933 | return r; |
@@ -3882,8 +3960,13 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
3882 | 3960 | ||
3883 | static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) | 3961 | static void dsi_display_uninit_dispc(struct omap_dss_device *dssdev) |
3884 | { | 3962 | { |
3963 | u32 irq; | ||
3964 | |||
3965 | irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ? | ||
3966 | DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2; | ||
3967 | |||
3885 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, (void *) dssdev, | 3968 | omap_dispc_unregister_isr(dsi_framedone_irq_callback, (void *) dssdev, |
3886 | DISPC_IRQ_FRAMEDONE); | 3969 | irq); |
3887 | } | 3970 | } |
3888 | 3971 | ||
3889 | static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev) | 3972 | static int dsi_configure_dsi_clocks(struct omap_dss_device *dssdev) |
@@ -3943,6 +4026,7 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev) | |||
3943 | static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | 4026 | static int dsi_display_init_dsi(struct omap_dss_device *dssdev) |
3944 | { | 4027 | { |
3945 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4028 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4029 | int dsi_module = dsi_get_dsidev_id(dsidev); | ||
3946 | int r; | 4030 | int r; |
3947 | 4031 | ||
3948 | r = dsi_pll_init(dsidev, true, true); | 4032 | r = dsi_pll_init(dsidev, true, true); |
@@ -3954,7 +4038,7 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev) | |||
3954 | goto err1; | 4038 | goto err1; |
3955 | 4039 | ||
3956 | dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src); | 4040 | dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src); |
3957 | dss_select_dsi_clk_source(dssdev->clocks.dsi.dsi_fclk_src); | 4041 | dss_select_dsi_clk_source(dsi_module, dssdev->clocks.dsi.dsi_fclk_src); |
3958 | dss_select_lcd_clk_source(dssdev->manager->id, | 4042 | dss_select_lcd_clk_source(dssdev->manager->id, |
3959 | dssdev->clocks.dispc.channel.lcd_clk_src); | 4043 | dssdev->clocks.dispc.channel.lcd_clk_src); |
3960 | 4044 | ||
@@ -3993,7 +4077,7 @@ err3: | |||
3993 | dsi_cio_uninit(dsidev); | 4077 | dsi_cio_uninit(dsidev); |
3994 | err2: | 4078 | err2: |
3995 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4079 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
3996 | dss_select_dsi_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4080 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); |
3997 | err1: | 4081 | err1: |
3998 | dsi_pll_uninit(dsidev, true); | 4082 | dsi_pll_uninit(dsidev, true); |
3999 | err0: | 4083 | err0: |
@@ -4005,6 +4089,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4005 | { | 4089 | { |
4006 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4090 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4007 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4091 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4092 | int dsi_module = dsi_get_dsidev_id(dsidev); | ||
4008 | 4093 | ||
4009 | if (enter_ulps && !dsi->ulps_enabled) | 4094 | if (enter_ulps && !dsi->ulps_enabled) |
4010 | dsi_enter_ulps(dsidev); | 4095 | dsi_enter_ulps(dsidev); |
@@ -4017,7 +4102,7 @@ static void dsi_display_uninit_dsi(struct omap_dss_device *dssdev, | |||
4017 | dsi_vc_enable(dsidev, 3, 0); | 4102 | dsi_vc_enable(dsidev, 3, 0); |
4018 | 4103 | ||
4019 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4104 | dss_select_dispc_clk_source(OMAP_DSS_CLK_SRC_FCK); |
4020 | dss_select_dsi_clk_source(OMAP_DSS_CLK_SRC_FCK); | 4105 | dss_select_dsi_clk_source(dsi_module, OMAP_DSS_CLK_SRC_FCK); |
4021 | dsi_cio_uninit(dsidev); | 4106 | dsi_cio_uninit(dsidev); |
4022 | dsi_pll_uninit(dsidev, disconnect_lanes); | 4107 | dsi_pll_uninit(dsidev, disconnect_lanes); |
4023 | } | 4108 | } |
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 3bf6e626f862..d9489d5c4f08 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c | |||
@@ -74,7 +74,7 @@ static struct { | |||
74 | struct dss_clock_info cache_dss_cinfo; | 74 | struct dss_clock_info cache_dss_cinfo; |
75 | struct dispc_clock_info cache_dispc_cinfo; | 75 | struct dispc_clock_info cache_dispc_cinfo; |
76 | 76 | ||
77 | enum omap_dss_clk_source dsi_clk_source; | 77 | enum omap_dss_clk_source dsi_clk_source[MAX_NUM_DSI]; |
78 | enum omap_dss_clk_source dispc_clk_source; | 78 | enum omap_dss_clk_source dispc_clk_source; |
79 | enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS]; | 79 | enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS]; |
80 | 80 | ||
@@ -313,6 +313,11 @@ void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src) | |||
313 | dsidev = dsi_get_dsidev_from_id(0); | 313 | dsidev = dsi_get_dsidev_from_id(0); |
314 | dsi_wait_pll_hsdiv_dispc_active(dsidev); | 314 | dsi_wait_pll_hsdiv_dispc_active(dsidev); |
315 | break; | 315 | break; |
316 | case OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC: | ||
317 | b = 2; | ||
318 | dsidev = dsi_get_dsidev_from_id(1); | ||
319 | dsi_wait_pll_hsdiv_dispc_active(dsidev); | ||
320 | break; | ||
316 | default: | 321 | default: |
317 | BUG(); | 322 | BUG(); |
318 | } | 323 | } |
@@ -324,7 +329,8 @@ void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src) | |||
324 | dss.dispc_clk_source = clk_src; | 329 | dss.dispc_clk_source = clk_src; |
325 | } | 330 | } |
326 | 331 | ||
327 | void dss_select_dsi_clk_source(enum omap_dss_clk_source clk_src) | 332 | void dss_select_dsi_clk_source(int dsi_module, |
333 | enum omap_dss_clk_source clk_src) | ||
328 | { | 334 | { |
329 | struct platform_device *dsidev; | 335 | struct platform_device *dsidev; |
330 | int b; | 336 | int b; |
@@ -334,17 +340,24 @@ void dss_select_dsi_clk_source(enum omap_dss_clk_source clk_src) | |||
334 | b = 0; | 340 | b = 0; |
335 | break; | 341 | break; |
336 | case OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI: | 342 | case OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI: |
343 | BUG_ON(dsi_module != 0); | ||
337 | b = 1; | 344 | b = 1; |
338 | dsidev = dsi_get_dsidev_from_id(0); | 345 | dsidev = dsi_get_dsidev_from_id(0); |
339 | dsi_wait_pll_hsdiv_dsi_active(dsidev); | 346 | dsi_wait_pll_hsdiv_dsi_active(dsidev); |
340 | break; | 347 | break; |
348 | case OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI: | ||
349 | BUG_ON(dsi_module != 1); | ||
350 | b = 1; | ||
351 | dsidev = dsi_get_dsidev_from_id(1); | ||
352 | dsi_wait_pll_hsdiv_dsi_active(dsidev); | ||
353 | break; | ||
341 | default: | 354 | default: |
342 | BUG(); | 355 | BUG(); |
343 | } | 356 | } |
344 | 357 | ||
345 | REG_FLD_MOD(DSS_CONTROL, b, 1, 1); /* DSI_CLK_SWITCH */ | 358 | REG_FLD_MOD(DSS_CONTROL, b, 1, 1); /* DSI_CLK_SWITCH */ |
346 | 359 | ||
347 | dss.dsi_clk_source = clk_src; | 360 | dss.dsi_clk_source[dsi_module] = clk_src; |
348 | } | 361 | } |
349 | 362 | ||
350 | void dss_select_lcd_clk_source(enum omap_channel channel, | 363 | void dss_select_lcd_clk_source(enum omap_channel channel, |
@@ -366,6 +379,12 @@ void dss_select_lcd_clk_source(enum omap_channel channel, | |||
366 | dsidev = dsi_get_dsidev_from_id(0); | 379 | dsidev = dsi_get_dsidev_from_id(0); |
367 | dsi_wait_pll_hsdiv_dispc_active(dsidev); | 380 | dsi_wait_pll_hsdiv_dispc_active(dsidev); |
368 | break; | 381 | break; |
382 | case OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC: | ||
383 | BUG_ON(channel != OMAP_DSS_CHANNEL_LCD2); | ||
384 | b = 1; | ||
385 | dsidev = dsi_get_dsidev_from_id(1); | ||
386 | dsi_wait_pll_hsdiv_dispc_active(dsidev); | ||
387 | break; | ||
369 | default: | 388 | default: |
370 | BUG(); | 389 | BUG(); |
371 | } | 390 | } |
@@ -382,9 +401,9 @@ enum omap_dss_clk_source dss_get_dispc_clk_source(void) | |||
382 | return dss.dispc_clk_source; | 401 | return dss.dispc_clk_source; |
383 | } | 402 | } |
384 | 403 | ||
385 | enum omap_dss_clk_source dss_get_dsi_clk_source(void) | 404 | enum omap_dss_clk_source dss_get_dsi_clk_source(int dsi_module) |
386 | { | 405 | { |
387 | return dss.dsi_clk_source; | 406 | return dss.dsi_clk_source[dsi_module]; |
388 | } | 407 | } |
389 | 408 | ||
390 | enum omap_dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel) | 409 | enum omap_dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel) |
@@ -715,7 +734,8 @@ static int dss_init(void) | |||
715 | 734 | ||
716 | dss.dpll4_m4_ck = dpll4_m4_ck; | 735 | dss.dpll4_m4_ck = dpll4_m4_ck; |
717 | 736 | ||
718 | dss.dsi_clk_source = OMAP_DSS_CLK_SRC_FCK; | 737 | dss.dsi_clk_source[0] = OMAP_DSS_CLK_SRC_FCK; |
738 | dss.dsi_clk_source[1] = OMAP_DSS_CLK_SRC_FCK; | ||
719 | dss.dispc_clk_source = OMAP_DSS_CLK_SRC_FCK; | 739 | dss.dispc_clk_source = OMAP_DSS_CLK_SRC_FCK; |
720 | dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK; | 740 | dss.lcd_clk_source[0] = OMAP_DSS_CLK_SRC_FCK; |
721 | dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK; | 741 | dss.lcd_clk_source[1] = OMAP_DSS_CLK_SRC_FCK; |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 90b4d51dcd6c..3e6dbd544dc0 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -240,11 +240,12 @@ int dss_sdi_enable(void); | |||
240 | void dss_sdi_disable(void); | 240 | void dss_sdi_disable(void); |
241 | 241 | ||
242 | void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src); | 242 | void dss_select_dispc_clk_source(enum omap_dss_clk_source clk_src); |
243 | void dss_select_dsi_clk_source(enum omap_dss_clk_source clk_src); | 243 | void dss_select_dsi_clk_source(int dsi_module, |
244 | enum omap_dss_clk_source clk_src); | ||
244 | void dss_select_lcd_clk_source(enum omap_channel channel, | 245 | void dss_select_lcd_clk_source(enum omap_channel channel, |
245 | enum omap_dss_clk_source clk_src); | 246 | enum omap_dss_clk_source clk_src); |
246 | enum omap_dss_clk_source dss_get_dispc_clk_source(void); | 247 | enum omap_dss_clk_source dss_get_dispc_clk_source(void); |
247 | enum omap_dss_clk_source dss_get_dsi_clk_source(void); | 248 | enum omap_dss_clk_source dss_get_dsi_clk_source(int dsi_module); |
248 | enum omap_dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel); | 249 | enum omap_dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel); |
249 | 250 | ||
250 | void dss_set_venc_output(enum omap_dss_venc_type type); | 251 | void dss_set_venc_output(enum omap_dss_venc_type type); |
@@ -275,12 +276,18 @@ static inline void sdi_exit(void) | |||
275 | 276 | ||
276 | /* DSI */ | 277 | /* DSI */ |
277 | #ifdef CONFIG_OMAP2_DSS_DSI | 278 | #ifdef CONFIG_OMAP2_DSS_DSI |
279 | |||
280 | struct dentry; | ||
281 | struct file_operations; | ||
282 | |||
278 | int dsi_init_platform_driver(void); | 283 | int dsi_init_platform_driver(void); |
279 | void dsi_uninit_platform_driver(void); | 284 | void dsi_uninit_platform_driver(void); |
280 | 285 | ||
281 | void dsi_dump_clocks(struct seq_file *s); | 286 | void dsi_dump_clocks(struct seq_file *s); |
282 | void dsi_dump_irqs(struct seq_file *s); | 287 | void dsi_create_debugfs_files_irq(struct dentry *debugfs_dir, |
283 | void dsi_dump_regs(struct seq_file *s); | 288 | const struct file_operations *debug_fops); |
289 | void dsi_create_debugfs_files_reg(struct dentry *debugfs_dir, | ||
290 | const struct file_operations *debug_fops); | ||
284 | 291 | ||
285 | void dsi_save_context(void); | 292 | void dsi_save_context(void); |
286 | void dsi_restore_context(void); | 293 | void dsi_restore_context(void); |
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c index 66f87112b67b..5be5eb0f1496 100644 --- a/drivers/video/omap2/dss/dss_features.c +++ b/drivers/video/omap2/dss/dss_features.c | |||
@@ -193,6 +193,8 @@ static const char * const omap4_dss_clk_source_names[] = { | |||
193 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "PLL1_CLK1", | 193 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "PLL1_CLK1", |
194 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "PLL1_CLK2", | 194 | [OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "PLL1_CLK2", |
195 | [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK", | 195 | [OMAP_DSS_CLK_SRC_FCK] = "DSS_FCLK", |
196 | [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC] = "PLL2_CLK1", | ||
197 | [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "PLL2_CLK2", | ||
196 | }; | 198 | }; |
197 | 199 | ||
198 | static const struct dss_param_range omap2_dss_param_range[] = { | 200 | static const struct dss_param_range omap2_dss_param_range[] = { |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 91290656c315..e3c9e0813f54 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -179,6 +179,8 @@ enum omap_dss_clk_source { | |||
179 | * OMAP4: PLL1_CLK1 */ | 179 | * OMAP4: PLL1_CLK1 */ |
180 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK | 180 | OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI, /* OMAP3: DSI2_PLL_FCLK |
181 | * OMAP4: PLL1_CLK2 */ | 181 | * OMAP4: PLL1_CLK2 */ |
182 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC, /* OMAP4: PLL2_CLK1 */ | ||
183 | OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */ | ||
182 | }; | 184 | }; |
183 | 185 | ||
184 | /* RFBI */ | 186 | /* RFBI */ |