From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9D10C55174 for ; Sat, 8 Aug 2026 13:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4M4UFgMiA/kjGbxRezpWv5tdN+ESXZuG14k4MpMW2gc=; b=W2rGpBmacelbss 8MfYS2Qx8e9ZnF/4HhoeD2E4ujvce7xLvEBfXdZYsh120Ocvxp8rRfY5dhXWIv4f4VsbhaWrR1bYf 5FVv8ae4nOESWazN/rMSVPR/YTdWqtdlS4LJ4hxkZHSO5tZzpY5i6enhKNBFDbvjUguDTzmw2hUzG 9SdKzmRJc6rbM4T+mKnetmaDDYSQ03r2wlYXfJ4ivZqBZCkopKdlaVKzMZrdPtp7qij6uKnfDMflu PDv8dewLsO8FMJj4h0fiMAekkMXz8Yew3INCwiRB7BcCCXGwvaA+B7Wtb6A6k5sVu2vBfGJD+01uS Yx0KXE9pNO+Rg3s+Ivgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wsh8e-00000009Pms-1qrT; Sat, 08 Aug 2026 13:31:00 +0000 Received: from mail-pz2-x01.google.com ([2607:f8b0:4864:3b::1]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wsh8b-00000009PmB-3Y5r for linux-phy@lists.infradead.org; Sat, 08 Aug 2026 13:30:59 +0000 Received: by mail-pz2-x01.google.com with SMTP id 41be03b00d2f7-c96a1a43f5bso15539a12.0 for ; Sat, 08 Aug 2026 06:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786195857; x=1786800657; darn=lists.infradead.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6zYCYgrPHJ1R0IyDM9ZJHQW95fmf52/M7XVvd8snhDU=; b=RvM2L+eVTE3dJONTBxEncLOeOKDdHINbZ8l/+rRCpEOFP/AQhQQvl68Xz2F49p/U7V FmIrOQpbrKjhSJqhZjVbbNq4I0QaajXhFNRmVsYy2VqjwTFIps6HbzvaXnpwMPf2weEe CGLEmrE1OLNZZNCPo0XCcu7zR7E+IXJRNc7vxIQvTwhMjr2U1g84BBu1V6j2AaaLb2j+ r/ljojxG8Vd+nYt157iC6TfhUjfYV9UDOh5XzVg8eXWPPXi44w5V6oV6XhG1aE0oXQuD 86toMTw3LuYWaM49ORBhZsrOnjW3nTyQrPI5tejhoUxHRqWWS24wu0S+NAIzTgcgIUH5 +a2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786195857; x=1786800657; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:subject:cc:to:from:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6zYCYgrPHJ1R0IyDM9ZJHQW95fmf52/M7XVvd8snhDU=; b=ZUpmPC823RNkx2SLtpu7PTs/X4sH/5JXBoZ1f9l3DMoTQam9OuEAMcEdA1Hr0A2Udg MOFgDZ9pc9wAn2U3Dzqs67MUsOOp53np22PVAp7UlCAw0eKZCe7SNGYCNzvEeSQV/aof ZDHWsGqeTU2FwEVMeZ/mg/RXxDGRzwCevuPMezwppLl1IauoASSZqYS6jTbG4xTNqp3V Wdpejx36RkqDs2E5T1NC0gQaVqAn5LetiC0nvsjqPLWf0sdenLEpeuTqmK/Quz/ePPcX EaEfVl9nvlZo8BHBKfedlq6pPF4QUH8UYfuqOsWzY0RlrrjHV6hnwsGo4+YlHq4V6stg bMqw== X-Forwarded-Encrypted: i=1; AHgh+RrgHV8ng+DMuABCd5r71GMgcwyYIh3BN0tnFbHFxMH37TbPw6CGND0T8G/0C2AF4sdOc22NRnQG2As=@lists.infradead.org X-Gm-Message-State: AOJu0YyJT37xKaZWsk8NWyk4eSPhxkVftLT9oyJ/iAmbKEQjI9C4LfBf t3d9ZN6CGgop3D6MJ+tSK47qj0DYLhm2k310Hf89i/Yr1QRc5lojEf3c X-Gm-Gg: AR+sD10hdw2CkZBvNKg/iqBKLGcH2PFWsRMDZVrTpkSqMO1MutUrdCoGKB6PUVfQ0xI /G44PoQ9ToPPTDdOQq2nm6wJ8eEUOiYw4fHLQIHqvTkKcGKhHL2uboCyyABFiCwjgUW9/zy/Jjx 8fIcKpajPiYt3lhYFUvl2UWt2KC7UQu4MOd3mdPswx4zRMHIN6zJomQ/YUZLZWZlPPkIId0fGpY YV9E500hUF+sBDuU0f+ZfxooOqMhfB5vt68YA6uqhyhI3L8Qt4Tp75q7E9pFKlnFXVVFR6bpENq FFY79+XfWlO/aYZmwKkjhS0eCu/dhG9Mha0pTdXl5d02QNtn6+Ebu5Cenwj0eUvpiwNFUUO9Qoe X1lLCkvvIUU5qq/+yRa1SstUnbFHYFj6xCEOdbr3LTmrIokEkcCwk/1F52TwporW4wVQohl0Bao PeQ5goChlTzcXQjPW2M9XcWInqTegHug+FaR+046eyxTLTb6qvlQ== X-Received: by 2002:a05:6a00:240c:b0:842:3838:cb03 with SMTP id d2e1a72fcca58-84f6b778b44mr5395163b3a.11.1786195856790; Sat, 08 Aug 2026 06:30:56 -0700 (PDT) Received: from localhost ([2403:2c80:17:1e::20db]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84f5a51e9a9sm2125357b3a.37.2026.08.08.06.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2026 06:30:56 -0700 (PDT) Date: Sat, 08 Aug 2026 21:30:52 +0800 Message-ID: From: Cody Kang To: Philipp Zabel Cc: David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Vinod Koul , Neil Armstrong , Haylen Chu , Michael Turquette , Stephen Boyd , Brian Masney , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , dri-devel@lists.freedesktop.org, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org Subject: Re: [PATCH RESEND 12/17] drm/spacemit: add Innosilicon DP/eDP controller bridge driver In-Reply-To: <5537a40f12e80b89e330f37032016de6f3b9f4c7.camel@pengutronix.de> References: <20260725-k3-display-v1-0-6de34d80e86c@gmail.com> <20260725-k3-display-v1-12-6de34d80e86c@gmail.com> <5537a40f12e80b89e330f37032016de6f3b9f4c7.camel@pengutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260808_063057_883682_AF6CEF22 X-CRM114-Status: GOOD ( 30.47 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Hi Philipp, On Mon, 27 Jul 2026 09:49:58 +0200, Philipp Zabel wrote: > On Sa, 2026-07-25 at 00:51 -0400, Cody Kang via B4 Relay wrote: > > From: Cody Kang > > > > Add the DP/eDP controller that sits downstream of the Saturn DPU. Two > > identical instances share one compatible; the eDP-vs-DP role is board > > wiring, so it is taken from the devicetree: an eDP panel always sits > > under an aux-bus child node, an external DP connector never does. > > > > The link is driven through the generic PHY framework, so the controller > > never touches a PLL register. The controller's HPD interrupt is gated by > > the DP pixel clock, which can be off exactly when a plug has to be > > caught, so the connector is also polled and the interrupt path re-reads > > the live level when it does fire. > > > > Signed-off-by: Cody Kang > > --- > > drivers/gpu/drm/spacemit/Kconfig | 19 + > > drivers/gpu/drm/spacemit/Makefile | 3 + > > drivers/gpu/drm/spacemit/spacemit_inno_dp.c | 2443 +++++++++++++++++++++++++++ > > drivers/gpu/drm/spacemit/spacemit_inno_dp.h | 328 ++++ > > 4 files changed, 2793 insertions(+) > > > [...] > > diff --git a/drivers/gpu/drm/spacemit/spacemit_inno_dp.c b/drivers/gpu/drm/spacemit/spacemit_inno_dp.c > > new file mode 100644 > > index 000000000000..e88731d9b18b > > --- /dev/null > > +++ b/drivers/gpu/drm/spacemit/spacemit_inno_dp.c > > @@ -0,0 +1,2443 @@ > [...] > > +static int inno_dp_probe(struct platform_device *pdev) > > +{ > [...] > > + dp->reset = devm_reset_control_get_optional_exclusive(&pdev->dev, NULL); > > Since this is only asserted in probe and deasserted in remove, you > could use devm_reset_control_get_optional_exclusive_deasserted() [1]. Thanks for the review. Will do in v2. The binding marks resets as required, which means I shouldn't use _optional in the first place. I will use the non-optional devm_reset_control_get_exclusive_deasserted(). > [1] https://docs.kernel.org/driver-api/reset.html#c.devm_reset_control_get_optional_exclusive_deasserted > > > + if (IS_ERR(dp->reset)) { > > + ret = dev_err_probe(dev, PTR_ERR(dp->reset), > > + "failed to get reset\n"); > > + return ret; > > + } > > + > > + dp->pxclk = devm_clk_get(dev, "pxclk"); > > + if (IS_ERR(dp->pxclk)) { > > + ret = dev_err_probe(dev, PTR_ERR(dp->pxclk), > > + "failed to get pxclk\n"); > > + return ret; > > + } > > + > > + if (dp->edp_mode) { > > + dp->bridge.type = DRM_MODE_CONNECTOR_eDP; > > + /* > > + * OP_DETECT is required: without it > > + * drm_bridge_connector_detect() hard-codes CONNECTED for any > > + * eDP connector and fbdev wedges at bind. > > + */ > > + dp->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | > > + DRM_BRIDGE_OP_HPD; > > + } else { > > + dp->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; > > + /* > > + * No OP_HPD: the HPD interrupt is gated by the DP pixel clock. > > + * Leaving it out marks the connector POLL_CONNECT | > > + * POLL_DISCONNECT instead. > > + */ > > + dp->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | > > + DRM_BRIDGE_OP_MODES; > > + } > > + > > + if (dp->reset) { > > This check is not necessary, reset_control_deassert() handles NULL > pointers. > > > + ret = reset_control_deassert(dp->reset); > > If the _deasserted() variant is used above, this can be removed and the > reset control doesn't need to be stored in dp. > > > + if (ret) { > > + dev_err(dev, "failed to deassert reset: %d\n", ret); > > + return ret; > > + } > > + } > > + > [...] > > + return 0; > > + > > +err_clk: > > + clk_disable_unprepare(dp->pxclk); > > +err_reset: > > + if (dp->reset) > > + reset_control_assert(dp->reset); > > Same as above. Remove the unnecessary check or manual assertion > entirely. Agree, all of these will be fixed in v2. Cody -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy