Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4959008imm; Tue, 31 Jul 2018 03:10:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpewg4AVDDR4wmDXML+xojfK8Hl2TwHquPSx5ps0mSHGJDYZyrIe+KCmP141UU0gfLkTQQTH X-Received: by 2002:a65:4c41:: with SMTP id l1-v6mr20107206pgr.310.1533031847461; Tue, 31 Jul 2018 03:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533031847; cv=none; d=google.com; s=arc-20160816; b=jspfr6+/cQtga+qNGH5cbN4oAWCMi91YRKIP6ubuoCpuadCehTstjPOn29VjxLFEZ1 Uo5z8ILMyaXz9F67lbQnVHuXFs7qDxxhiY9zx4yujq5Cpwf4gH/Me7wOGUl28Uutdg4A f3KJmVgUABbkaLEr6xVYT3HKNsJZb2QRjsmg1rZf/CXylmnmO4GC5RuKuP6M2AAexsGN d1zTtFEQU4d4GGAD0RaHoEcazRtFRNBZmIgeRQMsz43yNgTN03k9sIvUx7x3OzWzpcYM yIufoxBp9omhzZLTRcypMDGzkg5IqhY2nXzYLd2RTq/dPEUwp9iahG8GLEZZLpBb0a1V HLOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=gTJJ7iRa3fPBYohPhGb7v2cIFzEKicAsqv2NYgcbHec=; b=TQFD3d5/mRqltxl2Hj/Rb9Tmeo1cbVkj5u32laxDxulIwSs7EyK1tXZhe40gKJ62IS 9XKxWUU7+KXIy3zDA+7rP/HSnTldGjyJst9JIfp1uiRfTc4CW8fZWq+XQ6biDYE/rkN9 q7MFC7FDkycXnlCv6L5M6apVCsBNUgEJ4EZRjjI1sxF0K+66g7DQvw/piEAjApmN/za+ KLFi8CUKWjtk2MgsDo+VTGCPu31pmITsq2Ii6DZ1FfM6uvksAylMEPv/Al/vxm9fgsFJ PqVwQ1JGcoK8M6xlK1sjemZLs9NqVfafq33EyxBVABHu/fqkbGKUeoy1YVx5nL5simGn lrxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="m5/YLmQl"; dkim=pass header.i=@codeaurora.org header.s=default header.b="j/6ZeSiH"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a21-v6si12544153pfo.68.2018.07.31.03.10.33; Tue, 31 Jul 2018 03:10:47 -0700 (PDT) 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=@codeaurora.org header.s=default header.b="m5/YLmQl"; dkim=pass header.i=@codeaurora.org header.s=default header.b="j/6ZeSiH"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732073AbeGaLtJ (ORCPT + 99 others); Tue, 31 Jul 2018 07:49:09 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48310 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbeGaLtJ (ORCPT ); Tue, 31 Jul 2018 07:49:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BB0FA60481; Tue, 31 Jul 2018 10:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533031773; bh=YI6a5Q0HGLwKjizFSW2cEEIaRoKPDm3Mpw28U05ro6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m5/YLmQl6TFdaLH4cQf1nj6I625sCE+SJkeUWG5QpZskItKADgkHXmSRWQkHpNcAz SRgxdCmHZm6rPWjKRneMDB3vtArAlhDPo6hVD+E+WflG3o+GU6CgLiwxrjLvlvH2Cp edQxjuL4cxBZzXLRcteyQZ23vbOCfMHVrMibc1IY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from CANG02.ap.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cang@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7BA0E60585; Tue, 31 Jul 2018 10:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1533031772; bh=YI6a5Q0HGLwKjizFSW2cEEIaRoKPDm3Mpw28U05ro6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j/6ZeSiHt5fEMa+R6oo8+KKHsFnjIaeZuaP+4XNkO1MbNyCNGRS1M35aCtHsf6JVq X5Wr/p1dRa9N8blmyldzfOWlU4zmHfuPovKnxnqEQhNHwkXnrratjbiR2uKbATKgcc fCyXem8LsgJTzIQ/43H5bncy7z++GTecpbbWmA4Y= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7BA0E60585 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cang@codeaurora.org From: Can Guo To: subhashj@codeaurora.org, asutoshd@codeaurora.org, vivek.gautam@codeaurora.org, mgautam@codeaurora.org, kishon@ti.com, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, Can Guo Subject: [PATCH v8 2/5] phy: General struct and field cleanup Date: Tue, 31 Jul 2018 18:09:11 +0800 Message-Id: <20180731100914.19856-3-cang@codeaurora.org> X-Mailer: git-send-email 2.15.0.windows.1 In-Reply-To: <20180731100914.19856-1-cang@codeaurora.org> References: <20180731100914.19856-1-cang@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move MSM8996 specific PHY vreg list struct name to a genernal one as it is used by all PHYs. Add a specific field to handle dual lane situation. Signed-off-by: Can Guo Reviewed-by: Evan Green Reviewed-by: Manu Gautam Reviewed-by: Vivek Gautam --- drivers/phy/qualcomm/phy-qcom-qmp.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index ccb8578..9be9754 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -649,6 +649,8 @@ struct qmp_phy_cfg { /* true, if PHY has a separate DP_COM control block */ bool has_phy_dp_com_ctrl; + /* true, if PHY has secondary tx/rx lanes to be configured */ + bool is_dual_lane_phy; /* Register offset of secondary tx/rx lanes for USB DP combo PHY */ unsigned int tx_b_lane_offset; unsigned int rx_b_lane_offset; @@ -758,7 +760,7 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) }; /* list of regulators */ -static const char * const msm8996_phy_vreg_l[] = { +static const char * const qmp_phy_vreg_l[] = { "vdda-phy", "vdda-pll", }; @@ -778,8 +780,8 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), .reset_list = msm8996_pciephy_reset_l, .num_resets = ARRAY_SIZE(msm8996_pciephy_reset_l), - .vreg_list = msm8996_phy_vreg_l, - .num_vregs = ARRAY_SIZE(msm8996_phy_vreg_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = pciephy_regs_layout, .start_ctrl = PCS_START | PLL_READY_GATE_EN, @@ -809,8 +811,8 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) .num_clks = ARRAY_SIZE(msm8996_phy_clk_l), .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), - .vreg_list = msm8996_phy_vreg_l, - .num_vregs = ARRAY_SIZE(msm8996_phy_vreg_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = usb3phy_regs_layout, .start_ctrl = SERDES_START | PCS_START, @@ -870,8 +872,8 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), - .vreg_list = msm8996_phy_vreg_l, - .num_vregs = ARRAY_SIZE(msm8996_phy_vreg_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, .start_ctrl = SERDES_START | PCS_START, @@ -883,6 +885,7 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) .pwrdn_delay_max = POWER_DOWN_DELAY_US_MAX, .has_phy_dp_com_ctrl = true, + .is_dual_lane_phy = true, .tx_b_lane_offset = 0x400, .rx_b_lane_offset = 0x400, }; @@ -903,8 +906,8 @@ static inline void qphy_clrbits(void __iomem *base, u32 offset, u32 val) .num_clks = ARRAY_SIZE(qmp_v3_phy_clk_l), .reset_list = msm8996_usb3phy_reset_l, .num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l), - .vreg_list = msm8996_phy_vreg_l, - .num_vregs = ARRAY_SIZE(msm8996_phy_vreg_l), + .vreg_list = qmp_phy_vreg_l, + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), .regs = qmp_v3_usb3phy_regs_layout, .start_ctrl = SERDES_START | PCS_START, @@ -1116,12 +1119,12 @@ static int qcom_qmp_phy_init(struct phy *phy) /* Tx, Rx, and PCS configurations */ qcom_qmp_phy_configure(tx, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num); /* Configuration for other LANE for USB-DP combo PHY */ - if (cfg->has_phy_dp_com_ctrl) + if (cfg->is_dual_lane_phy) qcom_qmp_phy_configure(tx + cfg->tx_b_lane_offset, cfg->regs, cfg->tx_tbl, cfg->tx_tbl_num); qcom_qmp_phy_configure(rx, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num); - if (cfg->has_phy_dp_com_ctrl) + if (cfg->is_dual_lane_phy) qcom_qmp_phy_configure(rx + cfg->rx_b_lane_offset, cfg->regs, cfg->rx_tbl, cfg->rx_tbl_num); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project