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 CFC95C64ED6 for ; Sun, 26 Feb 2023 18:22:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF5A885B82; Sun, 26 Feb 2023 19:21:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hdzR3u9D"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B568885953; Sun, 26 Feb 2023 19:20:44 +0100 (CET) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C53CE85947 for ; Sun, 26 Feb 2023 19:20:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-lf1-x131.google.com with SMTP id t11so5741192lfr.1 for ; Sun, 26 Feb 2023 10:20:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SCzd82NPttPyQdNRIoXud/r2POFN7hYRcpHtJWehaJQ=; b=hdzR3u9Df73lR+U8UvzIwr40hX6dNn3KfSdd2U2E5rHw4XfwqpszXh18LOipyz8vzg ZI3psLr8SEz0spfAKb8Vyi0QY8F+pO5gXZgWkE6qGiNDCpVfv6YTErm/cbI/ZCPymecf muDezz0CQ5uGCqUAXzkNolXIEK9Rp1GB5CRz7G57sUOa6LCRw0PVg+Lh8y8m3cuDnXux oWPTtWvOyf43L1LMYe1o7xpuiK7lheB3V57Q0XbUXocsNAfMhb0I9p/+rQN8NsApFYra diY62VQaIgO3ycASTJmofV9c/+9DcnAGkl+YFn3mwYa8J2TbrqD69d7gkUqBk3qNuS/V Wc6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SCzd82NPttPyQdNRIoXud/r2POFN7hYRcpHtJWehaJQ=; b=GJ69Q2WCHKZ7eWIWt3Eb2pOhmPnd5lqFONTyzmCOA5q5gjrKoHUooFE8d8P1ed8/cY Um2S0P2MINAxu+T+/Akv2WhlBcrBPoAO/fJSSZR8w47ILAF/oEPlp7ShnTokWrLtNBTU Ku69n7Iy/rPcHXCSqHOWBPc9lu4zmRShLLFDBJCus2sXGsoPohBpldG0lxkDXMtjOJAJ /+edkFj9fdE6HdNI4E1fmpGdO1EKXSI4thGugyqQkGkipioDpv84X9+vIOPLAYshC3aw hgFlVU13ZZrcP8Q7XSw9UEDmLpbxPVZtbaurDaqi+UjeFREfQPrNirH1u90obLpiCjI0 vzdg== X-Gm-Message-State: AO0yUKWX0hM95q9F2ERIQ4FvZ696DIlwBHY2hnAJkslwiDOfEW5JSpTx sjGPUS7T2I7f71tp5rnzZNw= X-Google-Smtp-Source: AK7set/4oUwd2QMdyBVKSNsu9M4PyjXzWi1wmlkHi9YxxrDN6AUqaYlrXgFGCNANTJFvckIGhvYT6g== X-Received: by 2002:ac2:5493:0:b0:4d5:8306:4e9a with SMTP id t19-20020ac25493000000b004d583064e9amr7222052lfk.46.1677435639852; Sun, 26 Feb 2023 10:20:39 -0800 (PST) Received: from xeon.. ([188.163.112.76]) by smtp.gmail.com with ESMTPSA id x25-20020ac259d9000000b004dc4d984911sm619421lfn.271.2023.02.26.10.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 10:20:39 -0800 (PST) From: Svyatoslav Ryhel To: Tom Warren , Anatolij Gustschin , Simon Glass , Svyatoslav Ryhel , Marcel Ziswiler , Thierry Reding , Maxim Schwalm , Dmitry Osipenko , Nicolas Chauvet Cc: u-boot@lists.denx.de Subject: [PATCH v2 10/11] simple_panel: add support for get_display_timing Date: Sun, 26 Feb 2023 20:20:04 +0200 Message-Id: <20230226182005.27291-11-clamor95@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230226182005.27291-1-clamor95@gmail.com> References: <20230226182005.27291-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Some cases may require passing display timings from panel driver. To handle such cases support parsing device tree panel node for timing subnode. Tested-by: Robert Eckelmann # ASUS TF101 T20 Tested-by: Nicolas Chauvet # Paz00 Tested-by: Svyatoslav Ryhel # Google Nexus 7 2012 Signed-off-by: Svyatoslav Ryhel --- drivers/video/simple_panel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c index 91c91ee75d..5a8262669a 100644 --- a/drivers/video/simple_panel.c +++ b/drivers/video/simple_panel.c @@ -48,6 +48,15 @@ static int simple_panel_set_backlight(struct udevice *dev, int percent) return 0; } +static int simple_panel_get_display_timing(struct udevice *dev, + struct display_timing *timings) +{ + const void *blob = gd->fdt_blob; + + return fdtdec_decode_display_timing(blob, dev_of_offset(dev), + 0, timings); +} + static int simple_panel_of_to_plat(struct udevice *dev) { struct simple_panel_priv *priv = dev_get_priv(dev); @@ -102,6 +111,7 @@ static int simple_panel_probe(struct udevice *dev) static const struct panel_ops simple_panel_ops = { .enable_backlight = simple_panel_enable_backlight, .set_backlight = simple_panel_set_backlight, + .get_display_timing = simple_panel_get_display_timing, }; static const struct udevice_id simple_panel_ids[] = { -- 2.37.2