Am 19.05.2015 um 07:59 schrieb Tomi Valkeinen tomi.valkeinen@ti.com:
On 19/05/15 08:56, Dr. H. Nikolaus Schaller wrote:
Hi Tomi,
Am 19.05.2015 um 07:47 schrieb Tomi Valkeinen tomi.valkeinen@ti.com:
On 19/05/15 08:42, Dr. H. Nikolaus Schaller wrote:
No need.
Well, we have a need - we can’t compile mainline without this patch… I think mainline must not necessarily work, but should at least compile without errors.
Mainline kernel compiles fine. It does not have the code that fails to compile. You only have it in your tree.
Hm. Which one? I have checked the diffs but did not find it.
Probably something like "ARM: OMAP: add OMAP5 DSI muxing". That's the patch in my work-in-progress branch that adds the now-broken code that uses omap4_ctrl_pad_readl/writel.
Ah, you are right. I did only look for diffs in drivers/video/fbdev/omap2 because we have tried to reduce all unnecessary diffs to mainline.
But it is an extension of omap_dsi_enable_pads() completely wrapped inside of arch/arm/mach-omap2/display.c and we have not yet looked at that file.
Then of course it is not (yet) in mainline. On the other hand it would be nice to see it there… You can add me as “tested by”. Our complete diff is attached.
BR and thanks, Nikolaus
iMac:master hns$ git diff v4.1-rc3 -- arch/arm/mach-omap2/display.c diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index f492ae1..31841f8 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -107,8 +107,10 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = { };
#define OMAP4_DSIPHY_SYSCON_OFFSET 0x78 +#define OMAP5_DSIPHY_SYSCON_OFFSET 0x74
static struct regmap *omap4_dsi_mux_syscon; +static struct regmap *omap5_dsi_mux_syscon;
static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) { @@ -143,11 +145,33 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) return 0; }
+static int omap5_dsi_mux_pads(int dsi_id, unsigned lanes) +{ + u32 enable_mask, enable_shift, reg; + + if (dsi_id == 0) + enable_shift = 24; + else if (dsi_id == 1) + enable_shift = 19; + else + return -ENODEV; + + enable_mask = 0x1f << enable_shift; + + regmap_read(omap5_dsi_mux_syscon, OMAP5_DSIPHY_SYSCON_OFFSET, ®); + reg &= ~enable_mask; + reg |= (lanes << enable_shift) & enable_mask; + regmap_write(omap5_dsi_mux_syscon, OMAP5_DSIPHY_SYSCON_OFFSET, reg); + + return 0; +} + static int omap_dsi_enable_pads(int dsi_id, unsigned lane_mask) { if (cpu_is_omap44xx()) return omap4_dsi_mux_pads(dsi_id, lane_mask); - + else if (soc_is_omap54xx()) + return omap5_dsi_mux_pads(dsi_id, lane_mask); return 0; }
@@ -155,6 +179,8 @@ static void omap_dsi_disable_pads(int dsi_id, unsigned lane_mask) { if (cpu_is_omap44xx()) omap4_dsi_mux_pads(dsi_id, 0); + else if (soc_is_omap54xx()) + omap5_dsi_mux_pads(dsi_id, 0); }
static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput) @@ -676,5 +702,10 @@ int __init omapdss_init_of(void) if (node) omap4_dsi_mux_syscon = syscon_node_to_regmap(node);
+ /* add DSI info for omap5 */ + node = of_find_node_by_name(NULL, "omap5_padconf_global"); + if (node) + omap5_dsi_mux_syscon = syscon_node_to_regmap(node); + return 0; } iMac:master hns$