From patchwork Thu Feb 14 19:32:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10813645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F9AE17E0 for ; Thu, 14 Feb 2019 19:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EDF02EF29 for ; Thu, 14 Feb 2019 19:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 237242EF33; Thu, 14 Feb 2019 19:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D24532EF29 for ; Thu, 14 Feb 2019 19:33:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF9F66EABA; Thu, 14 Feb 2019 19:33:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id C54366EABA for ; Thu, 14 Feb 2019 19:33:22 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id r11so3552808pgp.6 for ; Thu, 14 Feb 2019 11:33:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=19y3NFakPeHXY1zH8KnDf83WNrHHUKHDkZ84jCJtIp4=; b=HRzwyw4WPIlDtK4E14hw3m6W3K0OpfPx5Tpha/O0D9eOASGgPQ5lTKKIY9btXNgcDg BCP+i+94VS65774kkqUVXge5UiSyzltBcWlNF6SdZZcLdvpF2v0eTRprS6BrS7YX+N7U n3BQ3/uyNB5651SSE4XUmBoaUhQu7S0QnctWcmXWS9hfPNMGUOvaVbntMVFBb7zL3tnC 7RHIpMaE8GphFjTydvtFy02tEM47+4NPhm1PCT6VzbAvJnfxPXlG3+2uapE0ELXFIkKK hdd1WmRgMEp2VX5Rzlm/YWu+UWnMyaImmQ+hDcTj9H7sxWjKsrcpLxRmu+NyVfseO2+r 9cUw== X-Gm-Message-State: AHQUAuZSXU0fwVEQiU3xjhNuugSefeWdL5W53YLIb7chRFJdtebTMbZS 9ANdU9M0LYBs4agVfANu93jh7w== X-Google-Smtp-Source: AHgI3IaiQm+AOueGS0W7QlK2nb6SV5QrYhhCcGjVaQOI8XBvu5vulXxgbm/qCrHac+tB3G2fAiUu3A== X-Received: by 2002:a63:8b43:: with SMTP id j64mr1458946pge.332.1550172802340; Thu, 14 Feb 2019 11:33:22 -0800 (PST) Received: from localhost.localdomain ([115.97.184.151]) by smtp.gmail.com with ESMTPSA id o23sm10808832pfa.140.2019.02.14.11.33.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 11:33:21 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai Subject: [PATCH v8 09/10] drm/sun4i: sun6i_mipi_dsi: Enable trail_inv and trail_fill controls Date: Fri, 15 Feb 2019 01:02:36 +0530 Message-Id: <20190214193236.7504-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190214193236.7504-1-jagan@amarulasolutions.com> References: <20190214193236.7504-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=19y3NFakPeHXY1zH8KnDf83WNrHHUKHDkZ84jCJtIp4=; b=G6kR7dmHa4ZyWHpN3fO0+0fN7GZ6QTCxKC2gsrRJZ4n7Rpa3N98OGiZMpah9yIffl2 KxaQJZdscp+9MXf3VA2OC7nVh7fC7mpuJGLNrD3jJ70b29DsO3NxhqcsGsGqXXAzNQLq I2eI0p1717HVSVxkb6F803/d/HsF5Fv4QZ8FY= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The burst mode panels with 4-lane would require to enable trail bits in DSI basic control register. So, enable 2byte trail and trail_env for 4-lane burst mode devices. Allwinner A64 BSP should also relie on same setup for enabling trail bit in DSI controller. Reference code avialable in BSP (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) if (panel->lcd_dsi_lane == 4) { dsi_dev[sel]->dsi_basic_ctl.bits.trail_inv = 0xc; dsi_dev[sel]->dsi_basic_ctl.bits.trail_fill = 1; } Signed-off-by: Jagan Teki Tested-by: Merlijn Wajer --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 63b83b47cf0d..ec9424b6da9e 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -34,6 +34,8 @@ #define SUN6I_DSI_CTL_EN BIT(0) #define SUN6I_DSI_BASIC_CTL_REG 0x00c +#define SUN6I_DSI_BASIC_CTL_TRAIL_INV(n) (((n) & 0xf) << 4) +#define SUN6I_DSI_BASIC_CTL_TRAIL_FILL BIT(3) #define SUN6I_DSI_BASIC_CTL_HBP_DIS BIT(2) #define SUN6I_DSI_BASIC_CTL_HSA_HSE_DIS BIT(1) #define SUN6I_DSI_BASIC_CTL_VIDEO_BURST BIT(0) @@ -482,6 +484,10 @@ static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi, /* enable burst mode */ regmap_read(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, &val); val |= SUN6I_DSI_BASIC_CTL_VIDEO_BURST; + if (device->lanes == 4) { + val |= SUN6I_DSI_BASIC_CTL_TRAIL_INV(0xc); + val |= SUN6I_DSI_BASIC_CTL_TRAIL_FILL; + } regmap_write(dsi->regs, SUN6I_DSI_BASIC_CTL_REG, val); }