From patchwork Fri Jul 9 06:57:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 472193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D64DEC11F67 for ; Fri, 9 Jul 2021 06:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C15E461260 for ; Fri, 9 Jul 2021 06:58:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231287AbhGIHAn (ORCPT ); Fri, 9 Jul 2021 03:00:43 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:50491 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbhGIHAg (ORCPT ); Fri, 9 Jul 2021 03:00:36 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210709065751epoutp03f263a54270cf53b35e76333cc1eab964~QDRom_5N82653826538epoutp03G for ; Fri, 9 Jul 2021 06:57:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210709065751epoutp03f263a54270cf53b35e76333cc1eab964~QDRom_5N82653826538epoutp03G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1625813871; bh=TzqmxWLzJw7YUlq6RtqJwNn05f8F68Wk3f4J2IILl0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lc5ynpU0asqw3AoBomly4kvDFxqUyBvYWf3BM6MRpOgy2vFVBRaKc0MMQbq525zMc 6tI8ZtfqZa1D3TWC7aUBHmetvapf92nASWifOx6takOZV16FQbpZPVNcRl2GB/9qCa sHtvw43tcESL8boW4KnfzK1cthD3870P/t9MEzq8= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210709065750epcas2p25da6afe8f8845a7f9098f925258a66e8~QDRoBhuGU1003510035epcas2p2K; Fri, 9 Jul 2021 06:57:50 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.187]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4GLkWK3Lrkz4x9Pw; Fri, 9 Jul 2021 06:57:49 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id BF.CF.09541.C63F7E06; Fri, 9 Jul 2021 15:57:48 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae~QDRkYkXFR2002520025epcas2p3-; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210709065746epsmtrp1db81e12a71d20945ee59c3848750f3af~QDRkXt-7M3220632206epsmtrp1V; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) X-AuditID: b6c32a47-5f3ff70000002545-14-60e7f36c99a6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E7.63.08394.A63F7E06; Fri, 9 Jul 2021 15:57:46 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20210709065746epsmtip2152a7ab400b2a5f98ac5a1a7f7cd2e6a~QDRkLgBkF3134631346epsmtip2y; Fri, 9 Jul 2021 06:57:46 +0000 (GMT) From: Chanho Park To: Alim Akhtar , "James E . J . Bottomley" , "Martin K . Petersen" Cc: Can Guo , Jaegeuk Kim , Kiwoong Kim , Avri Altman , Adrian Hunter , Christoph Hellwig , Bart Van Assche , jongmin jeong , Gyunghoon Kwon , linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, Chanho Park Subject: [PATCH 09/15] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops Date: Fri, 9 Jul 2021 15:57:05 +0900 Message-Id: <20210709065711.25195-10-chanho61.park@samsung.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709065711.25195-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJJsWRmVeSWpSXmKPExsWy7bCmhW7O5+cJBp9fMFucfLKGzeLBvG1s Fi9/XmWzmPbhJ7PFp/XLWC0u79e26NnpbHF6wiImiyfrZzFbLLqxjcli5TULi5tbjrJYzDi/ j8mi+/oONovlx/8xOfB7XL7i7XG5r5fJY/MKLY/Fe14yeWxa1cnmMWHRAUaPj09vsXj0bVnF 6PF5k5xH+4FupgCuqBybjNTElNQihdS85PyUzLx0WyXv4HjneFMzA0NdQ0sLcyWFvMTcVFsl F58AXbfMHKAXlBTKEnNKgUIBicXFSvp2NkX5pSWpChn5xSW2SqkFKTkFhoYFesWJucWleel6 yfm5VoYGBkamQJUJORmzJ99iLHjJXbFkx3vGBsZGri5GDg4JAROJacszuhi5OIQEdjBK3Dnc xAThfGKUuN7azwLhfGOUuNH/hw2m4/7iAIj4XkaJ/wsXskE4Hxkl1q+dwNjFyMnBJqArseX5 K0aQhIhAP6PE8v1zwUYxC5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dNSmpOZllqkb5dAlfG7Mm3GAteclcs2fGesYGxkauLkYNDQsBE4v7i gC5GLg4hgd2MEk1NJ1m7GDmB4rISz97tYIewhSXutxxhhSh6zyhx+P9+sCI2AV2JLc9fMYLY IgITGSWW3BMDKWIWuMws8W3aFWaQhLBAtMS/VRdZQGwWAVWJX6tXgdm8AvYSDxYsZobYIC9x atlBJhCbEyg+78cEMFtIwE7i3oZ97BD1ghInZz4B62UGqm/eOpt5AqPALCSpWUhSCxiZVjFK phYU56bnFhsWGOallusVJ+YWl+al6yXn525iBMeTluYOxu2rPugdYmTiYDzEKMHBrCTCazTj WYIQb0piZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1KzU1MLUotgskwcnFINTJ0lvZ82 t11Q3nC+8GHdtu73+aULDsrPlEq6aVT7NTH8eF/QfINPmc9T/yQd3DJndyr72byMp0u+BM2Y LK4Zvzrf68Ein8N7nyx8nxJ7br/E1MvcZdO2ZAb+WZEXwiFYMbda/+dMp+/++xI2KXHsFt6u yRhXvSDtEk/ytLS1v6cldta1Lvtdvntm/TVF7bu+jRsDU38uyvP9nnInt8ckVfSjQ25qjkTI je3CxTtvLN1UszVgx++qLx2f52u+yWSTa4yfskPJdMnCpDMLr9mXej3TPGLR+7t2KnvzHIHW pDNtizeK5XC77LOcHhnosj4v8Qxr5IxIUWPDmqIDR0s36Gt9kFqxckPx+b3Z6pc+r1FiKc5I NNRiLipOBACKxgtCFgMAAA== X-CMS-MailID: 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210709065746epcas2p35975dfa47363d0ea792988047f83a0ae References: <20210709065711.25195-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org By default, ufs_hba_exynos_ops will be used but this patch supports to use custom version of ufs_hba_variant_ops because some variants of exynos-ufs will use only few callbacks. Signed-off-by: Chanho Park --- drivers/scsi/ufs/ufs-exynos.c | 8 +++++++- drivers/scsi/ufs/ufs-exynos.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index 60edd420095f..90c0d7c85a13 100644 --- a/drivers/scsi/ufs/ufs-exynos.c +++ b/drivers/scsi/ufs/ufs-exynos.c @@ -1238,8 +1238,14 @@ static int exynos_ufs_probe(struct platform_device *pdev) { int err; struct device *dev = &pdev->dev; + const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops; + const struct exynos_ufs_drv_data *drv_data = + device_get_match_data(dev); - err = ufshcd_pltfrm_init(pdev, &ufs_hba_exynos_ops); + if (drv_data && drv_data->vops) + vops = drv_data->vops; + + err = ufshcd_pltfrm_init(pdev, vops); if (err) dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err); diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index a46f30639f38..0938bd82763f 100644 --- a/drivers/scsi/ufs/ufs-exynos.h +++ b/drivers/scsi/ufs/ufs-exynos.h @@ -142,6 +142,7 @@ struct exynos_ufs_uic_attr { }; struct exynos_ufs_drv_data { + const struct ufs_hba_variant_ops *vops; struct exynos_ufs_uic_attr *uic_attr; unsigned int quirks; unsigned int opts;