diff --git a/drivers/scsi/ufs/ufs-provision-dummy.c b/drivers/scsi/ufs/ufs-provision-dummy.c index 64301fbb..9d1e5411 100644 --- a/drivers/scsi/ufs/ufs-provision-dummy.c +++ b/drivers/scsi/ufs/ufs-provision-dummy.c @@ -6,13 +6,7 @@ #include "ufs-tegra.h" #ifdef CONFIG_DEBUG_FS -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) -#include -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) -#include -#else -#include -#endif +#include void debugfs_provision_init(struct ufs_hba *hba, struct dentry *device_root) { diff --git a/drivers/scsi/ufs/ufs-provision.c b/drivers/scsi/ufs/ufs-provision.c index d84fb547..3930ccf6 100644 --- a/drivers/scsi/ufs/ufs-provision.c +++ b/drivers/scsi/ufs/ufs-provision.c @@ -6,13 +6,7 @@ #include "ufs-tegra.h" #ifdef CONFIG_DEBUG_FS -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) -#include -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) -#include -#else -#include -#endif +#include #define CHECK_NULL(expr) \ { \ diff --git a/drivers/scsi/ufs/ufs-provision.h b/drivers/scsi/ufs/ufs-provision.h index 470060ba..85a0b02a 100644 --- a/drivers/scsi/ufs/ufs-provision.h +++ b/drivers/scsi/ufs/ufs-provision.h @@ -7,13 +7,7 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) -#include -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) -#include -#else -#include -#endif +#include #ifdef CONFIG_DEBUG_FS #include diff --git a/drivers/scsi/ufs/ufs-tegra-common.c b/drivers/scsi/ufs/ufs-tegra-common.c index 5fb2269b..76e2455d 100644 --- a/drivers/scsi/ufs/ufs-tegra-common.c +++ b/drivers/scsi/ufs/ufs-tegra-common.c @@ -23,22 +23,10 @@ #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) -#include -#include -#include -#include -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) -#include -#include -#include -#include -#else -#include -#include -#include -#include -#endif +#include +#include +#include +#include #include "ufs-tegra.h" #include "ufs-provision.h" diff --git a/include/drivers-private/scsi/ufs/k516/ufshcd-pltfrm.h b/include/drivers-private/scsi/ufs/k516/ufshcd-pltfrm.h deleted file mode 100644 index c33e28ac..00000000 --- a/include/drivers-private/scsi/ufs/k516/ufshcd-pltfrm.h +++ /dev/null @@ -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_ */ diff --git a/include/drivers-private/scsi/ufs/k61/ufshcd-pltfrm.h b/include/drivers-private/scsi/ufs/k61/ufshcd-pltfrm.h deleted file mode 100644 index c33e28ac..00000000 --- a/include/drivers-private/scsi/ufs/k61/ufshcd-pltfrm.h +++ /dev/null @@ -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_ */ diff --git a/include/drivers-private/scsi/ufs/k515/ufshcd-pltfrm.h b/include/drivers-private/scsi/ufs/ufshcd-pltfrm.h similarity index 100% rename from include/drivers-private/scsi/ufs/k515/ufshcd-pltfrm.h rename to include/drivers-private/scsi/ufs/ufshcd-pltfrm.h diff --git a/include/drivers-private/scsi/ufs/ufshcd.h b/include/drivers-private/scsi/ufs/ufshcd.h new file mode 100644 index 00000000..351b8da1 --- /dev/null +++ b/include/drivers-private/scsi/ufs/ufshcd.h @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#include +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#include +#else +#include +#endif diff --git a/include/drivers-private/scsi/ufs/ufshci.h b/include/drivers-private/scsi/ufs/ufshci.h new file mode 100644 index 00000000..ee7c85a8 --- /dev/null +++ b/include/drivers-private/scsi/ufs/ufshci.h @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#include +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#include +#else +#include +#endif diff --git a/include/drivers-private/scsi/ufs/unipro.h b/include/drivers-private/scsi/ufs/unipro.h new file mode 100644 index 00000000..d97f57b6 --- /dev/null +++ b/include/drivers-private/scsi/ufs/unipro.h @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#include +#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#include +#else +#include +#endif