Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31918C38142 for ; Tue, 31 Jan 2023 10:06:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E8AE085A1D; Tue, 31 Jan 2023 11:06:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="InLETUxS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C3BDC859F5; Tue, 31 Jan 2023 11:05:45 +0100 (CET) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 83D1A85A0C for ; Tue, 31 Jan 2023 11:05:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-jain1@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30VA5P49047394; Tue, 31 Jan 2023 04:05:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1675159525; bh=fkx1FTSSyPiijf/AvXmVmhTFaqr1pjTaTcbO0TOl9u0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=InLETUxSCIjVMq1LcxAPy0QJOoJS+iv4gD3/q+VrNqtLX4Eya1PgVB6APeK4SVTxX Ya181nUHj5fqbGXmtN9Gp6R/GHqtnxkyMyHUtZtLbvvlgTL7+mgqTfG810T7ybA+TT BUNINKIn5UkvbLkm5Zk+3ueKAj+f5PjgVqNY/ves= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30VA5P8p027152 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 31 Jan 2023 04:05:25 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 31 Jan 2023 04:05:25 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 31 Jan 2023 04:05:25 -0600 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30VA5O2c005456; Tue, 31 Jan 2023 04:05:25 -0600 From: Nikhil M Jain To: , , CC: , , , , , Subject: [PATCH v2 3/7] drivers: video: simple_panel: make simple panel independent of backlight Date: Tue, 31 Jan 2023 15:35:16 +0530 Message-ID: <20230131100520.103093-4-n-jain1@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230131100520.103093-1-n-jain1@ti.com> References: <20230131100520.103093-1-n-jain1@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This patch updates the necessary Kconfigs to make simple panel driver independent of backlight driver and compiling backlight related code in simple-panel driver conditionally to when user has set CONFIG_BACKLIGHT. Signed-off-by: Nikhil M Jain Reviewed-by: Simon Glass --- drivers/video/simple_panel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c index c8f7022ea6..91c91ee75d 100644 --- a/drivers/video/simple_panel.c +++ b/drivers/video/simple_panel.c @@ -63,12 +63,15 @@ static int simple_panel_of_to_plat(struct udevice *dev) return ret; } } + ret = uclass_get_device_by_phandle(UCLASS_PANEL_BACKLIGHT, dev, - "backlight", &priv->backlight); + "backlight", &priv->backlight); if (ret) { debug("%s: Cannot get backlight: ret=%d\n", __func__, ret); - return log_ret(ret); + if (ret != -ENOENT) + return log_ret(ret); } + ret = gpio_request_by_name(dev, "enable-gpios", 0, &priv->enable, GPIOD_IS_OUT); if (ret) { -- 2.34.1