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: 10687497 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 D942A14E2 for ; Sat, 17 Nov 2018 14:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C96ED2B902 for ; Sat, 17 Nov 2018 14:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDCE32B905; Sat, 17 Nov 2018 14:56:50 +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 7B76D2B902 for ; Sat, 17 Nov 2018 14:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7994D6E971; Sat, 17 Nov 2018 14:56:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by gabe.freedesktop.org (Postfix) with ESMTPS id 69A566E6FA for ; Fri, 16 Nov 2018 16:40:38 +0000 (UTC) Received: by mail-pl1-x642.google.com with SMTP id z23so166434plo.0 for ; Fri, 16 Nov 2018 08:40:38 -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=xQWYOyjdRmGs9UhZs6bBgbQ0IL6akLwNeZEkqRrFzQQ=; b=cPipzSeBpG+dWYnHtIxyMMtffdmfJuDOr8V7r7tryjHYDJ8qMVYmWcGrlS0nti1lA0 3bPiNRKLPlLe09T6ZYnGG9Xu4kvvonWceqRSbmsdP5O048mDjxP2IfJ5neMDCSbydJp3 0QDvgMncn0SZuh7NZAYAxlg1V8SePslDUeBrmmk51RKL34sHMOUxqp89TJ/ZINYw+0+g gdZ9UU/UG/R7UDmSXJZlD64VyvEXfEJQBrJf6jpDXWTFKGVbwiltl+4ToD1ztsNQYwIu famYkG7MN2+YLXRXgsjHz1GA2eQPpQ+3n8DSkAncn9NMf0fKwGeG2rdLl3+fB5+UQiPw yZSw== X-Gm-Message-State: AGRZ1gLfcOQ6KtwfhRTfq6pdlz+t6mwGrQLeN1HKEPC8WEwpj+1eX3pq a3Q/Aqc0z1oGDa4MRM4cRGnidQ== 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-Mailman-Approved-At: Sat, 17 Nov 2018 14:56:24 +0000 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: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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); }