From patchwork Tue Jul 20 15:33:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 481547 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5243585jao; Tue, 20 Jul 2021 08:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwndbVhvNkS6/+8fi4LfFhEGuFdfIYEn8X6QQl3LRVvnippQLS5OeEyTAS2nVfeQJQi10M7 X-Received: by 2002:a17:90a:a27:: with SMTP id o36mr36580320pjo.32.1626795238158; Tue, 20 Jul 2021 08:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626795238; cv=none; d=google.com; s=arc-20160816; b=onDDgFTnAE8GIZGMSyXlxs5uUXPeDVvOG1Z8rQyaLL3JouzFaAnyD+dVEpI/PRiBHC /7VvCqFPo1k1An3YaxLJXYZQlCMpCuBOpxahCzFeknxjRfQNR7un7fcF4lGK8B1TOLmL sL0epbKFxMhD891ULqhSgnEg3JK43tSdhnMa3U2AMJGAqClX9J6DMoAc7qvhe4oBW/aI s399Jz+K8PPQJDqDivyJzyaIl6Sd3WVcDBKFarb/FXkkBj71HyJURq10PPTuzvRDtWUm ayR4N49XB5THrX7gj++KNvlFNBTQAKIkfYuPcK6CEjIooOonUEp5eSJ+VoRxM/h3G8Ph fc0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:from:to:dkim-signature:date:delivered-to; bh=d9Q3moj/2J34xlyehWoq/C7zP8ek1tDX6NiP55RbvIw=; b=DGG8291qQMMBKl2U/WTugNUFYUXV5OUZGrYgQ6tcIQI1r1m7WUGCdRerr5gPiiGXAi lWb6mj1ReLeeBvDakmlkwCwv9GQs7g1RV3+DsvEcKs81p8IPFQCRbgs7nI7/ODb66bHG 4bgDD9dY1ruAZC408jzBoQiKmR7TTvUaCUTv9hkg/Nfv5nuP8qFjM5pEWwdNH5vq8iuP eQM8rkWLCJwerW2+uUqT+/EzfDsQmc15O6PsDS63OVg1aKIs15AUnBw5sSdFkdzJsloi BD6NuzZAjJEaKsBudIdN5eMxy1HbzsFOQeYw147ao3y4J0ks/OnAiKA5waejUzrXcE14 96Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@connolly.tech header.s=protonmail header.b=Xg4qOYPU; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id j11si27102760pfc.227.2021.07.20.08.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 08:33:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@connolly.tech header.s=protonmail header.b=Xg4qOYPU; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1084F89C33; Tue, 20 Jul 2021 15:33:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by gabe.freedesktop.org (Postfix) with ESMTPS id D924789C33 for ; Tue, 20 Jul 2021 15:33:54 +0000 (UTC) Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id 4GTjRj1DxWz50MKT for ; Tue, 20 Jul 2021 15:33:53 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="Xg4qOYPU" Date: Tue, 20 Jul 2021 15:33:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1626795229; bh=d9Q3moj/2J34xlyehWoq/C7zP8ek1tDX6NiP55RbvIw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Xg4qOYPUk793e8ucsxhhTPL54VmfiqV/0bzSeQbgFfxV8qKVM5NUA24rdBHPJ4e5Y AaGfTk2+TPzflGIxx6u7Ij+n1ruwAtqH0fHGQMD7onBeH5v7m0g34KQTLuSHtczYBI 0n95i5OOHJpze7akWJI1R8Gm0UHmMU53ssJeinMs= To: Caleb Connolly From: Caleb Connolly Subject: [PATCH 3/5] drm/panel/samsung-sofef00: make gpio optional Message-ID: <20210720153125.43389-4-caleb@connolly.tech> In-Reply-To: <20210720153125.43389-1-caleb@connolly.tech> References: <20210720153125.43389-1-caleb@connolly.tech> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch 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: , Reply-To: Caleb Connolly Cc: devicetree@vger.kernel.org, David Airlie , linux-arm-msm@vger.kernel.org, Rob Herring , Bjorn Andersson , Andy Gross , Thierry Reding , dri-devel@lists.freedesktop.org, Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The OnePlus 6T panel fails to initialise if it has been reset, workaround this by allowing panels to not specify a reset GPIO. Signed-off-by: Caleb Connolly --- drivers/gpu/drm/panel/panel-samsung-sofef00.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.32.0 diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c index 8cb1853574bb..a20a5af14653 100644 --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -44,6 +44,8 @@ struct sofef00_panel *to_sofef00_panel(struct drm_panel *panel) static void sofef00_panel_reset(struct sofef00_panel *ctx) { + if (!ctx->reset_gpio) + return; gpiod_set_value_cansleep(ctx->reset_gpio, 0); usleep_range(5000, 6000); gpiod_set_value_cansleep(ctx->reset_gpio, 1); @@ -137,7 +139,8 @@ static int sofef00_panel_prepare(struct drm_panel *panel) ret = sofef00_panel_on(ctx); if (ret < 0) { dev_err(dev, "Failed to initialize panel: %d\n", ret); - gpiod_set_value_cansleep(ctx->reset_gpio, 1); + if (ctx->reset_gpio) + gpiod_set_value_cansleep(ctx->reset_gpio, 1); return ret; } @@ -276,7 +279,7 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi) return ret; } - ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(ctx->reset_gpio)) { ret = PTR_ERR(ctx->reset_gpio); dev_warn(dev, "Failed to get reset-gpios: %d\n", ret);