Files
linux-nv-oot/drivers/scsi/ufs/ufshcd-priv.h
Jon Hunter c9abbd16c0 ufs: tegra: Simplify headers
Depending on kernel version the Tegra UFS driver includes different
headers to build the driver. Now that Linux v5.x kernels are no longer
supported, we can simplify this. Simplify the headers for the Tegra UFS
driver as follows ...

1. For Linux v6.x kernels only the ufshcd-priv.h and ufshcd-pltfrm.h
   headers are required. These headers are copied from the Linux kernel.
   However, only the prototypes for the functions 'ufshcd_query_attr',
   'ufshcd_query_descriptor_retry' and 'ufshcd_pltfrm_init' are needed.
   The functions 'ufshcd_query_attr' and 'ufshcd_query_descriptor_retry'
   have not been change since they were introduced in Linux v4.17 and
   the function 'ufshcd_pltfrm_init' was last updated in Linux v6.1
   (making the ufs_hba_variant_ops argument const). Although redefining
   the prototypes outside the kernel is fragile and does not protect the
   Tegra UFS driver from updates to these functions, this problem
   already exists.
2. Move the files ufshcd-pltfrm.h and ufshcd-priv.h into the Tegra UFS
   driver directory because these are not needed outside of the driver.

JIRA LINQPJ14-47

Change-Id: I3891bf756723f730f036637891c55090b5d2a384
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3349825
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
2025-07-24 10:19:19 +00:00

25 lines
910 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
/* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
/*
* This file is derived from the Linux kernel's drivers/ufs/core/ufshcd-priv.h
* header file, but only the necessary prototypes used by the Tegra UFS driver
* are copied. These functions were first introduced in Linux v4.17 and are
* compatible with kernels upto Linux v6.15. Linux kernels newer than v6.15 need
* to be verified.
*/
#ifndef _UFSHCD_PRIV_H_
#define _UFSHCD_PRIV_H_
#include <ufs/ufshcd.h>
int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
enum query_opcode opcode,
enum desc_idn idn, u8 index,
u8 selector,
u8 *desc_buf, int *buf_len);
int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
enum attr_idn idn, u8 index, u8 selector, u32 *attr_val);
#endif /* _UFSHCD_PRIV_H_ */