From patchwork Thu Apr 24 10:17:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 4048031 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 82A479F3E2 for ; Thu, 24 Apr 2014 10:20:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B31D8202A1 for ; Thu, 24 Apr 2014 10:20:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F5DE20279 for ; Thu, 24 Apr 2014 10:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755328AbaDXKTJ (ORCPT ); Thu, 24 Apr 2014 06:19:09 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:59015 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbaDXKTD (ORCPT ); Thu, 24 Apr 2014 06:19:03 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3OAIf2v023406; Thu, 24 Apr 2014 05:18:41 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3OAIfWB021205; Thu, 24 Apr 2014 05:18:41 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 24 Apr 2014 05:18:41 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3OAISls009835; Thu, 24 Apr 2014 05:18:39 -0500 From: Tomi Valkeinen To: Archit Taneja , , , CC: Tomi Valkeinen , Tony Lindgren Subject: [PATCH 06/23] ARM: OMAP: add OMAP5 DSI muxing Date: Thu, 24 Apr 2014 13:17:02 +0300 Message-ID: <1398334639-14172-7-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1398334639-14172-1-git-send-email-tomi.valkeinen@ti.com> References: <1398334639-14172-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support to set OMAP5 DSI pin muxing. Signed-off-by: Tomi Valkeinen Cc: Tony Lindgren --- arch/arm/mach-omap2/display.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 16d33d831287..974461441fc3 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -137,11 +137,42 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes) return 0; } +#define CONTROL_PAD_BASE 0x4A002800 +#define CONTROL_DSIPHY 0x614 + +static int omap5_dsi_mux_pads(int dsi_id, unsigned lanes) +{ + u32 enable_mask, enable_shift, reg; + void __iomem *ctrl_pad_base = NULL; + + ctrl_pad_base = ioremap(CONTROL_PAD_BASE, SZ_4K); + if (!ctrl_pad_base) + return -ENXIO; + + if (dsi_id == 0) { + enable_mask = OMAP4_DSI1_LANEENABLE_MASK; + enable_shift = OMAP4_DSI1_LANEENABLE_SHIFT; + } else if (dsi_id == 1) { + enable_mask = OMAP4_DSI2_LANEENABLE_MASK; + enable_shift = OMAP4_DSI2_LANEENABLE_SHIFT; + } else { + return -ENODEV; + } + + reg = __raw_readl(ctrl_pad_base + CONTROL_DSIPHY); + reg &= ~enable_mask; + reg |= (lanes << enable_shift) & enable_mask; + __raw_writel(reg, ctrl_pad_base + CONTROL_DSIPHY); + + 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; } @@ -149,6 +180,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)