From patchwork Tue Jan 21 03:00:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 13945610 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 E59DBC02182 for ; Tue, 21 Jan 2025 03:02:05 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References: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=35vTWcGqhl1Nc2bwTd0SZdrIqlWI86sk0Sh4lhQj+8k=; b=xfogTmeXQ2vxhX bEAzJVU++rXnQvwmowj7OCmZAbMKQWTSpe7FdzTaHFR5UW5e4WE1SN8GqTZw3+NRp9vqvlmlbnZGu 6cj9W497/GCy8cmFAA+IHE739XvaNyNOkXzWmh6GyyhWDsD8eFw+1J1h04rnSK/KmqE2pnB4vn/bn DymIBkpOR2hWKBfyEcK1O2EytZnA6hsMLs/U+qEWY0F5N3zvIMPjSjGj1A/JxWKvhTc7ZTNJVYlkt XsMf51Cl9KSKoayl57TTrCKwPr0Ec5YaViVz7F/loCWFB6bMNSZ2tls8Zp4OoLEomnLi4olTJqmLw vsn5TpQBxqH99W9zD3Mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ta4Wg-00000006luL-3uwV; Tue, 21 Jan 2025 03:02:02 +0000 Received: from mail-m15581.qiye.163.com ([101.71.155.81]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ta4We-00000006lsz-3OCX for linux-rockchip@lists.infradead.org; Tue, 21 Jan 2025 03:02:02 +0000 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 93fdcfc9; Tue, 21 Jan 2025 11:01:56 +0800 (GMT+08:00) From: Shawn Lin To: Rob Herring , "James E . J . Bottomley" , "Martin K . Petersen" , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , Heiko Stuebner , "Rafael J . Wysocki" Cc: Manivannan Sadhasivam , Alim Akhtar , Avri Altman , Bart Van Assche , YiFeng Zhao , Liang Chen , linux-scsi@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Shawn Lin Subject: [PATCH v6 5/7] scsi: ufs: core: Export ufshcd_dme_reset() and ufshcd_dme_enable() Date: Tue, 21 Jan 2025 11:00:25 +0800 Message-Id: <1737428427-32393-6-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1737428427-32393-1-git-send-email-shawn.lin@rock-chips.com> References: <1737428427-32393-1-git-send-email-shawn.lin@rock-chips.com> X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGRoYQlYaT0tNGU5PQxlOThhWFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSUhCSE NVSktLVUpCS0tZBg++ X-HM-Tid: 0a9486cf3f3a09cckunm93fdcfc9 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NBw6Gio5IjIKHjUwDgoMEhYN FSIwC1ZVSlVKTEhMT0lDTkpDSkxCVTMWGhIXVQgTGgwVVRcSFTsJFBgQVhgTEgsIVRgUFkVZV1kS C1lBWU5DVUlJVUxVSkpPWVdZCAFZQUlJTEk3Bg++ DKIM-Signature: a=rsa-sha256; b=TqI8ohmnyxhWLqD1UqvMHUDQC50neVHUoo/yIyD3lyqatb7ECjsy4gVzcatUt8pCx0CUABidLzivZnU133pKUOKpXRqy0hVa/AJmXIYKwlkoaj3nI1PTC5Sno+YQOXE8vzNGTKwembWHuK9cKKG6kHwGKc/kyWqNdF2cM22P3eI=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=62/IbHd0Qh119ueWxg+T4V12ACYtk6xM2YlX/+9xZY0=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250120_190201_028447_B4E100A8 X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org These two APIs will be used by glue driver if they need a different HCE process. Signed-off-by: Shawn Lin Reviewed-by: Manivannan Sadhasivam --- Changes in v6: - replace host drivers with glue drivers suggested by Mani - add Main's review tag Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/ufs/core/ufshcd.c | 6 ++++-- include/ufs/ufshcd.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 6a26853..723080b 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4014,7 +4014,7 @@ static int ufshcd_dme_link_startup(struct ufs_hba *hba) * * Return: 0 on success, non-zero value on failure. */ -static int ufshcd_dme_reset(struct ufs_hba *hba) +int ufshcd_dme_reset(struct ufs_hba *hba) { struct uic_command uic_cmd = { .command = UIC_CMD_DME_RESET, @@ -4028,6 +4028,7 @@ static int ufshcd_dme_reset(struct ufs_hba *hba) return ret; } +EXPORT_SYMBOL_GPL(ufshcd_dme_reset); int ufshcd_dme_configure_adapt(struct ufs_hba *hba, int agreed_gear, @@ -4053,7 +4054,7 @@ EXPORT_SYMBOL_GPL(ufshcd_dme_configure_adapt); * * Return: 0 on success, non-zero value on failure. */ -static int ufshcd_dme_enable(struct ufs_hba *hba) +int ufshcd_dme_enable(struct ufs_hba *hba) { struct uic_command uic_cmd = { .command = UIC_CMD_DME_ENABLE, @@ -4067,6 +4068,7 @@ static int ufshcd_dme_enable(struct ufs_hba *hba) return ret; } +EXPORT_SYMBOL_GPL(ufshcd_dme_enable); static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba) { diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index d7aca9e..e3fd40e 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -1357,6 +1357,8 @@ extern int ufshcd_system_thaw(struct device *dev); extern int ufshcd_system_restore(struct device *dev); #endif +extern int ufshcd_dme_reset(struct ufs_hba *hba); +extern int ufshcd_dme_enable(struct ufs_hba *hba); extern int ufshcd_dme_configure_adapt(struct ufs_hba *hba, int agreed_gear, int adapt_val);