mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
In Linux v6.2, the Tegra IVC driver was updated to support iosys-map and this breaks building some of the out-of-tree drivers for Linux v6.2+ kernels. In Linux v6.3, the GPIO OF APIs were removed and this breaks building some of the out-of-tree drivers that use these legacy APIs. For now the broken drivers are not built for these corresponding kernels. Instead of checking the kernel version in the Makefile for the corresponding broken driver, move the kernel version checking to the top-level Makefile and add CONFIG definitions that can be used the various Makefiles. This is also needed for working with 3rd party Linux kernels that may have upstream backports and need to set these CONFIG variables for their Linux kernel. Bug 4221847 Change-Id: I35ee59bccdcdb1be56e4680c453279b421692c6a Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996215 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
193 lines
5.4 KiB
C
193 lines
5.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
||
/*
|
||
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||
*/
|
||
|
||
#ifndef INCLUDE_CAPTURE_IVC_H
|
||
#define INCLUDE_CAPTURE_IVC_H
|
||
|
||
#include <linux/types.h>
|
||
#include <linux/version.h>
|
||
|
||
#if !defined(CONFIG_TEGRA_IVC_LEGACY_DISABLE)
|
||
/**
|
||
* @brief Submit the control message binary blob to capture-IVC driver,
|
||
* which is to be transferred over control IVC channel to RTCPU.
|
||
*
|
||
* @param[in] control_desc binary blob containing control message
|
||
* descriptor, is opaque to capture-IVC driver.
|
||
* @param[in] len size of control_desc.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_control_submit(
|
||
const void *control_desc,
|
||
size_t len);
|
||
|
||
/**
|
||
* @brief Submit the capture message binary blob to capture-IVC driver,
|
||
* which is to be transferred over capture IVC channel to RTCPU.
|
||
*
|
||
* @param[in] capture_desc binary blob containing capture message
|
||
* descriptor, is opaque to KMDs.
|
||
* @param[in] len size of capture_desc.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_capture_submit(
|
||
const void *capture_desc,
|
||
size_t len);
|
||
|
||
/**
|
||
* @brief Callback function to be registered by client to receive the rtcpu
|
||
* notifications through control or capture IVC channel.
|
||
*
|
||
* @param[in] resp_desc binary blob containing the response message
|
||
* received from rtcpu through control or capture
|
||
* IVC channel, its opaque to KMDs.
|
||
* @param[in] priv_context Client's private context, opaque to
|
||
* capture-IVC driver.
|
||
*/
|
||
typedef void (*tegra_capture_ivc_cb_func)(
|
||
const void *resp_desc,
|
||
const void *priv_context);
|
||
|
||
/**
|
||
* @brief Register callback function to receive response messages from rtcpu
|
||
* through control IVC channel.
|
||
*
|
||
* @param[in] control_resp_cb callback function to be registered for
|
||
* control IVC channel.
|
||
* @param[in] priv_context client's private context, opaque to
|
||
* capture-IVC driver.
|
||
* @param[out] trans_id temporary id assigned by capture-IVC driver,
|
||
* for the clients whose unique chan_id is not
|
||
* yet allocated by RTCPU, to match their
|
||
* responses with the requests.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_register_control_cb(
|
||
tegra_capture_ivc_cb_func control_resp_cb,
|
||
uint32_t *trans_id,
|
||
const void *priv_context);
|
||
|
||
/**
|
||
* @brief Notify client’s channel ID to capture-IVC driver.
|
||
* Once client gets the newly allocated channel ID from RTCPU, it has to
|
||
* notify it to capture-IVC driver also, so that it can replace the
|
||
* temporary ID trans_id with the new channel ID chan_id in its internal
|
||
* context. IVC driver uses this unique channel ID for mapping upcoming
|
||
* responses with the client requests.
|
||
*
|
||
* @param[in] chan_id new channel id allocated by RTCPU for the
|
||
* client, capture-IVC driver uses to refer the
|
||
* client for its future control responses.
|
||
* @param[in] trans_id temporary id assigned by capture-IVC driver,
|
||
* for the client.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_notify_chan_id(
|
||
uint32_t chan_id,
|
||
uint32_t trans_id);
|
||
|
||
/**
|
||
* @brief Register callback function to receive status-indication messages from
|
||
* rtcpu through capture IVC channel.
|
||
*
|
||
* @param[in] capture_status_ind_cb callback function to be registered for
|
||
* capture ivc channel.
|
||
* @param[in] chan_id client's channel id, capture-IVC driver
|
||
* uses it refer the client for its capture
|
||
* responses.
|
||
* @param[in] priv_context client's private context, opaque to
|
||
* capture-IVC driver.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_register_capture_cb(
|
||
tegra_capture_ivc_cb_func capture_status_ind_cb,
|
||
uint32_t chan_id,
|
||
const void *priv_context);
|
||
|
||
/**
|
||
* @brief Un-register callback function to stop receiving messages over
|
||
* control ivc channel.
|
||
*
|
||
* @param[in] id client's channel id or transaction id, for which the
|
||
* callback needs to be unregistered.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_unregister_control_cb(
|
||
uint32_t id);
|
||
|
||
/**
|
||
* @brief Un-register callback function to stop receiving messages over
|
||
* capture ivc channel.
|
||
*
|
||
* @param[in] chan_id client's channel id, for which the callback needs to be
|
||
* unregistered.
|
||
*
|
||
* @returns 0 (success), neg. errno (failure)
|
||
*/
|
||
int tegra_capture_ivc_unregister_capture_cb(
|
||
uint32_t chan_id);
|
||
#else
|
||
typedef void (*tegra_capture_ivc_cb_func)(
|
||
const void *resp_desc,
|
||
const void *priv_context);
|
||
|
||
static inline int tegra_capture_ivc_control_submit(
|
||
const void *control_desc,
|
||
size_t len)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_capture_submit(
|
||
const void *capture_desc,
|
||
size_t len)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_register_control_cb(
|
||
tegra_capture_ivc_cb_func control_resp_cb,
|
||
uint32_t *trans_id,
|
||
const void *priv_context)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_notify_chan_id(
|
||
uint32_t chan_id,
|
||
uint32_t trans_id)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_register_capture_cb(
|
||
tegra_capture_ivc_cb_func capture_status_ind_cb,
|
||
uint32_t chan_id,
|
||
const void *priv_context)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_unregister_control_cb(
|
||
uint32_t id)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
|
||
static inline int tegra_capture_ivc_unregister_capture_cb(
|
||
uint32_t chan_id)
|
||
{
|
||
return -ENOTSUPP;
|
||
};
|
||
#endif /* !defined(CONFIG_TEGRA_IVC_LEGACY_DISABLE) */
|
||
|
||
#endif /* INCLUDE_CAPTURE_IVC_H */
|