From patchwork Sun Feb 3 18:44:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10795061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8099F13B5 for ; Mon, 4 Feb 2019 08:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71CF62AFD1 for ; Mon, 4 Feb 2019 08:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 654FA2AFD4; Mon, 4 Feb 2019 08:22:26 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 205E02AFD1 for ; Mon, 4 Feb 2019 08:22:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BE676E37B; Mon, 4 Feb 2019 08:22:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D1D16E340 for ; Sun, 3 Feb 2019 18:45:04 +0000 (UTC) Received: by mail-pl1-x643.google.com with SMTP id t18so295391plo.9 for ; Sun, 03 Feb 2019 10:45:04 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=J3HkVQyg1bgdqlOuNsd9gIG4QKbDWhLCCN+a7fE0LAQ=; b=g8Dhd0i6dmvLSts2c1eFyJ0UJKkNPj8XoUiAiBkytImtrDyXaJcvW9mLSHqPDx/fN4 m+o4wWKUCBkAli/RxJDhEzgV2TRy5GatmrFP4PksiqjEh/jn8K4+y/35BjxRHNXUn/BD XiAhPCz/ki9uXYmRT4Nr7rOMRJfT5n3q9ydN8uZCeZSwHvWf6ZumO390+OAH6EUGV2+e ETXxGTPRCrVYWbySVqzAP3zwuoYoO/dAiVIxd0vGy68fhN6yI08bCstdpEJYwaMqcd3M 1wVJ+CCOopDQRbzIklRIHy3DAaRCkQqcDxD6zoG3Wl0KRXUrCfbxYTQntamRP/9TxQ5q bNMQ== X-Gm-Message-State: AJcUukeSs3uGPZ7dwJpRcP1tWEHsEJb8o5kNKglpDFO9AfaXAwdK/S2s bPVZuK1j3qjxL4H92oeGsA0= X-Google-Smtp-Source: ALg8bN734kn7YUP2L5uXGgZ7etmSBwjHwXVUZcU5CCgmZJchrc0Kjw+VcwU9zmFRRX+QisfUioTugQ== X-Received: by 2002:a17:902:722:: with SMTP id 31mr48870502pli.271.1549219503709; Sun, 03 Feb 2019 10:45:03 -0800 (PST) Received: from anarsoul-thinkpad.lan (216-71-213-236.dyn.novuscom.net. [216.71.213.236]) by smtp.gmail.com with ESMTPSA id c67sm21407831pfg.170.2019.02.03.10.45.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Feb 2019 10:45:02 -0800 (PST) From: Vasily Khoruzhick To: David Airlie Daniel Vetter <"airlied@linux.iedaniel"@ffwll.ch>, Rob Herring , Mark Rutland , Thierry Reding , Maxime Ripard , Chen-Yu Tsai , Archit Taneja , Andrzej Hajda , Laurent Pinchart , Icenowy Zheng , Sean Paul , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com Subject: [PATCH v2 07/12] drm/panel: simple: don't fail if we don't have panel desc Date: Sun, 3 Feb 2019 10:44:45 -0800 Message-Id: <20190203184450.8050-8-anarsoul@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190203184450.8050-1-anarsoul@gmail.com> References: <20190203184450.8050-1-anarsoul@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 04 Feb 2019 08:22:10 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is preparation for addition of generic eDP panel that doesn't have any modes or delays defined. Signed-off-by: Vasily Khoruzhick --- drivers/gpu/drm/panel/panel-simple.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 9c69e739a524..2f2cb2d81f2b 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -176,7 +176,7 @@ static int panel_simple_disable(struct drm_panel *panel) backlight_update_status(p->backlight); } - if (p->desc->delay.disable) + if (p->desc && p->desc->delay.disable) msleep(p->desc->delay.disable); p->enabled = false; @@ -195,7 +195,7 @@ static int panel_simple_unprepare(struct drm_panel *panel) regulator_disable(p->supply); - if (p->desc->delay.unprepare) + if (p->desc && p->desc->delay.unprepare) msleep(p->desc->delay.unprepare); p->prepared = false; @@ -220,11 +220,13 @@ static int panel_simple_prepare(struct drm_panel *panel) gpiod_set_value_cansleep(p->enable_gpio, 1); - delay = p->desc->delay.prepare; - if (p->no_hpd) - delay += p->desc->delay.hpd_absent_delay; - if (delay) - msleep(delay); + if (p->desc) { + delay = p->desc->delay.prepare; + if (p->no_hpd) + delay += p->desc->delay.hpd_absent_delay; + if (delay) + msleep(delay); + } p->prepared = true; @@ -238,7 +240,7 @@ static int panel_simple_enable(struct drm_panel *panel) if (p->enabled) return 0; - if (p->desc->delay.enable) + if (p->desc && p->desc->delay.enable) msleep(p->desc->delay.enable); if (p->backlight) { @@ -280,6 +282,9 @@ static int panel_simple_get_timings(struct drm_panel *panel, struct panel_simple *p = to_panel_simple(panel); unsigned int i; + if (!p->desc) + return 0; + if (p->desc->num_timings < num_timings) num_timings = p->desc->num_timings;