Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4898320yba; Wed, 10 Apr 2019 07:14:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnWiV6urbv2KfIedBSnUSf3NoTaNnShL3eOqrqtsn12uvjXVSIDCjIgah4tsU2N1CC3J5M X-Received: by 2002:a65:53cb:: with SMTP id z11mr40397082pgr.139.1554905641338; Wed, 10 Apr 2019 07:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554905641; cv=none; d=google.com; s=arc-20160816; b=x2QsFEHW39efcaUbIzlRIIhuG7/joYIl01cJ6iILfBVXnocUBBdr2GG5RWvzjYWxA8 Fe6nXsCM6wGxGlcC5H3+38h/fnviuf6VSSGvTgBI5vR80mqmbJgfP9kyzV03qllJgz66 VBxbvDp9nEOhfMRwcl7ZzFjqMZv5dfSvUcdJbbYBYwxlizU8Q42OSh36RbXkYrkwJVwM jpqSrQuaF8tdIrEv7yTcS12gSYjMU2Q7ljpTT9Oo1lzDfLjxdbPsZmCq2FIL52zi2XxO 0dcGWuc1PnkxZRiMlnS9g1Na50sevqtsTz/BdOhCfmoiUCxlGgQpzELwv+TbMIW+fmqp bTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from; bh=648dgR5MlwSNMBYdUB9AA9EBCBqtqBnzZHf540TK5VA=; b=lZk02c4sH9fnRzT+d+zWWyzlS0efmgQ94Q0qKO7O+zY8WEc45ezj7uTUsR4vqXufcg dDooy/PhP2yygD/foypFJCHXe77219GaCPt39JYvSabLgj1pYTXQByqrPelB7aqcZ6th gTfAvr2nuiLvt1eG5VO/Qpe7OzgbGMmPFAIM1U06UsXbLc1B3loU0uuqzQUvh4p1YoVC HvEftGmJfabQwDBTzK/JMPQYvs01vk6SlPk9dDxxPdyrfKlz4BzOMKBdMOyyGfOQZhQm fLzSMvo8nhlQ9OfHX65Q0Syykw/DTzyRApaTeOmdpysytlFLX/0994TdvnPBhWeFeFlt y1jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si33075108pld.11.2019.04.10.07.13.44; Wed, 10 Apr 2019 07:14:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732648AbfDJOLV (ORCPT + 99 others); Wed, 10 Apr 2019 10:11:21 -0400 Received: from vegas.theobroma-systems.com ([144.76.126.164]:55363 "EHLO mail.theobroma-systems.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730195AbfDJOLU (ORCPT ); Wed, 10 Apr 2019 10:11:20 -0400 Received: from ip092042140082.rev.nessus.at ([92.42.140.82]:49602 helo=purcell.lan) by mail.theobroma-systems.com with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1hEDwV-0003AE-VZ; Wed, 10 Apr 2019 16:11:12 +0200 From: Christoph Muellner Cc: heiko@sntech.de, Christoph Muellner , Thierry Reding , David Airlie , Daniel Vetter , Rob Herring , Mark Rutland , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm: panel-simple: Add simple-panel driver. Date: Wed, 10 Apr 2019 16:10:44 +0200 Message-Id: <20190410141045.58097-1-christoph.muellner@theobroma-systems.com> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On our RK3399-Q7 EVK base board we have the option to connect an arbitrary monitor via DP cable. The actual monitor is therefore not known in advance. This means, we don't have any panel information besides the EDID data from the device itself. The functionality for a 'simple-panel' has been remove a couple of years ago with 81cf32b. This patch brings this feature back. Signed-off-by: Christoph Muellner --- drivers/gpu/drm/panel/panel-simple.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 9e8218f6a3f2..1f69283f3e4b 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; @@ -2536,6 +2541,9 @@ static const struct panel_desc arm_rtsm = { static const struct of_device_id platform_of_match[] = { { + .compatible = "simple-panel", + .data = NULL, + }, { .compatible = "ampire,am-480272h3tmqw-t01h", .data = &ire_am_480272h3tmqw_t01h, }, { -- 2.11.0