From patchwork Sun Jul 9 20:13:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701171 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4CEDEB64DD for ; Sun, 9 Jul 2023 20:13:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbjGIUNP (ORCPT ); Sun, 9 Jul 2023 16:13:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbjGIUNN (ORCPT ); Sun, 9 Jul 2023 16:13:13 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A95D2129 for ; Sun, 9 Jul 2023 13:13:12 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-4fb77f21c63so5683756e87.2 for ; Sun, 09 Jul 2023 13:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688933591; x=1691525591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c7lSjPQNhr0BWjor5LdaN815hU/chfe4hoYUxqnTCAI=; b=T5GzhtTyJjxGyLP24p+UvR8XLrB4NVRE7/XTXnHdYuT77xZjInL1SKJoXJXffjIa3e hUxY+aw8lZWYqavxNLsCk072IIDUzC27HS4WGJjZhXR6GsfqE10BM1LBkwHterRl5vYD ZZpRxt9ZEOzVu8OD6ELJrTwnL7hAce86y6Zu3nEHY41nQRqGO4d2lL6oczaA5sMUXdGZ tTI72OzMVuaNd9VhQlcEkzCJSz3O24Yxw8ShDUL5aJ40jVI19BKcsNB816PUuO2Xrh+A p5v5DPBxmn7jF+kjqdLcVz+cBYXAEdUdI6eg8XjNXCEM+dl+kHMyU/d/B8Rk+6zwPitS WvVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688933591; x=1691525591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c7lSjPQNhr0BWjor5LdaN815hU/chfe4hoYUxqnTCAI=; b=kZSNQq6rRF1+xweCWpu/A7PK73OD51bcB6XG7Y/Ti3dMDp0uWT5c9CfQVhwklhyAyw EjWG5Y2Jj3KCc8csMBYpMZoEjRuzz5u/gxt6IhC3B+TDa48mDGxoM9B/TaafvXOuAO0k 27drNQFTP93hNw9syt8fiKEpf9lKQN0Wznmbs+gzKGndESNbYPOaiOTdm6oyFELPws4/ lhGcf9KMDd+UT0MFCjsCTG25gQHdXPIXOVEUA19iWRXGSqzAPsUGpTZPBcjTcxocxWxK kY4KK6wqkAlnzhnwmYAVV+9VEsTZO32/Env5glvAVQ/BbVJ/1KzWr7PGmafI+E1KuVdW nmwg== X-Gm-Message-State: ABy/qLZV5MB1Ru0b/B1pmDQIflwT2KWK4TDYWnl27qlIQMD3F/J6COS6 bfq5tw6iKM10QVtoph+2FnPCdA== X-Google-Smtp-Source: APBJJlFZuEiOyJs+Wxo5yotGxmFY/kIczdsa1ko9Q5u26MRMkHnsWnGRIo9a62sNAbznJh5fjeHpqw== X-Received: by 2002:a05:6512:3295:b0:4f8:770f:1b0b with SMTP id p21-20020a056512329500b004f8770f1b0bmr7078397lfe.33.1688933591071; Sun, 09 Jul 2023 13:13:11 -0700 (PDT) Received: from lothlorien.lan (dzdqv0yyyyyyyyyyybm5y-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::ab2]) by smtp.gmail.com with ESMTPSA id c12-20020ac2530c000000b004fb77d6cab3sm1420378lfh.261.2023.07.09.13.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 13:13:10 -0700 (PDT) From: Dmitry Baryshkov To: Heikki Krogerus , Greg Kroah-Hartman , Bryan O'Donoghue , Guenter Roeck , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 1/2] usb: typec: altmodes/displayport: add support for embedded DP cases Date: Sun, 9 Jul 2023 23:13:08 +0300 Message-Id: <20230709201309.274306-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230709201309.274306-1-dmitry.baryshkov@linaro.org> References: <20230709201309.274306-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In the embedded cases, the DisplayPort connector is handled by the TCPM itself. Fallback to the controller fwnode for HPD notifications to support such usecases without requiring additional DT properties. Signed-off-by: Dmitry Baryshkov --- drivers/usb/typec/altmodes/displayport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index 4e5aa17ce4c8..699438c7755e 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -578,7 +578,10 @@ int dp_altmode_probe(struct typec_altmode *alt) alt->ops = &dp_altmode_ops; fwnode = dev_fwnode(alt->dev.parent->parent); /* typec_port fwnode */ - dp->connector_fwnode = fwnode_find_reference(fwnode, "displayport", 0); + if (fwnode_property_present(fwnode, "displayport")) + dp->connector_fwnode = fwnode_find_reference(fwnode, "displayport", 0); + else + dp->connector_fwnode = fwnode_handle_get(fwnode); /* embedded DP */ if (IS_ERR(dp->connector_fwnode)) dp->connector_fwnode = NULL;