Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3005961ima; Mon, 22 Oct 2018 21:37:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV625hP0WM5x44FC7Abiy0eXttyAwLs3L+CZa6JiX7ff8FkEfzuyBE7iLHTLbxvWSI+taPl11 X-Received: by 2002:a17:902:2b84:: with SMTP id l4-v6mr22441922plb.124.1540269423531; Mon, 22 Oct 2018 21:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540269423; cv=none; d=google.com; s=arc-20160816; b=OHecz1OFWN8pK/7pKlJlkSAba9lm5hYOSKkmNw10MVao4skKiD8XQ+wkZCkTPlPYDO u4c70ApXL+N/0pknbL5QWHQVjM4Gu9bc2nIgZeNPUkp3PYm8YIRm757Y1dP6ky8vIYJi j1JH+Xrcq7oxvMmpMrxjx+EAslmwwa7AfV0ExqQW+8wgv9Nk98peTVZPxua3XDde2MlB Bo5laDJO9pp0wTAb1p9Fa5MsXv68b8AMJoPwYHdbP0PPwfCO9YSz9qnAYl32T9h0w3OJ z0OeOHN0tsvZhZu64JBoD+9Pbyo449+GTrkUwVhr92rXabPnhtp7wvEmj1IbLZT7a3TZ /ZJA== 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; bh=gTJJ7iRa3fPBYohPhGb7v2cIFzEKicAsqv2NYgcbHec=; b=Moc4nz4QstPZqW/nMB3WjPijkdRbcl3V06HVgj5wCfV4/VjHGd0brQLrZny3dWbH2g fkZdbdEYh5x+0UDp/gUVSG22eZNJCFAzWeXiVvTamY9+V060VnrLfRzWEaVdgqRa6o2s 5vr8b0MSvJ8CsAoAMm02gYJzadXDgxl2wgxwOvkxt+AJphfeqMvHzZMamTLpQQ0h4LJV kQq0Tb8SFC4t8G0Y8dAzytBcWIjSJdLIIgOmzd7P5//zgyQ2GI+JwQeG4uo5q/jwkscX ftwIQXwVIkwoQslX1ehLgi8vHqaYPjIIWS7qfSCe1qqt1NrqaX94zLpyv2WUs8N7Ogyq GN/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=HB34n2uv; dkim=pass header.i=@codeaurora.org header.s=default header.b="OjG0/6ap"; 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 m14-v6si96112pgd.282.2018.10.22.21.36.48; Mon, 22 Oct 2018 21:37:03 -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=HB34n2uv; dkim=pass header.i=@codeaurora.org header.s=default header.b="OjG0/6ap"; 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 S1727469AbeJWM54 (ORCPT + 99 others); Tue, 23 Oct 2018 08:57:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:48754 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727014AbeJWM5z (ORCPT ); Tue, 23 Oct 2018 08:57:55 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1B21D61309; Tue, 23 Oct 2018 04:36:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540269378; bh=YI6a5Q0HGLwKjizFSW2cEEIaRoKPDm3Mpw28U05ro6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HB34n2uvUKOGijKtatgZOt0wK0q6w9ioRD63ILqau9ial49QqPMHTlV3jdOfa/XAU RO427oGb9PK2z0zsdOjRFEQwp3P4KXxyQMLXakUqWyjglszhQlQKzbHydAGB17+sHM eTrDK7LYApDs6b5YPHCWQ61/88YfFx6DIVnzuosI= 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.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (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 EFF9C61308; Tue, 23 Oct 2018 04:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1540269377; bh=YI6a5Q0HGLwKjizFSW2cEEIaRoKPDm3Mpw28U05ro6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OjG0/6ap6BIy86q8rlh4Hn62c4rEqfI37Y/80W1/xuUtx4CbYvVoiPNJAUmIWdwJ/ tr9mk7hgWx+du5mQ0DA+THRoBW9/5B12SQnHrg6bOgC/fYgcEkdNirHQY+kmdrNtlf uxFN9cxcmblGrpvq8GJmNhQJVfkvIcDOoWW3h5ck= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org EFF9C61308 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, evgreen@chromium.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 v10 2/6] phy: General struct and field cleanup Date: Mon, 22 Oct 2018 21:35:57 -0700 Message-Id: <1540269361-28185-3-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1540269361-28185-1-git-send-email-cang@codeaurora.org> References: <1540269361-28185-1-git-send-email-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