From patchwork Tue Jun 7 07:29:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 12871454 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD1F0C43334 for ; Tue, 7 Jun 2022 07:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:References:MIME-Version:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DKEd5z2mhl1P0DQK0Fk1O+o2dUCeX/qg4m7u9JLHuxQ=; b=nuwitDNB5gOoMe dQ0ZbZERElaW20pnij0tF+J7etZpHTEafYnv1ZB+9yZ0WEycToT9HYmikNR0lVEsXxuZxUACsmsUE T1MVO51V9OwsoP4CgGpMcfNPtXUIvTILm0wrN0bCZ0bqrKaRZs1Itd99T1KP1WwQTUanVJMBFHwSK g6Sk/8g2XfT0rRg3YXBwrm51aooI6fJZl7DPsn3MpAbDNYtOHJVROsj6wlNz1/6k2hsQ0JSmJjOM4 +UuFKJm484g79h30cC/uX6cvdvgUA1njCo5VVU+b0UFvwIH+pUi8Fw3zIhWgaTrl5os9BNeEYs+QJ Ans/BUn+jSOelW5m99VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyTfz-005Sez-Ug; Tue, 07 Jun 2022 07:30:56 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyTeq-005SCo-91 for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2022 07:29:51 +0000 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220607072940epoutp01fd1ddf0cfc52456bf71ed6857a8bc5db~2RhePeT_h1595815958epoutp01q for ; Tue, 7 Jun 2022 07:29:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220607072940epoutp01fd1ddf0cfc52456bf71ed6857a8bc5db~2RhePeT_h1595815958epoutp01q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1654586980; bh=m9YTaw8QCCZT36Ok9LFuaA4+fVLObZmPAUiV0wh0I68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E0j8ORz8H/CXI0yTxbDV2ZHiWYnACkJdKil+xoD/IJO+O6tA+SLln+zanStoYWbzy UzFWn792lSqqbvRJglf8AdvbbUVR6x6RvarD8f6fBPEon5vzz5vq1eXxkTMT8cdJ81 SZ2Zf8XZCPeD7Tre3C6b/EalFsFic6EzBGctpGwM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20220607072939epcas2p48db3cfefc523ab93885a7dff217ddc03~2Rhdzpquv1805918059epcas2p4Z; Tue, 7 Jun 2022 07:29:39 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.102]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4LHMSL6kpMz4x9QV; Tue, 7 Jun 2022 07:29:38 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 77.A0.09694.26EFE926; Tue, 7 Jun 2022 16:29:38 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20220607072938epcas2p1bb5de39d25c45540c01fa5dfda5bb891~2Rhciwnie1437714377epcas2p1h; Tue, 7 Jun 2022 07:29:38 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220607072938epsmtrp13c10ff3ab9a2495a2e4c43aee29212ba~2Rhch73TI0498404984epsmtrp18; Tue, 7 Jun 2022 07:29:38 +0000 (GMT) X-AuditID: b6c32a48-495ff700000025de-c8-629efe62bb3b Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id B7.77.11276.26EFE926; Tue, 7 Jun 2022 16:29:38 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220607072938epsmtip1336aa726c79d726c0536b025796e66dd~2RhcVGPJO0977809778epsmtip1D; Tue, 7 Jun 2022 07:29:38 +0000 (GMT) From: Chanho Park To: Kishon Vijay Abraham I , Vinod Koul , Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-phy@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Chanho Park Subject: [PATCH v4 4/5] phy: samsung: ufs: remove drvdata from struct samsung_ufs_phy Date: Tue, 7 Jun 2022 16:29:06 +0900 Message-Id: <20220607072907.127000-5-chanho61.park@samsung.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607072907.127000-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJsWRmVeSWpSXmKPExsWy7bCmuW7Sv3lJBt+nmlo8mLeNzeLyfm2L +UfOsVpceNrDZtH34iGzxd7XW9ktNj2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uXVSvt YyzdmHtjx9Lnmlf8lViKMxINtZiLihMBs35tYPICAAA= X-CMS-MailID: 20220607072938epcas2p1bb5de39d25c45540c01fa5dfda5bb891 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220607072938epcas2p1bb5de39d25c45540c01fa5dfda5bb891 References: <20220607072907.127000-1-chanho61.park@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_002944_763381_232B55EE X-CRM114-Status: GOOD ( 20.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To change an offset of pmu_isol, we need to store its data instead of having drvdata's pointer. The definition of the pmu_isol structure should be extracted from samsung_ufs_phy_drvdata and rename the name with samsung_ufs_phy_ prefix. Suggested-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski Signed-off-by: Chanho Park Reviewed-by: Alim Akhtar --- drivers/phy/samsung/phy-samsung-ufs.c | 9 +++++---- drivers/phy/samsung/phy-samsung-ufs.h | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/phy/samsung/phy-samsung-ufs.c b/drivers/phy/samsung/phy-samsung-ufs.c index cd1c02d2cdda..0c933e364064 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.c +++ b/drivers/phy/samsung/phy-samsung-ufs.c @@ -207,7 +207,7 @@ static int samsung_ufs_phy_init(struct phy *phy) ss_phy->lane_cnt = phy->attrs.bus_width; ss_phy->ufs_phy_state = CFG_PRE_INIT; - if (ss_phy->drvdata->has_symbol_clk) { + if (ss_phy->has_symbol_clk) { ret = samsung_ufs_phy_symbol_clk_init(ss_phy); if (ret) dev_err(ss_phy->dev, "failed to set ufs phy symbol clocks\n"); @@ -259,7 +259,7 @@ static int samsung_ufs_phy_exit(struct phy *phy) clk_disable_unprepare(ss_phy->ref_clk); - if (ss_phy->drvdata->has_symbol_clk) { + if (ss_phy->has_symbol_clk) { clk_disable_unprepare(ss_phy->tx0_symbol_clk); clk_disable_unprepare(ss_phy->rx0_symbol_clk); clk_disable_unprepare(ss_phy->rx1_symbol_clk); @@ -326,9 +326,10 @@ static int samsung_ufs_phy_probe(struct platform_device *pdev) drvdata = match->data; phy->dev = dev; - phy->drvdata = drvdata; phy->cfgs = drvdata->cfgs; - phy->isol = &drvdata->isol; + phy->has_symbol_clk = drvdata->has_symbol_clk; + memcpy(&phy->isol, &drvdata->isol, sizeof(phy->isol)); + phy->lane_cnt = PHY_DEF_LANE_CNT; phy_set_drvdata(gen_phy, phy); diff --git a/drivers/phy/samsung/phy-samsung-ufs.h b/drivers/phy/samsung/phy-samsung-ufs.h index 5cd919539a3e..854b53bdf347 100644 --- a/drivers/phy/samsung/phy-samsung-ufs.h +++ b/drivers/phy/samsung/phy-samsung-ufs.h @@ -101,13 +101,15 @@ struct samsung_ufs_phy_cfg { u8 id; }; +struct samsung_ufs_phy_pmu_isol { + u32 offset; + u32 mask; + u32 en; +}; + struct samsung_ufs_phy_drvdata { const struct samsung_ufs_phy_cfg **cfgs; - struct pmu_isol { - u32 offset; - u32 mask; - u32 en; - } isol; + struct samsung_ufs_phy_pmu_isol isol; bool has_symbol_clk; }; @@ -122,7 +124,8 @@ struct samsung_ufs_phy { struct clk *rx1_symbol_clk; const struct samsung_ufs_phy_drvdata *drvdata; const struct samsung_ufs_phy_cfg * const *cfgs; - const struct pmu_isol *isol; + struct samsung_ufs_phy_pmu_isol isol; + bool has_symbol_clk; u8 lane_cnt; int ufs_phy_state; enum phy_mode mode; @@ -136,8 +139,8 @@ static inline struct samsung_ufs_phy *get_samsung_ufs_phy(struct phy *phy) static inline void samsung_ufs_phy_ctrl_isol( struct samsung_ufs_phy *phy, u32 isol) { - regmap_update_bits(phy->reg_pmu, phy->isol->offset, - phy->isol->mask, isol ? 0 : phy->isol->en); + regmap_update_bits(phy->reg_pmu, phy->isol.offset, + phy->isol.mask, isol ? 0 : phy->isol.en); } extern const struct samsung_ufs_phy_drvdata exynos7_ufs_phy;