From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37F65C47094 for ; Sun, 30 May 2021 15:57:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0793611CA for ; Sun, 30 May 2021 15:57:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0793611CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A208E6E07F; Sun, 30 May 2021 15:57:23 +0000 (UTC) Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F14F6E07F; Sun, 30 May 2021 15:57:22 +0000 (UTC) Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 30 May 2021 08:57:21 -0700 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 30 May 2021 08:57:20 -0700 X-QCInternal: smtphost Received: from rajeevny-linux.qualcomm.com ([10.204.66.121]) by ironmsg02-blr.qualcomm.com with ESMTP; 30 May 2021 21:26:38 +0530 Received: by rajeevny-linux.qualcomm.com (Postfix, from userid 2363605) id F22C921481; Sun, 30 May 2021 21:26:36 +0530 (IST) From: Rajeev Nandan To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [v5 2/5] drm/panel-simple: Support DP AUX backlight Date: Sun, 30 May 2021 21:26:09 +0530 Message-Id: <1622390172-31368-3-git-send-email-rajeevny@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1622390172-31368-1-git-send-email-rajeevny@codeaurora.org> References: <1622390172-31368-1-git-send-email-rajeevny@codeaurora.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.thompson@linaro.org, Rajeev Nandan , mkrishn@codeaurora.org, jani.nikula@intel.com, linux-kernel@vger.kernel.org, abhinavk@codeaurora.org, dianders@chromium.org, a.hajda@samsung.com, thierry.reding@gmail.com, seanpaul@chromium.org, laurent.pinchart@ideasonboard.com, kalyan_t@codeaurora.org, hoegsberg@chromium.org, sam@ravnborg.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If there is no backlight specified in the device tree and the panel has access to the DP AUX channel then create a DP AUX backlight if supported by the panel. Signed-off-by: Rajeev Nandan --- This patch depends on [1] (drm/panel: panel-simple: Stash DP AUX bus; allow using it for DDC) and the previous patch (2/5) of this series. Changes in v4: - New Changes in v5: - Address review comments and move backlight functions to drm_panel.c (Douglas) - Create and register DP AUX backlight if there is no backlight specified in the device tree and panel has the DP AUX channel. (Douglas) - The new drm_panel_dp_aux_backlight() will do the drm_edp_backlight_supported() check. [1] https://lore.kernel.org/dri-devel/20210524165920.v8.7.I18e60221f6d048d14d6c50a770b15f356fa75092@changeid/ drivers/gpu/drm/panel/panel-simple.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index b09be6e..047fad5 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -800,6 +800,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc, if (err) goto disable_pm_runtime; + if (!panel->base.backlight && panel->aux) { + err = drm_panel_dp_aux_backlight(&panel->base, panel->aux); + if (err) + goto disable_pm_runtime; + } + drm_panel_add(&panel->base); return 0; -- 2.7.4