brintos

brintos / linux-shallow public Read only

0
0
Text · 2.5 KiB · 5807915 Raw
73 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only OR MIT */2/* Copyright (c) 2023 Imagination Technologies Ltd. */3 4#ifndef PVR_PARAMS_H5#define PVR_PARAMS_H6 7#include "pvr_rogue_fwif.h"8 9#include <linux/cache.h>10#include <linux/compiler_attributes.h>11 12/*13 * This is the definitive list of types allowed in the definition of14 * %PVR_DEVICE_PARAMS.15 */16#define PVR_PARAM_TYPE_X32_C u3217 18/*19 * This macro defines all device-specific parameters; that is parameters which20 * are set independently per device.21 *22 * The X-macro accepts the following arguments. Arguments marked with [debugfs]23 * are ignored when debugfs is disabled; values used for these arguments may24 * safely be gated behind CONFIG_DEBUG_FS.25 *26 * @type_: The definitive list of allowed values is PVR_PARAM_TYPE_*_C.27 * @name_: Name of the parameter. This is used both as the field name in C and28 *         stringified as the parameter name.29 * @value_: Initial/default value.30 * @desc_: String literal used as help text to describe the usage of this31 *         parameter.32 * @mode_: [debugfs] One of {RO,RW}. The access mode of the debugfs entry for33 *         this parameter.34 * @update_: [debugfs] When debugfs support is enabled, parameters may be35 *           updated at runtime. When this happens, this function will be36 *           called to allow changes to propagate. The signature of this37 *           function is:38 *39 *              void (*)(struct pvr_device *pvr_dev, T old_val, T new_val)40 *41 *           Where T is the C type associated with @type_.42 *43 *           If @mode_ does not allow write access, this function will never be44 *           called. In this case, or if no update callback is required, you45 *           should specify NULL for this argument.46 */47#define PVR_DEVICE_PARAMS                                                    \48	X(X32, fw_trace_mask, ROGUE_FWIF_LOG_TYPE_NONE,                      \49	  "Enable FW trace for the specified groups. Specifying 0 disables " \50	  "all FW tracing.",                                                 \51	  RW, pvr_fw_trace_mask_update)52 53struct pvr_device_params {54#define X(type_, name_, value_, desc_, ...) \55	PVR_PARAM_TYPE_##type_##_C name_;56	PVR_DEVICE_PARAMS57#undef X58};59 60int pvr_device_params_init(struct pvr_device_params *params);61 62#if defined(CONFIG_DEBUG_FS)63/* Forward declaration from "pvr_device.h". */64struct pvr_device;65 66/* Forward declaration from <linux/dcache.h>. */67struct dentry;68 69void pvr_params_debugfs_init(struct pvr_device *pvr_dev, struct dentry *dir);70#endif /* defined(CONFIG_DEBUG_FS) */71 72#endif /* PVR_PARAMS_H */73