rtcpu: Add Doxygen documentation to RTCPU subsystem

Add detailed Doxygen documentation across all files in the RTCPU subsystem.
This documentation effort follows SWUD Doxygen guidelines and provides
complete API documentation for the entire RTCPU codebase.

Use Cursor Agent to generate SWUD doxygen headers

Jira CAMERASW-31120

Change-Id: I3095ff2e321402e72f0f8f5762bad798ea0ecf19
Signed-off-by: Mohit Ingale <mohiti@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3332472
Reviewed-by: Semi Malinen <smalinen@nvidia.com>
Reviewed-by: Vincent Chung <vincentc@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Frank Chen <frankc@nvidia.com>
This commit is contained in:
Mohit Ingale
2025-04-03 08:28:25 +00:00
committed by Jon Hunter
parent 11843f9878
commit 02a104cbb2
10 changed files with 4177 additions and 27 deletions

View File

@@ -16,6 +16,19 @@ struct camrtc_reset_group {
struct reset_control *resets[];
};
/**
* @brief Releases resources associated with a reset group
*
* This function is called when a reset group is being destroyed.
* It performs the following operations:
* - Iterates through all resets in the group
* - For each reset, if it exists, calls @ref reset_control_put() to release it
*
* @param[in] dev Pointer to the device
* Valid value: non-NULL
* @param[in] res Pointer to the reset group resource
* Valid value: non-NULL
*/
static void camrtc_reset_group_release(struct device *dev, void *res)
{
const struct camrtc_reset_group *grp = res;
@@ -27,6 +40,33 @@ static void camrtc_reset_group_release(struct device *dev, void *res)
}
}
/**
* @brief Gets a reset group based on device tree properties
*
* This function creates and initializes a reset group based on device tree properties.
* It performs the following operations:
* - Validates the device and its device tree node
* - Determines the appropriate property name based on the group_name parameter
* - Counts reset strings using @ref of_property_count_strings()
* - Checks for size overflows using @ref __builtin_add_overflow()
* - Allocates memory for the reset group using @ref devres_alloc()
* - Initializes group properties (nresets, device, group_name)
* - Iterates through all reset names in the group
* - Gets each reset control using @ref of_reset_control_get()
* - Adds the reset group to device resources using @ref devres_add()
*
* @param[in] dev Pointer to the parent device
* Valid value: non-NULL with valid device tree node
* @param[in] group_name Name of the reset group property
* Valid value: NULL (defaults to "reset-names") or a valid string
*
* @retval struct camrtc_reset_group* Reset group on success
* @retval ERR_PTR(-EINVAL) If device or device tree node is invalid
* @retval ERR_PTR(-ENOENT) If reset names property is not found
* @retval ERR_PTR(-EOVERFLOW) If size calculations overflow
* @retval ERR_PTR(-ENOMEM) If memory allocation fails
* @retval ERR_PTR(ret) If reset control retrieval fails
*/
struct camrtc_reset_group *camrtc_reset_group_get(
struct device *dev,
const char *group_name)
@@ -101,6 +141,23 @@ error:
}
EXPORT_SYMBOL_GPL(camrtc_reset_group_get);
/**
* @brief Reports an error related to a reset in a reset group
*
* This function reports an error related to a specific reset in a reset group.
* It performs the following operations:
* - Attempts to get the reset name from the device tree using @ref of_property_read_string_index()
* - Prints a warning message about the operation that failed using @ref dev_warn()
*
* @param[in] grp Pointer to the reset group
* Valid value: non-NULL
* @param[in] op String describing the operation that failed
* Valid value: non-NULL
* @param[in] index Index of the reset in the reset group
* Valid range: [0, grp->nresets-1]
* @param[in] error Error code
* Valid value: [INT_MIN, INT_MAX]
*/
static void camrtc_reset_group_error(
const struct camrtc_reset_group *grp,
char const *op,
@@ -119,6 +176,19 @@ static void camrtc_reset_group_error(
op, name, grp->group_name, index, error);
}
/**
* @brief Asserts all resets in a reset group
*
* This function asserts all resets in the specified reset group in reverse order.
* It performs the following operations:
* - Checks if the reset group is valid using @ref IS_ERR_OR_NULL()
* - Iterates through all resets in the group in reverse order
* - Asserts each reset using @ref reset_control_assert()
* - Reports errors using @ref camrtc_reset_group_error() if a reset fails to assert
*
* @param[in] grp Pointer to the reset group
* Valid value: any value including NULL or error pointer
*/
void camrtc_reset_group_assert(const struct camrtc_reset_group *grp)
{
int index, index0, err;
@@ -135,6 +205,24 @@ void camrtc_reset_group_assert(const struct camrtc_reset_group *grp)
}
EXPORT_SYMBOL_GPL(camrtc_reset_group_assert);
/**
* @brief Deasserts all resets in a reset group
*
* This function deasserts all resets in the specified reset group in forward order.
* It performs the following operations:
* - Checks if the reset group is valid using null check and @ref IS_ERR()
* - Iterates through all resets in the group in forward order
* - Deasserts each reset using @ref reset_control_deassert()
* - Reports errors using @ref camrtc_reset_group_error() if a reset fails to deassert
* - Returns an error code if any reset fails to deassert
*
* @param[in] grp Pointer to the reset group
* Valid value: any value including NULL or error pointer
*
* @retval 0 On successful deassertion of all resets
* @retval -ENODEV If the reset group is an error pointer
* @retval (int) Error code from @ref reset_control_deassert()
*/
int camrtc_reset_group_deassert(const struct camrtc_reset_group *grp)
{
int index, err;