mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Upstream Linux commit 4c1e0a97351a ("firmware: tegra: bpmp: Use
iosys-map helpers") updated the Tegra IVC driver to use the
iosys-map helpers for Linux v6.2. This causes the Tegra IVC extended
driver build to fail. Temporarily disable the building of this driver
while this build issue is fixed. Stub functions are added to permit
other drivers that use this driver to build.
Bug 3936429
Bug 3974855
Change-Id: I300ed321afdd805838b51144fe98ba76b922493b
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2861309
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
Tested-by: Rohit Khanna <rokhanna@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
182 lines
4.7 KiB
C
182 lines
4.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __TEGRA_IVC_EXT_H
|
|
#define __TEGRA_IVC_EXT_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/version.h>
|
|
#include <soc/tegra/ivc-priv.h>
|
|
|
|
#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE)
|
|
/**
|
|
* tegra_ivc_channel_notified - notifies the peer device
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* notifies the peer device
|
|
*
|
|
* Returns 0 if success else -EAGAIN in case of failure.
|
|
*/
|
|
int tegra_ivc_channel_notified(struct tegra_ivc *ivc);
|
|
|
|
/**
|
|
* tegra_ivc_channel_reset - Resets the channel state
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Resets the channel state
|
|
*/
|
|
void tegra_ivc_channel_reset(struct tegra_ivc *ivc);
|
|
|
|
/**
|
|
* tegra_ivc_empty - Checks whether channel is empty or not
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Checks whether channel is empty or not to read or write
|
|
*
|
|
* Returns true if channel is empty to read or write.
|
|
*/
|
|
bool tegra_ivc_empty(struct tegra_ivc *ivc, struct tegra_ivc_header *header);
|
|
|
|
/**
|
|
* tegra_ivc_channel_sync - Syncs the IVC channel accross reboots.
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Syncs the IVC channel accross reboots.
|
|
*
|
|
* Returns 0 on success.
|
|
*/
|
|
int tegra_ivc_channel_sync(struct tegra_ivc *ivc);
|
|
|
|
/**
|
|
* tegra_ivc_frames_available - Checks number of available frames.
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Checks number of available frames.
|
|
*
|
|
* Returns integer value indicating number of available frames..
|
|
*/
|
|
uint32_t tegra_ivc_frames_available(struct tegra_ivc *ivc, struct tegra_ivc_header *header);
|
|
|
|
/**
|
|
* tegra_ivc_can_read - Checks whether we can read from ivc channel
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Checks whether we can read from ivc channel or not
|
|
*
|
|
* Returns 1 for success and 0 for failure.
|
|
*/
|
|
int tegra_ivc_can_read(struct tegra_ivc *ivc);
|
|
|
|
/**
|
|
* tegra_ivc_can_write - Checks whether we can write to ivc channel
|
|
* @ivc pointer of the IVC channel
|
|
*
|
|
* Checks whether we can write to ivc channel or not
|
|
*
|
|
* Returns 1 for success and 0 for failure.
|
|
*/
|
|
int tegra_ivc_can_write(struct tegra_ivc *ivc);
|
|
|
|
/**
|
|
* tegra_ivc_read - Reads frame form ivc channel
|
|
* @ivc pointer of the IVC channel
|
|
* @usr_buf user buffer to be updated with data
|
|
* @buf kernel buffer to be updated with data
|
|
* @max_read max data ro be read form ivc channel
|
|
*
|
|
* Reads frame form ivc channel
|
|
*
|
|
* Returns no. of bytes read from ivc channel else return error.
|
|
*/
|
|
int tegra_ivc_read(struct tegra_ivc *ivc, void __user *usr_buf, void *buf, size_t max_read);
|
|
|
|
/**
|
|
* tegra_ivc_read_peek - Reads frame form ivc channel
|
|
* @ivc pointer of the IVC channel
|
|
* @usr_buf user buffer to be updated with data
|
|
* @buf kernel buffer to be updated with data
|
|
* @offset kernel buffer to be updated with data from some offset
|
|
* @size max data ro be read form ivc channel
|
|
*
|
|
* Reads frame form ivc channel from some offset
|
|
*
|
|
* Returns no. of bytes read from ivc channel else return error.
|
|
*/
|
|
int tegra_ivc_read_peek(struct tegra_ivc *ivc, void __user *usr_buf, void *buf, size_t offset, size_t size);
|
|
|
|
/**
|
|
* tegra_ivc_write - Writes frame to ivc channel
|
|
* @ivc pointer of the IVC channel
|
|
* @usr_buf user buffer to e written to ivc channel
|
|
* @buf kernel buffer to be written to ivc channel
|
|
* @size Data size to be written to ivc channel
|
|
*
|
|
* Writes frame to ivc channel
|
|
*
|
|
* Returns no. of bytes written to ivc channel else return error.
|
|
*/
|
|
int tegra_ivc_write(struct tegra_ivc *ivc, const void __user *usr_buf, const void *buf, size_t size);
|
|
#else
|
|
static inline int tegra_ivc_channel_notified(struct tegra_ivc *ivc)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline void tegra_ivc_channel_reset(struct tegra_ivc *ivc)
|
|
{
|
|
return;
|
|
}
|
|
|
|
static inline bool tegra_ivc_empty(struct tegra_ivc *ivc,
|
|
struct tegra_ivc_header *header)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static inline int tegra_ivc_channel_sync(struct tegra_ivc *ivc)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline uint32_t tegra_ivc_frames_available(struct tegra_ivc *ivc,
|
|
struct tegra_ivc_header *header)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int tegra_ivc_can_read(struct tegra_ivc *ivc)
|
|
{
|
|
return -ENOTSUPP;
|
|
};
|
|
|
|
static inline int tegra_ivc_can_write(struct tegra_ivc *ivc)
|
|
{
|
|
return -ENOTSUPP;
|
|
};
|
|
|
|
static inline int tegra_ivc_read(struct tegra_ivc *ivc, void __user *usr_buf,
|
|
void *buf, size_t max_read)
|
|
{
|
|
return -ENOTSUPP;
|
|
}
|
|
|
|
static inline int tegra_ivc_read_peek(struct tegra_ivc *ivc,
|
|
void __user *usr_buf, void *buf,
|
|
size_t offset, size_t size)
|
|
{
|
|
return -ENOTSUPP;
|
|
};
|
|
|
|
static inline int tegra_ivc_write(struct tegra_ivc *ivc,
|
|
const void __user *usr_buf,
|
|
const void *buf, size_t size)
|
|
{
|
|
return -ENOTSUPP;
|
|
};
|
|
|
|
#endif /* (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) */
|
|
|
|
#endif /* __TEGRA_IVC_EXT_H */
|