Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1022003pxb; Thu, 21 Oct 2021 14:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLg3L1DxV7ayGY0uEfdTNr9VIa055J9XkIyJzpCkf2+hBuNsQlMiVmWQ9wJBJrivd9LHr+ X-Received: by 2002:a63:d806:: with SMTP id b6mr6221584pgh.395.1634850801726; Thu, 21 Oct 2021 14:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634850801; cv=none; d=google.com; s=arc-20160816; b=nWzwYl/mqy4QUKNYeysWCPfj738O49gSvxEe5dBx1UxWNglAXW+lfPNGGJDTrCHClp EfzcmjU165EK0nYY2ut9BuSG/JRTB2K5q66lIPgL5gh+FVFa2HLmZ+BKGAtSC14hd3SV i5jeDr8Q6DCWD/QV+PuA6FrFj/1ZHSDqzt4ZBkvcrjldQcZfBeJD2OtxikFu5MY7hSsP RbrAe+5AxTZV5YAl6HcwYbbYEz0nkKFMdzChICuz0lV1KbIc5Hu7mdL03th3uDHnXYrp EkpezOx5uDNLA54vBXfGRbBy8UBNham/wNRsqpZwVvg6dwDF2WljLdMaXn+elOWcz/wd V9wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sSqNmBmwNnZiz7NUUt6h5WqgJhP/Ov1sKBBTlbjHzNY=; b=Sg4QdwhbFoOJYV6myBa2gowfSO7j8RbM6rAMFYM9/oUfR+b4B01sgTJRORtSNHX+so lN+R0iDpVahm1atg0hf7oWPq5RgGcT+p5BHGSXwQQzEBJEqWkA9kacCkXekPhfod6Qn3 cPd4llyrnYpXpk9yZiKZF/gMTRbQIkSZV4GdspcRBk1OElE/0QdzAFDnyzJcfc/IDa8E ck+4FbJOrOwoUAeQVO4bqSuWAov3XdIrAtfr9zeYc0Yn1qFUy0siWFQXqd1DmDdvmu/8 qozBskqIuphHOoSznjKE8psoblm4yzEDoIV2KKSwFFmD/3MkCg19tdt9C3CvAO0bzkCo 9hSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="XRsGY/xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y2si9222252plh.329.2021.10.21.14.13.08; Thu, 21 Oct 2021 14:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="XRsGY/xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232140AbhJUVNr (ORCPT + 99 others); Thu, 21 Oct 2021 17:13:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbhJUVNr (ORCPT ); Thu, 21 Oct 2021 17:13:47 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4C8CC061764 for ; Thu, 21 Oct 2021 14:11:30 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id v7so2455023ybq.0 for ; Thu, 21 Oct 2021 14:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sSqNmBmwNnZiz7NUUt6h5WqgJhP/Ov1sKBBTlbjHzNY=; b=XRsGY/xy50TtHIKbHoxMdCj0ZTTbuI00ENgALELUtUY5fWYRIggNJL5E9D5BcumiGv Ei4UdmBQiheCtzLfGJlbaFYE5i12T1IQTwLpPvfigWcSqRkugP1/kX/Pjq2XsNGTSP44 PFr1T8N2/vslAGg9WT7uTPZ59vePFQjJmmHNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sSqNmBmwNnZiz7NUUt6h5WqgJhP/Ov1sKBBTlbjHzNY=; b=4hNt6FlrqHLpWWt8nQvfABhGENivvVg7dN2i3xcnOsO0rwybO2M0HU0V+3JNSM84Fx KBFOViJ+rLWLSkYSQcvSoRniLcbjG13QVdQPU6PJK97EUYLd6XWvcWI4aR3QMPK1vP+N j3ahEDR14M8lNDDn9ou627Ik/ei92BBfHENyd7wXSf0Jh9g1wkg3SBppHWZDK0mio4Bi hEIV8oYFtqFg3oTXP1feloJlaqKTeWeOzLHv0eb0E6kIOZ8hYLRfJwSUt0IB12Mmxgk0 IxnMKmBo5/Ej/bQpSJla7nbK5mWcCO1fKb2kHgeIRUP6HHac+6z7zG8OYgmwVeWkdaQF SagQ== X-Gm-Message-State: AOAM532nwrYyXemr5NZlzXB1L87E6vi10KmNyBqh+Bemqkz/qZiZbQSa 0TjJxbYrXp4AdjkDxnINuaG7AMSH5e5MCCzZShbolA== X-Received: by 2002:a25:5044:: with SMTP id e65mr8298612ybb.57.1634850689972; Thu, 21 Oct 2021 14:11:29 -0700 (PDT) MIME-Version: 1.0 References: <20211016095644.1.I9d81c3b44f350707b5373d00524af77c4aae862b@changeid> <20211016095644.2.I44ee57ef73528243acf8f29af8d2416b810e1a9d@changeid> In-Reply-To: From: Philip Chen Date: Thu, 21 Oct 2021 14:11:19 -0700 Message-ID: Subject: Re: [PATCH 2/2] drm/bridge: parade-ps8640: Populate devices on aux-bus To: Doug Anderson Cc: LKML , Stephen Boyd , Andrzej Hajda , Daniel Vetter , David Airlie , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Neil Armstrong , Robert Foss , dri-devel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Doug, On Mon, Oct 18, 2021 at 1:43 PM Doug Anderson wrote: > > Hi, > > On Sat, Oct 16, 2021 at 9:57 AM Philip Chen wrote: > > > > Conventionally, panel is listed under the root in the device tree. > > When userland asks for display mode, ps8640 bridge is responsible > > for returning EDID when ps8640_bridge_get_edid() is called. > > > > Now enable a new option of listing the panel under "aux-bus" of ps8640 > > bridge node in the device tree. In this case, panel driver can retrieve > > EDID by triggering AUX transactions, without ps8640_bridge_get_edid() > > calls at all. > > > > To prevent the "old" and "new" options from interfering with each > > other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option > > is taken. > > > > Signed-off-by: Philip Chen > > --- > > > > drivers/gpu/drm/bridge/parade-ps8640.c | 52 ++++++++++++++++++++------ > > 1 file changed, 40 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c > > index acfe1bf0f936..98884f799ea8 100644 > > --- a/drivers/gpu/drm/bridge/parade-ps8640.c > > +++ b/drivers/gpu/drm/bridge/parade-ps8640.c > > @@ -14,6 +14,7 @@ > > #include > > > > #include > > +#include > > You need a `select DRM_DP_AUX_BUS` in the Kconfig to avoid the errors > that the build robot found for you. Thanks for the tip! I also found "select REGMAP_I2C" seems to be missing for ps8640. although the build robot didn't complain. Should I post a fix-up? > > > > #include > > #include > > #include > > @@ -149,6 +150,24 @@ static inline struct ps8640 *aux_to_ps8640(struct drm_dp_aux *aux) > > return container_of(aux, struct ps8640, aux); > > } > > > > +static bool ps8640_of_panel_on_aux_bus(struct device *dev) > > +{ > > + struct device_node *bus, *panel; > > + > > + if (!dev->of_node) > > + return false; > > You probably don't need the above check. I think things would be > pretty broken if we didn't have an "of_node". Removed in v2. PTAL. > > > > + bus = of_get_child_by_name(dev->of_node, "aux-bus"); > > + if (!bus) > > + return false; > > + > > + panel = of_get_child_by_name(bus, "panel"); > > of_node_put(bus); Added in v2. PTAL. > > > > + if (!panel) > > + return false; > > of_node_put(panel); Added in v2. PTAL. > > > Other than the above, this looks reasonable to me. > > -Doug