From patchwork Fri Nov 16 16:39:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10686671 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 92D3B13BF for ; Fri, 16 Nov 2018 16:42:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F3202CE5D for ; Fri, 16 Nov 2018 16:42:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 738D82CE5F; Fri, 16 Nov 2018 16:42:24 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C6F82CE5D for ; Fri, 16 Nov 2018 16:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8QjTui3N7HKpxUou+nvvWwEVvJpqBuVN0axfwj2t7Vw=; b=aLy1gxwRyn69dV Me6oguzbuCIRo43fDzj3dwtrKqqNe1in1DIZ//KxY/X2w+8miPG+VCgKCaD2NHn+4/mY9vgxXaUXl I/oB77AYeiNoD/VkPL3LdlA2bM7Sdkcg/gJq7pXElmbg1zbTudtBlEwafLGiUSQ1brC6T2QEEk4p5 fjoaNHu8ljeUU5NiQmmGLj26Dxm3xZQ34MecOp1pnsAN5hcyynNvEGsWuwWWbvPs3sC45oZE8X/Fn 50LpgRhi1fDY0UwvrcBDrR55/ehEOr0FM6DAiznkoy1VYbeGCudMDz3VOhe/zagcBv6oBv98YAZJV aRiBVc0+JL112iQUhsNw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNhCH-0007bj-By; Fri, 16 Nov 2018 16:42:21 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNhAn-00065N-4F for linux-arm-kernel@lists.infradead.org; Fri, 16 Nov 2018 16:40:55 +0000 Received: by mail-pl1-x642.google.com with SMTP id b22-v6so5961502pls.7 for ; Fri, 16 Nov 2018 08:40:38 -0800 (PST) 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=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=JqGzCIoFyPGvPhj/7yVhIdSIJM9/6pIgB2WfsDcwm0YEUsFfpQ2o0uL5x1pLewAvoD AQry88+ddoeIdHts+ZsCdpOR7T1ax6UfJS9bZau8xCb6D/Ho1KlxmaAkWnKPj1X+sY6/ WPHgI8U4FwSjx5KUDn2pvhExjgQ+XRwT3fKKU= 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=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=IVZeh5XVPhar7O/PhP6qCgKvxHu1yXMHiVIj1VLoO1tJBMS9oMLJLNPOgRslwvRsrw nH7Lwrlk9kYMJiWinSbNvNL7TGIx0IXkW7g7W5vVf1i8/Zkdsgm6p5oHyNaUrngic5JZ 3mubIth0AkHvAWbgZ0RnW1ZbPTJqxNPfV2KrgD8osKOvT7uYs2bZCulwegsTXUNxmkm7 x7ZGv7WYDhTW34yaGF2cVQNSL5dIUxLPG+dnTOMktLKR/JNxVjAfqcjTxXAuBEOAl5Ig IXi+ko/03nrJembenMc477Pa6OZTc70WgiKyn4cfN3/y0CrJiTjvA3ndu+gZNgroMCNN tpeg== X-Gm-Message-State: AGRZ1gLs2Bix7Y88j2HW6XFKdWk/RQtAx846XlOCJU2T+yvJw+NbbbrN x0At0NspJZq7jOl4hkaK19oppQ== X-Google-Smtp-Source: AJdET5cJl6/+xSmjk5mp7v3sI+9nYFc1w0XeY5fZhf9YNXpRVnC38Q2TJoyWRsAPtM3SsC+RGhl3Cg== X-Received: by 2002:a17:902:4025:: with SMTP id b34-v6mr11739165pld.318.1542386437932; Fri, 16 Nov 2018 08:40:37 -0800 (PST) Received: from localhost.localdomain ([115.97.190.86]) by smtp.gmail.com with ESMTPSA id p5-v6sm34622213pfb.109.2018.11.16.08.40.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 08:40:37 -0800 (PST) From: Jagan Teki To: Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Rob Herring , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Thierry Reding , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Trimarchi , TL Lim , linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Subject: [PATCH v2 08/12] drm/sun4i: sun6i_mipi_dsi: Enable 2byte trail for 4-lane burst mode Date: Fri, 16 Nov 2018 22:09:12 +0530 Message-Id: <20181116163916.29621-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181116163916.29621-1-jagan@amarulasolutions.com> References: <20181116163916.29621-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181116_084049_179548_059600B1 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For 4-lane, burst mode panels would need to enable 2byte trail_fill along with filling trail_env in dsi base control register. Similar 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 --- 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 0182408f8932..22d2987c3298 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) @@ -559,6 +561,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); }