Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
53 lines
1.3 KiB
C
53 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* System Control and Management Interface (SCMI) Message Protocol Quirks
|
|
*
|
|
* Copyright (C) 2025 ARM Ltd.
|
|
*/
|
|
#ifndef _SCMI_QUIRKS_H
|
|
#define _SCMI_QUIRKS_H
|
|
|
|
#include <linux/static_key.h>
|
|
#include <linux/types.h>
|
|
|
|
#ifdef CONFIG_ARM_SCMI_QUIRKS
|
|
|
|
#define DECLARE_SCMI_QUIRK(_qn) \
|
|
DECLARE_STATIC_KEY_FALSE(scmi_quirk_ ## _qn)
|
|
|
|
/*
|
|
* A helper to associate the actual code snippet to use as a quirk
|
|
* named as _qn.
|
|
*/
|
|
#define SCMI_QUIRK(_qn, _blk) \
|
|
do { \
|
|
if (static_branch_unlikely(&(scmi_quirk_ ## _qn))) \
|
|
(_blk); \
|
|
} while (0)
|
|
|
|
void scmi_quirks_initialize(void);
|
|
void scmi_quirks_enable(struct device *dev, const char *vend,
|
|
const char *subv, const u32 impl);
|
|
|
|
#else
|
|
|
|
#define DECLARE_SCMI_QUIRK(_qn)
|
|
/* Force quirks compilation even when SCMI Quirks are disabled */
|
|
#define SCMI_QUIRK(_qn, _blk) \
|
|
do { \
|
|
if (0) \
|
|
(_blk); \
|
|
} while (0)
|
|
|
|
static inline void scmi_quirks_initialize(void) { }
|
|
static inline void scmi_quirks_enable(struct device *dev, const char *vend,
|
|
const char *sub_vend, const u32 impl) { }
|
|
|
|
#endif /* CONFIG_ARM_SCMI_QUIRKS */
|
|
|
|
/* Quirk delarations */
|
|
DECLARE_SCMI_QUIRK(clock_rates_triplet_out_of_spec);
|
|
DECLARE_SCMI_QUIRK(perf_level_get_fc_force);
|
|
|
|
#endif /* _SCMI_QUIRKS_H */
|