From patchwork Fri Sep 1 09:36:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9933813 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 33D2D6016C for ; Fri, 1 Sep 2017 09:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32FA92861A for ; Fri, 1 Sep 2017 09:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25DED2862B; Fri, 1 Sep 2017 09:40:00 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 ABA252861A for ; Fri, 1 Sep 2017 09:39:59 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=diwuy8Y1z+wjg9fqt87wKnUM1qKdbuTd3hbznUFpdmw=; b=tdM59Yk7U2OtwVfB9n4olSRsO8 ieo7OSOzqF0u0hjsx4ytCVf1rkLGnuWaSvmZ3pQbxdNckphxJztvMKsjN3ZqCFThDYZ/btxNOH1cS AERQ6iap1gFQ9cAUqGzhThdc5rrKEF9mW5528eNuip/VTj50FykiJe+bhCYaqxxjwOcLeX5+VOHOb EtLBBbMaUcECrcdLN6U3DG2wDgcviyeChvzpvK8ue+Z/q58Fz/9bGOloqGtGxZ+C5/JAceA+Q6jSb K6p4QebBmV9Q92r+GowuaDApytQ1LybGpflC7bqADt+1vJZBbqJsHRJ9oahRvS9b6E6+23BOtHgHt G4MO/0ow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dniPk-0003yH-Qt; Fri, 01 Sep 2017 09:39:00 +0000 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dniO8-0002Sl-VR for linux-arm-kernel@lists.infradead.org; Fri, 01 Sep 2017 09:37:32 +0000 Received: by mail-lf0-x231.google.com with SMTP id y128so7255420lfd.4 for ; Fri, 01 Sep 2017 02:37:01 -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=KjD1PRJQp+SuXhWigSGZLuQ50pztlk1EB2ciyXUKI3Q=; b=UJoaMoShkd41wEbCa1kDGgATqPthK2NsAwsOgsEAyiPEjNXL8V35UCT+c/+lZnZxvM WRKj5ULr9D9qoTP1eN4uHzIVzz57prsiOckLTe0blHcGIRR+kLcDwWnfqCs9AvARUUic kR4XcMmYM3TtOhjV6nTvKsnruwjNKKEMDubcw= 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=KjD1PRJQp+SuXhWigSGZLuQ50pztlk1EB2ciyXUKI3Q=; b=sFVpB2xQBXsRcuKAtN/Snhyj05DS5vlbRXkCulvcJkz64pHaJQGUcAgiEk21yj7TOf Z+3CvOUcOs00MFDMaqgzy4OWaYBpdQnlC4T0dYqzCUOqqHMFZ0+4Ni6gfmFp+HP8/ng1 DjBhPk+3cMhwGZJh6Lw+WEzj0cje3YlWHizHgrZiwdpA6uGC4/8LKlfVSV4YVwIyJXx0 21wJR+x7yDl9TsSuf6G8SraBJwxpR6QdRbllydpZWdGIJPRFhrr2HOgzlqcmjM3msf59 GTE9v5A5C99vzI44RmSj2e8zKuevfH0sm99xv7ez6bi4tI2GOlo5gQykbvxeqh2cNs9m H0iQ== X-Gm-Message-State: AHPjjUhwk843NR9W5zGfNgpRdHYgDWa8qquyA6M/PZAfD4eLqW6stBBv A9Cn/uzzlAV+YKJ4 X-Google-Smtp-Source: ADKCNb5V4jgKUXL8RpCtrVHCg7TxM1A07KS90ksYwYVXRHaaYNNDuK+WriBqd4fC1F+O4BsR1YbUPw== X-Received: by 10.25.225.3 with SMTP id y3mr674386lfg.88.1504258619698; Fri, 01 Sep 2017 02:36:59 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x18sm328588ljd.85.2017.09.01.02.36.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 02:36:59 -0700 (PDT) From: Linus Walleij To: Daniel Vetter , Jani Nikula , Sean Paul , Eric Anholt Subject: [PATCH 6/7 v2] drm/pl111: Add optional variant display en/disable callbacks Date: Fri, 1 Sep 2017 11:36:36 +0200 Message-Id: <20170901093637.4041-7-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170901093637.4041-1-linus.walleij@linaro.org> References: <20170901093637.4041-1-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170901_023721_730672_A218266E X-CRM114-Status: GOOD ( 12.71 ) 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: Linus Walleij , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 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 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 Reviewed-by: Eric Anholt --- ChangeLog v1->v2: - Rebase on other display driver changes. --- drivers/gpu/drm/pl111/pl111_display.c | 6 ++++++ drivers/gpu/drm/pl111/pl111_drm.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index 3ed451ca2744..5ca2c307856c 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -207,6 +207,9 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe, */ msleep(20); + if (priv->variant_display_enable) + priv->variant_display_enable(drm, fb->format->format); + /* Power Up */ cntl |= CNTL_LCDPWR; writel(cntl, priv->regs + priv->ctrl); @@ -236,6 +239,9 @@ void pl111_display_disable(struct drm_simple_display_pipe *pipe) */ msleep(20); + if (priv->variant_display_disable) + priv->variant_display_disable(drm); + /* Disable */ writel(0, priv->regs + priv->ctrl); diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h index eeaabe735058..c28b5d042412 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; const 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);