aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-09-05 15:15:03 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-02-04 05:32:06 -0500
commit0006fd63d1fbb5deb29ced23da1580036afabe97 (patch)
treebcdcdc1d070c83d921a8743c619ecc725ba2a6a5 /drivers/video
parent935509275c2d315c6551da4d73bb3c36871b137c (diff)
OMAPDSS: DISPC: program dispc polarities to control module
On DRA7xx, DISPC needs to write output signal polarities not only to a DISPC register, like for all earlier DSS versions, but to control module's CTRL_CORE_SMA_SW_1 register. This patch adds support to write the polarities to control module. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/omap2/dss/dispc.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index 48429bab294a..31b743c70272 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -36,6 +36,9 @@
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/pm_runtime.h> 37#include <linux/pm_runtime.h>
38#include <linux/sizes.h> 38#include <linux/sizes.h>
39#include <linux/mfd/syscon.h>
40#include <linux/regmap.h>
41#include <linux/of.h>
39 42
40#include <video/omapdss.h> 43#include <video/omapdss.h>
41 44
@@ -117,6 +120,9 @@ static struct {
117 const struct dispc_features *feat; 120 const struct dispc_features *feat;
118 121
119 bool is_enabled; 122 bool is_enabled;
123
124 struct regmap *syscon_pol;
125 u32 syscon_pol_offset;
120} dispc; 126} dispc;
121 127
122enum omap_color_component { 128enum omap_color_component {
@@ -2958,6 +2964,25 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
2958 FLD_VAL(vsync_level, 12, 12); 2964 FLD_VAL(vsync_level, 12, 12);
2959 2965
2960 dispc_write_reg(DISPC_POL_FREQ(channel), l); 2966 dispc_write_reg(DISPC_POL_FREQ(channel), l);
2967
2968 if (dispc.syscon_pol) {
2969 const int shifts[] = {
2970 [OMAP_DSS_CHANNEL_LCD] = 0,
2971 [OMAP_DSS_CHANNEL_LCD2] = 1,
2972 [OMAP_DSS_CHANNEL_LCD3] = 2,
2973 };
2974
2975 u32 mask, val;
2976
2977 mask = (1 << 0) | (1 << 3) | (1 << 6);
2978 val = (rf << 0) | (ipc << 3) | (onoff << 6);
2979
2980 mask <<= 16 + shifts[channel];
2981 val <<= 16 + shifts[channel];
2982
2983 regmap_update_bits(dispc.syscon_pol, dispc.syscon_pol_offset,
2984 mask, val);
2985 }
2961} 2986}
2962 2987
2963/* change name to mode? */ 2988/* change name to mode? */
@@ -3741,6 +3766,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
3741 u32 rev; 3766 u32 rev;
3742 int r = 0; 3767 int r = 0;
3743 struct resource *dispc_mem; 3768 struct resource *dispc_mem;
3769 struct device_node *np = pdev->dev.of_node;
3744 3770
3745 dispc.pdev = pdev; 3771 dispc.pdev = pdev;
3746 3772
@@ -3767,6 +3793,20 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
3767 return -ENODEV; 3793 return -ENODEV;
3768 } 3794 }
3769 3795
3796 if (np && of_property_read_bool(np, "syscon-pol")) {
3797 dispc.syscon_pol = syscon_regmap_lookup_by_phandle(np, "syscon-pol");
3798 if (IS_ERR(dispc.syscon_pol)) {
3799 dev_err(&pdev->dev, "failed to get syscon-pol regmap\n");
3800 return PTR_ERR(dispc.syscon_pol);
3801 }
3802
3803 if (of_property_read_u32_index(np, "syscon-pol", 1,
3804 &dispc.syscon_pol_offset)) {
3805 dev_err(&pdev->dev, "failed to get syscon-pol offset\n");
3806 return -EINVAL;
3807 }
3808 }
3809
3770 pm_runtime_enable(&pdev->dev); 3810 pm_runtime_enable(&pdev->dev);
3771 3811
3772 r = dispc_runtime_get(); 3812 r = dispc_runtime_get();