Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1873276rdb; Sun, 11 Feb 2024 00:52:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhDRMI583wMincFgW0EgctfmZ9xYFTvK0T2TS9APwIpEVBMpYe8v2JbZewF90rVdE24ySe X-Received: by 2002:a17:906:d93c:b0:a3b:f16c:2297 with SMTP id rn28-20020a170906d93c00b00a3bf16c2297mr2426406ejb.15.1707641563935; Sun, 11 Feb 2024 00:52:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707641563; cv=pass; d=google.com; s=arc-20160816; b=AA4VMOSntlz7DDsNflNjyKR4pIPSq5JF+HI0y+d6I1X6Nkrz6hJrMJWRYvd/AT3bc5 rFyBvDEZLLof9YqKgqM43zAI7c5lh1kTGoMyLPFpx9P5XZ/wDIPw9d939QyiFmQ5rVF3 iPKMfiGvOIm/XMUvMCq+JhblzsXB0RJDuwcmJdILpkLsbLVAv7ak0Y5soUgR/03XKXaB Ke9+uRpmHscjzihlzItZTRDONBADoonWxGTukw9CGxFyK2dVUpVoi5cfeYxQmu69Xau6 uOhX3ae32wUOa9Z/8WYwiscYG3ZXafYsj65Pf7wtwx65DSoIFQN0HTXQEm9WITyXF2ES Kfzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:dkim-signature; bh=CLizHpyv/f+DbolOV42ApsVVXm0Dg0xdAa06w8qDvks=; fh=EOWH/Ws7FTADqXYtzdU0qf6sMYjHfUBtPbHNnNOyKUI=; b=Pf/p4vI00qrrBLM6vRE9mk9SrmExs/MA8CgiSLtJNWnDPZSF/95zN2OkcCBN4mNNEz uBOImV+eWwoj00kJAcpQUO/apGe5DtTE5i7O0JK6dIQL8F5FLIyCvMp1ZAhy00zqMmwb jDgOk3/mbwB0PQbvH2nitOtI0xT1ksD1CtIwK7hu0w8aH0SJeDwjNfLR6imysGN5dHkJ mOiNjw5HC7bA2QSjtNqmIHlC3xPlskS9XSwwbUVMvW2L0GSdP8lzZ1/l3JmeYF0lhiTX VW/+DPX9x6mFXRp2lOW0NZN956LGm/pwsh779jn4C/K85AeM8TrHOPFtCkZoJTG829EO dkRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dATkH9CM; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCUGqc5rwAxiMl/Oc3nNxO6zH++iBq+v6oj7PYSYari56lkwSpAuUQVwhbL+sWVTijQZd11PetKz7ir215OkIQc7A9pE6HB9NLLGesTsqg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n26-20020a170906b31a00b00a389b1866a3si2620328ejz.708.2024.02.11.00.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 00:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dATkH9CM; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-60669-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60669-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 99B561F2181C for ; Sun, 11 Feb 2024 08:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA1E359154; Sun, 11 Feb 2024 08:52:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dATkH9CM" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7F9636102 for ; Sun, 11 Feb 2024 08:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707641554; cv=none; b=isDuZYTro7/KwbuKRDOQkMjKgGsAqz/FBak6aDOQnGGXW6ndM0vwO9m36U1sjNk3lsn1b/XMJc1KHVadxPR3l4eZ2tKQ829a1FdhFGLdhyK/yPY3yB01m4deTcwPJBuThVUIRGnXSNCSztONLtbEzPyxEMgj3d99mQa+ri7+3c0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707641554; c=relaxed/simple; bh=8artP/TApEldtwBPGtbWZ5bG6juyp+Nno5U5w89q+Bw=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=NXmhWXycgcXF/ZfbYqZv/OmmIJc3yKVW5xH4V8O4TbaER5gEjQV/gB9h7A50x9btXkESRr4kre2U/HyU8MKYVNGWA1TyBOVlDQ6E6Mld/51n3KrU8Ac+830trco47nxOtuEOPcVBetXyyEr1UxhJflOkUkjrgbrCM2a+ZnYWtnc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dATkH9CM; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d0512f6e32so31700241fa.1 for ; Sun, 11 Feb 2024 00:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707641550; x=1708246350; darn=vger.kernel.org; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=CLizHpyv/f+DbolOV42ApsVVXm0Dg0xdAa06w8qDvks=; b=dATkH9CMfh1+IqH8rXZkSRL4Zi2we1WcG69zvAmuUtlHPw1bQgT8pboXvg2dewDwxp bujEh2C5aIKpLkaZixEmw9Nud9ZHfp6NjV/BfOOBN2dCQlm717g7ebS9Xx1oOzoEEXRs 4yDi4IBAIfyXJt0/cGbMD/tHPggOAg0yPybEw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707641550; x=1708246350; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CLizHpyv/f+DbolOV42ApsVVXm0Dg0xdAa06w8qDvks=; b=dwDxlDDzVIF5SqNL25kFoBucehcjjxbFsyYHsXOGdMMYjCT0yahJBz7yQxAtmzS+17 pcB8sGmFw6M+ca2/pnaq43jyql6srl3hnt6Y9vokFOWUytLpYrj6kE4ch9hZq6nKKPBg wQbI6DvY3ilS339nMkK1KU5iEaKNaRfX00+7sTK6XHNCZc8fw8peJaUntN29tnH3tphH Uqb+5cYlA2Jy7/wWV4UNUGZBOSXlVh2Rse31mvVvp1dkZh5IQrs4K1O1XB4yT1uTaiNX YLjjGvYcAK6YFVwOGddd7kJFaB8M3SVOqP4TVMhTOeU/oK+LzC72NoOzqeGlrgFgsJpF gNPw== X-Gm-Message-State: AOJu0YzH5lH3Jb0gipVYkfjX0sTyDOyogcFxA2EOu+MTgJS/dEVL8YSW EZJprXcPdqCCXXj7HfxaPpu+J3F943DZULtA76lAnEdL0Ujt+mXP1+qRdDKQd4Ch+FlNQytTdfF Mk/qMcvANwIb9/BjfCC2nVqr5huaRNQM7mhxA X-Received: by 2002:a05:6512:21c7:b0:511:8cb2:2f80 with SMTP id d7-20020a05651221c700b005118cb22f80mr267458lft.43.1707641549800; Sun, 11 Feb 2024 00:52:29 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 11 Feb 2024 03:52:28 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: References: <20240210070934.2549994-1-swboyd@chromium.org> <20240210070934.2549994-15-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Sun, 11 Feb 2024 03:52:28 -0500 Message-ID: Subject: Re: [PATCH 14/22] platform/chrome: cros_typec_switch: Add support for signaling HPD to drm_bridge To: Dmitry Baryshkov Cc: chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Douglas Anderson , Pin-yen Lin , Prashant Malani , Benson Leung , Tzung-Bi Shih Content-Type: text/plain; charset="UTF-8" Quoting Dmitry Baryshkov (2024-02-10 06:10:31) > On Sat, 10 Feb 2024 at 09:14, Stephen Boyd wrote: > > diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c > > index 769de2889f2f..d8fb6662cf8d 100644 > > --- a/drivers/platform/chrome/cros_typec_switch.c > > +++ b/drivers/platform/chrome/cros_typec_switch.c > > @@ -18,6 +19,15 @@ > > #include > > #include > > > > +#include > > +#include > > + > > +struct cros_typec_dp_bridge { > > + struct cros_typec_switch_data *sdata; > > + bool hpd_enabled; > > + struct drm_bridge bridge; > > +}; > > Is there any chance that you can use drm_dp_hpd_bridge_register() / > drm_aux_hpd_bridge_notify() instead of implementing another > drm_bridge? > If something is missing from the existing implementation we can > probably work that out. Yeah I think that can work. I had put the drm_bridge in this driver because I needed a 'struct device' per DP phy, but I think that problem goes away with an auxiliary device, so that is nicely solved. I'll have to add logic about typec ports to that auxiliary driver though, like mapping data-lanes and handling lane assignments. And then I'll move this code from the cros_typec_switch driver to the cros_ec_typec driver so it can be called outside of the typec mux set path. That's probably better because it's sort of bolted on to the cros_typec_switch driver. We'll need to know if the DP phy needs to handle orientation or if the EC is doing that somehow, so probably I'll need to add a DT property to the google,cros-ec-typec binding to indicate that orientation control is needed. It looks like I should add a new auxiliary device, like 'dp_typec_bridge', and have some other function like drm_dp_typec_bridge_register() for that. I can wrap the 'struct drm_aux_hpd_bridge_data' with a 'struct drm_aux_typec_bridge_data' and then the typec port information can live there. HPD can still be signaled with drm_aux_hpd_bridge_notify() but other functions can be used to set the active typec port, e.g. drm_aux_typec_bridge_set_active_port(), and then get orientation with typec_get_orientation() in the atomic_check().