Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9466305ybl; Fri, 17 Jan 2020 12:31:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzvLaL5W4ACbONyNOc0YcMTPxmYNKx552V7o1OMAsKdGIE092WR8p3VMiFpbOxbBquHZxuD X-Received: by 2002:a9d:7f16:: with SMTP id j22mr7367356otq.256.1579293072537; Fri, 17 Jan 2020 12:31:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579293072; cv=none; d=google.com; s=arc-20160816; b=D03VkbvahHygOnjveIf7nusEYKHoulI8v1NPCxbCe4ienQREhKCElgch3Ln3got5kd Z8/ORpD3eTMwT9UzOiKDvunq5xArCPfN6IeKwCh7w0lXggq78UE0KaXtJ2fRTS6xbSp3 qeS1XwubifQ54o/1ClW7PGg0AdVcaOuv2V8MVW5HYzMZajcQv5Q27fweqbzL8zZnoHVq ZAHs/sZRdGlp4OIMDiUMo8T7rMHsrZTlQWj6VNd9LpOaVzpKHIq+gws/KiZTMrFW8ZS7 of80OfpPSTlz33QeN21rroc43EgsCbqMypp7XXZnlqYiIYS6bA3Dah0TR7YBIiNqM6EB 2GLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GGAyM1twdUCFSIRwHNEdtuNNt80SvelsJ0RcGl3xtNU=; b=RcuKIGlL8j1Mbzsi5Ay5sDo351j/eMkezz3eUnLZcZYV+OeYkNdlO9sDK6GVFS7oto qQeY/qeiQUX90BqEFyAiRvDC074A/Q+6tuLoEuXz4jzekEIEyMnss/6y9D89XyHkwnF/ Je/tfRUf74pCqJk9d41094EgechrgHIqVlXhM2E8HNSJ0x6QSBaDlvgFNnLtjna4ehsB CPmbVDrjTzsb3oDniRbXCCKuL5EO3bcrZhS7zQrdY/YW8hvaAm1H/kmZeRdRVtCQFBI+ eEz0dgMMVRJFvYzshwHVyfzZ+ao8Wr7kKmVlR3yUhorvQd9Xp4gZfRebNWPGW3g6F6TP 7ThQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YcPaX20o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id c2si14513508oig.255.2020.01.17.12.31.00; Fri, 17 Jan 2020 12:31:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YcPaX20o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729777AbgAQUaD (ORCPT + 99 others); Fri, 17 Jan 2020 15:30:03 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37780 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729593AbgAQUaD (ORCPT ); Fri, 17 Jan 2020 15:30:03 -0500 Received: by mail-pl1-f196.google.com with SMTP id c23so10310500plz.4 for ; Fri, 17 Jan 2020 12:30:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GGAyM1twdUCFSIRwHNEdtuNNt80SvelsJ0RcGl3xtNU=; b=YcPaX20oCsGJgoOto+VUl/hdNBU4hapAOJeZycJ6ydDHTUO1UkASSTnQ7fPUP4h89B zYvZFzjJgjwPJCz5etFqEK6kRSTDTKQvK3axG4ZLJp9Il+6BCHnEkMI/XcZ8uSmU5Svn lgtUfRgkQKHf/9p6b79EOBLjR5Ox4Q19How+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GGAyM1twdUCFSIRwHNEdtuNNt80SvelsJ0RcGl3xtNU=; b=Dj51AC0p3HUBp4uCjDdL3A24WbBJVFDtdQTwdx5eIUBhchherayf7naUvnyxylIP9q kx+i2EyNk/FiEVRz7agHwbCMGpTxC0ppf8li+EEDnm9n5zcPindkortNdlguBY5xwksP sEnMbFeQFBrxGUQ9hJIxL4vgxgMSXNz0Eu7zZoUNzJRPB/krhhHlaYZFV0R61EQX4LPk ejkjDO6Zl6RxDnQvl2m3dDLpKZKdzpB+5TvIa3rbnrj3upGIu2XkFt4e6PoIz6iRvqtb ZM3yn/xaddrDr1AsXS4C++SHlyAXjEQHK0Eh1RNd9Q1CLbfN9RK32wbFtFPHGJ49zx48 ITnQ== X-Gm-Message-State: APjAAAUDH1NUF2lUEjS75iW9gOJcRusWo6S/O7A4ocVZzmuTHX3ORncU 7pOEBD6PC+xbqcP/UdJsIDoq+w== X-Received: by 2002:a17:90a:a596:: with SMTP id b22mr8202926pjq.28.1579293002540; Fri, 17 Jan 2020 12:30:02 -0800 (PST) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id n188sm29430344pga.84.2020.01.17.12.30.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jan 2020 12:30:01 -0800 (PST) Date: Fri, 17 Jan 2020 12:30:00 -0800 From: Matthias Kaehlcke To: Sandeep Maheswaram Cc: Andy Gross , Bjorn Andersson , Kishon Vijay Abraham I , Rob Herring , Mark Rutland , Stephen Boyd , Doug Anderson , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Manu Gautam Subject: Re: [PATCH v3 1/5] phy: qcom-qusb2: Add QUSB2 PHY support for SC7180 Message-ID: <20200117203000.GP89495@google.com> References: <1578658699-30458-1-git-send-email-sanm@codeaurora.org> <1578658699-30458-2-git-send-email-sanm@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1578658699-30458-2-git-send-email-sanm@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Jan 10, 2020 at 05:48:15PM +0530, Sandeep Maheswaram wrote: > Using generic cfg table for QUSB2 V2 PHY. > Add QUSB2 PHY config data and compatible for SC7180. > > Signed-off-by: Sandeep Maheswaram > --- > drivers/phy/qualcomm/phy-qcom-qusb2.c | 22 ++++++++++++++-------- > 1 file changed, 14 insertions(+), 8 deletions(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c > index bf94a52..db4ae26 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c > +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (c) 2017, The Linux Foundation. All rights reserved. > + * Copyright (c) 2017, 2019, The Linux Foundation. All rights reserved. > */ > > #include > @@ -177,7 +177,7 @@ static const struct qusb2_phy_init_tbl msm8998_init_tbl[] = { > QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19), > }; > > -static const unsigned int sdm845_regs_layout[] = { > +static const unsigned int qusb2_v2_regs_layout[] = { > [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8, > [QUSB2PHY_PLL_STATUS] = 0x1a0, > [QUSB2PHY_PORT_TUNE1] = 0x240, > @@ -191,7 +191,7 @@ static const unsigned int sdm845_regs_layout[] = { > [QUSB2PHY_INTR_CTRL] = 0x230, > }; > > -static const struct qusb2_phy_init_tbl sdm845_init_tbl[] = { > +static const struct qusb2_phy_init_tbl qusb2_v2_init_tbl[] = { > QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x03), > QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CLOCK_INVERTERS, 0x7c), > QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CMODE, 0x80), > @@ -258,10 +258,10 @@ static const struct qusb2_phy_cfg msm8998_phy_cfg = { > .update_tune1_with_efuse = true, > }; > > -static const struct qusb2_phy_cfg sdm845_phy_cfg = { > - .tbl = sdm845_init_tbl, > - .tbl_num = ARRAY_SIZE(sdm845_init_tbl), > - .regs = sdm845_regs_layout, > +static const struct qusb2_phy_cfg qusb2_v2_phy_cfg = { > + .tbl = qusb2_v2_init_tbl, > + .tbl_num = ARRAY_SIZE(qusb2_v2_init_tbl), > + .regs = qusb2_v2_regs_layout, > > .disable_ctrl = (PWR_CTRL1_VREF_SUPPLY_TRIM | PWR_CTRL1_CLAMP_N_EN | > POWER_DOWN), > @@ -774,8 +774,14 @@ static const struct of_device_id qusb2_phy_of_match_table[] = { > .compatible = "qcom,msm8998-qusb2-phy", > .data = &msm8998_phy_cfg, > }, { > + .compatible = "qcom,sc7180-qusb2-phy", > + .data = &qusb2_v2_phy_cfg, > + }, { I don't think you need the new entry as of now, since sc7180 just uses the standard v2 configuration. DT compatible entries should look like this: { compatible = "qcom,sc7180-qusb2-phy", "qcom,qusb2-v2-phy"; ... } hence the correct configuration is selected, even without a specific entry for 'qcom,sc7180-qusb2-phy'. > .compatible = "qcom,sdm845-qusb2-phy", > - .data = &sdm845_phy_cfg, > + .data = &qusb2_v2_phy_cfg, > + }, { think this can also be removed if you add 'qcom,qusb2-v2-phy' to the list of compatible strings of nodes 'usb_1_hsphy' and 'usb_2_hsphy' in arch/arm64/boot/dts/qcom/sdm845.dtsi. > + .compatible = "qcom,qusb2-v2-phy", > + .data = &qusb2_v2_phy_cfg, > }, > { }, > };