mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
scsi: ufs: Clean-up headers
Clean-up the UFS headers by adding a new top-level header for ufshcd.h,
ufshci.h and unipro.h that will include the appropriate header
depending on kernel version. This saves replicating the kernel version
check for every source file that includes these headers.
Note that the ufshcd-pltfrm.h header is identical between v5.15, v5.16
and 6.1 kernels and so remove the duplicated versions of this header and
just use a common header for all kernel versions.
Bug 4221847
Change-Id: I0e0ba2f4389af7e34ab62e3131141405d87aeeb1
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996211
(cherry picked from commit 54e01347ea)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3031885
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
11e0abc8a3
commit
ff6f3c6916
@@ -6,13 +6,7 @@
|
|||||||
#include "ufs-tegra.h"
|
#include "ufs-tegra.h"
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
#include <drivers-private/scsi/ufs/ufshcd.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshcd.h>
|
|
||||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshcd.h>
|
|
||||||
#else
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshcd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void debugfs_provision_init(struct ufs_hba *hba, struct dentry *device_root)
|
void debugfs_provision_init(struct ufs_hba *hba, struct dentry *device_root)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,13 +6,7 @@
|
|||||||
#include "ufs-tegra.h"
|
#include "ufs-tegra.h"
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
#include <drivers-private/scsi/ufs/ufshcd.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshcd.h>
|
|
||||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshcd.h>
|
|
||||||
#else
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshcd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CHECK_NULL(expr) \
|
#define CHECK_NULL(expr) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -7,13 +7,7 @@
|
|||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
#include <drivers-private/scsi/ufs/ufshcd.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshcd.h>
|
|
||||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshcd.h>
|
|
||||||
#else
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshcd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
|||||||
@@ -23,22 +23,10 @@
|
|||||||
|
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
#include <drivers-private/scsi/ufs/ufshcd-pltfrm.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshcd-pltfrm.h>
|
#include <drivers-private/scsi/ufs/ufshcd.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshcd.h>
|
#include <drivers-private/scsi/ufs/unipro.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/unipro.h>
|
#include <drivers-private/scsi/ufs/ufshci.h>
|
||||||
#include <drivers-private/scsi/ufs/k515/ufshci.h>
|
|
||||||
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshcd-pltfrm.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshcd.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k516/unipro.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k516/ufshci.h>
|
|
||||||
#else
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshcd-pltfrm.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshcd.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k61/unipro.h>
|
|
||||||
#include <drivers-private/scsi/ufs/k61/ufshci.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ufs-tegra.h"
|
#include "ufs-tegra.h"
|
||||||
#include "ufs-provision.h"
|
#include "ufs-provision.h"
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UFSHCD_PLTFRM_H_
|
|
||||||
#define UFSHCD_PLTFRM_H_
|
|
||||||
|
|
||||||
#include "ufshcd.h"
|
|
||||||
|
|
||||||
#define UFS_PWM_MODE 1
|
|
||||||
#define UFS_HS_MODE 2
|
|
||||||
|
|
||||||
struct ufs_dev_params {
|
|
||||||
u32 pwm_rx_gear; /* pwm rx gear to work in */
|
|
||||||
u32 pwm_tx_gear; /* pwm tx gear to work in */
|
|
||||||
u32 hs_rx_gear; /* hs rx gear to work in */
|
|
||||||
u32 hs_tx_gear; /* hs tx gear to work in */
|
|
||||||
u32 rx_lanes; /* number of rx lanes */
|
|
||||||
u32 tx_lanes; /* number of tx lanes */
|
|
||||||
u32 rx_pwr_pwm; /* rx pwm working pwr */
|
|
||||||
u32 tx_pwr_pwm; /* tx pwm working pwr */
|
|
||||||
u32 rx_pwr_hs; /* rx hs working pwr */
|
|
||||||
u32 tx_pwr_hs; /* tx hs working pwr */
|
|
||||||
u32 hs_rate; /* rate A/B to work in HS */
|
|
||||||
u32 desired_working_mode;
|
|
||||||
};
|
|
||||||
|
|
||||||
int ufshcd_get_pwr_dev_param(struct ufs_dev_params *dev_param,
|
|
||||||
struct ufs_pa_layer_attr *dev_max,
|
|
||||||
struct ufs_pa_layer_attr *agreed_pwr);
|
|
||||||
void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param);
|
|
||||||
int ufshcd_pltfrm_init(struct platform_device *pdev,
|
|
||||||
const struct ufs_hba_variant_ops *vops);
|
|
||||||
void ufshcd_pltfrm_shutdown(struct platform_device *pdev);
|
|
||||||
|
|
||||||
#endif /* UFSHCD_PLTFRM_H_ */
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UFSHCD_PLTFRM_H_
|
|
||||||
#define UFSHCD_PLTFRM_H_
|
|
||||||
|
|
||||||
#include "ufshcd.h"
|
|
||||||
|
|
||||||
#define UFS_PWM_MODE 1
|
|
||||||
#define UFS_HS_MODE 2
|
|
||||||
|
|
||||||
struct ufs_dev_params {
|
|
||||||
u32 pwm_rx_gear; /* pwm rx gear to work in */
|
|
||||||
u32 pwm_tx_gear; /* pwm tx gear to work in */
|
|
||||||
u32 hs_rx_gear; /* hs rx gear to work in */
|
|
||||||
u32 hs_tx_gear; /* hs tx gear to work in */
|
|
||||||
u32 rx_lanes; /* number of rx lanes */
|
|
||||||
u32 tx_lanes; /* number of tx lanes */
|
|
||||||
u32 rx_pwr_pwm; /* rx pwm working pwr */
|
|
||||||
u32 tx_pwr_pwm; /* tx pwm working pwr */
|
|
||||||
u32 rx_pwr_hs; /* rx hs working pwr */
|
|
||||||
u32 tx_pwr_hs; /* tx hs working pwr */
|
|
||||||
u32 hs_rate; /* rate A/B to work in HS */
|
|
||||||
u32 desired_working_mode;
|
|
||||||
};
|
|
||||||
|
|
||||||
int ufshcd_get_pwr_dev_param(struct ufs_dev_params *dev_param,
|
|
||||||
struct ufs_pa_layer_attr *dev_max,
|
|
||||||
struct ufs_pa_layer_attr *agreed_pwr);
|
|
||||||
void ufshcd_init_pwr_dev_param(struct ufs_dev_params *dev_param);
|
|
||||||
int ufshcd_pltfrm_init(struct platform_device *pdev,
|
|
||||||
const struct ufs_hba_variant_ops *vops);
|
|
||||||
void ufshcd_pltfrm_shutdown(struct platform_device *pdev);
|
|
||||||
|
|
||||||
#endif /* UFSHCD_PLTFRM_H_ */
|
|
||||||
12
include/drivers-private/scsi/ufs/ufshcd.h
Normal file
12
include/drivers-private/scsi/ufs/ufshcd.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k515/ufshcd.h>
|
||||||
|
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k516/ufshcd.h>
|
||||||
|
#else
|
||||||
|
#include <drivers-private/scsi/ufs/k61/ufshcd.h>
|
||||||
|
#endif
|
||||||
12
include/drivers-private/scsi/ufs/ufshci.h
Normal file
12
include/drivers-private/scsi/ufs/ufshci.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k515/ufshci.h>
|
||||||
|
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k516/ufshci.h>
|
||||||
|
#else
|
||||||
|
#include <drivers-private/scsi/ufs/k61/ufshci.h>
|
||||||
|
#endif
|
||||||
12
include/drivers-private/scsi/ufs/unipro.h
Normal file
12
include/drivers-private/scsi/ufs/unipro.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <linux/version.h>
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k515/unipro.h>
|
||||||
|
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
|
||||||
|
#include <drivers-private/scsi/ufs/k516/unipro.h>
|
||||||
|
#else
|
||||||
|
#include <drivers-private/scsi/ufs/k61/unipro.h>
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user