From patchwork Sat Nov 3 10:08:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10666653 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 C074D13B5 for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF3B82883F for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A355828915; Sat, 3 Nov 2018 14:23:38 +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 640812883F for ; Sat, 3 Nov 2018 14:23:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F6456EED1; Sat, 3 Nov 2018 14:23:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D41A6E681 for ; Sat, 3 Nov 2018 10:09:37 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id p7-v6so2140676plk.5 for ; Sat, 03 Nov 2018 03:09:37 -0700 (PDT) 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=YhcdTaqekiJ1IH3Njt5SqmOCHXO4U7AWqNWukgHaAi8=; b=XHMZ1vJAm/LTovDCoBDZKOIz4CK0O69vTaLotzS2h5iNu2H7xNsWeOMo6ssrq3jljL +TSv7McPifS+5vzNMGd2IBPBylsZgxjOp8kChNYBiqBjcwb8AgyVv83jlkwQtBDFAd5U hh0tYz87+Tu4xEtL4p9pZHsmlGeTgSCOL1FRp+Goz2Z5S8KsGUnhALeAuON3LBUKWkHt TeBcPqzDLCEXovxORslKHN8azFiV1A/jZ7g9myOgDvi6xRRCBv/beL1dBRSEcCx71HsT q11hGTQ4GPHILok6nXHRGE3J1oAt4eJWvPppqAbrmta9Pf0fJ7Nb5P/cX1A5WfOcUOvd Smpw== X-Gm-Message-State: AGRZ1gJQsFyI2+xxBuyE7j88Ogyh+0uwrBHpiW2ZidUG/SouvJcalC6A lHllXDZCnNM2wojpSTdXnzXr4w== X-Google-Smtp-Source: AJdET5fUxfrFit8SCslEnOy9JQ2bunA85HTt2862WrZQENW8wd5fo1Lk7lp2wBJKv5WizrufHateGA== X-Received: by 2002:a17:902:a9c5:: with SMTP id b5-v6mr14826077plr.340.1541239776608; Sat, 03 Nov 2018 03:09:36 -0700 (PDT) Received: from localhost.localdomain ([2405:204:6094:3f7a:ed0a:fb74:1220:defe]) by smtp.gmail.com with ESMTPSA id z79-v6sm28466823pfl.33.2018.11.03.03.09.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Nov 2018 03:09:36 -0700 (PDT) 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 Subject: [PATCH 02/10] drm/sun4i: sun6i_mipi_dsi: Support instruction loop selection Date: Sat, 3 Nov 2018 15:38:52 +0530 Message-Id: <20181103100900.30313-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181103100900.30313-1-jagan@amarulasolutions.com> References: <20181103100900.30313-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 03 Nov 2018 14:23:26 +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 Instruction loop selection would require before writing loop number registers, so enable idle, LP11 bits on loop selection register. Reference code available in BSP (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) (dsi_dev[sel]->dsi_inst_loop_sel.dwval = 2<<(4*DSI_INST_ID_LP11) | 3<<(4*DSI_INST_ID_DLY); Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index da152c21ec62..077b57ec964c 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -397,6 +397,10 @@ static void sun6i_dsi_setup_inst_loop(struct sun6i_dsi *dsi, struct mipi_dsi_device *device = dsi->device; u16 delay; + regmap_write(dsi->regs, SUN6I_DSI_INST_LOOP_SEL_REG, + DSI_INST_ID_HSC << (4 * DSI_INST_ID_LP11) | + DSI_INST_ID_HSD << (4 * DSI_INST_ID_DLY)); + if (device->mode_flags == MIPI_DSI_MODE_VIDEO_BURST) delay = (((mode->htotal - mode->hdisplay) * 150) / ((mode->clock / 1000) * 8)) - 50;