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: 10793063 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 85CAC159A for ; Fri, 1 Feb 2019 15:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7346832203 for ; Fri, 1 Feb 2019 15:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 677C73220E; Fri, 1 Feb 2019 15:45:20 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 0A4A532203 for ; Fri, 1 Feb 2019 15:45:20 +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=ROLM/R2Vzt8/9r0AY8m6OjMxnrj/80Yn9Wf0bb+S9GE=; b=Hlljti5tF99dzl PjCLY5fO1IxWwexqnJyMtAuPu3ti1PwuY96e/zr8imAKHW7JT9e6H92Tsc73hfAduzIpkOYngO1e0 +RVFtHPLEX38nKCwkhKMZnkA4iX6/ug+tYoWCZ0b8Pd0k6EFKMVloSz3CaHha0T0/0EzxYXXVjL/7 GQJBUfq34jXzAvwZtCkdpxt/ean8HpMpikBGwCvif1ujIDM6hsAeaox2vJEBjhYOnPm8q+WxuLO0k ia63mNwvNJNfG64eiXBJMEW5EjOhKRE4/ACUdx2qz6f/9rcxFKqb4otVuzy1XFQKwCEnz9nbuU02K ayjlTleJVdc3avPkYF6A==; 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 1gpb0I-0004oK-J1; Fri, 01 Feb 2019 15:45:18 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpay4-0002DY-Mn for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2019 15:43:08 +0000 Received: by mail-lf1-x141.google.com with SMTP id i26so5420977lfc.0 for ; Fri, 01 Feb 2019 07:43:00 -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=gORzC+7uOkm6SDlV79rtmniK+blmBQB95TGr01AJrAfGW3EzaxcY6QOUkRodQGFsTL e2c8UfcT9OyUAEo/ZXG32Rm7k3QluHEQEmM4r6tVBinzr4zSKLPSE4OKJSf2ZQqngjXr VIqofN/M3l/zUsjbDQJXbIN2UPbDOP7UmVpC49+bpx7K+mxncZ4w7aQSveh+5JhOaZey Zc57o4Kee5fclvTWwH/+2asuHJRgTD3Nw3PTqizh5xZ+H/Fv8qaDPTSULT65p1AlBjsF E1WY4YoYz5mVjMbL9jrhPMj4fzKJjAxQ8y7cDdQNh7inz5T4aOc3L4MozUAXrcqWgg18 FhOQ== X-Gm-Message-State: AJcUukf6P7wj1/KFIL4G2NtVzL5OkoYo/ozlLAisrHQ9/mtfrEW4lXyC 7IBsV4S9T5twVjBC/eVeev3JQw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190201_074301_352444_29FFC14B X-CRM114-Status: GOOD ( 12.25 ) 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: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Jagan Teki , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 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); }