From patchwork Wed Aug 30 18:07:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9930453 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7B0F560383 for ; Wed, 30 Aug 2017 18:08:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C8228750 for ; Wed, 30 Aug 2017 18:08:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64A482876A; Wed, 30 Aug 2017 18:08:27 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 0D07328757 for ; Wed, 30 Aug 2017 18:08:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 572866E4EA; Wed, 30 Aug 2017 18:07:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 266F86E4EA for ; Wed, 30 Aug 2017 18:07:49 +0000 (UTC) Received: by mail-lf0-x22d.google.com with SMTP id a126so27578872lfa.0 for ; Wed, 30 Aug 2017 11:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9I3TrHDocg6MUoBbHcPbr2FFOYKqsCYkz86RwlG+6Pw=; b=iw9lMzvxEFIgPTqtXgxydf3+sfqKx3vVV17O8PgMt/DWKRTCuJGMBW+JD7D/WlNInB l68t2aCV0IRot2j6KQ7yhuYE/qt5zXtNxCxXwJgZI28U1/Yh1lDQjfqgzqeDNQzgbyCy yRoeyubq9LuNedswBsU+/sXxOq18ha+Gsyyeg= 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; bh=9I3TrHDocg6MUoBbHcPbr2FFOYKqsCYkz86RwlG+6Pw=; b=fvTeZkWpgIpF6jPVWucaxK5ND3yIqIQDxbwo/Fye3DXQuASUTE/V3YFbi+Ikvf0QJT hgLNkMw0m/dPBtNS7q5fG8nGbCrm3snX/s+NYvPAwVpAq3fKKkIvECc49I1KkKfw2d5U MFo6NSnKQNFcV3k/fy2gLJyuPqnBvybTq5Ze0aJwnzWZtEFIBuE+TcsdpsusjFP+IRZh /0gFp1GalDxDV8mWFBZkHpNZMk/PA3WG6B2XAwWH1Qy6Uf6Ow0wZnxJAOF7eD7wFmw+r w28ewmlZbbFQi1sTh8YDSDM7qaIhjZmB0reHPEkAop3kfnBf7MZ47hin6XeXpbWFfjSY 6GyQ== X-Gm-Message-State: AHPjjUgxPxIyz4k2vri0KyJcjA7aWnFby2bV9eTiVvxPlekq6s58eX+t cUPDgXXL8nTn+inB X-Received: by 10.25.115.73 with SMTP id o70mr1019893lfc.209.1504116467581; Wed, 30 Aug 2017 11:07:47 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-287571d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.117.40]) by smtp.gmail.com with ESMTPSA id 123sm1177067ljf.80.2017.08.30.11.07.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Aug 2017 11:07:37 -0700 (PDT) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 6/7] drm/pl111: Add optional variant display en/disable callbacks Date: Wed, 30 Aug 2017 20:07:10 +0200 Message-Id: <20170830180711.2791-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170830180711.2791-1-linus.walleij@linaro.org> References: <20170830180711.2791-1-linus.walleij@linaro.org> Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The silcon and components around the PL111 may require some variants to perform special set-up of the display. Add two callbacks to manage this. Signed-off-by: Linus Walleij --- drivers/gpu/drm/pl111/pl111_display.c | 7 +++++++ drivers/gpu/drm/pl111/pl111_drm.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 39106068b158..37f409867934 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -208,6 +208,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, * We expect these calls to enable and stabilize the contrast * voltage Vee as stipulated by the manual */ + if (priv->variant_display_enable) + priv->variant_display_enable(drm, fb->format->format); + drm_panel_enable(priv->panel); /* Power Up */ @@ -238,6 +241,10 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe) * stipulated by the manual */ drm_panel_disable(priv->panel); + + if (priv->variant_display_disable) + priv->variant_display_disable(drm); + drm_panel_unprepare(priv->panel); /* Disable */ diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index b316a8a0fbc0..a5368d36e9f5 100644 --- a/drivers/gpu/drm/pl111/pl111_drm.h +++ b/drivers/gpu/drm/pl111/pl111_drm.h @@ -26,6 +26,7 @@ #include #include #include +#include #define CLCD_IRQ_NEXTBASE_UPDATE BIT(2) @@ -67,6 +68,8 @@ struct pl111_drm_dev_private { */ spinlock_t tim2_lock; struct pl111_variant_data *variant; + void (*variant_display_enable) (struct drm_device *drm, u32 format); + void (*variant_display_disable) (struct drm_device *drm); }; int pl111_display_init(struct drm_device *dev);