From patchwork Thu Jun 11 09:19:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 188548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E71DAC433DF for ; Thu, 11 Jun 2020 09:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC3022083E for ; Thu, 11 Jun 2020 09:20:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VNL+43GY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbgFKJUA (ORCPT ); Thu, 11 Jun 2020 05:20:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbgFKJTZ (ORCPT ); Thu, 11 Jun 2020 05:19:25 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96EDC08C5C5 for ; Thu, 11 Jun 2020 02:19:23 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id s10so2307839pgm.0 for ; Thu, 11 Jun 2020 02:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IffcdynUzLiVRH6ZJC8EjUsRzUadgkTfcsySB4WRgNE=; b=VNL+43GYhCqFGotP9JyZlnwxmJgU1dVnZWI+2KDxyHXld23AV/7bzPgibZ6iZibpnr 7PiNXpZE/93VoL+CXzAUMEaoD/bLopzwG4vZG5fKs3TIAhmBQR5SAQVvnkGM9rcns7hv 7FCF18SnLTbSfBbdL6MLXuECKryeb66Z5TqWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IffcdynUzLiVRH6ZJC8EjUsRzUadgkTfcsySB4WRgNE=; b=OzlBYaFMsVnrAlbVtij6vwDYOL125eePByn3L1Dy/pun4ABBtS98fiUhqShwgP6Rs7 hWrueellhm1Bhtez2k6nFS0+indalqDPSZibTr4F9qhjqLDQKYfcFMFZJTjFOTT5MLhU +lO3cLR3HgkvwnJHJFVG8Hniy2JenKZnhi1LswV6BFhZH01k3YvgXNGShmB5Coi4DXxW uyy7UEFbjgGKGRInWKY6QmhWEyB6mUOajd/Z4efZMA3tKUEOi4em1o/WU1S1y5usum9C IwUqRjvOzmT/AQ/Ey+StRW7FqrSOD4dbHkuOW5WmVCMlLSTE7ZMMBU5lmQgmLgt/CDr6 nqYg== X-Gm-Message-State: AOAM531vj2WOySDeoKP6OXymNl0znfqUFafeYCTTeaaMhQ6Ey8pvozjE cGYoRz2UADQB5pZ/0qqg/2TMIA== X-Google-Smtp-Source: ABdhPJzWzzcxsoD0Otp8bKkBEdtKvM+xPzFi8wYbCPfB57ykYKdGwXGzYzY8r1vE2jQLi2Zqg9+SZQ== X-Received: by 2002:a63:fd57:: with SMTP id m23mr6506336pgj.325.1591867163236; Thu, 11 Jun 2020 02:19:23 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id 1sm2367852pfx.210.2020.06.11.02.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 02:19:22 -0700 (PDT) From: Stephen Boyd To: Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jeykumar Sankaran , Chandan Uddaraju , Vara Reddy , Tanmay Shah , Bjorn Andersson , Manu Gautam , Sandeep Maheswaram , Douglas Anderson , Sean Paul Subject: [PATCH/RFC 2/8] phy: qcom-qmp: Remove 'initialized' in favor of 'init_count' Date: Thu, 11 Jun 2020 02:19:13 -0700 Message-Id: <20200611091919.108018-3-swboyd@chromium.org> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog In-Reply-To: <20200611091919.108018-1-swboyd@chromium.org> References: <20200611091919.108018-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We already track if any phy inside the qmp wrapper has been initialized by means of the struct qcom_qmp::init_count member. Let's drop the duplicate 'initalized' member to simplify the code a bit. Cc: Jeykumar Sankaran Cc: Chandan Uddaraju Cc: Vara Reddy Cc: Tanmay Shah Cc: Bjorn Andersson Cc: Manu Gautam Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Sean Paul Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index fa8faa2d3d69..f3f0cab99ed0 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -1382,7 +1382,6 @@ struct qmp_phy { * @phys: array of per-lane phy descriptors * @phy_mutex: mutex lock for PHY common block initialization * @init_count: phy common block initialization count - * @phy_initialized: indicate if PHY has been initialized * @ufs_reset: optional UFS PHY reset handle */ struct qcom_qmp { @@ -1399,7 +1398,6 @@ struct qcom_qmp { struct mutex phy_mutex; int init_count; - bool phy_initialized; struct reset_control *ufs_reset; }; @@ -2114,7 +2112,6 @@ static int qcom_qmp_phy_enable(struct phy *phy) dev_err(qmp->dev, "phy initialization timed-out\n"); goto err_pcs_ready; } - qmp->phy_initialized = true; return 0; err_pcs_ready: @@ -2152,8 +2149,6 @@ static int qcom_qmp_phy_disable(struct phy *phy) qcom_qmp_phy_com_exit(qmp); - qmp->phy_initialized = false; - return 0; } @@ -2228,7 +2223,7 @@ static int __maybe_unused qcom_qmp_phy_runtime_suspend(struct device *dev) if (cfg->type != PHY_TYPE_USB3) return 0; - if (!qmp->phy_initialized) { + if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; } @@ -2254,7 +2249,7 @@ static int __maybe_unused qcom_qmp_phy_runtime_resume(struct device *dev) if (cfg->type != PHY_TYPE_USB3) return 0; - if (!qmp->phy_initialized) { + if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; } From patchwork Thu Jun 11 09:19:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 188550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 425E2C433E2 for ; Thu, 11 Jun 2020 09:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ECB120801 for ; Thu, 11 Jun 2020 09:19:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="C+z/AWXq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbgFKJT2 (ORCPT ); Thu, 11 Jun 2020 05:19:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727037AbgFKJT0 (ORCPT ); Thu, 11 Jun 2020 05:19:26 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86CAEC08C5C2 for ; Thu, 11 Jun 2020 02:19:25 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id b5so1341875pgm.8 for ; Thu, 11 Jun 2020 02:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5LpZ1I24LzIYbhauF0cdv9OkeHWQm8vU4vzlbgzihJI=; b=C+z/AWXqqqyoNGp2beIObz9flW/5cQ7P6N13gSPIgc64s2Jop6sfsm7A9Fyv5oLwXV 4ZGcCbEzds+M8NSiYmV1e/tQCX4hd6FePNTXJtm7XgH02eGGtUnFa0XlzBQUXwTlmiX1 odZLSscTFven04VLWscFmeudCJ2U4LgGusJMA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5LpZ1I24LzIYbhauF0cdv9OkeHWQm8vU4vzlbgzihJI=; b=KggzSZAYlkndhosf6gQ/0T4Xntdxhx77ooaAoqw4WIudWyTC2qY0woc08R7cSO41rz rYx35cFvVenmxF8GVQ7b1EFob7x2JApjlJ/IVe4GnhsrahO2o/W/bhGdCXGd07L6ldhs cmtBtmCLvPCC7NnzxP57zODILWEj2ZYH67LA0TNpIZFhMcspVhRj+SzfgjVMfkkx8N4A 9vdUIailT/M2pfXa9XviMXRlJoWNkKzAGXZ4mL+Y+HCf46FBzRI9F0Qzgdk8yX+26C/t vg2tMydkgb1MZO8Fugw2pY9t3Qtn/SS37lrILumN+WezIkfI7DiPbqT4tfskSmwWTIvV 9RLA== X-Gm-Message-State: AOAM531djHnVsjTZSE4HNn5JkPZyQFZO+MkJXHD35R0T/tqq+HVGs+Ks MxY9QBPo9HA9u8vH7qpusDXUtg== X-Google-Smtp-Source: ABdhPJwzJPE7MfrQqvauxYPmpM5cOPWyY7NDCroTlQmtVZKhjPPDhPWOd2QQiztqms+Ay51GEAd7KA== X-Received: by 2002:a62:7993:: with SMTP id u141mr6712669pfc.110.1591867165095; Thu, 11 Jun 2020 02:19:25 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id 1sm2367852pfx.210.2020.06.11.02.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 02:19:24 -0700 (PDT) From: Stephen Boyd To: Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jeykumar Sankaran , Chandan Uddaraju , Vara Reddy , Tanmay Shah , Bjorn Andersson , Manu Gautam , Sandeep Maheswaram , Douglas Anderson , Sean Paul Subject: [PATCH/RFC 4/8] phy: qcom-qmp: Get dp_com I/O resource by index Date: Thu, 11 Jun 2020 02:19:15 -0700 Message-Id: <20200611091919.108018-5-swboyd@chromium.org> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog In-Reply-To: <20200611091919.108018-1-swboyd@chromium.org> References: <20200611091919.108018-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The dp_com resource is always at index 1 according to the dts files in the kernel. Get this resource by index so that we don't need to make future additions to the DT binding use 'reg-names'. Cc: Jeykumar Sankaran Cc: Chandan Uddaraju Cc: Vara Reddy Cc: Tanmay Shah Cc: Bjorn Andersson Cc: Manu Gautam Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Sean Paul Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index dace2f497c85..9dbc8c422263 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -2608,8 +2608,7 @@ static int qcom_qmp_phy_probe(struct platform_device *pdev) /* per PHY dp_com; if PHY has dp_com control block */ if (cfg->has_phy_dp_com_ctrl) { - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "dp_com"); + res = platform_get_resource(pdev, IORESOURCE_MEM, 1); base = devm_ioremap_resource(dev, res); if (IS_ERR(base)) return PTR_ERR(base); From patchwork Thu Jun 11 09:19:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 188549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E9BEC433E3 for ; Thu, 11 Jun 2020 09:19:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9A7E2083E for ; Thu, 11 Jun 2020 09:19:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IHlYe6N1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727093AbgFKJTn (ORCPT ); Thu, 11 Jun 2020 05:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727041AbgFKJT1 (ORCPT ); Thu, 11 Jun 2020 05:19:27 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805D3C08C5C5 for ; Thu, 11 Jun 2020 02:19:27 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id b201so2437068pfb.0 for ; Thu, 11 Jun 2020 02:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KudpLSpXqj1Z9k8pwvBBduHUKZ612Cfs4Dza1EdkkLU=; b=IHlYe6N142CwZ9UozoEiR7e3+AcKrMOaZqPxZprdr/TNQ4z/j7lVHQf6UsUg1DjVIJ aEBAetfGfOeeJLOyizsa21Q591SPshCTtky6hHTnl+T6tQabRZ7FxrTy9UD8ElAkdQNd Un+VWr/t1SKkkNW0XCZXhC1NI8cMVGa6RdRI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KudpLSpXqj1Z9k8pwvBBduHUKZ612Cfs4Dza1EdkkLU=; b=ViiDMFceFRc5vWM385DCoEnXNh0HNGUEeAaHnc74nBm434U+7BvEzPfn+CYg4pHEK+ iJLzciB8tjZHBRr9FCAby6TOpSjO1fN0ak+ArixWSa7hzJ6aPsK74ktOJLSwoTjrAgfN iJuyQKZEX3+AyrJ3Zx/W5lU4eUcczLddIRGlpqC8xzjK6r5VLyYyqUxmOlyr+ToQz0aG wkVBKfZA0WdDuXZSQ8dkXt0DvzSV788o0KCCmAbwaYP+BxB2bairQzF6VEnKaBjqGmwA 4yRfcw1SAUbhdWgkPIU6nctdxgOYHG4fTUMhd3ALwh2f1FK6gwwT5Xr+gnQJHoKlkV+/ 5G5A== X-Gm-Message-State: AOAM532dRRlLofXUPHrhYPjw86viauyrlRQr6ezBr5qs874uG2auqy5I s9i39TFzwDiEd0k0AjdwRFqVXw== X-Google-Smtp-Source: ABdhPJzlsQ2ElXykmsDK44gv2wdEYeVibfslwxUkSrqUj0M+wND+s+D4qsnVEvEkfFWQjbgvxxR0Yg== X-Received: by 2002:a05:6a00:2ae:: with SMTP id q14mr6473844pfs.255.1591867167060; Thu, 11 Jun 2020 02:19:27 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:fa53:7765:582b:82b9]) by smtp.gmail.com with ESMTPSA id 1sm2367852pfx.210.2020.06.11.02.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 02:19:26 -0700 (PDT) From: Stephen Boyd To: Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jeykumar Sankaran , Chandan Uddaraju , Vara Reddy , Tanmay Shah , Bjorn Andersson , Manu Gautam , Sandeep Maheswaram , Douglas Anderson , Sean Paul Subject: [PATCH/RFC 6/8] phy: qcom-qmp: Add support for sc7180 DP phy Date: Thu, 11 Jun 2020 02:19:17 -0700 Message-Id: <20200611091919.108018-7-swboyd@chromium.org> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog In-Reply-To: <20200611091919.108018-1-swboyd@chromium.org> References: <20200611091919.108018-1-swboyd@chromium.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the necessary compatible strings and phy data for the sc7180 USB3+DP combo phy. Link: https://lore.kernel.org/r/20200609034623.10844-1-tanmay@codeaurora.org Cc: Jeykumar Sankaran Cc: Chandan Uddaraju Cc: Vara Reddy Cc: Tanmay Shah Cc: Bjorn Andersson Cc: Manu Gautam Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Sean Paul Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 290233becd58..f6841716d21a 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -961,6 +961,24 @@ static const struct qmp_phy_init_tbl qmp_v3_dp_serdes_tbl_hbr3[] = { QMP_PHY_INIT_CFG(QSERDES_V3_COM_CP_CTRL_MODE0, 0x06), }; +static const struct qmp_phy_init_tbl qmp_v3_dp_tx_tbl[] = { + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TRANSCEIVER_BIAS_EN, 0x1a), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_VMODE_CTRL1, 0x40), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_PRE_STALL_LDO_BOOST_EN, 0x30), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_INTERFACE_SELECT, 0x3d), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_CLKBUF_ENABLE, 0x0f), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_RESET_TSYNC_EN, 0x03), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TRAN_DRVR_EMP_EN, 0x03), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_PARRATE_REC_DETECT_IDLE_EN, 0x00), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TX_INTERFACE_MODE, 0x00), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TX_BAND, 0x4), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TX_POL_INV, 0x0a), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TX_DRV_LVL, 0x38), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_TX_EMP_POST1_LVL, 0x20), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_RES_CODE_LANE_OFFSET_TX, 0x06), + QMP_PHY_INIT_CFG(QSERDES_V3_TX_RES_CODE_LANE_OFFSET_RX, 0x07), +}; + static const struct qmp_phy_init_tbl qmp_v3_usb3_rx_tbl[] = { QMP_PHY_INIT_CFG(QSERDES_V3_RX_UCDR_FASTLOCK_FO_GAIN, 0x0b), QMP_PHY_INIT_CFG(QSERDES_V3_RX_RX_EQU_ADAPTOR_CNTRL2, 0x0f), @@ -1842,6 +1860,28 @@ static const struct qmp_phy_cfg sc7180_usb3phy_cfg = { .is_dual_lane_phy = true, }; +static const struct qmp_phy_cfg sc7180_dpphy_cfg = { + .type = PHY_TYPE_DP, + .nlanes = 1, + + .tx_tbl = qmp_v3_dp_tx_tbl, + .tx_tbl_num = ARRAY_SIZE(qmp_v3_dp_tx_tbl), + .clk_list = qmp_v3_phy_clk_l, + .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), + .reset_list = sc7180_usb3phy_reset_l, + .num_resets = ARRAY_SIZE(sc7180_usb3phy_reset_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), + + .has_phy_dp_com_ctrl = true, + .is_dual_lane_phy = true, +}; + +static const struct qmp_phy_combo_cfg sc7180_usb3dpphy_cfg = { + .usb_cfg = &sc7180_usb3phy_cfg, + .dp_cfg = &sc7180_dpphy_cfg, +}; + static const struct qmp_phy_cfg qmp_v3_usb3_uniphy_cfg = { .type = PHY_TYPE_USB3, .nlanes = 1, @@ -3247,6 +3287,9 @@ static const struct of_device_id qcom_qmp_phy_of_match_table[] = { }, { .compatible = "qcom,sc7180-qmp-usb3-phy", .data = &sc7180_usb3phy_cfg, + }, { + .compatible = "qcom,sc7180-qmp-usb3-dp-phy", + /* It's a combo phy */ }, { .compatible = "qcom,sdm845-qhp-pcie-phy", .data = &sdm845_qhp_pciephy_cfg, @@ -3274,6 +3317,10 @@ static const struct of_device_id qcom_qmp_phy_of_match_table[] = { MODULE_DEVICE_TABLE(of, qcom_qmp_phy_of_match_table); static const struct of_device_id qcom_qmp_combo_phy_of_match_table[] = { + { + .compatible = "qcom,sc7180-qmp-usb3-dp-phy", + .data = &sc7180_usb3dpphy_cfg, + }, { } };