From patchwork Fri Feb 1 15:42:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10793097 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 567EE159A for ; Fri, 1 Feb 2019 15:46:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4678A32203 for ; Fri, 1 Feb 2019 15:46:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A075322BE; Fri, 1 Feb 2019 15:46:58 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D892232203 for ; Fri, 1 Feb 2019 15:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730505AbfBAPnF (ORCPT ); Fri, 1 Feb 2019 10:43:05 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37406 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728794AbfBAPnB (ORCPT ); Fri, 1 Feb 2019 10:43:01 -0500 Received: by mail-lf1-f68.google.com with SMTP id n23so38254lfl.4 for ; Fri, 01 Feb 2019 07:42:59 -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=84THfXXcgvHcJWr1/uOYg32V3kLlV4Ule+FUJsuojRc=; b=L5Yb0b0JI9GGktwopEnSvepURroFbEHVxRtM15IoDKL1JhwJG3ZBwGQgJ2sh3Rw5TA iDnws8KdDnCZMRbe+mXF69inQx7rAj9LpRRoXCzEOHZ8qyoDBHVXGo5T0GGAVuQsJbx/ kCmLrxPE+erOMMqggrGIWCRrZH6tHpGsSk1N4= 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=84THfXXcgvHcJWr1/uOYg32V3kLlV4Ule+FUJsuojRc=; b=QAnVnYB3ivEaz1dN5J/4JsV4tsdfztUA/rI31gqoVSIULZIjciKNOxTvo5cjigr5g2 93t9XuZNqCcDWzoqXDgEf2QlkE4Ig8uImQFT+o47HHNBtGSdnyVrHimKipqWpcBoYlzh /8jxVvSRGO2BTptYvUNskvcobSJOgVpm1ySLQ0PfStH3gXBgJqE/bnWvqEF22yp9keqn 3njmZUJA6LCqAWYSBnWg7WKfCZjx7rBOumWKINpWyqUKtn1CL+VPfdHozxHFv6Y487Um WpwYa9yTSLOdLbPmVeaxnUhVlvUJoHh8Q3JkSwnZIXhuvwudt1BC6WqQHmF4S+pegTek yvaA== X-Gm-Message-State: AJcUukcl3IkNQiByuBK/NJ3qQaXorSkszugM5486XcXVuvnAk+jwjGEr atDN36iZlwMGAhFwkLy9vjDFmw== X-Google-Smtp-Source: ALg8bN7eWAS4XWIfCIU/GKq6nDCT+Mcco6ruQsm5PRsdG39i7pjM42SH4WVYRmLXcxOYg7dqPiZlSw== X-Received: by 2002:a19:db82:: with SMTP id t2mr30736640lfi.130.1549035779099; Fri, 01 Feb 2019 07:42:59 -0800 (PST) Received: from localhost.localdomain ([217.76.202.68]) by smtp.gmail.com with ESMTPSA id i13-v6sm1305712ljg.82.2019.02.01.07.42.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 07:42:58 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v7 08/23] drm/sun4i: sun6i_mipi_dsi: Enable trail_inv and trail_fill controls Date: Fri, 1 Feb 2019 21:12:17 +0530 Message-Id: <20190201154232.10505-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190201154232.10505-1-jagan@amarulasolutions.com> References: <20190201154232.10505-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org 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 46ad142e66e8..a2ad9fa7f8d5 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -33,6 +33,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) @@ -464,6 +466,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); }